Hotline Data Dump
v1.1 - 07.10.2020
This document was created by Urinstein with help from dump
All the necessary data mining was done by dump with some help from Urinstein
The AI state table is heavily condensed into just a few heavily loaded terms in the interest of readability. It is important that you understand the meaning of those terms in order to understand the table.
So please have a look at the Glossary at the bottom and read it with care.
AI States
Gun Roamer | Gun Patrol | Gun Stationary | Melee Patrol / Fatso | Melee Stationary | Dog | Idle | |
Neutral State 0 | speed: 0 or 1 u/ fr random load direction RandomMove 60-120 | speed: 1 u/fr | speed: 0 or 2 u/fr random load direction create path home | speed: 1 u/fr | speed: 0 or 2 u/fr random load direction create path home | speed: 1 u/fr | see Tab. 2 (Idle State 0) |
If hear sound: switch to State 2 AlertWait 10 load offset: -1 CheckReload 30 load offset: 0-30 If direct LoS: AlertWait = 15 If indirect LoS: If direct LoS: switch to State 1 AlertWait = -1 switch to State 2 | If hear sound: switch to State 2 AlertWait 0 load offset: -1 CheckReload 30 load offset: 0-30 If direct LoS: AlertWait = 0 If indirect LoS: If direct LoS: switch to State 1 AlertWait = -1 switch to State 2 | ||||||
Charging State 1 (attacking w/ direct LoS) | speed: 3 u/fr turn speed: 10°/fr shoot + run directly at player If distance < 80 units: Turn to player 10°/fr Else face player Accelerate by .25 u/fr (max 3) | speed: 3 u/fr turn speed: 10°/fr run directly at player If distance < 8 units: | speed: 5 u/fr turn speed: n/a Accelerate towards player If touching player | ||||
CheckReload 0 If indirect LoS: If no LoS: | |||||||
Aiming State 2 (attacking w/ indirect LoS) | If distance > 280 units: Else shoot If no path: stand still If distance < 80 units: Else face player CheckReload 0 If direct LoS: switch to State 1 If no LoS: | switch to State 3 | |||||
Chasing State 3 (following path) | speed: 2 u/fr If not on a path generate path to player CheckReload 20 If direct LoS: switch to State 1 (unless Dog/Detective) If indirect LoS: update path (unless Dog/Detective/Policeman) play animation stand still for 50 fr (unless Melee Patrol) | ||||||
Knocked Down | hitbox: 16x16 After 115-235 frames: switch to Unarmed | ||||||
Unarmed | RandomMove 60-120 If LoS to weapon: grab weapon and switch to Melee Patrol/Gun Roamer State 0 |
Tab. 1: AI States
Idle State 0
Peeing | Smoking | Sitting | Phone | Guard | |
State 0 | CheckReload 20 If LoS: randomly create Melee Stationary or Gun Roamer (AR) face player If direct LoS: switch to State 1 If indirect LoS: switch to State 2 | CheckReload 15 If LoS: randomly create Melee Stationary or Gun Roamer (AR) face player If direct LoS: switch to State 1 If indirect LoS: switch to State 2 | CheckReload 30 If LoS: get up animation randomly create Melee Stationary or Gun Roamer (AR) face player If direct LoS: switch to State 1 If indirect LoS: switch to State 2 | CheckReload 15 If LoS: create Gun Roamer (AR) face player If direct LoS: switch to State 1 If indirect LoS: switch to State 2 | CheckReload 15 If LoS: create Gun Roamer (AR) face player If direct LoS: switch to State 1 If indirect LoS: switch to State 2 |
On death | drop gun / melee | drop gun | drop gun / melee | drop gun | drop M16 |
On Knockdown | drop gun / melee |
Tab. 2: Idle State 0 *no guns/gunmen on Metro - no melee on Clean Hit* *the sitting AI on Vengeance 1 can only spawn with a golf club on LoS*
Speeds
1 u/fr | 2 u/fr | 3 u/fr | 3.5 u/fr | 4 u/fr | 5 u/fr | ||||||
State 0 Unarmed | Patrols / Roamers / Dogs Roaming | State 0 State 3 Hostage Unarmed | Stationaries on controller only player getting weapon | Richard State 1 | without Cleaver all but Dogs | Graham | maskless | Brandon Hostage Bug | State 1 | Dogs | |
12 u/fr | 10-16 u/fr | 12-16 u/fr | 16 u/fr | ||||||||
Throwing | incl Biker | Double Barrel | Pumpgun | every other gun's bullets |
Tab. 3: Speeds
pump 12-16
db 10-16
default 16
throwing (incl biker's knife) 12
Weapon Spreads
0° | 4* | 6° | 10° | 12° | 20° |
Magnum | Throwing weapons | M16 Scorpion Pistol | Uzi (silenced) MP5 | Pumpgun | Double Barrel |
Tab. 4: Weapon Spreads
Weapon Drops
method | Dropping | Standing Execution | Melee Kill | Gun Kill | Knockdown |
0° direction | player direction | AI direction | straight up (cardinal direction) | direction of bullet impact | AI direction |
drop direction | dir+70+random(40) | direction-115+random(50) | -70+random(40) | bullet.direction-70+random(40) | direction-70+random(40) |
speed | 1-3 u/fr | 2-3 u/fr | 2-4 u/fr | 2-4 u/fr | 2-4 u/fr |
visual |
Tab. 5: Weapon Drops
Hurtboxes / Collision Masks
size | 16x16 | 16x8 | 6x6 |
objects | Jacket / Biker Gun Roamers Gun Stationaries Knocked Down Unarmed | Gun Patrols Melee Patrols Melee Stationaries | Dropped Weapons Thrown Weapons |
visual |
Tab. 6: Hurtboxes / Collision Masks *If a Gun Patrol goes into State 3 their hurtbox changes to 16x16 and remains so until they despawn*
*If you try to hit an AI through a wall with a melee weapon, their hurtbox changes to 6x6 until they despawn or go into Gun State 3*
*If you do the same with fists, it changes to 16x16*
*Leaning AI's hurtbox is fucked. It's 16x16 fo execution but for melee it's inside the wall and for bullets it's just really small inside their head*
*Also you can kill Leaning AI through walls if you hug the wall*
Frame Data active +inactive frames
Melee Weapons | Ranged Weapons | Executions | |||
14 +6 | Fists | +4 | M16 | ||
12 +13 | Bat | +30 | Pumpgun | ||
12 +10 | Pipe | +10 | DB | ||
12 +7 | Golf Club | +8 | Magnum | ||
8 +2 | Knife | +2 | Skorpion | ||
18 +2 | Suitcase | +2 | (Silenced) Uzi | ||
14 +11 | Pot | +3 | MP5 | ||
12 +8 | Pool Cue | +6 | Silenced Pistol | ||
10 +10 | Broken Pool Cue | +20 | Throwing weapons | ||
16 +4 | Crowbar | +30 | Biker's Knife | ||
16 +4 | Pan | ||||
20 +10 | Axe | ||||
12 +2 | Baton | ||||
16 +4 | Trophy | ||||
18 +2 | Drill | ||||
7 +8 | Katana | ||||
16 | Machete | ||||
37 | Sledge Hammer | ||||
16 | Biker's Cleaver |
Tab. 7: Frame Data *Execution Frames are not data mined yet, hopefully in the future*
Fig. 1 Distances | Fig. 2 Player Hitbox and Melee Hurtbox |
Health
Fatso Health:
If a fatso is moving, not on a path and you land a 7th hit, they die and skip the dying animation.
Every frame their health decreases by 1 + hits/4 per frame. Their health is 120.
Magnum bullets count as one bullet and penetrate.
Other Health:
AI spawn with either 0 or 1 health. A bullet/pallet does 1 damage. AI dies when health < 0.
Magnum bullet and lethal throwing weapons kill consistently.
Player Health:
The player spawns with either 1 or 2 health. A bullet/pallet does 1 damage. They die if their health reaches 0.
Glossary
LoS / Line of Sight | There are two types of LoS: |
CheckReload | This variable decrements by 1 every frame until it reaches 0, at which point it gets reset to whatever value is specified for the respective state the AI is in. |
AlertWait | Like CheckReload this variable decrements by 1 per frame. However it only does so while in State 0. When it reaches 0 it gets reset to the specified value (-1) and all the colour matched checks are done. This timer is essentially a reaction delay and has the effect of making the AI seemingly see you through walls, since it does not check for LoS. |
RandomMove | This variable also decrements by 1 every frame. When it reaches 0 it gets reset to a value from the specified range. The AI is then rolled a new direction and a new speed (0 or 1 u/fr). |
load offset | When a new floor is loaded, every AI is individually rolled a starting value for their respective timers. The load offset is the range from which a starting value can be chosen. |
random / roll | The terms random and roll will always refer to a uniform distribution within the specified ranges. |
units / u/fr | A unit corresponds to 1 pixel at a vertical resolution of 256px. That means in 1080 resolution it corresponds to around 4.22 pixels. |
Path | In State 3 (rarely 2) the AIs walk along paths. These paths are generated along the nav mesh which means that they are very angular and include weird movements like hugging the sides of doorways and such. A good rule of thumb is that both you and the AI should stand away from furniture, as well as the bottom and right side of walls, all of which casts large dead areas in the nav mesh. |
shoot | When a gun AI is in state 1 or 2, they will shoot at you. They will hold down the trigger and shoot as fast as possible. For this the game has a variable Reload which decrements by 1 per frame, but only in State 1 and 2. When it reaches 0, the AI will shoot and the timer is reset to the gun's fire rate. Importantly every AI starts at a Reload value of 13 when a floor is loaded or after picking up a gun from the Unarmed state. If you decrement an AI's Reload timer and break LoS, they will have different (potentially even close to 0) Reload values, the next time they see you. |
hear sound | The AI's reaction to sound is the highest perceived source of RNG in the game. Ironically most of that perceived RNG comes from the bad path generation. |
collision mask | Collision masks (CMs) are the blue rectangles from Tab. 6 and Fig. 2. They determine if an object is touching another object or not. As such they are the ones bumping into objects and walls, not your or the AI's sprite. CMs also determine whether or not you can execute an enemy, as your CM has to touch theirs for it to be the case. Lastly a thrown weapon will hit its target if their CMs overlap. |
hitbox | The hitbox is the area of effect of the player's melee weapon. It can be seen in Fig. 2 as the green box around Jacket. It is the same for all weapons. Yes, that indeed means knife and sledgehammer have the same range. |
hurtbox | Hurtboxes are the regions of the player and the AI where they are vulnerable to damage. In the case of bullets, the hurtbox is simply the CM. That means some AI, like melee AI, are easier to hit in a north/south direction. When you perform a melee swing, the AI will actually have two hurtboxes. The first being the CM again and the second being the green boy around the Ai in Fig. 2. Hitting either of these with your hitbox will kill the AI. |
Examples
AlertWait / Reaction Delay | A State 0 AI will see you within 1-30 frames (CheckReload), then Alertwait is set to 15fr, after which they will either be set to State 1 or 2 depending on whether you are still in dLoS or not. So a State 0 AI's reaction time is anywhere between 15fr and 45fr. Two weird effects arise from AlertWait: |
Other Reaction Times | In State 3 CheckReload is between 0-20 and there is no AlertWait, so AI's reaction time can go as low as 0 frames. However the third timer Reload can add an additional buffer to gunmen reaction times. Every gunman spawns with a Reload offset of 13fr. So the first time you see a gunman, they will not shoot until 13fr after they see you, so their total reaction time is 28-58fr. Reload only decrements in State 0 and is only reset when the AI shoots, so you could be walking past an AI, lowering their Reload timer and the next time you come across them their reaction time can again be as low as 15fr in State 0 and 0fr in State 3. (Caution: Idle AI will mostly have lower State 0 CheckReloads than 30) |
indirect LoS | Indirect LoS (iLoS) also leads to some sketchy behaviour. |