ai_show_connect
ai_show_connect
is a console command available in all Source games.
Introduction
The ai_show_connect
console command is a debugging tool for examining the AI node graph. The quality of the node graph has a large impact on the perceived quality of the AI, so it's important to be able to identify and solve node graph problems.
When debugging node graph problems, first determine the hull size used by the NPC that's having problems navigating. Each NPC tells the AI system the size of its NPC Hull. A small headcrab will be able to get into spaces that the much larger Antlion Guard can't, so the AI system calculates potential connections between nodes for each registered hull.
The easiest way to fix node graph problems is to use the map_edit command, which allows you to interactively modify the node graph in-engine.
Graph Display
An example on the right shows ai_show_connect
in action. The currently selected hull is shown in the bottom right corner. In this case, the hull is HUMAN_HULL
, which is used by all humanoid sized enemies (Combine Soldiers, Metropolice, Citizens, Alyx, etc).
The color of the lines between the nodes will identify the type or state of the connection between the nodes. The colors are as follows:
- Green
- Ground movement connection. Only usable by NPCs that move on the ground.
- Blue
- Jump movement connection. Only usable by NPCs that can jump.
- Cyan
- Fly movement connection. Only usable by NPCs that can fly.
- Grey
- A connection currently turned off by an info_node_link_controller.
- Dark red
- A connection that is valid for some other Hull size, but not the currently selected Hull.
- Bright red
- A connection that an NPC recently marked invalid because it was unable to move between the nodes.
Once marked, connections stay invalid for at least 4 seconds to prevent multiple NPCs trying to navigate over a dynamically blocked connection.
Usage
ai_show_connect
- Toggle displaying ground node connections.
ai_show_connect_jump
- Toggle display of jump connections between nodes.
ai_show_connect_fly
- Toggle display of fly connections between nodes.
ai_next_hull
- Display the next NPC Hull size.
ai_nodes
- Display all nodes. Useful for spotting nodes without any connections to them. Entering the command twice will also display the Hammer ID of the node.