saints row iv · ai
Saints Row IV AI Explained
How enemies and allies decide what to do: 20 goals checked in priority order, 112 actions tried until one succeeds.
AI137 rows
NPC brain: a priority list of goals, each with an ordered list of actions. The NPC keeps trying until one action succeeds. Names are Volition's own (from tables inside the exe).
| # | Name | Meaning / category | Code |
|---|---|---|---|
| How it decides (runs for every AI character, every update) | |||
| 1 | If a mission script has forced an action (e.g. 'shoot at X'), do that and stop. | human+0x500 flags, command at human+0x560 | |
| 2 | Otherwise go through the 20 goals below from top to bottom. A goal only counts if this NPC's behaviour profile allows it AND the goal's check function says it applies right now. | profile = *(human+0x328), from ai_behavior.xtbl | |
| 3 | For the first goal that applies, try its actions in order (the order comes from ai_goals.xtbl). Skip actions this NPC can't do, that are disabled for it, or that are cooling down. | ||
| 4 | The first action whose function returns 'success' is what the NPC does. If nothing works, fall through to the next goal. | current goal = human+0x4F8, action = human+0x4F9 | |
| 5 | If no goal produces an action, run the vehicle-passenger fallback. | ai_action_vehicle_passenger 00564a00 | |
| The 20 goals, highest priority first | |||
| Goal 0 | change mode | Switch the NPC's AI mode when its situation changes. | check: 00530090 |
| Goal 1 | assault bot | Special logic for assault robots. | check: 005300a0 |
| Goal 2 | dodge attack | Get out of the way of an incoming attack. | check: 00531220 |
| Goal 3 | avoid brute | Stay away from a Brute. | check: 00533210 |
| Goal 4 | kill near player | Attack enemies close to the player (followers). | check: 00531b90 |
| Goal 5 | survive | Stay alive when badly hurt. | check: 005311c0 |
| Goal 6 | retreat | Fall back. | check: 00531c90 |
| Goal 7 | group | Regroup with allies. | check: 005312d0 |
| Goal 8 | suppress | Pin the target down with fire. | check: 00531330 |
| Goal 9 | cover | Use cover. | check: 00531380 |
| Goal 10 | taking_damage | React to being hit. | check: 00531da0 |
| Goal 11 | advance | Push forward on the target. | check: 005333f0 |
| Goal 12 | reload | Reload the weapon. | check: 00530100 |
| Goal 13 | mercy | Stop attacking a downed or surrendering target. | check: 005300b0 |
| Goal 14 | kill enemy | Attack the current target. | check: 005315c0 |
| Goal 15 | flush out | Force a hiding target out. | check: 00531e40 |
| Goal 16 | frustrated | Change tactics after failing for a while. | check: 00531530 |
| Goal 17 | acquire target | Find something to fight. | check: 00531f70 |
| Goal 18 | investigate | Check out a noise or disturbance. | check: 00531630 |
| Goal 19 | idle | Nothing to do - stand, wander, ambient behaviour. | check: 00532100 |
| The 112 actions an NPC can perform | |||
| Action 0 | fire | shooting | 00591040 |
| Action 1 | fire sweep | shooting | 005916e0 |
| Action 2 | fire suppress | shooting | 00591370 |
| Action 3 | fire chaos | shooting | 00590c20 |
| Action 4 | fire left | shooting | 00590c90 |
| Action 5 | throw grenade | grenade | 0059dec0 |
| Action 6 | throw weapon | throw | 005a49a0 |
| Action 7 | melee | melee | 005a2cc0 |
| Action 8 | melee vehicle | melee | 005a3760 |
| Action 9 | cover take def | cover | 0058fcd0 |
| Action 10 | cover take off | cover | 0058fed0 |
| Action 11 | cover advance | cover | 0058ff40 |
| Action 12 | cover stay down | cover | 00590520 |
| Action 13 | cover fire | cover | 0058da70 |
| Action 14 | cover popout | cover | 0058dc80 |
| Action 15 | hold position | movement | 005806e0 |
| Action 16 | melee stand back | movement | 00588620 |
| Action 17 | move retreat | movement | 00588a40 |
| Action 18 | move regroup | movement | 00581470 |
| Action 19 | move advance | movement | 00583cd0 |
| Action 20 | move advance lof | movement | 00583bf0 |
| Action 21 | move chase | movement | 00584020 |
| Action 22 | avatar chase | movement | 005846e0 |
| Action 23 | move surround | movement | 00587df0 |
| Action 24 | move surround lof | movement | 00587cd0 |
| Action 25 | move rush | movement | 005832d0 |
| Action 26 | move rush to melee | movement | 005892e0 |
| Action 27 | move scripted | movement | script-only |
| Action 28 | move to navmesh | movement | 00580ae0 |
| Action 29 | move sidestep | movement | 0058a3e0 |
| Action 30 | move dodge | movement | 00585b50 |
| Action 31 | move lunge | movement | 00586090 |
| Action 32 | move to post combat | movement | 00584970 |
| Action 33 | move to post idle | movement | 00584a30 |
| Action 34 | move close in | movement | 0058b1f0 |
| Action 35 | move to battlefront | movement | 00581d20 |
| Action 36 | follow make way | following | 00595240 |
| Action 37 | follow avoid LOF | following | 00593cb0 |
| Action 38 | follow formation | following | 00596b70 |
| Action 39 | follow acquire | following | 00596cb0 |
| Action 40 | follow player | following | 00597290 |
| Action 41 | follow teleport | following | 00597360 |
| Action 42 | follow lemming | following | 005974d0 |
| Action 43 | follow to car | following | 00597d00 |
| Action 44 | follow other car | following | 005984a0 |
| Action 45 | follow carjack | vehicle | 00598720 |
| Action 46 | follow browse | following | 00594160 |
| Action 47 | investigate move | investigate | 005a0ff0 |
| Action 48 | investigate look | investigate | 005a1330 |
| Action 49 | investigate peek | investigate | 005a1ae0 |
| Action 50 | reload | reload | 005a38f0 |
| Action 51 | pickup weapon | pickup | 00507d50 |
| Action 52 | human shield grab | human shield | 00553e70 |
| Action 53 | taunt | taunt | 005a44a0 |
| Action 54 | vehicle passenger | vehicle | 00564a00 |
| Action 55 | vehicle enter scpt | vehicle | script-only |
| Action 56 | vehicle extract | vehicle | 00564170 |
| Action 57 | brute throw prop | brute / boss | 0056d590 |
| Action 58 | brute car flip | brute / boss | 0056e160 |
| Action 59 | brute bull rush | brute / boss | 0056f5c0 |
| Action 60 | brute qte player | brute / boss | 0056dcc0 |
| Action 61 | brute attack brute | brute / boss | 0056ce00 |
| Action 62 | brute gun finisher | brute / boss | 00571fc0 |
| Action 63 | avatar shockwave | brute / boss | 0056cf90 |
| Action 64 | avatar stomp | brute / boss | 0056c1f0 |
| Action 65 | avatar taunt | taunt | 0056c190 |
| Action 66 | avatar fireballs | brute / boss | 0056d070 |
| Action 67 | avatar teleport stomp | brute / boss | 0056d150 |
| Action 68 | avatar bullrush | brute / boss | 0056c1c0 |
| Action 69 | quick kill | special melee | 00575050 |
| Action 70 | sprint attack | special melee | 005744a0 |
| Action 71 | zombie eat | zombie | 0057ffc0 |
| Action 72 | zombie explode | zombie | 0057fa50 |
| Action 73 | killbane chase | movement | 00582120 |
| Action 74 | killbane strafe | movement | 005821d0 |
| Action 75 | super jump attack | super powers | 00520340 |
| Action 76 | super jump on car | super powers | 00520440 |
| Action 77 | super jump advance | super powers | 00522530 |
| Action 78 | super jump surround | super powers | 00522740 |
| Action 79 | super jump follow | super powers | 00522170 |
| Action 80 | super scripted move | super powers | script-only |
| Action 81 | super tele throw | super powers | 0051c720 |
| Action 82 | super tele catch | super powers | 0051c2b0 |
| Action 83 | super energy blast | super powers | 00522e50 |
| Action 84 | super ground pound | super powers | 00518ff0 |
| Action 85 | super teleport | super powers | 00519540 |
| Action 86 | super attack | super powers | 00516c80 |
| Action 87 | super combo | super powers | 00516cd0 |
| Action 88 | super conversion | super powers | 005189b0 |
| Action 89 | roller blader change | special | 00577240 |
| Action 90 | idle | idle | 00554f10 |
| Action 91 | giant laser eyes | boss laser | 0050db80 |
| Action 92 | assault bot attack | assault bot | 0050a380 |
| Action 93 | assault bot crawl | assault bot | 0050a3a0 |
| Action 94 | assault bot trans | assault bot | 0050a3c0 |
| Action 95 | marauder | marauder | 00526ce0 |
| Action 96 | ambush mode | ambush | script-only |
| Action 97 | revive beam | revive | 0050d6f0 |
| Action 98 | golden cid flee | flee | 005112e0 |
| Action 99 | cid loiter | loiter | 00511240 |
| Action 100 | civilian flee | flee | 004e3240 |
| Action 101 | hover move to fire | hover craft | 004eba90 |
| Action 102 | hover shield ally | hover craft | 004ecc40 |
| Action 103 | hover move to ally | hover craft | 004ecc40 |
| Action 104 | hover flee | hover craft | 004ebe40 |
| Action 105 | hover fire | hover craft | 004eb790 |
| Action 106 | hover bludger | hover craft | 004ebd80 |
| Action 107 | hover move scripted | hover craft | script-only |
| Action 108 | hover stop scripted | hover craft | script-only |
| Action 109 | hover orbit | hover craft | script-only |
| Action 110 | hover suicid | hover craft | script-only |
| Action 111 | hover formation | hover craft | script-only |
Built from SR4_Game_Explained.xlsx (650 KB), if you'd rather filter it in Excel. SaintsRowIV.exe v1.0.6.1 (Steam). Names are ours unless they're Volition's own Lua or C++ class names.

