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
| Bit | Use |
|---|---|
WALL_RUNTIME_PASSAGE | Required 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_PASSAGE | Lets 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_PASSAGE | Lets a monster's move continue; a wandering monster looks for it on side faces; see walls and doors.3 |
WALL_RUNTIME_DOOR | Marks 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_ENDPOINT | The 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_ENDPOINT | The 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_OBJECTS | One condition for drawing a block's items and flying objects behind the wall.2 |
WALL_RUNTIME_BIT_6_UNKNOWN | None. |
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
| Reference | Properties | Role |
|---|---|---|
| 0 | PASSAGE, SMALL_PROJECTILE_PASSAGE, MONSTER_PASSAGE | No wall: everything passes. |
| 1, 2 | none (2 also has BIT_6_UNKNOWN) | Solid walls; two graphics variants that behave identically. |
| 3, 8, 13, 18 | DOOR, DOOR_CLOSED_ENDPOINT, SHOW_BLOCK_OBJECTS | A closed door. |
| 4–6, 9–11, 14–16, 19–21 | DOOR, SHOW_BLOCK_OBJECTS | A door partly open. |
| 7, 12, 17, 22 | DOOR, DOOR_OPEN_ENDPOINT, SHOW_BLOCK_OBJECTS, PASSAGE, SMALL_PROJECTILE_PASSAGE, MONSTER_PASSAGE | An open door. |
| 23, 24 | PASSAGE, SMALL_PROJECTILE_PASSAGE | Passable for the party and flying objects, not for monsters. |
| 25–79 | none | Left 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.