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.
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:
- Ground movement connection. Only usable by NPCs that move on the ground.
- Jump movement connection. Only usable by NPCs that can jump.
- Fly movement connection. Only usable by NPCs that can fly.
- 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.
- Toggle displaying ground node connections.
- Toggle display of jump connections between nodes.
- Toggle display of fly connections between nodes.
- Display the next NPC Hull size.
- 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.