Skip to content

Adding a map

SquarerFive edited this page Feb 21, 2021 · 1 revision

✨Building a nav-mesh

Notes

There are three types of mesh generation methods,

  1. Score-based; terrain will have the lowest cost while structures/rocks will have the highest. (Fast)
  2. Elevation-based; the cost is calculated by using the elevation of the surface. (Fast)
  3. Distance Field-based; a distance field mesh is built by collecting the distances from each voxel to an object. (Slow)

Tutorial

  1. Determine the boundaries of the level by walking to the corners of the playable area and typing in pos in the console (press the tilde ~ key to open the console). Note down your coordinates like the example below (from Noshahr Canals TDM), then use those values to find the minimum and maximum XZ corners. The Y value can be set to something high such as 2048. The range between minX and maxX must be the same as the range between minY and maxY (forming a box with an aspect ratio of 1:1).
corners:
-325 69 338
-410 74 263
-342 74 178
-258 65 270


Minimum Corner: -512	2048	128
Maximum Corner: -128	2048	512
  1. Open the dashboard, click 'open' on your active project, click 'add level' and enter your min corner and max corner into the grid bounds field.
  2. Set your Step Size to 64. If you are using DF-based scoring, then set it to 128 or higher.
  3. Leave the Voxel Size at 1.0. For more smaller/dense maps, you may set this value to something like 0.5. Lower values result in a higher resolution nav-mesh.
  4. Tick elevation-based scoring, this will be used on open-terrain maps. Urban maps will use DF-based scoring.
  5. Click 'Add Level and Generate Navmesh', this will take a few minutes.
  6. Once it's completed, click 'tasks' and then 'start all'.
  7. Open the map editor and tweak it how you like, recalculate costs to apply your changes.
Clone this wiki locally