Skip to main content

How a door graphic moves

DoorKind · byte in the door records of a level INF file, kept as a word per door graphic while the level is loaded

Doors, teleporters and temporary walls › Doors · Walls and doors › What a wall lets through

A level has up to two door graphics. Its INF file gives each one a kind, which decides how the door's shapes are drawn as the door opens. The kind changes only the drawing: opening, closing and passage follow the wall properties of the door references.

/* How a door graphic is drawn while the door opens (EOB II DOS). */
typedef enum DoorKind {
DOOR_KIND_RISING = 0, /* One panel that rises as the door opens. */
DOOR_KIND_RISING_OVER_FIXED = 1, /* A fixed shape, with door graphic 1's shape rising over it. */
DOOR_KIND_PARTING = 2 /* Two halves: the top one rises, the bottom one sinks half as fast. */
} DoorKind;

How each kind is drawn​

With n the opening step, from 0 (closed) to 4 (fully open):

  • DOOR_KIND_RISING. The door's shape stands on the door's bottom row and is raised by n times a distance that depends on how far the door is.
  • DOOR_KIND_RISING_OVER_FIXED. The door's shape is drawn unmoved on the bottom row, then the shape of door graphic 1 at the same distance is drawn over it and raised as above.
  • DOOR_KIND_PARTING. The door's shape hangs from the top row and rises by n steps; the shape of door graphic 1 at the same distance stands on the bottom row and sinks by half as much.

The second shape of kinds 1 and 2 is taken three shapes further in the table of door shapes, which is door graphic 1's shape. In the original levels these two kinds are used only for door graphic 0. With any other value, no door shape is drawn; the switch may still be. The rows, steps and positions are listed in doors.

KindOriginal levels using it
DOOR_KIND_RISINGevery other door record
DOOR_KIND_RISING_OVER_FIXED5 (door graphic 0)
DOOR_KIND_PARTING3 (door graphic 0)

Sources​

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

The door records loader and the door kinds table; the door drawing. The level values come from the door records of the sixteen level INF files, read with the INF schema. Comparative source: _doorType in EoBCoreEngine::initLevelData and DarkMoonEngine::drawDoorIntern in REF-SCUMM-016.