The new navigation mesh is based on Recast: https://github.com/memononen/recastnavigation
You can open a UI by entering the "wars_editor" command while you have your map loaded: Simply press "Build" to generate the navigation mesh. On large maps this will take around 15 seconds, on smaller more simple maps much and much faster. The process currently blocks, so make sure to run the game windowed.
You can select to visualize the navigation mesh. 5 different navigation meshes are generated for different sized unit types: You can also visualize how units traverse the navigation mesh and what mesh they use by entering the command "unit_show_route": The blue squares visualize which tiles are hit during path finding, while the lines show the route followed by the units.
The old navigation mesh would generate the cover spots automatically (but not do a great job on it). For the new navigation mesh, we decided to manually place the cover spots. The wars editor includes a tool to place these spots. The spots are saved in a separate file along side the map (yourmapname.wars).
You can also opt to use the following available commands, rather than the UI:
- recast_build - Builds the navigation mesh
- recast_draw_navmesh - Visualizes the navigation mesh
- recast_draw_nodepth - Draws the navigation mesh with no depth. Can be useful if map geometry is overlapping the mesh, but if you have multiple layers this can look confusing.
- recast_draw_trimeshslope - Visualizes the map geometry used by the build process. Useful if the navigation mesh result does not match the expected result.
- recast_build_numthreads - Max number of threads used when building navigation meshes in parallel (restricted by the number of meshes to build).
- recast_loadmapmesh - Generates the map geometry used by the build process. recast_build will do this automatically, but can be useful if you only want to visualize the generated map geometry.