Contents

Technical Documentation - Dungeon Master and Chaos Strikes Back Graphics.dat: Item 560 (Actions and spells)

Overview

This page describes the content of item 560 found in the graphics.dat file from:

  • Dungeon Master for Atari ST versions 1.0 English (1987-12-08), 1.0 English (1987-12-11), 1.1 English, 1.2 English, 1.2 German and 1.3 French.
  • Chaos Strikes Back for Atari ST versions 2.0 English and 2.1 English.
  • Dungeon Master for Amiga version 2.0 English.

This item is not found in any other version of the games (even in other Dungeon Master for Amiga 2.x versions).
There are five variations in the content of this item with two possible sizes:

  • Dungeon Master for Atari ST versions 1.0 English (1987-12-08) and 1.0 English (1987-12-11) (1256 bytes).
  • Dungeon Master for Atari ST versions 1.1 English (1256 bytes).
  • Dungeon Master for Atari ST versions 1.2 English, Chaos Strikes Back for Atari ST versions 2.0 English and 2.1 English, Dungeon Master for Amiga version 2.0 English (1256 bytes).
  • Dungeon Master for Atari ST versions 1.2 German (1356 bytes).
  • Dungeon Master for Atari ST versions 1.3 French (1356 bytes).

The additional 100 bytes in the German and French versions are used by the list of action names.

This item is only used in Atari ST versions. All Amiga versions contain the equivalent data in the executable file itself and never read any data from this item.
It contains initialization data for global variables that was not included in the source code as an optimization to reduce the executable file size. This was because of the special way the C compiler worked on Atari ST, and this trick was not used on any other platform.

You may consult the names, values and usage of all these variables in the source code of ReDMCSB http://dmweb.free.fr/Stuff/ReDMCSB_WIP20210206.7z (search the source code for variable names containing "_Graphic558_", "_Graphic559_", "_Graphic560_", "_Graphic561_" and "_Graphic562_").
You may extract all values to text files with the data file decoder script at DM, CSB and DMII Data Files and Animations Decoders for PC.

All the notes below are the results of older research by credited people. They are incomplete and presented "as-is".

Credits

Paul Stevens (CSBwin source code)
rain` (ADGE source code)
Adamo (about Palette modifier)

Detailed structure

000h (0000), 48 bytes, Rectangle areas for actions

Structure: 6x8 bytes
This section contains 6 rectangle areas.
Values:
233 319 42 49: Line with champion name above symbols.
251 292 81 117: Area to display damage inflicted to creature (small).
242 305 81 117: Area to display damage inflicted to creature (large).
224 319 77 97: Line with champion name above actions and first action.
224 319 77 109: Line with champion name above actions, first and second action.
224 319 77 121: Line with champion name above actions, first, second and third action.

030h (0048), 16 bytes, Palette changes to display object icons in action area

Values: 0 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0
When a champion has an item in hand that has actions (like weapons), this item is displayed in the actions area with a special palette different from the default palette. For each color in the default palette, one of these 16 bytes specifies a replacement color to use to display items in the actions area.
With the default values, the effect is that all colors are replaced by black except the 13th color which is replaced by pale blue (28h).

040h (0064), 44 bytes, Actions experience gain

For each of the 44 actions, this section contains one byte defining the base value of the experience you gain when using the action.

06Ch (0108), 44 bytes, Actions improved skill number

For each of the 44 actions, this section contains one byte defining the skill number in which the experience is gained when using the action.

098h (0152), 44 bytes, Actions defense modifier

For each of the 44 actions, this section contains one signed byte (possible values range from -128 to 127) defining the defense modifier applied until the champion can make an action again.

0C4h (0196), 44 bytes, Actions stamina

For each of the 44 actions, this section contains one byte defining the base value of stamina consumed when using the action.

0F0h (0240), 44 bytes, Actions hit probability

For each of the 44 actions, this section contains one byte defining the probability to hit when using the action. Values can range from 0 to 75, 75 means an automatic hit.

11Ch (0284), 44 bytes, Actions damage

For each of the 44 actions, this section contains one byte defining the damage modifier when using the action (in 1/32's). A value of 16 would be "half normal damage".

148h (0328), 44 bytes, Actions fatigue

For each of the 44 actions, this section contains one byte defining the fatigue which is the amount of time before you can make another action (in 1/6ths of a second).

174h (0372), 300 or 400 bytes, Actions names

This block of data contains the names of the 44 actions. Names are in ASCII and separated by a 00 character. The end of the block is padded with additional 00 bytes.
Values: Please refer to Technical Documentation - Dungeon Master and Chaos Strikes Back - Actions and Combos.

2A0h or 304h (0672 or 0772), 352 bytes, Actions Combos

Structure: 44x8 bytes
This section defines the actions combos (groups of 1 to 3 actions).
Each combo is defined by 8 bytes:

  • 1 byte: The first action index. The value 255 means there is no action in the combo.
  • 1 byte: The second action index. The value 255 means there is only one action in the combo.
  • 1 byte: The third action index. The value 255 means there are only two actions in the combo.
  • 1 byte: First action
    • Bit 7: Using this action uses charges.
    • Bit 6-0: The minimum level required to use the action. The skill is defined by the action itself.
  • 1 byte: Second action
    • Bit 7: Using this action uses charges.
    • Bit 6-0: The minimum level required to use the action. The skill is defined by the action itself.
  • 1 byte: Third action
    • Bit 7: Using this action uses charges.
    • Bit 6-0: The minimum level required to use the action. The skill is defined by the action itself.
  • 1 byte: Unused, values range from 0 to 19. During an early stage of the game's development, this value was probably used to store 'Improved Skill' indices before the developers decided to associate them to actions instead of combos. 35 of the 44 values correspond to the 'Improved Skill' of at least one action in the combo. [Information sent by Jean-Claude]
  • 1 byte: Unused, always 0.

400h or 464h (1024 or 1124), 2 bytes, Copy protection variable

This variable is set to 1113 when item 560 is loaded in memory. The same value is also set when the party enters a new map and the last copy protection check occurred more than 500 clock ticks ago.
This variable is set to 12777 if a copy protection check succeeded (if the floppy disk was identified as original). While this value is set, no further copy protection checks occur until the value is changed again to 1113.

402h or 466h (1026 or 1126), 200 bytes, Spells

Structure: 25x8 bytes
This section defines the 25 spells in the game. Each spell is defined by 8 bytes:

  • 1 dword: Symbols. Each byte in the dword represents a symbol. The most significant byte is always 00 and corresponds to the first symbol (power symbol) which may be any one of the six power symbols. The following bytes represent the second, third and fourth symbol (least significant byte).
  • 1 byte: Base Difficulty. The spell cast succeeds only if the champion skill level is higher than or equal to the Spell Base Difficulty + the power of the spell (1..6 defined by the first power symbol of the spell).
  • 1 byte: Skill index. The skill in which the champion must have a high enough level to cast the spell. If the spell cast succeeds, the champion will gain experience in this skill. If the spell casting fails, the champion may or may not gain some experience depending on a random test involving his Wisdom and the number of missing skill levels.
  • 1 word:
    • Bits 15-10: Duration. Number of clock ticks (approx 1/6ths of a second) the champion has to wait before being able to use its action hand. A champion can cast spells one right after the other.
    • Bits 9-4: Spell subtype. For Potions, this value is written in bits 8-14 of the 'Empty Flask' item attribute, effectively changing its type.
      For missiles, this value is added to 0xFF80.
      For other spells, sub type values are:
      • 0: Light
      • 1: Darkness
      • 2: See Through Walls
      • 3: Invisibility (Party)
      • 4: Shield (Party)
      • 5: Torch
      • 6: Magic Footprints
      • 7: Zokathra Spell
      • 8: Spell Shield
    • Bits 3-0: Spell type
      • '1': Potions. These spells require a flask in hand.
      • '2': Missiles.
      • '3': Other spells

4CAh or 52Eh (1226 or 1326), 6 bytes, Spell difficulty multipliers

This section contains one byte for each of the six power symbols (Lo, Um, On, Ee, Pal, Mon).
The difficulty to cast a spell depends on the difficulty of the spell multiplied by the difficulty multiplier associated with the power symbol of the spell.
Values: 8 12 16 20 24 28

4D0h or 534h (1232 or 1332), 24 bytes, Base mana cost of symbols

This section contains one byte for each of the 24 symbols. Each byte defines the base mana cost of the symbol.
The real mana cost when using a symbol is: (Base mana cost) * (Power Level + 1) / 2
where Power Level is 1 to 6 based on the selected power symbol. The result is rounded down when necessary.
Values:
1 2 3 4 5 6
2 3 4 5 6 7
4 5 6 7 7 9
2 2 3 4 6 7