Skip to main content

Monster data

Data · Routines · Address index

Monster slots and type properties, and the tables of monster steps, positions and close attacks. The data page explains how the entries are written.

DS:0x302a — Direction offsets​

  • Layout: 8 signed bytes: −32, −31, 1, 33, 32, 31, −1, −33
  • Role: Block-index offset of each of the eight directions, clockwise from north, read by movement to recognize an adjacent destination. A monster standing on its destination makes movement read DS:0x302a + 255, or + 251 when it flees, past the end of the table.
  • Used by: Moving toward the destination › One step

DS:0x3032 — Side steps​

  • Layout: 16 signed bytes, four per diagonal direction (NE, SE, SW, NW), indexed by the facing N, E, S, W: 1, −32, 0, 0; 0, 32, 1, 0; 0, 0, −1, 32; −1, 0, 0, −32
  • Role: Block offset of the side step that movement tries toward a diagonally adjacent destination; 0 when the facing gives none. A fleeing monster standing on its destination makes movement read DS:0x3032 + 0x1f4 to 0x1f7 (DS:0x3226–0x3229), past the end of the table: the bytes 7, 5, 3 and 13, by facing (0x19a45–0x19a61). The byte at DS:0x3125 (DS:0x302a + 251) is 0, so the adjacency test at 0x19a11–0x19a1e passes on the monster's own block and selects this path.
  • Used by: Moving toward the destination › One step

DS:0x3042, DS:0x3052 — Step orders​

  • Layout: two arrays of 8 signed words, 7, −6, 5, −4, 3, −2, 1, 0 and −7, 6, −5, 4, −3, 2, −1, 0, applied from the last entry
  • Role: Cumulative direction changes of the fallback search of movement. From a start direction s (eight-way, odd results skipped), the first order tries s, s + 1, s − 1, s + 2, s − 2, s + 3, s − 3 and s + 4; the second is its mirror. The selector picks one.
  • Used by: Moving toward the destination › One step

DS:0x3062, DS:0x3064 — Step order selector and counter​

DS:0x3066, DS:0x306a, DS:0x307a — Monster position tables​

  • Layout: DS:0x3066, 4 bytes: 0 1 3 2. DS:0x306a, 4 × 4 bytes: 0 1 2 3, 0 2 1 3, 0 1 2 3, 3 1 2 0. DS:0x307a, signed bytes -1 3 -1 -1 -1 -1 -1 -1 0 2 -1 1, whose last four are also read as the mode turn amounts from DS:0x3082; the close-attack tables follow at DS:0x3086.
  • Status: the executable does not show where the class-1 table ends; the lookup reads the bytes listed above whatever their table.
  • Role: Read by the position routines. DS:0x3066 gives, by direction, the corner to which a centre occupant is moved; DS:0x306a the class-0 search order by direction (position = direction XOR entry), front half first; DS:0x307a the class-1 position by mask of occupied positions (−1: refused). The class-1 lookup at 0x19df0 indexes DS:0x307a with masks up to 31, so masks of 12 or more read the close-attack tables past its end: masks 12 to 31 give 1 1 0 0 0 1 0 1 0 0 1 1 1 0 1 0 2 3 0 1. Mask 9, whose byte is 2, is refused before the lookup (0x19de9).
  • Comparative source: REF-SCUMM-020, _monsterCloseAttPosTable1, _monsterCloseAttPosTable2 and _monsterCloseAttUnkTable.
  • Used by: Obstacles and other monsters › Sharing a block, Level data (INF)

DS:0x3082, DS:0x307f — Mode turn amounts​

  • Layout: signed bytes; DS:0x3082–0x3085 hold 00 02 ff 01.
  • Status: that the original program declares a single table here is inferred.
  • Role: Turn passed by the mode dispatch to the movement routine of a mode. The dispatch reads DS:0x3082 + mode for the three patrol modes (+2, −1, +1) and DS:0x307f + mode for the two wander modes (−1, +1). The second base is the first minus 3, so both reads land on the same bytes, DS:0x3083–0x3085: each wander mode reads the entry of the patrol mode three below it, as compiled code does for an index mode − 3.
  • Comparative source: REF-SCUMM-012, updateMonsters.
  • Used by: Monster behavior modes › How each mode behaves

DS:0x3086–DS:0x30e5 — Close-attack tables​

  • Layout: four byte tables. DS:0x3086, 4 × 4, indexed by 4 × monster direction + position: 1 where the monster can attack (1 1 0 0, 0 1 0 1, 0 0 1 1, 1 0 1 0). DS:0x3096, 4 × 4, indexed by 4 × party direction
    • monster direction: the group, 0 front, 1 right, 2 behind, 3 left (2 3 0 1, 1 2 3 0, 0 1 2 3, 3 0 1 2). DS:0x30a6, 4 groups × 2 orders × 6 slots: 1 0 3 2 5 4 / 0 1 2 3 4 5, 5 3 1 4 2 0 / 1 3 5 0 2 4, 4 5 2 3 0 1 / 5 4 3 2 1 0, 0 2 4 1 3 5 / 4 2 0 5 3 1. DS:0x30d6, 4 × 4, indexed like DS:0x3086: 1 selects the second order (0 1 0 1, 0 0 1 1, 1 0 1 0, 1 1 0 0), which is the right half of the block from the monster's point of view.
  • Role: Read by the attack position check and the target choice. The group is (monster direction − party direction + 2) mod 4 (0x1aeb5–0x1aecc): since a monster attacks only the block ahead, 0 means it stands in front of the party, 1 on its right, 2 behind, 3 on its left. DS:0x30d6 is 1 exactly for the two positions on the monster's right (0x1aee5–0x1aef7).
  • Comparative source: REF-SCUMM-018, the _monsterCloseAtt… tables.
  • Used by: Formation › Who a monster attacks, Tools

DS:0x6e2a — Monster slots​

DS:0x92a6 — Class-1 sharing direction​

  • Layout: byte, 0 in the image
  • Status: that it keeps its initial value 0 is inferred: no instruction or stored pointer addresses it, the neighbouring tables stay in bounds and the saved parts do not cover it, but a far pointer computed at run time is not excluded.
  • Role: Direction given to a class-1 monster that finds a place in an occupied block, read by the position search at 0x19e01, so such a monster always faces north.
  • Comparative source: REF-SCUMM-020.
  • Used by: —

DS:0xcd1a — Monster type properties​

DS:0xe5a2 — Deferred-damage flag​

  • Layout: word
  • Role: Set to 1 by the four paths that damage a list of monsters — Burning Hands (0x1b32f), a magic object's hit, single or whole-block (0x2180d), Cone of Cold (0x24275) and Turn Undead (0x24c1f) — each of which calls finish deferred damage after its loop. While it is set, damage a monster returns early for a monster whose block is visible: no kill and no new destination. The kill is left to finish deferred damage, which clears the flag (0x1aab2); Turn undead also clears it at 0x24c5a.
  • Comparative source: REF-SCUMM-020, _preventMonsterFlash in inflictMonsterDamage and updateAllMonsterShapes.
  • Used by: Noticing the party › Where the destination comes from