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.
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.
| Order | Face | Columns | Rows | VMP area | Condition |
|---|---|---|---|---|---|
| 1 | 00 right-hand | −2 to 0 | 3 to 7 | 102 | wall present |
| 2 | 06 left-hand, mirrored | 21 to 23 | 3 to 7 | 102 | wall present |
| 3 | 01 right-hand | 2 to 4 | 3 to 7 | 102 | see special cases |
| 4 | 05 left-hand, mirrored | 17 to 19 | 3 to 7 | 102 | see special cases |
| 5 | 02 right-hand | 8 | 3 to 7 | 97 | wall present |
| 6 | 04 left-hand, mirrored | 13 | 3 to 7 | 97 | wall present |
| 7 | 01 front | −4 to 1 | 3 to 7 | 129 | solid wall |
| 8 | 05 front | 20 to 25 | 3 to 7 | 129 | solid wall |
| 9 | 02 front | 2 to 7 | 3 to 7 | 129 | solid wall |
| 10 | 04 front | 14 to 19 | 3 to 7 | 129 | solid wall |
| 11 | 03 front | 8 to 13 | 3 to 7 | 129 | wall present |
| 12 | 07 right-hand | 0 to 1 | 3 to 8 | 117 | wall present |
| 13 | 11 left-hand, mirrored | 20 to 21 | 3 to 8 | 117 | wall present |
| 14 | 08 right-hand | 6 to 7 | 2 to 9 | 81 | wall present |
| 15 | 10 left-hand, mirrored | 14 to 15 | 2 to 9 | 81 | wall present |
| 16 | 08 front | −4 to 5 | 2 to 9 | 159 | solid wall |
| 17 | 10 front | 16 to 25 | 2 to 9 | 159 | solid wall |
| 18 | 09 front | 6 to 15 | 2 to 9 | 159 | wall present |
| 19 | 12 right-hand | 3 to 5 | 1 to 12 | 45 | wall present |
| 20 | 14 left-hand, mirrored | 16 to 18 | 1 to 12 | 45 | wall present |
| 21 | 12 front | −13 to 2 | 1 to 12 | 239 | no WALL_RUNTIME_DOOR |
| 22 | 14 front | 19 to 34 | 1 to 12 | 239 | no WALL_RUNTIME_DOOR |
| 23 | 13 front | 3 to 18 | 1 to 12 | 239 | wall present |
| 24 | 15 right-hand | 0 to 2 | 0 to 14 | 0 | wall present |
| 25 | 17 left-hand, mirrored | 19 to 21 | 0 to 14 | 0 | wall 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 area | Size in tiles | Used for |
|---|---|---|
| 0 | 3 × 15 | side faces of the party's row |
| 45 | 3 × 12 | side faces one step ahead |
| 81 | 2 × 8 | inner side faces two steps ahead |
| 97 | 1 × 5 | inner side faces three steps ahead |
| 102 | 3 × 5 | outer side faces three steps ahead |
| 117 | 2 × 6 | outermost side faces two steps ahead |
| 129 | 6 × 5 | front faces three steps ahead |
| 159 | 10 × 8 | front faces two steps ahead |
| 239 | 16 × 12 | front 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.