Navigation Meshes (L4D)

From Valve Developer Community
Jump to: navigation, search

Left 4 Dead uses the navigation mesh to spawn infected. The director uses the Navigation Mesh when deciding where to spawn infected as well as other factors such as light intensity and line of site. By altering the mesh, it is possible to change the type of infected spawning (such as hospital patients and so on) and the density of their spawn.

Tip:The automatically generated navigation mesh looks for objects on a grid of 25 units. If object protrude into this grid it may not generate a navigation block at that location. An easy way to view the grid is to open the Hammer configuration. Under "2D Views" set the "Highlight every 'x' grid lines" to 25 units. Now you can place objects knowing exactly how the navigation grid will be generated around them.

NOTE: This article was written with experimental information and may not be 100% accurate. This article also assumes that you have read and understood the Navigation Meshes article.

Marking

Marking is as important in Left 4 Dead than it is in Counterstrike. While in counterstrike it affects how bots behave, in Left 4 Dead it both controls how they behave and how they spawn. By marking an area with certain attributes certain spawning behaviours can be created. Marking is the same as in Counterstrike, except with extra attributes, such as:

Available attributes for marking areas in Navigation Mesh editing mode.

AVOID
Informs NPCs to avoid the area when possible.
BATTLEFIELD
Designates a region where a planned crescendo event will play out. Mobs will spawn and swarm dynamically inside this area. Should be a large region of the map, capable of containing a BATTLESTATION, and many spawn-friendly/mob-related areas within it. Survivors should be located inside this area at the time of the panic event - it is essential to the effect this attribute is intended to create.
BATTLESTATION
Indicates a strong defensive area that contains supplies/weapons for use during a panic event. Survivor bots will consider this area as important, and will use or protect it as long as other survivors are nearby. It is intended to be used in carefully selected locations of BATTLEFIELD and FINALE regions.
BREAKABLEWALL (Left 4 Dead 2)
Indicate to infected if a wall is breakable or not.The infected attack the wall until it breaks.
CHECKPOINT
Designates the start/safe-room areas of the map. The round starts when a survivor leaves this area, and ends when the door is closed at the ending checkpoint with only the survivors inside. Infected are prohibited from spawning inside this area at all times.
CLIFF
Could be used to determine whether falling in this area triggers the hanging script that prevents survivors from falling great heights. Usually marked during automatic generation.
CROUCH
Indicates that the use of crouch is required to navigate the area. Usually automatically added by the game during a nav_analyze.
DONT_HIDE
Marks areas that are not suitable hiding spots. This appears to be an attribute Counter-Strike: Source. To do: Does this still apply to L4D2?
DOOR
Marks areas in which a door is located. Usually located in door frames. Usually automatically added by the game during a nav_analyze.
EMPTY
Prevents wandering infected from being populated in this location. Useful for places outside the survivors playable area, or any other place you do not want wandering/sleeping infected to spawn (e.g. rooftops & surfaces infected fall off of).
Note:Does not affect mobs/special-infected.
ESCAPE_ROUTE
Basic guideline path of map from start to finish by linking spawns/checkpoints to the ending checkpoint/finale. It should be found using the nav_analyze command, and may not work properly if drawn manually. This path helps the game/AI to make decisions based on routes and level progression.
FINALE
Indicates a finale area, and controls the spawning of ALL infected during a Finale Sequence. Once the sequence has been started, only areas marked with FINALE will spawn infected. Should be used extensively across your finale area, and contain a BATTLESTATION within it.
JUMP
(Probably not L4D Specific) One area was found in a map marked as "jump" - on top of a subway car only reachable by infected who could jump. This area likely signifies a place you must jump to somehow in order to reach.
Note:There is a CVAR called nav_generate_fixup_jump_areas (Default set to 1) that states that it's purpose is to "convert obsolete jump areas into 2-way connections".
LYINGDOWN (Left 4 Dead 2)
Causes zombies to lie down when not aroused by player. It can be found used in C2M1 (Dark Carnival) along the freeway ramp, the motel pool of dead bodies, and along the stream on the way to Whispering Oaks.
MOB_ONLY
The name suggests it could be used to only allow mobs through the area. It is caused by switching the Breakable By property to All Infected on nearby props and breakables. This can't be set manually (at least under Left 4 Dead 1).
NOT_CLEARABLE
Prevents an area from being cleared, and allows infected to spawn here indefinitely. Used in the outer-most areas survivors are able to attack or have line-of-sight to, but can't really see (e.g. through fog). It is considered a potential area for mob spawns when not in the line-of-sight. If the only mob spawn area available in a fully cleared map (like a small test map) are constrained to an area marked with NOT_CLEARABLE that is within survivor LOS, the director for will wait for survivors to look away before a mob is spawned. Use this attribute in conjunction with OBSCURED if a nav area is known to be obscured.
Note:Nav-squares are 'cleared' once survivors view and remove them of all infected. Cleared areas cannot spawn infected. NOT_CLEARABLE modifies such a rule.
NO_HOSTAGES
To do
NO_JUMP
To do
NO_MERGE
To do
NO_MOBS
Prevents infected mobs from spawning in this location. Commonly used to help mobs spawn further away from survivors and in more secluded areas of the map. Also used to keep sources of mobs from appearing unnatural or odd, such as spawning on rooftops of certain buildings. A clever example of NO_MOBS is in the "drainage" level of the Death Toll campaign. It is used in the long pipes so that infected must spawn in the upper areas and run at you down the lengths of the pipe, rather than just around the corners.
NOTHREAT
To do: What does this do, exactly? Specifically, it may be used to prohibit potential boss infected (tank & witch) spawns and possibly special infected. It is often seen alongside attributes EMPTY and NO_MOBS. The combination may suggest nav areas that are desired for infected to be able to go to but not spawn there. It would allow common infected to navigate to that area when a pipe bomb or bile bomb is placed there. This can be seen in c1m1_hotel end-saferoom and the perimeter around the hotel where the only way to access that area is to fall from a deadly height. In c1m2_streets, NOTHREAT is added to nav areas such as ones through and near a doorway, under a walkway bridge passing, and near the scene where a cinematic explosion occurs.
OBSCURED
Affects the amount and manner of which infected can spawn. This is a very important navigation attribute, use both wisely and with caution. There are two primary uses:
  • Indicates that the area is not viewable by survivors, and allows the director to spawn flowing, or large waves of mobs. It is often used in blocked alleyways and other areas that survivors cannot view. The director can still create effective mobs without the use of OBSCURED, but they will usually be further outside the survivor PVS.
  • Allows infected to spawn even when there is line-of-sight to a survivor. Useful in unreachable areas with heavy fog, or areas with props that don't block line-of-sight in the engine, but still obscure the survivors view on all sides (e.g. bushes & leafy trees). Bot line-of-sight is also blocked to prevent omniscient behavior.
    Tip:Props that have collisions disabled are always unable to block line-of-sight and will need the help of OBSCURED
OBSTACLE_TOP
To do: What does this explicitly do? Some nav areas on top of props don't have this attribute but infected and survivor bots can still can climb over fine.
In c1m2_streets, nav areas with this attribute are seen on top of props that require infected to climb over, such as concrete road blocks and low-lying fences blocking the streets. It is not consistently marked for all the nav areas on top of those props.
PLAYERCLIP (Left 4 Dead 2)
Marks an area of the navmesh which has a Player clip texture on it. Survivors will not go to this area, but infected will still use it - great for creating zombie spawn closets or infected-only ladders.
PLAYER_START
This attribute is used in the exact nav mesh area(s) that the players spawn in. This appears to only be used in the very first level of each campaign - likely because after the first level it cannot be guaranteed where a player will spawn into the game (since you load relative to the landmark).
PRECISE
Used to mark narrow pathways such as the ticket counters and exposed support-beams in the subway/generator area of No Mercy.
RESCUE_CLOSET
Marks off the location of rescue closets inside the level. Usually automatically added by the game during a nav_analyze.
RESCUE_VEHICLE
Marks where survivors should go to during rescue. Used only in a Finale sequence and remains locked until "FinaleEscapeVehicleReadyForSurvivors" is fired. Area covered in RESCUE_VEHICLE should be the location of the rescue vehicle once it is in position. In some cases, a lead-in must be made to make the path onto the vehicle navigable (see 'No Mercy' finale).
RUN
To do
STOP
To do
STOP_SCAN
Rarely used. Function unknown. Claimed by some to be helpful for bots around ladders and stair cases, but this is speculation. To do
STAIRS
To do
STAND
To do
TANK_ONLY
This area seems to be exclusively reserved for the tank. Bots won't use it and the flow won't compute through them. It is caused by switching the Breakable By property to Tank only on nearby props and breakables. This can't be set manually (at least under Left 4 Dead 1).
THREAT
Added automatically by the game during a nav_analyze. Boss Infected (tank & witch) should spawn in these areas. To do: Single nav areas along the escape route are marked with THREAT and are subsequently removed when that portion of the escape route has already been reached. Could it be that those are potential spots for boss infected to spawn along an escape_route?
TRANSIENT
This area may not always be navigable, as it could become blocked.
UNDERWATER
Obviously, this marking means that the area is under water. This property is automatically added by the engine during a nav_generate and/or nav_analyze. This can be found in every map that has water, including C5M3 (Left 4 Dead 2: The Parish) when going through the sewers, before the multiple alarm car area.
WALK
Toggles the 'traverse this area by walking' flag used by the AI system. To do: confirm if applicable to L4D Series

As you can see, some of these are obvious, and will require experimentation to create the right amount of spawn density or to discover their function.

Place names

See also