Extended Floor Decorations

The author of ConfluxIII demanded that we make it possible to define additional floor decorations. In order to provide the necessary variety in his dungeon. Here is the result: the ability to display up to 262,000 different floor decorations arbitrarily on any level of the dungeon.

Specifying floor decoration locations -

Ah! The DSA becomes valuable once again! Actuators commonly specify a wall decoration. For example, a pushbutton might specify that a 'Blue Button' be displayed on the wall. Normally, a DSA has no decoration. But! If the DSA is number 255, then its parameter B is used to specify a floor decoration from the CSBgraphics.dat file.

Format of Floor Decorations -

A Floor Decoration consists of three parts:

  1. An array of descriptors showing where the decoration should be displayed on each of 9 floors that the player can see while touring the dungeon.
  2. Two bytes of flags controlling 'mirroring'.
  3. A bitmap of the decoration.

A 'Floor Decoration' segment of CSBgraphic.dat consists of those three parts, one after the other, with no space between the parts.

The positioning Descriptors -

There are nine descriptors; in numeric order, for each of the numbered positions shouwn in this diagram:

Floor numbers

Each descriptor consists of six bytes of information providing the x and y coordinates of a rectangle, relative to the viewport, which is to contain a view of the Wall Decoration.

Descriptor 7 describes the bitmap itself.

The Flags-

The two bytes are to be interpreted as a 16-bit value in little-endian format (least significant byte first).

The bottom bits specify which relative cells are subject to mirror. If the bit is clear then never mirror.

bit 0 = relative cell 0
bit 6 = relative cell 6
...
bit 8 = relative cell 8
Bit 9 = mirror if party facing north
...
Bit 12 = mirror if party facing west

The remaining 3 bits might someday be used for some other purpose. We might, for example, be able to say something like 'Delay drawing until objects on far side of tile are drawn'. That is how doors are drawn: Far side objects, then door, then near side objects. I don't guarantee that I can pull this off. We will wait and see if it would be worth the effort to try. At any rate, the 3 bits are left over.

The Bitmaps -

The bitmaps are in the Atari 'Bit-Plane' format in which four 16-bit words are used to represent 16 pixels. The first of the four words contains the least significant bit of each of the 16 pixels. The second 16-bit word contains the next least significant bits, etc. The most significant bit in each of the four words provide the four bits for the first pixel, etc. In this way the four words define 16 pixels. Each horizontal line in the bitmap contains a multiple of four words or sixteen pixels.

Rectangles used by Dungeon Master

Here are all the rectangles used by Dungeon Master to display Floor Decorations. There are three groups of nine. Each decoration in the dungeon specifies which group is to be used to display that decoration. This was done so that each decoration would require only one byte to specify the placment. In our case, it seemed reasonable to add the 54 bytes of information to each of the decorations and, in return, we can place them arbitrarily . . . even totallly mis-place them (like on the ceiling???) if that helps your design in some way.

20 4F 42 47 18 06
60 7F 42 47 10 06
90 BF 42 47 18 06
00 3F 4D 57 20 0B
50 8F 4D 57 20 0B
A0 DF 4D 57 20 0B
00 1F 5C 74 10 19
50 8F 5C 74 20 19
C0 DF 5C 74 10 19

00 5F 42 50 30 0F
40 9F 42 50 30 0F
80 DF 42 50 30 0F
00 4F 4B 61 28 17
38 A7 4B 61 38 17
90 DF 4B 61 28 17
00 3F 5A 87 20 2E
20 BF 5A 87 50 2E
A0 DF 5A 87 20 2E

2A 39 44 48 08 05
68 77 44 48 08 05
A6 B5 44 48 08 05
09 28 50 55 10 06
60 7F 50 55 10 06
B7 D6 50 55 10 06
00 0F 61 6C 08 0C
60 7F 61 6C 10 0C
D0 DF 61 6C 08 0C