The Daemon engine supports automatic navigation mesh generation from bsp map files. This navigation mesh (or "navmesh" for short) is used by the bots to navigate throughout the world.
The -nav parameter to daemonmap will generate a navigation mesh from a bsp file. Use it like so:
daemonmap.exe -game unv -nav mapname.bsp
./daemonmap -game unv -nav mapname.bsp
The navigation mesh generation process is conservative by default. This means some areas (particularly, small ledges) that should be walkable may instead create a break in the navmesh which bots interpret as "I am unable to go past there." The following optional parameters give the map maker some control over navmesh generation to help with this.
A lower cellheight will increase mesh generation accuracy at the cost of generation time and mesh size.
If there are gaps in the navigation mesh even though a player can easily just walk to get through, you can decrease the value to help.
Applies a median filter to the walkable areas of the mesh to help contain any "noise."
See this article for more information.
Attempts to compensate for cellsize inaccuracy by increasing the stepheight navigation mesh generation parameter based on the current samplesize. It is recommended to be used with a lower than default cellsize to help avoid over optimistic assumptions (i.e., saying some areas are walkable that really aren't). Useful for fixing breaks in the mesh caused by some small ledges.
This produces bad results depending on how big your
cellsizeparameter is, but generating the mesh in this way will be faster than simply decreasing the
Navigation mesh files go in the
maps/ directory either in the folder specified by the
fs_game cvar, or in the maps folder inside a map's
Testing the Mesh
- You may test your map locally by entering
\devmap mapNameas you would to test any map at any time. Note, of course, that this will disconnect you from whatever game you may currently be in.
- To enable drawing the navigation mesh, use
navedit enable navmeshnamewhere "navmeshname" is one of:
Where level4 is tyrant, level3 is dragoon, level2 is marauder, level1 is mantis, and level0 is dretch. The two builder navmeshes are not used at this time.
- Add bots with the
botcommand and spectate the game.
Navmesh editing is still a work in progress, but it can be useful for fixing unnavigable ledges.
Unfortunately, automatic navigation mesh generation that fully supports all of the map features and player abilities in Unvanquished is incredibly difficult. Automatic generation will usually produce a very satisfactory base mesh, but some areas may need further tweaking.
To edit the navmesh, you must select the one you wish to edit using the
To add connections use the
A oneway connection will only allow bots to move from the start of the connection to the end of the connection, but not from the end to the start. A twoway connection will allow bots to move in either direction along the connection. The radius of the connection is how far away the center of the bot has to be from the middle to take the connection.
Modifications to the navmesh are made in real time, so any bots that have spawned will react accordingly.
When you are done editing a specific navmesh, you can use
navedit save to save your work.