Spots and wall decorations
The dungeon view · Items and flying objects · Wall decorations (DEC)
In brief
After the walls, the game draws the objects of each visible block. Items, monsters and flying objects stand on one of five spots of their block, its four corners and its centre, at a fixed offset for each visible block. Wall decorations come from the level's DEC data, which places each one for ten positions of a face; the faces of the view use them, some mirrored.
Where objects are drawn
After the walls, the game draws, for each visible block in the object order, its wall decorations, the items on its floor, its monsters (the 15 blocks ahead only) and its flying objects. All positions below are pixels from the top-left corner of the view. A shape's size comes from its header: height in pixels, width in 8-pixel columns.1
The five spots of a block
Items, monsters and flying objects stand on one of five spots of their block: its four corners and its centre. The game converts a position in the block (0 north-west, 1 north-east, 2 south-west, 3 south-east) into a spot as seen by the party:
| Facing | North-west | North-east | South-west | South-east |
|---|---|---|---|---|
| North | far left | far right | near left | near right |
| East | near left | far left | near right | far right |
| South | near right | near left | far right | far left |
| West | far right | near right | far left | near left |
Each spot has a fixed offset per visible block, added to (88, 124) for items and to (88, 127) for monsters:
| Block | Far left | Far right | Near left | Near right | Centre |
|---|---|---|---|---|---|
| 00 | −111, −63 | −95, −63 | −139, −59 | −117, −59 | −120, −61 |
| 01 | −76, −63 | −60, −63 | −95, −59 | −74, −59 | −80, −61 |
| 02 | −43, −63 | −27, −63 | −53, −59 | −31, −59 | −40, −61 |
| 03 | −8, −63 | 8, −63 | −10, −59 | 10, −59 | 0, −61 |
| 04 | 27, −63 | 43, −63 | 31, −59 | 53, −59 | 40, −61 |
| 05 | 60, −63 | 76, −63 | 74, −59 | 95, −59 | 80, −61 |
| 06 | 95, −63 | 111, −63 | 117, −59 | 139, −59 | 120, −61 |
| 07 | −118, −53 | −92, −53 | −152, −45 | −120, −45 | −118, −50 |
| 08 | −66, −53 | −40, −53 | −84, −45 | −51, −45 | −59, −50 |
| 09 | −13, −53 | 13, −53 | −16, −45 | 16, −45 | 0, −50 |
| 10 | 40, −53 | 66, −53 | 51, −45 | 84, −45 | 59, −50 |
| 11 | 92, −53 | 118, −53 | 120, −45 | 152, −45 | 118, −50 |
| 12 | −110, −35 | −67, −35 | −140, −22 | −83, −22 | −98, −30 |
| 13 | −22, −35 | 22, −35 | −27, −22 | 27, −22 | 0, −30 |
| 14 | 67, −35 | 110, −35 | 83, −22 | 140, −22 | 98, −30 |
| 15 | −128, −4 | 128, −4 | −128, −66 | 128, −66 | 128, 0 |
| 16 | −38, −4 | 38, −4 | −38, −66 | 38, −66 | 0, 0 |
| 17 | −128, −4 | 128, −4 | −128, −66 | 128, −66 | 128, 0 |
For the party's row, the "far" spots are the front half of the block and the "near" spots its back half, which lies behind the viewer.
Wall decorations
A wall reference can carry a chain of decorations from the level's DEC data. Each decoration gives a rectangle and an (x, y) placement for ten positions; the visible faces use them as follows, a negative position meaning that the decoration is drawn mirrored:
| DEC position | Face | Horizontal shift |
|---|---|---|
| 1 | block 16, the side behind the party | 0 |
| 2 | front faces of 12, 13, 14 | −128, 0, +128 |
| 3 | front faces of 07 to 11 | −160, −80, 0, +80, +160 |
| 4 | front faces of 01 to 05 | −96, −48, 0, +48, +96 |
| 5, −5 | right-hand face of 15, left-hand face of 17 | none |
| 6, −6 | right-hand face of 12, left-hand face of 14 | none |
| 7, −7 | right-hand face of 08, left-hand face of 10 | none |
| 8, −8 | right-hand face of 02, left-hand face of 04 | none |
| 9, −9 | right-hand face of 07, left-hand face of 11 | none |
| 10, −10 | right-hand face of 01, left-hand face of 05 | none |
Blocks 00 and 06 carry no decorations, and blocks 03, 09 and 13 none on their sides. For each block the side face is decorated first, then the front face; each decoration of the chain is drawn in turn:
p = abs(position) − 1 # DEC entry 0 to 9
if rectangle[p] == none: skip
shift = 0
if front face (positions 1 to 4):
shift = centre spot x of the block if flags & 4 else horizontal shift above
if flags & 1 or (flags & 2 and backdrop mirrored): position = −position
if position > 0: x = placement_x[p] + shift # normal
else: x = 176 − placement_x[p] + shift − 8 × width # mirrored
y = placement_y[p]
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.