L4D Level Design:ru/Nav Flow:ru
The flow is a numeric representation of the distance from the starting checkpoint towards the ending checkpoint.
Flow values let the AI systems quickly decide who is "ahead" or "behind," when players are near the checkpoint, etc. The flow is determined by setting the attributes: PLAYER_START, CHECKPOINT, and FINALE.
To see the flow of the whole nav mesh at once, enter these commands:
z_debug 1 z_show_flow_delta 2
z_show_flow_delta, "1" will show the delta for the area you point at, "2" shows the flow for the whole active area set.
If the flow is broken, the survivor bots will not be able to compute a path to the ending checkpoint, there will be no wandering Infected, Tanks, or Witches and the rescue closets won't work correctly. Basically, the game will be broken.
Another way to tell if the flow is broken is to run the following:
z_debug 1 z_show_flow_distance 1
This will show two numbers on each area. The numbers represent Units Increasing Toward Goal/Units Increasing Away From Start.
If the numbers are -9999/-9999, then the numbers are invalid and the flow is broken.
If the flow appears to be broken, that means that Survivors can not reach the destination of the level (the end checkpoint or the finale).
This could mean a few things:
- The starting area (the PLAYER_START area or the starting CHECKPOINT) is not set up correctly
- The destination area (the end CHECKPOINT or the FINALE) is not set up correctly
- The nav mesh does not connect throughout the level correctly.
Double-check that your level has a PLAYER_START area or a CHECKPOINT at the beginning. The CHECKPOINT at the start must have the requirements mentioned in the Checkpoint Rooms Tutorial.
Double-check that your level has an ending CHECKPOINT area or a FINALE. The CHECKPOINT at the end must have the requirements mentioned in the Checkpoints and Checkpoint Rooms Tutorials. The FINALE must have the requirements mentioned in the Finale Events Tutorial.
You can perform a "
nav_trouble_report orphan" check to see if the nav mesh does not connect throughout the level. It should also select the part of the map so that you can check the border area where it should connect.