Introduction to AI
AI stands for Artificial Intelligence (Wikipedia) and controls the behaviour of all but the simplest of NPC actions in the Source engine. Regardless of how easily you might have torn through the Combine it won’t be long after you start working with Source's AI that you recognise its power, intelligence and flexibility. This introductory guide will give you a brief overview of the AI from the implementation perspective. Please be aware that there is currently no official AI documentation: everything you see in this category was researched and written by the community. This means mistakes and omissions are inevitable.
The following are all entities a level designer might place in a map to manipulate the AI. A map doesn’t have any of them for the AI to function, but the more the better.
These give the AI bearing in the world besides other NPCs or the player. They are required for all but the simplest of AI actions.
The most direct way of influencing AI is through the path_corner entity. It bluntly instructs the NPC to go to it, and they do so in the most direct manner possible. A path_corner is essentially a script placed directly in the map.
Goals give the AI a task to fulfil in a semi-scripted manner.
Hints give AI contextual pointers that it would not be able to work out on it’s own. Areas safe to crouch and reload in, objects of interest, even places for birds to perch.
Assaults are the less scripted and combat orientated sisters of path_corners. Use them to move NPCs while retaining their tactical routines.
Unknown, possibly related to assaults.
Organise your NPCs into squads for increased efficiency and teamwork.
Other components including relationships, speech, and more.
General AI Events
<need to research events>