Navigation Mesh (Nav Mesh)
Navigation mesh, or nav mesh, is a key tool in game programming that helps to determine where characters or objects can move within the game environment. Think of it as a map, made up of interlinked polygons, that the game's AI uses to navigate the world. It covers all walkable surfaces and helps to create realistic movement paths. It's a flexible system that can adapt to various types of environments, enabling characters to move around obstacles and through complex landscapes.
Add nav mesh to your map
- Shift + Left Click to select the floor brush.
- Right Click → Groups → Add Selected To → New Group
- In the popup window, name the new group nav.
For a brush to be added to the navigation mesh, it must be added to a group named nav (all lower case).
- In the World Editor, go to Build menu → Build Wizard
- In Navigation, toggle on Ground
- Click Build → Close
To view navmesh, go to Tools → View Options, then in Show Nav, toggle on Show Nav Mesh and Filled Mesh Faces
If you built the Nav correctly and selected the correct View Options, you should see a green overlay in the navigation areas.
View nav mesh
Visualizing the nav will help you understand where AI can navigate as you build encounters.
To view the nav, go to World Editor → Tools menu → View Options → Show Nav.
There are several Show Nav options in View Options. These options allow you to view nav mesh for various sizes of AI.