Overview

To ensure bots navigate around obstacles like buildings and trees, we use a navigation mesh system. This system generates a separate mesh based on the heightmap, landmesh, or water (depending on settings) that defines areas bots can traverse. The mesh is generated in the daEditor under the locationed/properties tab.

The navigation mesh is baked into a binary file during every export.

The navigation mesh is generated from a top-down view, which means there will be no navmesh under bridges or other elevated assets. To avoid this, you can specify the rendinst to exclude in develop/gameBase/config/navmesh_layers.blk under the filter{} block. The syntax is as follows:

"^.*af_conveyor.*$" {}

This is a regular expression, allowing you to exclude either all assets or specific ones by name. Note that the ending *$" {} is required.

Important

For successful ground navigation mesh generation, at least one spline must be present in the level (water navigation meshes are calculated based on the water surface alone).

Tank Navigation Mesh

The tank navigation mesh is constrained by splines. You can use existing splines or create new ones specifically for navigation mesh purposes.

Tank navigation mesh

If a spline has the Use for navmesh checkbox enabled in the properties panel, the mesh will include the area within the specified radius around the spline.


After creating a navigation mesh, additional files such as navMesh.PC.bin and/or navMesh2.PC.bin will appear in the level directory.

To view the navmesh in the daEditor, enable the show exported navmesh option in the panel.

To view the navmesh in-game, use the console command ai.debug_nav.

Common Error

The following error indicates that the tank/ship navigation mesh is missing from the level:

18.43 [F] $03 FATAL ERROR: skyquake\prog\main\app.cpp,5191: assert failed in ..\..\skyquake\prog\main\app.cpp:5191,AcesApp::doJob() : "pathfinder::isLoaded() || (strstr(levelFileName, "avg_") != levelFileName && strstr(levelFileName, "avn_") != levelFileName)" Call stack (5 frames): ...

Displaying Navigation in daEditor

The navigation and additional object display modes can be toggled from the following menu:

Displaying navigation in daEditor
  • Show exported nav mesh: displays navigation areas with a red-yellow overlay.

    Show exported nav mesh
  • Show exported covers: displays cover points for AI in green.

    Show exported covers
  • Show exported nav mesh obstacles: displays navigation obstacles in purple boxes.

    Show exported nav mesh obstacles