Skip to main content

Wall properties

WallRuntimeFlags · 1 byte per wall reference, in a table of 80 kept for the whole game

Wall mapping flags · Walls and doors · Obstacles and other monsters · The engine in ten minutes

Each kind of wall has a byte of combinable properties: whether the party, flying objects or monsters can pass, whether it is a door and in which state, whether objects behind it are drawn. The game looks the byte up from the wall reference stored in the map; the bits are not stored in the MAZ wall byte itself. A level's wall mappings set the byte of the references they name, with INF_WALL_SUPPRESS_MONSTER_PASSAGE inverted into WALL_RUNTIME_MONSTER_PASSAGE; the other references keep their previous value.1

typedef enum WallRuntimeFlags {
WALL_RUNTIME_PASSAGE = 0x01, /* The party, flying objects and ranged traces pass; a spell's target search goes on. */
WALL_RUNTIME_SMALL_PROJECTILE_PASSAGE = 0x02, /* Small flying items pass; with bit 0, ranged traces. */
WALL_RUNTIME_MONSTER_PASSAGE = 0x04, /* Lets a monster's move continue to the occupancy check. */
WALL_RUNTIME_DOOR = 0x08, /* A door, not a solid face: drawn by the door routine; selects the door faces. */
WALL_RUNTIME_DOOR_OPEN_ENDPOINT = 0x10, /* The fully open state of a door; an opening door stops here. */
WALL_RUNTIME_DOOR_CLOSED_ENDPOINT = 0x20, /* The fully closed state of a door; a closing door stops here. */
WALL_RUNTIME_BIT_6_UNKNOWN = 0x40, /* Never tested; set only on reference 2 of the initial table. */
WALL_RUNTIME_SHOW_BLOCK_OBJECTS = 0x80 /* Allows drawing the objects behind a mapped wall. */
} WallRuntimeFlags;

Where each bit is tested​

BitUse
WALL_RUNTIME_PASSAGERequired by the party movement check, alongside a separate occupancy check.2 Lets any flying object through (throwing), and with bit 1 a monster's ranged attack trace through an intermediate block.3 A spell that looks for a target ahead of the party goes on through faces that have it. The door path also tests it.4
WALL_RUNTIME_SMALL_PROJECTILE_PASSAGELets a qualifying flying item pass when bit 0 is clear; see wall mapping flags. Set or cleared after loading for the closed and partly open references of each door graphic, by the level's door records.2
WALL_RUNTIME_MONSTER_PASSAGELets a monster's move continue; a wandering monster looks for it on side faces; see walls and doors.3
WALL_RUNTIME_DOORMarks the references of doors: in the executable's initial table, every door reference has it. The door routine tests it on side 0: when set, sides 0 and 2 are the door's faces, otherwise sides 1 and 3.5 In the view, such a face is not drawn as a wall but by the door drawing; when the face ahead of a side wall is a door, that door reference's wall graphics fill the side position. Items can be dropped into a door block.6
WALL_RUNTIME_DOOR_OPEN_ENDPOINTThe reference where an opening door stops, the open state. Also stops a door operation under way and skips a door-clipping calculation when the scene is drawn.5
WALL_RUNTIME_DOOR_CLOSED_ENDPOINTThe reference where a closing door stops, the closed state. Also stops a door operation under way; lets a monster type with MONSTER_CAP_OPENS_DOORS open a closed door with a switch;3 and makes a door that cannot be forced (INF_WALL_SPECIAL_DOOR_NO_FORCE) answer a click with "No one is able to pry this door open.".4
WALL_RUNTIME_SHOW_BLOCK_OBJECTSOne condition for drawing a block's items and flying objects behind the wall.2
WALL_RUNTIME_BIT_6_UNKNOWNNone.

Monster code reads only WALL_RUNTIME_MONSTER_PASSAGE for moves, WALL_RUNTIME_DOOR_CLOSED_ENDPOINT in the door branch and the two low bits for ranged attacks.3

Built-in references​

The executable's initial table gives every reference its starting properties, and no original INF file maps references 0 to 24: they keep these values in every level.7

ReferencePropertiesRole
0PASSAGE, SMALL_PROJECTILE_PASSAGE, MONSTER_PASSAGENo wall: everything passes.
1, 2none (2 also has BIT_6_UNKNOWN)Solid walls; two graphics variants that behave identically.
3, 8, 13, 18DOOR, DOOR_CLOSED_ENDPOINT, SHOW_BLOCK_OBJECTSA closed door.
4–6, 9–11, 14–16, 19–21DOOR, SHOW_BLOCK_OBJECTSA door partly open.
7, 12, 17, 22DOOR, DOOR_OPEN_ENDPOINT, SHOW_BLOCK_OBJECTS, PASSAGE, SMALL_PROJECTILE_PASSAGE, MONSTER_PASSAGEAn open door.
23, 24PASSAGE, SMALL_PROJECTILE_PASSAGEPassable for the party and flying objects, not for monsters.
25–79noneLeft to the levels' wall mappings.

The flag names are written without their WALL_RUNTIME_ prefix. Each door graphic has two groups of five references, from closed to open; see walls and doors.

Lifetime of the table​

Only two things write the table: a level's wall mappings, applied when the level is loaded, and the door records, which set or clear WALL_RUNTIME_SMALL_PROJECTILE_PASSAGE on the closed and partly open references of a door graphic. Neither a new level, a new game nor a saved game resets it, and a saved game does not hold it. A reference that the level being loaded does not map therefore keeps the properties left by the level loaded before, or its initial value. In the original levels this matters in a single case, a game saved on level 8; see faces that the level does not map.1

Sources​

Locations refer to the game executable reference.

Footnotes​

  1. Wall properties table, filled when the INF loader assigns a wall mapping. ↩ ↩2

  2. Party passability, wall group toggle, scene shape bounds, the block-object drawing checks at 0x3e269 and at 0x3efeb, and the door operations of overlay 251. ↩ ↩2 ↩3

  3. Check a candidate move, the wander modes, the ranged action and the flying-object step. Comparative sources: walkMonsterNextStep and updateMonsterTryDistanceAttack in REF-SCUMM-008 and REF-SCUMM-020. ↩ ↩2 ↩3 ↩4

  4. Finding spell targets, the door side test and the wall-click dispatchers. ↩ ↩2

  5. Door and wall step routine, the door path at 0x25384, the advance of door operations and the scene shape bounds. ↩ ↩2

  6. The view setup, with its "has wall" test, and the floor drop and pick-up. Comparative source: hasWall and generateBlockDrawingBuffer in REF-SCUMM-016. ↩

  7. Initial entries in the wall-to-graphics table, the decoration selectors, the special types and the wall properties. ↩