Sorting out navigation flow
Getting the nav flow right is one of the hardest parts in creating a good, working Left 4 Dead map. If the flow from the start to the end of the map isn't valid, survivors may not be able to reach the end safe room or finale, rescue closets might not work and the wandering infected will not spawn.
This is a checklist that I have compiled as I've overcome problems in my nav mesh generation. Please feel free to add to this if you discover any other useful methods/pieces of information.
Introduction
Firstly, the standard Left 4 Dead campaigns consist of five levels. The first level contains the original player spawn area (referred to in the navigation mesh as PLAYER START) and proceeds to a safe room (CHECKPOINT). The next three maps go from safe room to safe room and the last map ends in a finale (FINALE). Any campaign you build is not limited to five maps, but using the standard campaign basis as an example, this is the general flow:
- PLAYER START to CHECKPOINT - eg. l4d_airport01_greenhouse.bsp - "Player Start" map.
- CHECKPOINT to CHECKPOINT - eg. l4d_airport02_offices.bsp - "Checkpoint" map.
- CHECKPOINT to CHECKPOINT - eg. l4d_airport03_garage.bsp - "Checkpoint" map.
- CHECKPOINT to CHECKPOINT - eg. l4d_airport04_terminal.bsp - "Checkpoint" map.
- CHECKPOINT to FINALE - eg. l4d_airport05_runway.bsp - "Finale" map.
Depending on how many maps your campaign has, the CHECKPOINT to CHECKPOINT does not necessarily have to exist. You could have PLAYER START to CHECKPOINT and then CHECKPOINT to FINALE, or just plain PLAYER START to FINALE.

Console Commands
To start editing the navigation mesh, type exec nav_mode into the console. This sets up Valve's configuration for nav editing and is very useful in accessing all the commands you will need to use. To quit the nav editing mode, press Page Down; note that this doesn't always seem to remove all editing functions, so you may need to type exec config_default afterwards to reset your controls to the default configuration.
The best way to get to know the commands is to open up the nav_mode.cfg file yourself and make a list of the keys. However, some very useful editing commands are below:
- z_spawn (default 1) - This spawns a normal zombie at your crosshair. If you add a parameter after the command the relevant zombie will be spawned; for example, "z_spawn tank" will spawn a tank.
- noclip (default n) - Allows you to fly around the map and through objects. Very useful in positioning yourself for editing high-up areas or for getting to a specific area of your map quickly.
- nav_save (default TAB) - Saves your navigation mesh. Do this often, as there's no function for undoing changes if you mess things up!
- director_start/stop (default F3) - Toggles the director's enabled/disabled state. If enabled (and your flow is valid), wandering zombies will spawn, tanks and witches will spawn, etc.
- respawn_bot (default Numpad DEL) - This respawns a random bot. Note that this is a custom alias created in the nav_mode.cfg file and so will not function unless you have exec'd the file. The alias "respawn_bots" respawns all four bots but is not bound to a key by default.
- warp_all_survivors_here (default ' [apostrophe]) - Warps all survivors (including you) to the spot under your crosshair.
- nb_delete_all (default 2) - Deletes all NPCs (zombies, specials, survivors) from the world.
- nb_move_to_cursor (default 3) - Tells all NPCs to move towards the point under your crosshair. The target point is marked temporarily with a small green cross.
- nav_simplify_selected (default F7) - Attempts to merge any nav areas you have selected to simplify them. Don't try this with the whole map selected as the game will crash.
- nav_gui (default F6) - Opens up the nav-editing GUI with some advanced options. Note that the nav_gui command will need to be typed again to close the window and re-enable movement.
- nav_trouble_report (default PgUp) - Runs a check for the common problems present in navigation meshes. Any problem areas will be highlighted and the number of errors displayed in the console. Try typing the command in the console and add a space to see the different parameters that can be given.
There are also some other very useful commands that are not included in the config:
- z_show_flow_delta 1/2 - This enables flow arrows on the nav sector that you're looking at (if set to 1) or all nav sectors in the area (if set to 2).
- z_show_flow_distance 1 - This enables the flow distance to be displayed: xxxx/xxxx. These numbers relate to the units increasing towards map goal/units increasing from start. If -9999/-9999, the flow to this nav area is broken.
Recomputing The Flow
The most common error you'll encounter while nav-editing is the flow error. For a map to work properly there must be distinguishable start and end points and a completely connected route through the map. The director uses the flow to work out how far the survivors are through the map, which areas are in front of them and which are behind.
If when running a map you get a large "Map is unplayable!" error at the start, it's likely that your flow is broken. To fix this, one magic command can help tremendously in debugging: nav_recompute_flow. The command attempts to hook up your starting area (PLAYER_START or CHECKPOINT) with the ending area (CHECKPOINT or FINALE); if it can't, one of these possible errors will be displayed in the console:
- GetGoalArea: Cannot find SPAWN_RESCUE_CLOSET area in FINALE, thus cannot guarantee reachability of goal area.
If your current map is a finale map, you will need to create at least one rescue closet available to the survivors before they reach the finale area. This ensures that there is an available place for the survivors to respawn in the map if they die, since there's no ending safe room present.
If your map is not a finale map, this means there is a problem with your ending safe room. The game cannot find a second checkpoint area in the map and so assumes that it has a finale event. Of course, it then cannot find any nav areas marked FINALE and so reports the finale as broken. See the third item on the checklist below for a list of the entities required in an ending safe room.
- ComputeFlowDistances: ERROR - [Error here]
Depending on what error is being reported, this may be because of a number of problems:
- Cannot determine start/end area - This means you have not set up your beginning/ending checkpoint or finale correctly. See the checklist below for more information.
- Cannot reach start area from end area - This is the easiest of the nav errors and simply means that you have a break in your nav connections somewhere along the line. You can use nav_trouble_report orphan to check for disconnected nav areas and z_show_flow_distance/delta to check the flow ID for each area. Look out for dark blue (one-way) connections which could be pointing backwards, ie. the survivors will be able to walk from the further area to the nearer area but not the other way around. Left 4 Dead also commonly mucks up the meshes on stairs, so these would be your first culprits to check.

- GetGoalArea: Cannot find end area - no checkpoint or finale located.
This means that none of your nav areas have been marked with either CHECKPOINT or FINALE. If you want a checkpoint, you've probably done something wrong concerning your safe rooms - see the third item on the cheklist below. If you want a finale, you need to apply the mark FINALE attribute liberally to the navigation sectors in your finale area.
Checklist
For me, this is my complete nav flow checklist:
- If on Player Start map (see top) of campaign, needs a PLAYER START nav surrounded by CHECKPOINT where the players will spawn. If not starting map (a Checkpoint or Finale map, see top), just needs CHECKPOINT areas inside the safe room.
- Prop_door_rotating_checkpoint in the spawning safe room needs to be named checkpoint_exit, and in the final safe room named checkpoint_entrance. These names are important: I have unconfirmed speculations, but I think that the navigation flow is invalid if these names are not followed correctly. They are the opposite way around to they way you'd expect: the starting door exits the previous safe room, the ending door enters the next one.
- A trigger_changelevel needs to be put into the ending saferoom and needs to touch at least the majority of floor space in the room. This is so that, when computing the navigation mesh, the game knows where to mark the CHECKPOINT areas. Note that the trigger_changelevel does not necessarily need to point to a valid map but does need to have something in the map field, otherwise the navigation flow may not be computed correctly. Should usually be used in conjuction with a trigger_transition and info_landmark, named identically to each other.
- After recent investigation, I've found out that the placement of weapons and items is important when computing navigation flow. The game uses these entities to further help distinguish safe rooms from the rest of the map. It's recommended to have at least one weapon_ammo_spawn, four weapon_first_aid_kit_spawns and either a Pump Shotgun and SMG or the three power weapons in each safe room or starting area.
- It is recommended that each map has at least one survivor closet: a room, completely sealed apart from a prop_door_rotating, and housing three info_survivor_rescue entities. Note that PLAYER START to CHECKPOINT (Player start) or CHECKPOINT to CHECKPOINT (Checkpoint) maps don't necessarily need one, as the safe room acts as a closet on the next map load. However, for finale maps it is essential that a survivor closet exists, since there is no final saferoom for the survivors. If you do not put a survivor closet in a finale map, there will be an error when computing the flow - see the first nav_recompute_flow error above.
- If all the navigation sectors in your map are marked "Missing Checkpoint" by nav_trouble_report checkpoint, this is either because you haven't set up one/both of your checkpoints properly, or because some areas of navigation mesh are either preceding your first checkpoint or succeeding your last checkpoint. If there are nav areas beyond either of these checkpoints, the safe room areas are not going to be marked explicitly as the beginning and ending areas of your map - for example, if there was some mesh succeeding your ending safe room, the end of this extra mesh area would become the end of the map and the safe room area would only be 99% of the way there, which is not what we would want. Since the nav generation process sometimes isn't the smartest, it'll think that all the mesh in-between your beginning and ending safe rooms should belong to one safe room only - the one at the start. Hence, it wants you to have a massive safe room spanning the entirety of your map, just to have the actual playable section as that tiny, unmarked bit right at the end. Luckily, if you delete these extra areas the problem should go away. Correct me if I'm wrong, of course.
- Finally, if all else fails, re-generate your mesh using nav_generate and tweak it to your liking. This sometimes solves problems that you cannot find a solution to.
In Conclusion
If anyone's having problems they can't sort out, drop me an e-mail at jonathan[.]poncelet[@]talk21[.]com and I'll try to help. Happy mapping!