The AI system is the part of the game responsible for AI behaviour over short time scales. It is paired with level scripts which give the AI broader or situational goals.
Halo's game design goals heavily influenced the AI system; actors are meant to be predictable rather than completely random, react to the player, have incomplete knowledge, and communicate their internal state via dialogue, animations, and focus of attention.
AI have an individual knowledge model with "real" perception. They do not have complete knowledge of the battlefield but rather remember key objects and rely on cues like visibility and sound to track their enemy. This allows the AI to be fooled and act more believably.
According to quotes from Halo's AI programmer Chris Butcher, certain AI behaviours are triggered by hard-coded conditions. For example, the Grunt behaviour of fleeing when their Elite is killed is hard-coded, likely based on the actor type. Marines have an individual behaviour to stand close, but not too close, to other Marines, giving the illusion of them working in groups.
In Halo1, AIs were grouped into encounters, which also contained a set of firing positions. Various subsets of this set were made available to the AI depending on the state of their encounter (have many of their allies been killed? Are they winning? Are they losing? This was a mapping that was created by a designer).
Firing positions are discrete locations stored in the scenario's encounters where the AI can stand when trying to perform a spatial behaviour. They are not pathfinding nodes, but rather a pathfinding destination. The AI will weigh and select firing positions based on a few factors:
- Line of sight
- Distance to target
- Proximity of cover
- Proximity of friends and enemies
- Obstructions and hazards like vehicles, grenades, etc.
For example, the AI may move to a firing position if it has a clear line of sight to an enemy's presumed location (remember, AI have an incomplete knowledge model) and is in the actor's desired range.
Pathfinding is the system which allows AI to navigate between locations. It relies in part on precomputed BSP pathfinding data and object pathfinding spheres to know available paths and possible obstacles.
When the AI wishes to navigate, this data and static obstructions like scenery are considered to create a "smoothed" path of nodes between source and destination, which the AI then follows. It is believed that the A* pathfinding algorithm is used at this phase. While following the path, dynamic obstructions like units may force the AI to make detours to continue to its next node but it does not need to recalculate the entire path.
On a more technical level, pathfinding spheres are projected to the AI's ground-plane at pathfinding time to become pathfinding discs.
The maximum pathfinding distance that Halo's engine permits is 3276.7 world units, an extremely long distance. For reference, the distance between bases in Timberland is approximately 100 units. Halo 1 does not support pathfinding in moveable reference frames, unlike Halo 2 for Scarabs.
Thanks to the following individuals for their research or contributions to this topic:
- Chris Butcher (Quotes in article "The Artificial Intelligence of Halo 2" and GDC 2002 slides in "The Integration of AI and Level Design in Halo")
- gbMichelle (Discovering max pathfinding distance)
- Kornman00 (Overview of AI pathfinding system)