Faces and drawing order
The dungeon view · Where each face goes on the screen · Screen coordinates
In brief
Of the four faces of each of the 18 visible blocks, the game draws only those the party could see: the front face of a block ahead, the side face of a block off to one side. It draws them from the farthest to the nearest, so nearer walls cover farther ones, then draws the objects of each block in a fixed order. A corridor three blocks long shows how these faces make up the view.
Which faces are drawn
A block has four faces, one per side. The game only ever draws the faces the party could see:
- the front face, the side of the block turned towards the party, for the blocks that are ahead of it;
- a side face for the blocks off to one side: a block on the left shows its right-hand face (direction d + 1), a block on the right its left-hand face (direction d − 1).
Blocks 00, 06, 07, 11, 15 and 17 show only a side face, and the blocks straight ahead, 03, 09 and 13, only their front face. None of the faces of the party's own block, 16, is drawn: the walls beside the party are the side faces of its neighbors 15 and 17.1
Putting it together
The sketch below shows the view from inside a straight corridor three blocks long that ends in a wall. The corridor's own blocks, 16, 13 and 09, are open; the walls the party sees are the side faces of the blocks beside it and the front face of block 03.
Each wall of the sketch lies inside the tile rectangle of its face, given under where each face goes on the screen: the right-hand face of block 15 inside columns 0 to 2, that of block 12 inside columns 3 to 5, and so on. The near edge of each side wall meets the edge of the front face one row closer, which is how the fixed rectangles give the impression of depth. The exact pixel positions are listed under screen coordinates.
Drawing order
The walls are drawn into the tile grid in a fixed order: the farthest row first, and in each row the outer faces before the inner ones and the side faces before the front faces. Nearer walls therefore cover farther ones. The game then draws the objects of each visible block, in this order:
| Pass | Blocks |
|---|---|
| Three steps ahead | 00, 06, 01, 05, 02, 04, 03 |
| Two steps ahead | 07, 11, 08, 10, 09 |
| One step ahead | 12, 14, 13 |
| Party's row | 15, 17, 16 |
For every block it draws the wall decorations and the items on the floor. For the 15 blocks ahead of the party it then draws doors, the monsters of occupied blocks and temporary walls; for every block, the flying objects and teleporters. Each block's objects are clipped to the columns where the block can be seen.2
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.