Skip to main content

Monsters

Home · The engine in ten minutes · MonsterRuntime · MonsterMode

In brief​

Monsters do not see the party: they remember a destination block. When the party comes close enough and in front of a monster, the monster records the party's current block and starts pursuing it. If the party slips away, the monster keeps walking toward the block where it last noticed it, then starts wandering. Once in pursuit, a monster tries a ranged attack, then a melee attack, and moves only if it could do neither. A monster that has been attacked never forgets it: whenever it stops pursuing, it sets off again toward the party. Monsters open some doors, share a block according to their size (inferred), and act on their group's update; the game has no rounds.

Each monster's state is held in a MonsterRuntime slot, initialized from the level's INF data; its current behavior is its MonsterMode.

How a monster acts​

Monsters are updated in groups, each run by its own timed update at an interval the level sets — 15, 25 or 35 ticks in the original levels. A monster's group is two times its INF unit, plus one for an odd slot, so the monsters of a unit are split between two updates with the same interval (cadence). For each monster of the group, in slot order:1

  1. A monster with no hit points left, or turned to stone, is skipped.
  2. A monster that a neighbor on its block has just turned (step 7) skips this one update.
  3. The monster may notice the party.
  4. A provoked monster that is not pursuing goes back to pursuit.
  5. The routine of its mode runs.
  6. Its walking frame alternates, except in MONSTER_MODE_WAIT, MONSTER_MODE_DELAYED and MONSTER_MODE_PEACEFUL.
  7. When its type's occupancy class is 1 — the class whose monsters share a block in pairs — every other monster on its block takes its facing; each one that turns skips its next update.

Step 7 also runs for the monsters of the other groups, at every group's update.

In pursuit (MONSTER_MODE_PURSUE), the routine follows this order:2

The order of a pursuing monster's update. If the block ahead is its destination and the party is not there, it starts wandering, left or right at random. Otherwise it tries a ranged attack, then a melee attack; the update ends after either. If it did neither, it moves toward its destination, and a type that can act after moving then tries a melee attack again.
A pursuing monster attacks if it can and moves only when it could not.

The block ahead is the neighboring block in the monster's facing. A type with MONSTER_CAP_ATTACKS_ANY_SIDE uses instead the neighbor toward the party when the party lies in one of the four straight directions; the melee attack checks the same block. The second melee attempt depends on MONSTER_CAP_POST_MOVE_ACTION in the monster type's capabilities. Movement is described under moving toward the destination; the other modes — patrolling, waiting, wandering, timed inactivity — on the MonsterMode page, and what makes a monster change mode in its own page.

The pages of this chapter​

PageWhat it covers
Noticing the partyDistance, facing and the destination block; losing the party.
Moving toward the destinationThe direction tried first, the order of tries, fleeing.
Modes and provocationReacting to damage, changing mode, the state that lasts.
Obstacles and other monstersWalls and doors, sharing a block.
Ranged attacksWeapons, the wait between attacks, monster spells.
Melee attacksThe attack sequence, effects on characters, attack timing.
When a monster diesExplosions, items, experience, the final opponent.
BestiaryThe 29 monster images compared, who has which ability, and one sheet per monster: where it lives, its values, abilities and other values.

Sources​

Locations refer to the game executable reference; comparative sources are listed in the technical references.

Footnotes​

  1. Monster update and mode dispatch with turn a block's monsters, run by monster group handler entries of the timed-callback table, whose intervals the monster-timer loader sets. Comparative source: REF-SCUMM-020, updateMonsters and setBlockMonsterDirection. ↩

  2. Pursuit decision, with ranged action, close-range action and movement. Comparative source: REF-SCUMM-020, updateMoveMonster. ↩