Skip to main content

Items and flying objects

The dungeon view · Spots and wall decorations · On the floor and in the air

In brief​

Items on the floor are drawn at their spot, reduced by one scale step per row of distance and spread a little by their item number; those three steps ahead on the far spots, and the near spots of the party's row, are not drawn. Flying objects are drawn at a fixed height, with a shape that depends on what flies and on its direction compared with the party's facing.

Left: the scale steps of an item on the floor by row of distance and spot; three steps ahead the far spots are not drawn and the near spots take 3 steps; two steps ahead 2 steps; one step ahead 1 step; on the party’s row the far spots are drawn at full size and the near spots not at all. Right: the scale steps of a flying object by visible block and spot; a dash means not drawn.
The farther the row, the more scale steps; some spots are never drawn.

Items on the floor​

Items are drawn only if the front face of their block, the side turned towards the party, has no wall graphics or carries WALL_RUNTIME_SHOW_BLOCK_OBJECTS; the party's own block is always drawn. Items lying at positions 4 to 7 are not drawn here; an item at position 8 is in a wall niche.

for each item of the block:
if niche (position 8): spot = far left (for the scale only); x = niche_x[block]; y = niche_y[depth]
else: spot = spot of the position; x = 88 + spot_x; y = 124 + spot_y
steps = item_scale[depth][spot] # −1: not drawn
if the front face is a door (WALL_RUNTIME_DOOR) and spot is far and steps != 0:
clip to the bounds of another visible block (see below); y −= 4
shape = item shape reduced `steps` times
x = x − 4 × width + 2 × jitter[item & 7]
y = y − height + (0 if niche else jitter[(item >> 1) & 7])
draw shape at (x, y)
DepthFar spotsNear spotsNiche y
three steps aheadnot drawn3 steps37 (not drawn)
two steps ahead2 steps2 steps49
one step ahead1 step1 step56
party's rowfull sizenot drawn0
  • jitter = 0, −2, 1, −1, 2, 0, 1, −1: items in the same spot are spread according to their item number.
  • niche_x by block, 00 to 17: −56, −8, 40, 88, 136, 184, 232, −72, 8, 88, 168, 248, −40, 88, 216, −88, 88, 264.
  • The block whose bounds are used for items behind a door is 03 for block 09, 09 for 13, 11 for 15, 12 for 16 and 13 for 17; the other blocks use no extra clipping.

Flying objects​

A flying object is drawn at x = 88 + spot x of its spot and at a fixed y = 39, with these scale steps (— not drawn, blocks not listed: never):

BlockFar leftFar rightNear leftNear right
01———3
02——33
03——33
04——33
05——3—
082222
092222
102222
12—1—1
131111
141—1—
1600——

Like items, flying objects are hidden by a front face with wall graphics unless it carries WALL_RUNTIME_SHOW_BLOCK_OBJECTS. Up to five are drawn per block, one per spot. The shape depends on what flies and on its direction of flight compared with the party's facing:

if the object is a thrown item:
s = item shape of its icon # as for items on the floor
k = 0 if it flies the way the party faces, 1 if towards the party, else none
if k != none and flight_shape[s] != none:
shape = thrown shape [flight_shape[s] + k]; mirrored = flight_mirror[direction][position]
else:
shape = item shape s; mirrored = (direction == the party's right)
else: # any other flying object
shape = thrown shape [object type]; mirrored = flight_mirror[direction][position]
if the object is marked centred: x = 88 + centre spot x; y = 44
shape = shape reduced `steps` times
x = x − 4 × width; y = y − height (y − height / 2 for a centred object)
draw shape at (x, y), mirrored or not

The 13 thrown shapes are cut from THROWN.CPS when the game starts: nine of 32 × 24 pixels, then four of 48 × 32. Only three item shapes have a flight shape, 15, 18 and 20, which use the thrown shapes 2–3, 4–5 and 6–7, the first of each pair when the item flies away from the party. Indexed by direction of flight, then by position in the block, flight_mirror is:

Direction of flightNorth-westNorth-eastSouth-westSouth-east
Northnoyesnoyes
Eastnonoyesyes
Southyesnoyesno
Westyesyesnono

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.