Skip to main content

Where each face goes on the screen

The dungeon view · Screen coordinates · Wall layouts (VMP)

In brief​

Each visible face has a fixed rectangle of tiles in the 22 × 15 view; the game copies into it, from the farthest face to the nearest, the tiles that the level's VMP file gives for that wall and that size of rectangle. Side faces on the right reuse the left-hand graphics, mirrored. Nine sizes of rectangle cover every face, and each wall graphic of a VMP file holds one area of each size. Doors and a few faces follow special rules.

The tile rectangles​

Tile coordinates count from the top left of the view.

Each visible face has a fixed rectangle of tiles. Some rectangles extend beyond the 22 columns of the view; only the part inside is drawn. Side faces on the right of the view use the same graphics as those on the left, mirrored; front faces are never mirrored.

Eight panels, each showing the 22 × 15 tile view. One panel per row of blocks and kind of face shows the tile rectangles used for each face; the last panel is the full-view backdrop.
The tile rectangles where each face of each row of blocks is drawn in the 22 × 15 view.

The game draws the faces in the order of this table. A face is copied only if the block has a wall on that side, and some faces have an extra condition, explained below.

OrderFaceColumnsRowsVMP areaCondition
100 right-hand−2 to 03 to 7102wall present
206 left-hand, mirrored21 to 233 to 7102wall present
301 right-hand2 to 43 to 7102see special cases
405 left-hand, mirrored17 to 193 to 7102see special cases
502 right-hand83 to 797wall present
604 left-hand, mirrored133 to 797wall present
701 front−4 to 13 to 7129solid wall
805 front20 to 253 to 7129solid wall
902 front2 to 73 to 7129solid wall
1004 front14 to 193 to 7129solid wall
1103 front8 to 133 to 7129wall present
1207 right-hand0 to 13 to 8117wall present
1311 left-hand, mirrored20 to 213 to 8117wall present
1408 right-hand6 to 72 to 981wall present
1510 left-hand, mirrored14 to 152 to 981wall present
1608 front−4 to 52 to 9159solid wall
1710 front16 to 252 to 9159solid wall
1809 front6 to 152 to 9159wall present
1912 right-hand3 to 51 to 1245wall present
2014 left-hand, mirrored16 to 181 to 1245wall present
2112 front−13 to 21 to 12239no WALL_RUNTIME_DOOR
2214 front19 to 341 to 12239no WALL_RUNTIME_DOOR
2313 front3 to 181 to 12239wall present
2415 right-hand0 to 20 to 140wall present
2517 left-hand, mirrored19 to 210 to 140wall present

"Wall present" means a nonzero wall reference; "solid wall" also excludes the references whose WallRuntimeFlags carry WALL_RUNTIME_DOOR. In every case the copy draws nothing when the level maps the wall reference to no VMP graphics.1

The "VMP area" column is where the face's tiles start inside the wall's group of 431 VMP entries. Each wall graphic of a VMP file holds exactly one area of each size, left-side views only:

VMP areaSize in tilesUsed for
03 × 15side faces of the party's row
453 × 12side faces one step ahead
812 × 8inner side faces two steps ahead
971 × 5inner side faces three steps ahead
1023 × 5outer side faces three steps ahead
1172 × 6outermost side faces two steps ahead
1296 × 5front faces three steps ahead
15910 × 8front faces two steps ahead
23916 × 12front faces one step ahead

The nine areas fill the 431 entries exactly. Inside a rectangle, a zero entry leaves the tile below unchanged, so a wall can have any outline: the rectangle is only the space it may use.2

Special cases​

  • Doors. The door references carry WALL_RUNTIME_DOOR (WallRuntimeFlags). Such a face is not copied as the front face of blocks 01, 02, 04, 05, 08, 10, 12 and 14: the door drawing draws the door instead. The side face of block 01 is copied only if it is a wall and the front face of block 02 is not a door; if block 01 has a side face there and the front face of block 02 is a door, the wall graphics of that door reference are copied into block 01's side rectangle instead. Blocks 05 and 04 follow the same rule on the right.
  • Mirrored backdrop. The floor and ceiling backdrop is drawn mirrored when the party's row + column + direction is odd, so it alternates from one block to the next and with each quarter turn.
  • Clipping. Columns outside 0 to 21 are skipped, which is why the front faces of blocks 01, 05, 08, 10, 12 and 14 can start or end outside the view.
  • Redrawing. The view is redrawn when something marks it as changed. A script that changes a wall of one of the 15 blocks ahead of the party marks it; changes to the party's own row do not.3

Sources​

Locations refer to the game executable reference; comparative sources are listed in the technical references. The figures are drawn from the values listed on these pages, with no game graphics, by make_view_figures.py.

Footnotes​

  1. Set up the view and its view sides; the VMP area copy and the wall-to-VMP mapping. Comparative source: REF-SCUMM-016, generateBlockDrawingBuffer and hasWall. ↩

  2. VMP area copy and the tile grid. Schema: VMP.ksy. ↩

  3. Redraw if a block is in view and the state-change flag; the view setup for the backdrop and the VMP area copy for clipping. ↩