This article's documentation is for anything that uses the Source engine. Click here for more information.

Npc route: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(Undo revision 453621 by Gameplayer (talk))
Tag: Undo
 
(25 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{wrongtitle|title=npc_route}}
{{lang}}
{{this is a|console command|name=npc_route}}


The <code>npc_route</code> 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.
The <code>npc_route</code> 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.
{{devreq}}


== Example ==
== Example ==
<center>[[Image:npc_route.jpg|550px|An npc_zombie's route in HL2's d1_town_01.bsp]]</center>
<center>[[File:npc_route.jpg|550px|An npc_zombie's route in HL2's d1_town_01.bsp]]</center>
An example of <code>npc_route</code> 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.
An example of <code>npc_route</code> 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.


Line 27: Line 29:


== See also ==
== See also ==
* [[ai_debug_nav]], [[npc_go]], [[ai_moveprobe_debug]].
* [[ai_debug_nav]], [[npc_go]], [[ai_moveprobe_debug]], [[developer]].


[[Category:Debugging]]
[[Category:Debugging]]
[[Category:AI Commands]]

Latest revision as of 09:14, 17 September 2024

English (en)Translate (Translate)

npc_route is a console command available in all Source Source games.

The 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.

Note.pngNote:The game must be in Developer mode for this command to work properly.


Example

An npc_zombie's route in HL2's d1_town_01.bsp

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.

Notes

The color of the route lines represent the type of route built from each waypoint to the next. The colors are as follows:

  • Blue
    • Standard path to the next waypoint.
  • Cyan
    • 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.
  • Red
    • The NPC will perform a jump from this waypoint to the next.
  • Maroon
    • The final path to the destination point.

Usage

  • npc_route
    • 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.
  • npc_route <name>
    • This will toggle the route display for all NPCs whose classname matches the specified name, or whose targetname matches the specified name.

See also