AI Documentation: Difference between revisions
No edit summary |
m fix typo |
||
Line 7: | Line 7: | ||
All AI in The Dark Mod can have four distinct levels of alertness, indicated by an Alert Index ranging from 0 to 4: | All AI in The Dark Mod can have four distinct levels of alertness, indicated by an Alert Index ranging from 0 to 4: | ||
* Alert Index 0: Idle, not suspicious | * Alert Index 0: Idle, not suspicious | ||
* Alert Index 1: Idle, | * Alert Index 1: Idle, suspicious | ||
* Alert Index 2: Searching | * Alert Index 2: Searching | ||
* Alert Index 3: Agitated Searching | * Alert Index 3: Agitated Searching | ||
Line 16: | Line 16: | ||
The thresholds are stored in the AI's member variables (thresh_1, thresh_2, thresh_3 and thresh_combat). Idle AI have their alertlevel below thresh_1. | The thresholds are stored in the AI's member variables (thresh_1, thresh_2, thresh_3 and thresh_combat). Idle AI have their alertlevel below thresh_1. | ||
{{ai}} | |||
Revision as of 05:53, 4 November 2007
This should be the starting point when trying to learn how the AI code in The Dark Mod is working.
General Coding
As of November 2007, a new AI coding framework has been introduced to further modularise the AI code. See AI Framework for more information.
Alertness
All AI in The Dark Mod can have four distinct levels of alertness, indicated by an Alert Index ranging from 0 to 4:
- Alert Index 0: Idle, not suspicious
- Alert Index 1: Idle, suspicious
- Alert Index 2: Searching
- Alert Index 3: Agitated Searching
- Alert Index 4: Combat, Chasing Enemy
Despite these states, the actual alert level of an AI is seamless (internally stored in a float), the current Alert Index is changed when the threshold for a given index is exceeded. These thresholds can be set for each AI in its spawnargs, if a mapper wants to mess with that.
The thresholds are stored in the AI's member variables (thresh_1, thresh_2, thresh_3 and thresh_combat). Idle AI have their alertlevel below thresh_1.