npc_route console command is a debugging tool for debugging the route that an NPC is using to navigate to a target destination. The route consists of a set of waypoints. Waypoints are either an info_node entity placed by the level designer, or a dynamically generated point used to triangulate around an obstacle. To properly view this debug tool, make sure you are in developer mode.
An example of
npc_route in action. The npc_zombie is attempting to move from the right of the screen to the left (he is operating under the instruction of the npc_go command). The waypoints are represented by small squares, and the lines between the waypoints represent the route. Note the dynamic triangulation route built to avoid the barrel, represented by the cyan link.
The color of the route lines represent the type of route built from each waypoint to the next. The colors are as follows:
- Standard path to the next waypoint.
- The path to a triangulation waypoint. These are dynamically generated by NPCs when they detect objects in their path, in an attempt to navigate around the obstacle.
- The NPC will perform a jump from this waypoint to the next.
- The final path to the destination point.
- This will toggle the route display for the NPC under your crosshair, if any.
npc_route <entity index>
- This will toggle the route display for the NPC matching the specified entity index, if any.
- This will toggle the route display for all NPCs whose classname matches the specified name, or whose targetname matches the specified name.