This page is a raw work in progress.
This page describes the content of item 562 found in the graphics.dat file from:
This item is not found in any other version of the games (even in other Dungeon Master for Amiga 2.x versions).
The size of this item is always 1826 bytes but there are four variations in the content of this item:
Paul Stevens (CSBwin source code)
rain` (ADGE source code)
Offset CSB2xST DM12ST/20AM 000005C8: 02 00 000005C9: 10 60
i8 Byte1830; // Start of graphic 0x232
String containing a single 'Line Feed' character
This string is used by a function to print a 'Line Feed' character in the message area on the bottom of the screen.
Two arrays of 4 longs containing masks
These masks are used when a character is printed over two consecutive blocks of 16 pixels in video memory.
The character is printed in two steps using a pair of masks, one from each array. The combination of the two masks contain 5 clear bits (each character is 5 pixels wide).
7FFF7FFF 3FFF3FFF 1FFF1FFF 0FFF0FFF
FFF0FFF0 FFF8FFF8 FFFCFFFC FFFEFFFE
Structure: 2x4 dwords
i32 Long1828; // masks for text !not reversed!
i32 Long1812; // masks for text !not reversed!
RectPos wRectPos1796; // ... bottom of screen rect
RectPos wRectPos1788; // ... right side of screen rect
RectPos wRectPos1780; // ... top of screen rect
Structure: 22x8 bytes
SOUND sound1772; // [Offset 58]
word[0-1] ... graphic address. index de l'item SNDx dans le graphics.dat
byte ... unused
byte ... Timer type, always 0x70 (now unused)
byte ... length of time sound exists
byte ... unused
byte ... distance sound will travel as 'loud'
byte ... distance sound will travel as 'soft'
This array contains the type of timer to create for each type of tile targetted by an actuator.
This word is modified by a copy protection routine but it is never used afterwards.
This array contains the carry location indices in the order in which they are dropped on the floor when a champion dies.
3 word values per champion (one for each bar graph).
Offset in bytes from the left of screen to the first 16 pixels block containing the bar graph
Each bar graph can be over two 16 pixels blocks. There are two words for each bar. Each bit in these words indicate if the corresponding pixel is to be drawn for the bar (there are exactly 4 consecutive bits set in each pair of words, all other bits are clear)
i8 SpecialChars; //1422 comma,period,semi-colon,colon,space
Values: 44 46 59 58 32 0
i8 Byte1416; String containing a single space character. Values: 32 0
i8 Byte1414; String containing a underscore character. Values: 95 0
For each carry location (body parts only), this array contains a multiplier that is used when computing resistance to injuries.
i8 Byte1412; // resistances to ouches (getting hurt...) :P
i16 Word1406; // eye rectangle
i16 Word1398; // mouth rectangle
This rectangle is used to extract a single portrait from the graphic containing all champion portraits
For each champion, this array contains the color index to use to draw the champion position icon and text messages about the champion
The color palette is available on Technical Documentation - File Formats - Portrait Files (.CMP).
When holding an object in hand, the mouse cursor represents the object with a shadow.
Palette changes are used to substitute some colors by others when drawing the cursor.
Each byte in a "Palette changes" is the replacement color index multiplied by 10.
For example, if the second byte is $3C = 60 this means the second color (index 1) must be replaced by color index 6.
Palette changes to apply to an icon to draw its shadow in a mouse cursor (objects in hand and champion position icon)
Palette changes to apply to an icon to draw the icon over its shadow in a mouse cursor (objects in hand and champion position icon)
These replacement colors allow the cursor to be displayed over the viewport without being affected by the dungeon luminance
The graphic is in Atari ST planar mode, 16x16 pixels, 4 colors.
The graphic is in Atari ST planar mode, 16x16 pixels, 4 colors.
Viewport area containing the floppy disk, Zzz and Cross icons. This rectangle is used to hide the icons when viewing a potential champion (a champion that is not yet in the party, before reincarnation of resurrection).
Table used to determine which color palette to use for the dungeon view based on the total luminance (Magical luminance + luminance produced by torches held in champion hands)
Values: 99 75 50 25 1 0
For example, with a luminance of 30, the 4th color palette would be used.
Table used to determine the luminance produced by:
- Spell 'Torch' (Luminous Power is 3, 4, 5, 6, 7 or 8 based on spell power)
- Spell 'Light' (Luminous Power is 3, 5, 7, 9, 11 or 13 based on spell power)
- Spell 'Darkness' (Luminous Power is 2, 3, 4 ,5 ,6 or 7 based on spell power)
- Action 'Light' on objects 'Yew Staff' and 'Sceptre of Lyf' (Luminous Power is 2)
- Object 'Illumulet' (Luminous Power is 2)
- Object 'Torch' (Luminous Power is stored in the Torch object itself, ranging from 0 to 15)
Values: 0 5 12 24 33 40 46 51 59 68 76 82 89 94 97 100
For example, an Illumulet (Luminous Power = 2) would add 12 to the total Luminance.
This array contains a mask for each carry location (30 in chanmpion inventory and 8 in chest) describing what kind of objects can be stored in that carry location.
Check Technical Documentation - Dungeon Master and Chaos Strikes Back Items properties for the meaning of each bit in the masks.
Object Description Circle
Arrow Or Eye
Resurrect or Reincarnate Buttons / Open Scroll
RectPos wRectPos966;// poisoned draw rect box (static 48x12);
RectPos wRectPos958;// water (24x12) 12 = transparent pixel?
RectPos wRectPos950;// food (24x12) 12 = transparent pixel?
RectPos wRectPos942;// item circle (16x12) 12 = transparent pixel?
RectPos wRectPos934;// arrow/eye (8x8) 8 = transparent pixel?
RectPos wRectPos926;// empty inventory box rect: 8 = transparent pixel?
This word is used by the copy protection of the game.
i16 Unused918;//Word918; //
This array contains 46 entries: 8 for hands in portraits, 30 for clothing/backpack and 8 for chest.
Each entry is 6 bytes large:
1 word: X coordinate
1 word: Y coordinate
2 bytes: Object full type
ICONDISPLAY IconDisplay; //916
For each torch charge count (0..15) this array contains the graphic to use to draw the torch.
This rectangle is used to clear the screen area where the name of the object held in hand is printed.
This data is never used in the game code. Probably a rectangle for an icon.
Values: 00 0F 00 0F
This array contains the first object full type in each of the 7 graphics containing object icons.
This data is never used in the game code.
Values: 0A 0B 0D 0C 0A 0D 06 0D
Each creature descriptor contains probabilities of injuring a champion Head, Torso, Legs or Feet. These 4 masks are used to apply the injuries to the champion.
$20: 32 Feet
$10: 16 Legs
$08: 8 Torso
$04: 4 Head
A creature's word22 has direct relation to this. If a creature hits you, it
has a chance to do injuries from this table. it takes a nibble off the
least significant side of word22, if it is less than a random(0-15),
it landed a critical and uses the mask of ubyte590. It then takes another nibble
and tests if that is less than the same random(0-15) as before. If it is
still less than it, it uses the mask of ubyte590, and moves all the way up
to ubyte590. Creatures with low values for the least significant nibbles in
word22 will do 'deep' criticals which I assume deal many injuries. This explains why
a single hit from a dragon almost is a guaranteed injury
These bytes might be filled with 0, 1, 2 or 3 and are responsible for the priority of sub-cells choosen by a monster to attack a character.
This doesn`t works for creature that have the "attack every position" flag set. In that case, the creature attacks random subcells.
I will use that notation:
Code: Select all L R - L- left monster, R- right monster A | B - A and B - 1st and 2nd char in a party ------ D | C - C and D - 3rd and 4th char in a party
So you can see that monster L stays right in front of a character occupying subcell A and monster R stays right in front of a character occupying subcell B.
In original code, there are four eight-byte words:
0 1 3 2 1 0 2 3
1 2 0 3 2 1 3 0
3 2 0 1 2 3 1 0
0 3 1 2 3 0 2 1
wchich you can read as:
Code: Select all ----------------------------------- | LEFT | RIGHT | | monster | monster | | attack | attack | | priority | priority | | I II III IV | I II III IV | ----------------------------------- | 0 1 3 2 | 1 0 2 3 | <= for party facing NORTH: | | | 0=A 1=B 2=C 3=D | 1 2 0 3 | 2 1 3 0 | <= for party facing EAST: | | | 0=D 1=A 2=B 3=C | 3 2 0 1 | 2 3 1 0 | <= for party facing SOUTH: | | | 0=C 1=D 2=A 3=B | 0 3 1 2 | 3 0 2 1 | <= for party facing WEST: | | | 0=B 1=C 2=D 3=A -----------------------------------
If party is facing NORTH, then LEFT monster attack priority is subcell A (priority I). If this subcell is empty (for example you have one character in party occupying subcell B, or character is dead), then a monster tries to attack character on subcell B (priority II). Then subcell C (priority III), and then subcell D (priority IV). RIGHT monster do the same, but in different order (BACD).
Second line is for a case when a party is facing EAST, but the current values for each line will be different (because each line represents different world quarter!). Third line is for party facing SOUTH and fourth for party facing WEST.
Originally, the code is set for monsters L and R to attack every possible subcell, but it can be chaged depending on the party facing set. For example, if we change the second line to 00003333, that would mean that when party facing WEST, the LEFT monster will attack only subcell D (priority order set to DDDD) and RIGHT monster will attack only subcell A (priority order AAAA). So if you have only two characters in a party, you could place them in subcells B and C so the monsters wouldn`t attack at all (the party would be safe in front of four skeletons when facing WEST).
For example, the code can be rearranged in a way that RIGHT monster doesn`t attack subcell B when party facing SOUTH. Or LEFT monster attacks subcell C only when party facing NORTH. Or all monsters attacks subcells C and D first (if they are empty, tries to attack A and B- so if you have a full party, they will attack back characters first). Or when a party is facing NORTH, monsters attacks only subcell A, when SOUTH- only B. Or when party is facing EAST, LEFT monster tries to attack C first, then AD (but doesn`t attack B at all), and when party is facing WEST, RIGHT monster attacks D first, then BC (but doesn`t attack A at all). Or whenever party is facing SOUTH, monsters only attack subcell A (so characters occupying BCD would be safe). Etc, etc. It`s up to the designer.
This value is used by the copy protection of the game.
Each color palette is an arry of 16 integers (32 bytes). Each integer defines a color (512 colors possible).
Bits 15-12: unused
Bits 11-8: Red component
Bits 7-4: Green component
Bits 3-0: Blue component
Dungeon View Palettes (6 levels of luminance, from lightest to darkest)
Main Menu Color Palette
Credits Color Palette
Note the first dungeon view palette is always used to draw the top and bottom of the screen. The middle of the screen is drawn with one of the 6 palettes depending on the luminance in the dungeon.
The first dungeon view palette is the one described on Technical Documentation - File Formats - Portrait Files (.CMP).
This array contains the indices of graphics that are always loaded in memory
This array is used as palette changes when no changes are required: it replaces each color by itself. It is used to draw Clouds (D1 to D4), Missiles (D1), Damange Done, ...
Values: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150
This section contains 17 rectangles:
Endgame Champion Portrait (This is for the first portrait, X+48 for other portraits)
Endgame Champion Mirror (This is for the first portrait, X+48 for other portraits)
Dungeon Entrance Door Right
Dungeon Entrance Door Left
Dungeon Entrance Viewport
Dungeon Entrance Door Right (modifyable)
Dungeon Entrance Door Left (modifyable)
Dungeon Entrance Dungeon View
Spell Casting Area
i16 Word140; // rect of first character's graphic on screen,
i16 Word132; // rect of first character's death graphic. +48 again.
i16 Word124; // some rect for 'restarting' the game, cleared when used
i16 Word116; // some rect for 'restarting' the game, cleared when used
i16 Word108; // "THE END" label rect (for graphic 6)
i16 Word100; // entrance door (right) rect
i16 Word92; // entrance door (left) rect
i16 Word84; // saved rect from before opening doors (saves a quick ss of this rect)
i16 Word76; // modifyable entrance door (right) rect
i16 Word68; // modifyable entrance door (left) rect (moves it as u open)
i16 Word60; // left part of interior rect as you open doors
i16 Word52; // intro graphic rect to delay display (its around "presents");
i16 Word44; // into graphic rect to delay display ("presents" again???)
i16 Word36; // into graphic rect for "stikes back"
i16 Word28; // movement arrow key rects
i16 Word20; // attack damage rect
i16 Word12; // magic spell area rect