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+0x1f4to0x1f7(DS:0x3226–0x3229), past the end of the table: the bytes 7, 5, 3 and 13, by facing (0x19a45–0x19a61). The byte atDS:0x3125(DS:0x302a+ 251) is 0, so the adjacency test at0x19a11–0x19a1epasses 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
- Layout: two words, 0 in the image
- Role:
DS:0x3064counts the movement calls of all monsters (0x1997c–0x1998e); above 10 it restarts at 0 andDS:0x3062switches between the two step orders, 0 selecting the first. Neither is saved. - Used by: Moving toward the destination › One step
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 fromDS:0x3082; the close-attack tables follow atDS: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:0x3066gives, by direction, the corner to which a centre occupant is moved;DS:0x306athe class-0 search order by direction (position = direction XOR entry), front half first;DS:0x307athe class-1 position by mask of occupied positions (−1: refused). The class-1 lookup at0x19df0indexesDS:0x307awith masks up to 31, so masks of 12 or more read the close-attack tables past its end: masks 12 to 31 give1 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,_monsterCloseAttPosTable2and_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–0x3085hold00 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 + modefor the three patrol modes (+2, −1, +1) andDS:0x307f + modefor 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 indexmode − 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 likeDS: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.
- monster direction: the group, 0 front, 1 right, 2 behind, 3 left (
- 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:0x30d6is 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
- Layout: 30 slots of 30 bytes
- Role: The state of every monster of the current level, one
MonsterRuntimeper slot. - Used by: Monster slot › From the INF record to the slot, Monster slot › In brief, Values passed on to other routines › The routines, Level data (INF), Saved games (SAV), Level maps, Level records (LEVELS.TMP) › What it becomes in memory
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
- Layout:
0x2e(46) bytes per monster type - Role: Properties shared by all monsters of a type, loaded by overlay
routine
0x48497. The word at offset0x10holds theMonsterImmunityFlags; its only readers test0x200and0x1000(0x1f606,0x1f621, hit roll),0x100and0x2000(0x20740,0x20762,0x207ac), the six pair masks of the combat tables (0x207f1) and0x10,0x02,0x08,0x04(0x20c86,0x20d15,0x20d2f,0x20d77, spell effects); bits0x0001,0x4000and0x8000are never tested. The byte at offset0x1eis the occupancy class used when monsters share a block; class 1 also lets a monster attack from any position of its block (0x1ac1f). The word at offset0x12holds theMonsterCapabilityFlags, read at0x19a78,0x19fa7,0x19fd0,0x1a5d5,0x1a680,0x1abab,0x1adaa,0x1aded,0x1ae3c,0x1ae78,0x1af97,0x1f732,0x205bfand in overlay 244 at file offsets0x3e615and0x3e63c; each reader tests one bit, and none tests0x0040or0x0400. The melee attack reads the attack count at+0x06and three damage dice triplets (count, sides, bonus) from+0x07; the ranged action reads the ranged attacks at+0x21, the weapon list mode at+0x22, the weapon count at+0x23and the weapon bytes from+0x24. When the INF type has no weapon list, the loader leaves+0x22to+0x28unchanged (overlay code at file offsets0x4861a–0x4861e); in the 16 original INF files every such type has a ranged attack count of 0, so these bytes are never read. The other fields and their only readers: armour class+0x00(0x1f659, hit roll), hit chance+0x01(0x1acdf, monster hit roll), level+0x02(0x206e7,0x20c9e, the monster's saving throws), hit-point dice+0x03(0x1b076–0x1b080, slot initialization), type flags+0x16(0x20cd6,0x20cf4,0x24c06: bits0x0001,0x0002,0x0004only), experience+0x1a(0x1ab84, kill a monster), attack sound+0x1f(0x1a1f7,0x1a23c,0x1a26e, close-range action), step sound+0x20(0x1a0a5,0x1a0be, move check), turn resistance+0x29, evasion+0x2aand the three decoration selectors+0x2b(overlay 244,0x3e871–0x3e8f1, monster drawing). The type index is never range-checked; the next data the code addresses is atDS:0xcee6, room for ten types. - Used by: Ranged attacks › When a monster fires, Monster capabilities › Where it is used, Monster slot › From the INF record to the slot, Monster slot › In brief, Level 4: reference tables › Monster types, Level 5: reference tables › Monster types, Values passed on to other routines › The routines, Bestiary, Level data (INF), Level 2: reference tables, Level 3: reference tables, Level 6: reference tables, Level 7: reference tables, Level 8: reference tables, Level 9: reference tables, Level 11: reference tables, Level 12: reference tables, Level 13: reference tables, Level 14: reference tables, Level 15: reference tables, Level 16: reference tables, Monster immunities, Level 1: reference tables › Monsters
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 at0x24c5a. - Comparative source: REF-SCUMM-020,
_preventMonsterFlashininflictMonsterDamageandupdateAllMonsterShapes. - Used by: Noticing the party › Where the destination comes from