Skip to content

Game logic

Movement and AI

How units walk, choose a target and follow the orders a mission or the player gives them.

Movement

Choosing a target

Orders

A mission or the player gives each unit an order, and the order sets the state the unit decides from every frame. The sight radius is the unit’s own (on each unit’s page), and missions often change it.

OrderWhat the unit doesState
WaitWaitWith mode 0 it stays where it is and attacks a target that comes within its reach + 22 px; it never chases. With any other mode (state 1) it chases and attacks a target within its sight radius, and otherwise idles.0 / 1
MoveWalk · MoveFollows its route without stopping to attack.2
Move, attacking on the wayWalkAuto · MoveAutoFollows its route and attacks targets already within its reach, without leaving the route.3
Move, chasingWalkAttack · MoveAttackChases a target within its sight radius; with none, follows its route.4
Move, then waitWalkWaitAuto · MoveWaitAutoFollows its route and chases targets within its sight radius; stopped and with no target, it waits as with any mode other than 0.5
Guard a pointGuardPositionWatches over a point and may chase from there. Farther than its sight radius from the point, it walks back (state 10) and resumes when within half that radius.9 / 10
FleeEscapeRuns straight away from its target while their centres are closer than its keep distance (on each unit’s page: 60 px for monsters, 0 for Isaac and the mages); then it stops.11

States 6, 7, 8, and 12 also exist: explicit orders to attack a given unit or object, and one with no decision of its own. Which orders produce them is still being researched.

Read from the game’s code (the class of each order, the state it stores and the instructions that decide), not observed in an emulator.

1×