AI stats: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Destined (talk | contribs)
No edit summary
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Spawnarg Explanation ==
<pre style="color: red">THIS PAGE IS A WORK IN PROGRESS</pre>
This is a short explanation what the respective spawnarg does. The information is taken from the explanations in the def-files. For clarity the spawargs were divided into three subgroups: Combat related spawnargs that include spawnargs influencing the fighting capabilities; Interactions that cover interactions between the player and the AI as well as the AI and the world; AI perception that include spawnargs that influence how the AI perceive their surroundings; and finally other that in my understanding do not fit the other categories.
== Spawnargs and Game Mechanics ==
In order to understand the influence of the spawnargs on game mechanics, I want to give a simple insight into the mechanics. For this I have decided to categorise them into  four subgroups: AI perception, Combat, and Interaction between AIs and player out of combat.
=== AI perception ===
In the centre of each stealth game lies the perception of the AIs. This includes the ability of AIs to see, hear, and touch its environment. The chance to percieve anything with the respective sense is multiplied with the respective acuity_* spawnarg at some point. If the AI is drunk all these factors are multiplied with the drunk_acuity_factor (default 0.5), which reduces the chance of the AI to notice the player.
==== Visual perception ====
In general, when an object with an AIUse spawnarg comes into the field of vision of an AI, the AI gets a visual STIM. The chancenotice* spawnargs influence if the AI reacts to the STIM and the argument of the AIuse spawnarg (not listed in the table) determines how the AI reacts. For example if the AI gets a visual STIM of another friendly AI it will greet, while it will attack a hostile AI on sight. The chance to spot the player follows a more complex algorithm and is influenced by the brightness of the light gem, the distance to the AI and the visual acuity of the AI (acuity_vis). You can check the [[Visual scan]] article for further information.
==== Aural perception ====
Noises made by the player as well as thrown objects or noise arrows produce a propagated sound of a specified volume. The propagated sound's volume decreases linearly with increasing distance from the source. When it reaches an AI the alert_aud_thresh value is subtracted and the remaining volume (if it is greater than 0) is added to the alert level of an AI.
==== Tactile perception ====
Tactile perception gets triggered, when the AI collision model touches the player's collision model.
==== Perception and Alarms ====
When an AI perceives anything suspicious, it adds to the AI's alert level. When this counter exceeds a certain amount (alert_thresh#), the AI will reach the next alert stage. In order to prevent the alert level to ramp up too quickly there is a grace period (alert_gracetime#) during which a new suspicious stim will not further alert the AI. This period can be terminated if the new stim during the grace period is too strong (exceeds the former addition to the alert level multiplied with the "alert_gracefrac#" value) or if there are too many stims in quick succession (exceeding the alert_gracecount#). Above the "idle" state (0) there are five alert stages:
*1: Observant (bark, but otherwise no reaction)
*2: Suspicious (bark, look, may stop and turn)
*3: Searching (Investigation)
*4: Agitated Searching (Investigation, Weapon out, AI is quite sure that there is someone around)
*5: Combat.
The AI will stay in this alert state for a time determined by "alert_time#".  Please note, that as soon as an AI has drawn its weapon it will not recede to the regular idle state, but instead to the "alert idle" state, which results in a hightened senses and possibly different behaviour of the AI (e.g. a former stationary AI starts patroling).
{| class="wikitable"
{| class="wikitable"
|+Combat related
|+Spawnargs related to AI perception
|-
|-
|armor
|acuity_aud
|Type of armor the AI is wearing (may vary depending on hit zone). The damage multipliers are: leather 0.75, chain 0.5, plate 0.
|AI aural acuity (in percent)
|-
|acuity_env
|AI environmental acuity.  How sensitive the AI is to things that have changed in its environment.
|-
|acuity_other
|AI generic acuity for scripted events.  You can call this alert type on an entity with entity.Alert( <char *type>, <float amount>).  This will alert the entity by amount * acuity_other in your script.
|-
|acuity_tact
|AI tactile acuity (in percent)
|-
|acuity_vis
|AI visual acuity (in percent)
|-
|alert_aud_thresh
|Threshold of audibility for the AI.  This is in dB of sound pressure level (SPL). The real life value for humans is around 20 (a barely heard whisper).  Changing this by even 0.1 has a large effect on sound propagation behavior, because propagated sounds below this volume are not heard at all. NOTE if this is not set, it gets the value from soundprop global settings.
|-
|alert_gracecount#
|If the number of additional alerts for an AI in alert state # during the grace period exceeds the grace count, the grace period will be terminated.
|-
|alert_gracefrac#
|An alert that is higher than the last increase times the grace fraction will terminate the grace period for an AI in alert state #.
|-
|alert_gracetime#
|After being alerted, the AI in alert state # will ignore additional alerts during the grace period (in seconds), to avoid adding up the alert level too quickly.
|-
|alert_thresh#
|The alert level threshold for reaching alert state #.
|-
|alert_time#
|The time it takes for the alert level to ramp down from the upper to the lower threshold in alert state # (in seconds).
|-
|-
|attack_accuracy
|chancenoticeblood
|Maximum angular offset to randomly offset the monster's aim when firing missiles
|Chance to notice the visual stim of blood
|-
|-
|attack_cone
|chancenoticebrokenitem
|Monster can only throw projectile within this cone relative to his direction.
|Chance to notice the visual stim of a broken item
|-
|-
|bleed
|chancenoticedoor
|If set to true, this entity will bleed, e.g. spawn blood particles and decals when hurt.
|Chance to notice the visual stim of an open door that should be closed
|-
|-
|damage
|chancenoticelight
|Damage definition if it damages things it collides with.
|Chance to notice the visual stim of a light that should be on
|-
|-
|def_melee_set
|chancenoticemissingitem
|The defined melee set that describes the fighting skills. The levels are "novice", "trained", and "skilled" and are further modiefied by the difficulty of the game.
|Chance to notice the visual stim of a missing item
|-
|-
|health
|chancenoticemonster
|Amount of damage to receive before dying.
|Chance to notice the visual stim of a monster
|-
|-
|health_critical
|chancenoticeperson
|When the health drops below this value, the AI will flee. Set this to 0 for AI that don't wet their pants.
|Chance to notice the visual stim of other persons
|-
|-
|melee_damage
|chancenoticepickedpocket
|Damage dealt with a melee weapon.
|Chance to notice that an object bound to the AI has been stolen
|-
|-
|melee_damage_mod
|chancenoticerope
|When the AI hits with a melee weapon, this multiplies the default damage done by the weapon. Is depending on difficulty and is replaced by melee_sets. Ranges from 0.8 to 1.4.
|Chance to notice the visual stim of a rope created by a rope arrow
|-
|-
|melee_predicts_proximity
|chancenoticesuspiciousitem
|If true, AI takes the current velocity of itself and its enemy into account to predict whether it will hit the enemy in the future if it starts a melee attack now.  All but the stupidest AI should do this.
|Chance to notice the visual stim of suspicious items
|-
|-
|melee_predicted_attack_time
|chancenoticeundead
|The amount of time in milliseconds that the AI uses to predict whether it will hit its enemy if it starts its attack now.  Should roughly correspond to the time it takes before the attack animation is threatening to an enemy in front of them.  This baseline can be set on an AI for empty-hand attacks, then may be overwritten by individual weapons if their attack animations are slower/faster than this baseline.
|Chance to notice the visual stim on an undead
|-
|-
|melee_range
|chancenoticeweapon
|do melee attack when within 3x this range
|Chance to notice the visual stim of suspicious weapons
|-
|-
|melee_rep_attack_time
|drunk_acuity_factor
|Time it takes for a melee attack to be repeated.
|If the AI is drunk, their acuities (visual, hearing, tactile) will be reduced by this factor.
|-
|-
|outofreach_projectile_delay_max
|fov
|Maximum period to wait between throwing player-out-of-reach projectiles
|Full field of view in degrees.  Will be used for both horizontal and vertical fov unless vertical is explicitly specified.
|-
|-
|outofreach_projectile_delay_min
|fov_rotation
|Minimum period to wait between throwing player-out-of-reach projectiles
|A vector of 3 space-delimited angles applied to rotate the AI's field of view relative to their head joint.  For most heads, the angles are: yaw pitch roll.
|-
|-
|outofreach_projectile_enabled
|fov_vert
|Ability to throw player-out-of-reach projectiles at the player.
|Full vertical field of view in degrees.  Leave blank or set to -1 to use the same value as the horizontal fov.
|-
|-
|pain_threshold
|headturn_chance_idle
|How much damage monster has to receive in one blow for it to play a pain animation.
|The chance for random head turning while idle (0 0-1 0)
|-
|-
|unarmed_melee
|headturn_factor_alerted
|Set this to 1 when this type of AI doesn't need melee weapons to fight. This is usually true for spiders, undead and such. Humans are wimps and need weapons.
|The headturning chance gets multiplied by this amount when the AI is alerted
|-
|-
|unarmed_ranged
|Set this to 1 when this type of AI doesn't need weapons for ranged combat. This is usually true for belchers.
|}
|}
=== Interaction between AI and player ===
Apart from percieving their surroundings, there are several ways the AIs and the player can interact with each other and the environment. What an AI can do is defined by the "can*" spawnargs. If it is set to "1" an AI can for example use a light switch (like most humans can). If it is set to "0" it cannot do that. For example zombies are not able to operate switches or elevators.
=== Stealth Combat ===
A player may want to be sure that AI will not bother him/her any more. . It is possible to knock it out, as long as they are below their "ko_alert_immune_state". In order to achieve that, the player has to hit the AI with the blackjack in an area around the "ko_zone" (usually the head), that is defined by the two "ko_angle_horiz/vert" spawnargs. This area can change, when the AI is alerted to the values defined via the "ko_angle_alert_horiz/vert" spawnargs. An alternative way to knock out AI is with gas arrows, except if the AI has the spawnarg "gas_immune" set to 1 (e.g. as most undead have). For the more ruthless player, it is also possible to kill AIs. As long as AIs are not alerted (i.e. below the "sneak_attack_alert_state") the damage of each of the player's attacks is multiplied with a factor defined in "sneak_attack_mult", which can lead to one-shot kills, if the hit-zone does not reduce the damage too much. Sneak damage to the head should almost always result in death for the AI. Should the AI not be killed, it will be alerted, of course, and following attacks will not deal additional damage. For a short term distraction of AIs, the player can blind AI with flash bombs or distract them with noise arrows. Note that the flash bombs will only be dropped, when the "use" button in tapped. Holding the button for a longer time will resilt in a farther throwing distance. The AI will be bilnded for a time defined as "blind_time" that is randomized by the "blind_time_fuzzyness".
{| class="wikitable"
{| class="wikitable"
|+Interactions
|+Spawnargs related to AI interactions with the player and vice versa
|-
|-
|blind_time
|blind_time
|The time span in seconds the AI is staying in 'blinded' state when hit by a flashbomb or -mine.
|The time span in seconds the AI is staying in 'blinded' state when hit by a flashbomb or -mine.
|-
|blind_time_fuzziness
|his is the random portion of 'blind_time'. A value in [blind_time-fuzziness ... blind_time+fuzziness] is chosen.
|-
|can_be_flatfooted
|If set to true, the AI becomes flat-footed in certain combat situations.  This means they're unable to run at the player, but can still turn to face the player.
|-
|-
|can_drown
|can_drown
Line 84: Line 127:
|canoperatedoors
|canoperatedoors
|AI ability to handle doors
|AI ability to handle doors
|-
|canclosedoors
|AI ability to close doors. canoperatedoors must be enabled for this to work. Added in TDM 2.12.
|-
|-
|canoperateelevators
|canoperateelevators
Line 137: Line 183:
|-
|-
|pickpocket_delay_max
|pickpocket_delay_max
|Maximum delay before reacting to a picked pocket
|Maximum delay before reacting to a picked pocket in milliseconds
|-
|-
|picpocket_delay_min
|picpocket_delay_min
|Minimum delay before reacting to a picked pocket
|Minimum delay before reacting to a picked pocket in milliseconds
|-
|-
|push_player
|push_player
Line 150: Line 196:
|sneak_attack_mult
|sneak_attack_mult
|Damage multiplier applied to ALL damage when AI is damaged at an alert level below that defined in 'sneak_attack_alert_state'.
|Damage multiplier applied to ALL damage when AI is damaged at an alert level below that defined in 'sneak_attack_alert_state'.
|-
|team
|Monsters do not actively attack players or monsters with the same team number. For common team numbers see [[AI Relations (Editing)]].
|-
|-
|}
|}
=== Open Combat ===
When stealth fails, the player always has the option to openly fight AIs instead of fleeing. However, combat in TDM is meant as a last resort and will ruin any stealth scores and will most likely kill you, when you face more than one guard. Also, common settings prohibit killing civilians (AI with the spawnarg "is_civilian" set to 1) and even guards on higher difficulties. The difficulty of a melee fight is influenced by three factors (not counting the player's skills): The combat difficulty setting in the menu (which can be set by the player), the melee skills of the AI (novice, trained, skilled, see Melee sets, are usually set for specific AI, but can be changed by the map author), and the difficulty setting of the current map (also chosen by the player). For a more detailed description on what to keep in mind while fighting, see [[The Dark Mod Gameplay#Combat|Combat]]. A hit by the player will deal damage. The damage reduces the amount of health of the AI by the base damage, scaled by the "damage_scale" of the zone hit.  When the dealt damage surpasses the pain_threshold, the pain animation of the AI will be played. As soon as the health of the AI reaches the health_critical value, the AI will flee.  Each successful hit or parry by the player will render an AI "flatfooted", which means it will not move for an amount of time defined as flatfooted_time (it can still attack, though). This time can be used to flee from the AI instead of continuing fighting.  If the player gets outside the melee reange of an AI (e.g. by climbing somewhere the AI cannot reach), the AI will start throwing stones at the player if "outofreach_projectile_enabled" is set to "1". It will wait a random amount of time between "outofreach_projectile_delay_min" and "outofreach_projectile_delay_max" before doing so. The "attack_cone" determines in which region the AI can throw (or shoot in case of bowmen). Additionally, each shot will be offset by a random amount of up to "attack_accuracy" degrees, so not each shot will hit the player.
{| class="wikitable"
{| class="wikitable"
|+AI perception
|+Spawnargs realted to combat
|-
|Spawnarg
|Explanation
|-
|armor
|Type of armor the AI is wearing (may vary depending on hit zone). The damage multipliers are: leather 0.75, chain 0.5, plate 0.
|-
|attack_accuracy
|Maximum angular offset to randomly offset the monster's aim when firing missiles
|-
|attack_cone
|Monster can only throw projectile within this cone relative to his direction.
|-
|bleed
|If set to true, this entity will bleed, e.g. spawn blood particles and decals when hurt.
|-
|can_be_flatfooted
|If set to true, the AI becomes flat-footed in certain combat situations.  This means they're unable to run at the player, but can still turn to face the player.
|-
|damage
|Damage definition if it damages things it collides with.
|-
|damage_zones
|There are different hit zones for AI that vary the damage recieved from the player.
|-
|damage_scale "zone"
|Factor by which damage in the given zone is multiplied.
|-
|def_melee_set
|The defined melee set that describes the fighting skills. The levels are "novice", "trained", and "skilled" and are further modiefied by the difficulty of the game.
|-
|flatfooted_time
|The duration in milliseconds that this AI remains flat footed after a combat action triggers this state.
|-
|health
|Amount of damage to receive before dying.
|-
|health_critical
|When the health drops below this value, the AI will flee. Set this to 0 for AI that don't wet their pants.
|-
|is_civilian
|If true, the AI is a civilian. Defaults to 0.
|-
|move_speed
|The movement speed of AIs is dependent on their animations and animation rate. The animation rate can be changed with the anim_rate_X (X = animation name).
|-
|outofreach_projectile_delay_max
|Maximum period to wait between throwing player-out-of-reach projectiles in seconds
|-
|outofreach_projectile_delay_min
|Minimum period to wait between throwing player-out-of-reach projectiles in seconds
|-
|outofreach_projectile_enabled
|Ability to throw player-out-of-reach projectiles at the player.
|-
|pain_threshold
|How much damage monster has to receive in one blow for it to play a pain animation.
|-
|unarmed_melee
|Set this to 1 when this type of AI doesn't need melee weapons to fight. This is usually true for spiders, undead and such. Humans are wimps and need weapons.
|-
|unarmed_ranged
|Set this to 1 when this type of AI doesn't need weapons for ranged combat. This is usually true for belchers.
|}
== Human AIs ==
Human AIs are somewhat special as the spawnargs are defined by the entity definition as well as the definition of the head. This leads to a great number of combinations and is the reason that heads are discussed here as well as the various human classes. In order to make this article as clear as possible, in the first table the base values for human AIs are stated. In the class specific tables only changes to these base values are listed.
=== Base Values ===
This table lists all base values for human AIs in alphabetical order.
{| class="wikitable"
|+Humanoid AIs
|Spawnarg
|Base Value
|-
|-
|acuity_aud
|acuity_aud
|AI aural acuity (in percent)
|100
|-
|-
|acuity_env
|acuity_env
|AI environmental acuity.  How sensitive the AI is to things that have changed in its environment.
|100
|-
|-
|acuity_other
|acuity_other
|AI generic acuity for scripted events.  You can call this alert type on an entity with entity.Alert( <char *type>, <float amount>).  This will alert the entity by amount * acuity_other in your script.
|100
|-
|-
|acuity_tact
|acuity_tact
|AI tactile acuity (in percent)
|100
|-
|-
|acuity_vis
|acuity_vis
|AI visual acuity (in percent) For a more elaborate description of the mechanics see [[Visual scan]]
|100
|-
|-
|alert_aud_thresh
|alert_aud_thresh
|Threshold of audibility for the AI. This is in dB of sound pressure level (SPL). The real life value for humans is around 20 (a barely heard whisper). Changing this by even 0.1 has a large effect on sound propagation behavior, because propagated sounds below this volume are not heard at all. NOTE if this is not set, it gets the value from soundprop global settings.
|18.8
|-
|alert_gracecount1
|5
|-
|alert_gracecount2
|5
|-
|alert_gracecount3
|4
|-
|alert_gracecount4
|4
|-
|alert_gracefrac1
|1.2
|-
|alert_gracefrac2
|1.2
|-
|alert_gracefrac3
|1.2
|-
|alert_gracefrac4
|1.0
|-
|alert_gracetime1
|2
|-
|alert_gracetime2
|2
|-
|alert_gracetime3
|3
|-
|alert_gracetime4
|2
|-
|alert_thresh1
|1.5
|-
|alert_thresh2
|6
|-
|alert_thresh3
|10
|-
|alert_thresh4
|18
|-
|alert_thresh5
|23
|-
|alert_time1
|5 +/- 1.5
|-
|alert_time2
|8 +/- 2
|-
|alert_time3
|25 +/- 8
|-
|alert_time4
|65 +/- 20
|-
|alert_time5
|
|-
|armor
|variable
|-
|attack_accuracy
|2.3
|-
|attack_cone
|70
|-
|bleed
|1
|-
|blind_time
|8 +/- 4
|-
|can_be_flatfooted
|1
|-
|can_drown
|1
|-
|canlighttorches
|1
|-
|canoperatedoors
|1
|-
|canoperateelevators
|1
|-
|canoperateswitchlights
|1
|-
|cansearch
|1
|-
|cansearchcooperatively
|1
|-
|-
|chancenoticeblood
|chancenoticeblood
|Chance to notice the visual stim of blood
|1.0
|-
|-
|chancenoticebrokenitem
|chancenoticebrokenitem
|Chance to notice the visual stim of a broken item
|1.0
|-
|-
|chancenoticedoor
|chancenoticedoor
|Chance to notice the visual stim of an open door that should be closed
|1.0
|-
|-
|chancenoticelight
|chancenoticelight
|Chance to notice the visual stim of a light that should be on
|0.9
|-
|-
|chancenoticemissingitem
|chancenoticemissingitem
|Chance to notice the visual stim of a missing item
|1.0
|-
|-
|chancenoticemonster
|chancenoticemonster
|Chance to notice the visual stim of a monster
|1.0
|-
|-
|chancenoticeperson
|chancenoticeperson
|Chance to notice the visual stim of other persons
|1.0
|-
|-
|chancenoticepickedpocket
|chancenoticepickedpocket
|Chance to notice that an object bound to the AI has been stolen
|0.5
|-
|-
|chancenoticerope
|chancenoticerope
|Chance to notice the visual stim of a rope created by a rope arrow
|1.0
|-
|-
|chancenoticesuspiciousitem
|chancenoticesuspiciousitem
|Chance to notice the visual stim of suspicious items
|1.0
|-
|-
|chancenoticeundead
|chancenoticeundead
|Chance to notice the visual stim on an undead
|1.0
|-
|-
|chancenoticeweapon
|chancenoticeweapon
|Chance to notice the visual stim of suspicious weapons
|1.0
|-
|damage
|34
|-
|damage_zone
|head, chest, torso_low, left_arm, right_arm, legs
|-
|damage_scale head
|2
|-
|damage_scale chest
|1.5
|-
|damage_scale torso_low
|1.0
|-
|damage_scale left_arm
|0.3
|-
|damage_scale right_arm
|0.3
|-
|damage_scale legs
|0.4
|-
|def_melee_set
|variable
|-
|-
|drunk_acuity_factor
|drunk_acuity_factor
|If the AI is drunk, their acuities (visual, hearing, tactile) will be reduced by this factor.
|0.5
|-
|-
|fov
|fov
|Full field of view in degrees.  Will be used for both horizontal and vertical fov unless vertical is explicitly specified.
|150
|-
|-
|fov_rotation
|fov_rotation
|A vector of 3 space-delimited angles applied to rotate the AI's field of view relative to their head joint.  For most heads, the angles are: yaw pitch roll.
|0 -20 0
|-
|-
|fov_vert
|fov_vert
|Full vertical field of view in degrees.  Leave blank or set to -1 to use the same value as the horizontal fov.
|120
|-
|gas_immune
|0
|-
|-
|headturn_chance_idle
|headturn_chance_idle
|The chance for random head turning while idle (0.0-1.0)
|0.3
|-
|-
|headturn_factor_alerted
|headturn_factor_alerted
|The headturning chance gets multiplied by this amount when the AI is alerted
|2
|-
|-
|}
|health
{| class="wikitable"
| variable
|+Other
|-
|-
|ignore_alerts
|health_critical
|ignores alerts; melee trainer only
|15
|-
|-
|is_civilian
|is_civilian
|If true, the AI is a civilian. Defaults to 0.
|0
|-
|-
|is_mantleable
|is_mantleable
|If set to 1, this entity is not mantleable by the player. Defaults to 0.
|0
|-
|ko_alert_immune
|0
|-
|ko_alert_immune_state
|5
|-
|ko_alert_state
|4 (as soon as weapon is drawn)
|-
|ko_angle_alert_horiz
|110
|-
|ko_angle_alert_vert
|180
|-
|ko_angle_horiz
|360
|-
|ko_angle_vert
|360
|-
|ko_immune
|0
|-
|ko_rotation
|0 0 0
|-
|ko_spot_offset
|2 -2.5 0
|-
|ko_zone
|head
|-
|melee_damage
|variable
|-
|melee_damage_mod
|0.6 - 1.4
|-
|melee_predicts_proximity
|1
|-
|melee_predicted_attack_time
|750
|-
|melee_range
|0
|-
|melee_rep_attack_time
|10000
|-
|outofreach_projectile_delay_max
|7.0
|-
|-
|move_speed
|outofreach_projectile_delay_min
|The movement speed of AIs is dependent on their animations and animation rate.  
|10.0
|-
|outofreach_projectile_enabled
|1
|-
|pain_threshold
|1
|-
|pickpocket_alert
|0
|-
|pickpocket_delay_max
|25000
|-
|picpocket_delay_min
|5000
|-
|push_player
|
|-
|sneak_attack_alert_state
|2
|-
|sneak_attack_mult
|2.0
|-
|-
|stamina
|stamina
|Determines how long the player can run. I have found this only for the player, not for AI.
|player only
|-
|-
|team
|team
|Monsters do not actively attack players or monsters with the same team number. For common team numbers see [[AI Relations (Editing)]].
| variable
|-
|unarmed_melee
|0
|-
|unarmed_ranged
|0
|-
|}
=== Heads ===
Different heads can change the cones of the field of vision and the ko volume, so it it is advisable to check if any AI you encounter wears a hat or helmet and/or an eye patch. Please note that even though many AIs wear helmets, this only reduces the cone in which you can knock out the guard. Only the ones with neck protecting elite helmets (see [[Heads Available for AI#Elite Guard Heads|Heads Available for AI]]) are in general immune to being knocked out (i.e. the cone you have to hit with the blackjack is reduced to 0).
{| class="wikitable"
|+Heads
|Spawnarg
|Heads with an eye patch
|Heads with hoods
|Head with a straw hat
|Heads with non-brimmed helmet
|Heads with non-brimmed saxon helmet
|Heads with brimmed City Watch helmet
|Heads with elite helmet
|Heads with brimmed City Watch helmet and an eye-patch
|Heads with elite helmet and an eye-patch
|-
|Heads
|[[Heads Available for AI#Builder Guard Heads|Builder Guard Head 6]],[[Heads Available for AI#Generic Guard Heads|Commoner Default Heads 2, 12]], [[Heads Available for AI#Commoner Default Heads|Commoner Default Head 12]]
|[[Heads Available for AI#Commoner Default Heads|Commoner Default Heads 1,10]]
|[[Heads Available for AI#Commoner Default Heads|Commoner Default Head 3]]
|[[Heads Available for AI#Generic Guard Heads|Commoner Default Heads 6, 7, 13, 16]]
|[[Heads Available for AI#Generic Guard Heads|Commoner Default Heads 14, 15]]
|[[Heads Available for AI#City Watch Heads|City Watch Heads 1 - 4, 6 - 8]]
|[[Heads Available for AI#Elite Guard Heads|Elite Guard Heads 1,2]]
|[[Heads Available for AI#City Watch Heads|City Watch Heads 5, 10]]
|[[Heads Available for AI#Elite Guard Heads|Elite Guard Heads 3]]
|-
|fov
|110
|80
|150
|150
|110
|150
|150
|110
|110
|-
|fov_rotaion
| -30 -20 0
|0 -35 0
|0 -35 0
|0 -30 0
|0 -30 0
|0 -30 0
|0 -30 0
| 0 -30 0
|-30 -20 0
|-
|fov_vert
|120
|95
|100
| 120
|120
|100
|120
|100
|120
|-
|ko_angle_alert_horiz
|110
|110
|110
|110
|110
|110
|0
|110
|0
|-
|ko_angle_alert_vert
|180
|180
|180
|180
|180
|180
|0
|180
|0
|-
|ko_angle_horiz
|360
|360
|360
|110
|110
|110
|0
|110
|0
|-
|ko_angle_vert
|360
|360
|360
|180
|180
|180
|0
|180
|0
|-
|ko_alert_immune_state
|5
|5
|5
|4
|4
|4
|all
|4
|all
|-
|-
|}
|}
=== Builders ===
=== Guards ===
=== Mages ===
=== Moors ===
=== Pagans ===
=== Thieves ===
=== Townsfolk ===
== Non-human AIs ==
=== Monster ===
=== Steambots ===
=== Undead ===
[[Category:AI]]

Latest revision as of 20:23, 30 January 2024

THIS PAGE IS A WORK IN PROGRESS

Spawnargs and Game Mechanics

In order to understand the influence of the spawnargs on game mechanics, I want to give a simple insight into the mechanics. For this I have decided to categorise them into four subgroups: AI perception, Combat, and Interaction between AIs and player out of combat.

AI perception

In the centre of each stealth game lies the perception of the AIs. This includes the ability of AIs to see, hear, and touch its environment. The chance to percieve anything with the respective sense is multiplied with the respective acuity_* spawnarg at some point. If the AI is drunk all these factors are multiplied with the drunk_acuity_factor (default 0.5), which reduces the chance of the AI to notice the player.

Visual perception

In general, when an object with an AIUse spawnarg comes into the field of vision of an AI, the AI gets a visual STIM. The chancenotice* spawnargs influence if the AI reacts to the STIM and the argument of the AIuse spawnarg (not listed in the table) determines how the AI reacts. For example if the AI gets a visual STIM of another friendly AI it will greet, while it will attack a hostile AI on sight. The chance to spot the player follows a more complex algorithm and is influenced by the brightness of the light gem, the distance to the AI and the visual acuity of the AI (acuity_vis). You can check the Visual scan article for further information.

Aural perception

Noises made by the player as well as thrown objects or noise arrows produce a propagated sound of a specified volume. The propagated sound's volume decreases linearly with increasing distance from the source. When it reaches an AI the alert_aud_thresh value is subtracted and the remaining volume (if it is greater than 0) is added to the alert level of an AI.

Tactile perception

Tactile perception gets triggered, when the AI collision model touches the player's collision model.

Perception and Alarms

When an AI perceives anything suspicious, it adds to the AI's alert level. When this counter exceeds a certain amount (alert_thresh#), the AI will reach the next alert stage. In order to prevent the alert level to ramp up too quickly there is a grace period (alert_gracetime#) during which a new suspicious stim will not further alert the AI. This period can be terminated if the new stim during the grace period is too strong (exceeds the former addition to the alert level multiplied with the "alert_gracefrac#" value) or if there are too many stims in quick succession (exceeding the alert_gracecount#). Above the "idle" state (0) there are five alert stages:

  • 1: Observant (bark, but otherwise no reaction)
  • 2: Suspicious (bark, look, may stop and turn)
  • 3: Searching (Investigation)
  • 4: Agitated Searching (Investigation, Weapon out, AI is quite sure that there is someone around)
  • 5: Combat.

The AI will stay in this alert state for a time determined by "alert_time#". Please note, that as soon as an AI has drawn its weapon it will not recede to the regular idle state, but instead to the "alert idle" state, which results in a hightened senses and possibly different behaviour of the AI (e.g. a former stationary AI starts patroling).

Spawnargs related to AI perception
acuity_aud AI aural acuity (in percent)
acuity_env AI environmental acuity. How sensitive the AI is to things that have changed in its environment.
acuity_other AI generic acuity for scripted events. You can call this alert type on an entity with entity.Alert( <char *type>, <float amount>). This will alert the entity by amount * acuity_other in your script.
acuity_tact AI tactile acuity (in percent)
acuity_vis AI visual acuity (in percent)
alert_aud_thresh Threshold of audibility for the AI. This is in dB of sound pressure level (SPL). The real life value for humans is around 20 (a barely heard whisper). Changing this by even 0.1 has a large effect on sound propagation behavior, because propagated sounds below this volume are not heard at all. NOTE if this is not set, it gets the value from soundprop global settings.
alert_gracecount# If the number of additional alerts for an AI in alert state # during the grace period exceeds the grace count, the grace period will be terminated.
alert_gracefrac# An alert that is higher than the last increase times the grace fraction will terminate the grace period for an AI in alert state #.
alert_gracetime# After being alerted, the AI in alert state # will ignore additional alerts during the grace period (in seconds), to avoid adding up the alert level too quickly.
alert_thresh# The alert level threshold for reaching alert state #.
alert_time# The time it takes for the alert level to ramp down from the upper to the lower threshold in alert state # (in seconds).
chancenoticeblood Chance to notice the visual stim of blood
chancenoticebrokenitem Chance to notice the visual stim of a broken item
chancenoticedoor Chance to notice the visual stim of an open door that should be closed
chancenoticelight Chance to notice the visual stim of a light that should be on
chancenoticemissingitem Chance to notice the visual stim of a missing item
chancenoticemonster Chance to notice the visual stim of a monster
chancenoticeperson Chance to notice the visual stim of other persons
chancenoticepickedpocket Chance to notice that an object bound to the AI has been stolen
chancenoticerope Chance to notice the visual stim of a rope created by a rope arrow
chancenoticesuspiciousitem Chance to notice the visual stim of suspicious items
chancenoticeundead Chance to notice the visual stim on an undead
chancenoticeweapon Chance to notice the visual stim of suspicious weapons
drunk_acuity_factor If the AI is drunk, their acuities (visual, hearing, tactile) will be reduced by this factor.
fov Full field of view in degrees. Will be used for both horizontal and vertical fov unless vertical is explicitly specified.
fov_rotation A vector of 3 space-delimited angles applied to rotate the AI's field of view relative to their head joint. For most heads, the angles are: yaw pitch roll.
fov_vert Full vertical field of view in degrees. Leave blank or set to -1 to use the same value as the horizontal fov.
headturn_chance_idle The chance for random head turning while idle (0 0-1 0)
headturn_factor_alerted The headturning chance gets multiplied by this amount when the AI is alerted

Interaction between AI and player

Apart from percieving their surroundings, there are several ways the AIs and the player can interact with each other and the environment. What an AI can do is defined by the "can*" spawnargs. If it is set to "1" an AI can for example use a light switch (like most humans can). If it is set to "0" it cannot do that. For example zombies are not able to operate switches or elevators.

Stealth Combat

A player may want to be sure that AI will not bother him/her any more. . It is possible to knock it out, as long as they are below their "ko_alert_immune_state". In order to achieve that, the player has to hit the AI with the blackjack in an area around the "ko_zone" (usually the head), that is defined by the two "ko_angle_horiz/vert" spawnargs. This area can change, when the AI is alerted to the values defined via the "ko_angle_alert_horiz/vert" spawnargs. An alternative way to knock out AI is with gas arrows, except if the AI has the spawnarg "gas_immune" set to 1 (e.g. as most undead have). For the more ruthless player, it is also possible to kill AIs. As long as AIs are not alerted (i.e. below the "sneak_attack_alert_state") the damage of each of the player's attacks is multiplied with a factor defined in "sneak_attack_mult", which can lead to one-shot kills, if the hit-zone does not reduce the damage too much. Sneak damage to the head should almost always result in death for the AI. Should the AI not be killed, it will be alerted, of course, and following attacks will not deal additional damage. For a short term distraction of AIs, the player can blind AI with flash bombs or distract them with noise arrows. Note that the flash bombs will only be dropped, when the "use" button in tapped. Holding the button for a longer time will resilt in a farther throwing distance. The AI will be bilnded for a time defined as "blind_time" that is randomized by the "blind_time_fuzzyness".

Spawnargs related to AI interactions with the player and vice versa
blind_time The time span in seconds the AI is staying in 'blinded' state when hit by a flashbomb or -mine.
can_drown If true, the AI will drown if it gets under water, either by walking in or by being dropped in unconsciously. Set to '0' to make them breathe under water.
canlighttorches AI ability to switch on torches
canoperatedoors AI ability to handle doors
canclosedoors AI ability to close doors. canoperatedoors must be enabled for this to work. Added in TDM 2.12.
canoperateelevators AI ability to handle elevators
canoperateswitchlights AI ability to operate light switches
cansearch Whether the AI can conduct a search or not
cansearchcooperatively ability to participate in a coordinated search
gas_immune 0 = not immune, 1 = immune to gas
ko_alert_immune If true, the AI is immune to knockouts when alerted at or above the alert state defined in 'ko_alert_state'.
ko_alert_immune_state Alert state number at which immunity behavior changes.
ko_alert_state Alert state number at which knockout behavior changes.
ko_angle_alert_horiz Horizontal knockout cone angle when the AI is alerted at or above 'ko_alert_state'.
ko_angle_alert_vert Vertical knockout cone angle when the AI is alerted at or above 'ko_alert_state'.
ko_angle_horiz Defines a horizontal cone angle extending backwards from the direction AI is looking. Anywhere within this cone and the vertical cone is a valid KO.
ko_angle_vert Defines a vertical cone angle extending backwards from the direction AI is looking. Anywhere within this cone and the horizontal cone is a valid KO.
ko_immune 0 = not immune, 1 = immune to blackjack
ko_rotation A vector of 3 space-delimited angles applied to rotate the AI's blackjack acceptance cone relative to their head joint. For most heads, the angles are: yaw pitch roll.
ko_spot_offset Defines the center of the head for knockout testing purposes. Vector offset from the head attachment joint to the desired head center point. The possible knockout cone extends back from this point.
ko_zone Name of the damage zone that must be hit for a possible knockout. Set this blank (i.e. : 'ko_zone' ) to make the AI immune to KOs from the blackjack.
pickpocket_alert Incremental alert value to be added to an AI's current alert level
pickpocket_delay_max Maximum delay before reacting to a picked pocket in milliseconds
picpocket_delay_min Minimum delay before reacting to a picked pocket in milliseconds
push_player Set this to 1 to let this entity push the player (default is 0).
sneak_attack_alert_state Alert state number at which the AI can no longer be sneak attacked.
sneak_attack_mult Damage multiplier applied to ALL damage when AI is damaged at an alert level below that defined in 'sneak_attack_alert_state'.
team Monsters do not actively attack players or monsters with the same team number. For common team numbers see AI Relations (Editing).

Open Combat

When stealth fails, the player always has the option to openly fight AIs instead of fleeing. However, combat in TDM is meant as a last resort and will ruin any stealth scores and will most likely kill you, when you face more than one guard. Also, common settings prohibit killing civilians (AI with the spawnarg "is_civilian" set to 1) and even guards on higher difficulties. The difficulty of a melee fight is influenced by three factors (not counting the player's skills): The combat difficulty setting in the menu (which can be set by the player), the melee skills of the AI (novice, trained, skilled, see Melee sets, are usually set for specific AI, but can be changed by the map author), and the difficulty setting of the current map (also chosen by the player). For a more detailed description on what to keep in mind while fighting, see Combat. A hit by the player will deal damage. The damage reduces the amount of health of the AI by the base damage, scaled by the "damage_scale" of the zone hit. When the dealt damage surpasses the pain_threshold, the pain animation of the AI will be played. As soon as the health of the AI reaches the health_critical value, the AI will flee. Each successful hit or parry by the player will render an AI "flatfooted", which means it will not move for an amount of time defined as flatfooted_time (it can still attack, though). This time can be used to flee from the AI instead of continuing fighting. If the player gets outside the melee reange of an AI (e.g. by climbing somewhere the AI cannot reach), the AI will start throwing stones at the player if "outofreach_projectile_enabled" is set to "1". It will wait a random amount of time between "outofreach_projectile_delay_min" and "outofreach_projectile_delay_max" before doing so. The "attack_cone" determines in which region the AI can throw (or shoot in case of bowmen). Additionally, each shot will be offset by a random amount of up to "attack_accuracy" degrees, so not each shot will hit the player.

Spawnargs realted to combat
Spawnarg Explanation
armor Type of armor the AI is wearing (may vary depending on hit zone). The damage multipliers are: leather 0.75, chain 0.5, plate 0.
attack_accuracy Maximum angular offset to randomly offset the monster's aim when firing missiles
attack_cone Monster can only throw projectile within this cone relative to his direction.
bleed If set to true, this entity will bleed, e.g. spawn blood particles and decals when hurt.
can_be_flatfooted If set to true, the AI becomes flat-footed in certain combat situations. This means they're unable to run at the player, but can still turn to face the player.
damage Damage definition if it damages things it collides with.
damage_zones There are different hit zones for AI that vary the damage recieved from the player.
damage_scale "zone" Factor by which damage in the given zone is multiplied.
def_melee_set The defined melee set that describes the fighting skills. The levels are "novice", "trained", and "skilled" and are further modiefied by the difficulty of the game.
flatfooted_time The duration in milliseconds that this AI remains flat footed after a combat action triggers this state.
health Amount of damage to receive before dying.
health_critical When the health drops below this value, the AI will flee. Set this to 0 for AI that don't wet their pants.
is_civilian If true, the AI is a civilian. Defaults to 0.
move_speed The movement speed of AIs is dependent on their animations and animation rate. The animation rate can be changed with the anim_rate_X (X = animation name).
outofreach_projectile_delay_max Maximum period to wait between throwing player-out-of-reach projectiles in seconds
outofreach_projectile_delay_min Minimum period to wait between throwing player-out-of-reach projectiles in seconds
outofreach_projectile_enabled Ability to throw player-out-of-reach projectiles at the player.
pain_threshold How much damage monster has to receive in one blow for it to play a pain animation.
unarmed_melee Set this to 1 when this type of AI doesn't need melee weapons to fight. This is usually true for spiders, undead and such. Humans are wimps and need weapons.
unarmed_ranged Set this to 1 when this type of AI doesn't need weapons for ranged combat. This is usually true for belchers.

Human AIs

Human AIs are somewhat special as the spawnargs are defined by the entity definition as well as the definition of the head. This leads to a great number of combinations and is the reason that heads are discussed here as well as the various human classes. In order to make this article as clear as possible, in the first table the base values for human AIs are stated. In the class specific tables only changes to these base values are listed.

Base Values

This table lists all base values for human AIs in alphabetical order.

Humanoid AIs
Spawnarg Base Value
acuity_aud 100
acuity_env 100
acuity_other 100
acuity_tact 100
acuity_vis 100
alert_aud_thresh 18.8
alert_gracecount1 5
alert_gracecount2 5
alert_gracecount3 4
alert_gracecount4 4
alert_gracefrac1 1.2
alert_gracefrac2 1.2
alert_gracefrac3 1.2
alert_gracefrac4 1.0
alert_gracetime1 2
alert_gracetime2 2
alert_gracetime3 3
alert_gracetime4 2
alert_thresh1 1.5
alert_thresh2 6
alert_thresh3 10
alert_thresh4 18
alert_thresh5 23
alert_time1 5 +/- 1.5
alert_time2 8 +/- 2
alert_time3 25 +/- 8
alert_time4 65 +/- 20
alert_time5
armor variable
attack_accuracy 2.3
attack_cone 70
bleed 1
blind_time 8 +/- 4
can_be_flatfooted 1
can_drown 1
canlighttorches 1
canoperatedoors 1
canoperateelevators 1
canoperateswitchlights 1
cansearch 1
cansearchcooperatively 1
chancenoticeblood 1.0
chancenoticebrokenitem 1.0
chancenoticedoor 1.0
chancenoticelight 0.9
chancenoticemissingitem 1.0
chancenoticemonster 1.0
chancenoticeperson 1.0
chancenoticepickedpocket 0.5
chancenoticerope 1.0
chancenoticesuspiciousitem 1.0
chancenoticeundead 1.0
chancenoticeweapon 1.0
damage 34
damage_zone head, chest, torso_low, left_arm, right_arm, legs
damage_scale head 2
damage_scale chest 1.5
damage_scale torso_low 1.0
damage_scale left_arm 0.3
damage_scale right_arm 0.3
damage_scale legs 0.4
def_melee_set variable
drunk_acuity_factor 0.5
fov 150
fov_rotation 0 -20 0
fov_vert 120
gas_immune 0
headturn_chance_idle 0.3
headturn_factor_alerted 2
health variable
health_critical 15
is_civilian 0
is_mantleable 0
ko_alert_immune 0
ko_alert_immune_state 5
ko_alert_state 4 (as soon as weapon is drawn)
ko_angle_alert_horiz 110
ko_angle_alert_vert 180
ko_angle_horiz 360
ko_angle_vert 360
ko_immune 0
ko_rotation 0 0 0
ko_spot_offset 2 -2.5 0
ko_zone head
melee_damage variable
melee_damage_mod 0.6 - 1.4
melee_predicts_proximity 1
melee_predicted_attack_time 750
melee_range 0
melee_rep_attack_time 10000
outofreach_projectile_delay_max 7.0
outofreach_projectile_delay_min 10.0
outofreach_projectile_enabled 1
pain_threshold 1
pickpocket_alert 0
pickpocket_delay_max 25000
picpocket_delay_min 5000
push_player
sneak_attack_alert_state 2
sneak_attack_mult 2.0
stamina player only
team variable
unarmed_melee 0
unarmed_ranged 0

Heads

Different heads can change the cones of the field of vision and the ko volume, so it it is advisable to check if any AI you encounter wears a hat or helmet and/or an eye patch. Please note that even though many AIs wear helmets, this only reduces the cone in which you can knock out the guard. Only the ones with neck protecting elite helmets (see Heads Available for AI) are in general immune to being knocked out (i.e. the cone you have to hit with the blackjack is reduced to 0).

Heads
Spawnarg Heads with an eye patch Heads with hoods Head with a straw hat Heads with non-brimmed helmet Heads with non-brimmed saxon helmet Heads with brimmed City Watch helmet Heads with elite helmet Heads with brimmed City Watch helmet and an eye-patch Heads with elite helmet and an eye-patch
Heads Builder Guard Head 6,Commoner Default Heads 2, 12, Commoner Default Head 12 Commoner Default Heads 1,10 Commoner Default Head 3 Commoner Default Heads 6, 7, 13, 16 Commoner Default Heads 14, 15 City Watch Heads 1 - 4, 6 - 8 Elite Guard Heads 1,2 City Watch Heads 5, 10 Elite Guard Heads 3
fov 110 80 150 150 110 150 150 110 110
fov_rotaion -30 -20 0 0 -35 0 0 -35 0 0 -30 0 0 -30 0 0 -30 0 0 -30 0 0 -30 0
fov_vert 120 95 100 120 120 100 120 100 120
ko_angle_alert_horiz 110 110 110 110 110 110 0 110 0
ko_angle_alert_vert 180 180 180 180 180 180 0 180 0
ko_angle_horiz 360 360 360 110 110 110 0 110 0
ko_angle_vert 360 360 360 180 180 180 0 180 0
ko_alert_immune_state 5 5 5 4 4 4 all 4 all

Builders

Guards

Mages

Moors

Pagans

Thieves

Townsfolk

Non-human AIs

Monster

Steambots

Undead