Level Editor/Workflows/Bots and navigation
Bots find their way round a map with a navigation mesh: a map of the walkable ground, baked from your level. This page shows how to give a map one, and how bots then know what to do.
- Functional > Nav Region and click on the floor.
- Resize its Extents so the box covers every floor, ramp and stair bots should use, with some height above the floors.
- Use several regions for a large or many-storeyed map. They can overlap and touch; the game joins them.
See Nav Region.
2. Bake
Select the regions and choose Functional > Bake Selected NavRegion (with none selected, every region is baked). The walkable area shows in the viewport. Look for:
- gaps where bots should be able to walk: a step too high (over 0.457 m), a slope too steep, a doorway too low or too narrow for a player;
- islands on top of crates or fences, which are harmless.
Each region has Bake On Export on by default, so the export always bakes again from the finished map. Terrain with Generate Navmesh on is baked at export too.
3. Doors and gates
You do not need to do anything special for doors and team gates: at export, each doorway's floor becomes a piece of navigation the game opens to the right bots while the door is open or the gate is theirs. Bake a nav region over every doorway as for any floor. If the export log says a door or a team's gates have no doorway polygons, there is no baked floor under them. See Door.
4. Tell the bots their jobs
With no orders a bot hunts whoever is nearest and wanders when there is nobody. That is right for a deathmatch. For any mode with an objective, the map's bot script (Map Config > Gamemode > Bot) gives each bot a job: defend this point, push the cart, collect that pickup, escort the carrier. See Bots.
5. Test
Start a playtest with bots and watch where they go. Bots that stand still or walk into a wall usually point at a gap in the navigation: bake again and check the area.