Dungeon files are called DUNGEON.DAT in most versions of the games. The Apple IIGS dungeon file is called DUNGEON.GAME (this version also contains an additional dungeon file called DUNGEON.BONUS for the Kid Dungeon). In multilingual versions, DUNGEONF.DAT and DUNGEONG.DAT are also used respectively for French and German versions of the dungeons.
Each dungeon file describes a complete dungeon with walls, doors, items, creatures, etc… It is possible to play completely new games by replacing the original dungeon files by new fan-made dungeons.
The file format for dungeons is nearly the same for all versions of Dungeon Master, Chaos Strikes Back and Dungeon Master II. Here are the few differences:
Little endian or big endian
Computers can store a word of data (2 bytes) in two ways:
It is possible to convert a dungeon between these two formats by swapping the two bytes of each word of data (single bytes must not be swapped).
Checksum
A dungeon file may optionnaly include a 16 bits checksum (a word) at the end of the file. The games will accept dungeons with a correct checksum or no checksum at all, but they will reject a dungeon with an incorrect checksum (This was not checked with all versions).
In Dungeon Master versions 1.x (Atari ST), the original dungeon files never have a checksum.
In Dungeon Master and Chaos Strikes Back versions 2.x and above, English dungeon files always have a checksum and non English dungeon files never have a checksum (this applies to the Dungeon Master dungeon, the Kid Dungeon and the Chaos Strikes Back Prison.
In the Chaos Strikes Back dungeon and in the Dungeon Master II dungeon (including beta and demo versions) there is always a checksum.
Compression
Each dungeon file may be optionnaly compressed. Most versions of the games will accept both compressed and uncompressed dungeons, but for example Dungeon Master for Atari ST version 1.2 English does not support compressed dungeons. (This was not checked with all versions).
Here is a summary of the properties of the dungeons from all the available versions of the games on this site:
Dungeon File Description MD5 Hash | Game | Endian | Checksum | Compressed Size (if compressed) | Uncompressed size | Notes |
---|---|---|---|---|---|---|
DUNGEON.DAT (Atari ST 1.0 EN 1987-12-08)EBCCB5F99C4437ADCB34D9228B57EB6A | Dungeon Master | Big | No | 33286 | ||
DUNGEON.DAT (Atari ST 1.0 EN 1987-12-11)C4A54AF4284F40BC3D53FE2C7EF5195B | Dungeon Master | Big | No | 33314 | ||
DUNGEON.DAT (Atari ST 1.1 EN)E0333C81C52E957DACD3B45739D077C9 | Dungeon Master | Big | No | 33442 | ||
DUNGEON.DAT (Atari ST 1.2 EN)050FB2CFDED1B502EC2C53956B94C5BD | Dungeon Master | Big | No | 33442 | ||
DUNGEON.DAT (Atari ST 1.2 GE)CEA11D6E9F7E1698FC95329FE3FB0899 | Dungeon Master | Big | No | 33792 | Identical to uncompressed DUNGEON.DAT (Amiga 2.0 & 2.2 GE), DUNGEONG.DAT (Amiga 3.6 EN FR GE) | |
DUNGEON.DAT (Atari ST 1.3 FR)DFD82FB7D44E4B5CC81ADD257655C966 | Dungeon Master | Big | No | 33774 | Identical to uncompressed DUNGEON.DAT (Amiga 2.0 FR), DUNGEONF.DAT (Amiga 3.6 EN FR GE) | |
DUNGEON.GAME (Apple IIGS 2.0 EN)E10959DE5CE74E48A17E2CC84D1C0B92 | Dungeon Master | Little | Yes | 25006 | 33444 | Once converted to big endian, identical to DUNGEON.DAT (Amiga 2.0 & 2.1 & 2.2 EN, 3.6 EN FR GE) |
DUNGEON.DAT (Amiga 2.0 & 2.1 & 2.2 EN, 3.6 EN FR GE)30028FB6A301ECB20127EF0B3AF32B05 | Dungeon Master | Big | Yes | 25006 | 33444 | Once converted to little endian, identical to dungeon.game (Apple IIGS 2.0 EN) |
DUNGEON.DAT (Amiga 2.0 FR), DUNGEONF.DAT (Amiga 3.6 EN FR GE)C0E1BF1B9C5578681879D624BB28E663 | Dungeon Master | Big | No | 25414 | 33774 | Once uncompressed, identical to DUNGEON.DAT (Atari ST 1.3 FR) |
DUNGEON.DAT (Amiga 2.0 & 2.2 GE), DUNGEONG.DAT (Amiga 3.6 EN FR GE)59E332CF47852D5C7C88A9538F0ADCEA | Dungeon Master | Big | No | 25380 | 33792 | Once uncompressed, identical to DUNGEON.DAT (Atari ST 1.2 GE) |
DUNGEON.DAT (FM-Towns 2.0 EN)3DC0A932D0E0ADFE59878F07C51700C5 | Dungeon Master | Little | Yes | 33423 | ||
DUNGEON.DAT (FM-Towns 2.0 JP, PC-98 2.0 JP)FE098F70CE83CFE3F2333565093DAF35 | Dungeon Master | Little | No | 33931 | ||
DUNGEON.DAT (X68000 3.0 JP)3E9612E7137BB0BA63D79D35F3458B4E | Dungeon Master | Big | No | 33990 | ||
DUNGEON.DAT (PC 3.4 EN, 3.4 EN FR GE)766450C940651FC021C92FE5D0D0B3A6 | Dungeon Master | Little | Yes | 33357 | ||
DUNGEONF.DAT (PC 3.4 EN FR GE)82C7802122E9CFB2DC117BC9D197F457 | Dungeon Master | Little | No | 33687 | ||
DUNGEONG.DAT (PC 3.4 EN FR GE)B9487DB563FF9E89605C77EE44D17D14 | Dungeon Master | Little | No | 33705 | ||
Extract (Super NES 1.0 EN (Europe), 1.0 EN (USA), 1.0 & 1.1 JP)049D670A12CC1979F20AC0E15EDDDD79 | Dungeon Master | Little | No | 33380 | This dungeon was extracted from the Super NES ROM using {{}} | |
DUNGEON.BONUS (Apple IIGS 2.0 EN)550EFD94ECB941D44E65DEF1B758587C | Kid Dungeon (Bonus dungeon supplied with some versions of the game) | Little | Yes | 4958 | 6562 | |
DUNGEONB.DAT (Amiga 2.2 EN, 2.2 GE)D42915CF346494EFA0ED78CFBBB4C2B5 | Kid Dungeon (Bonus dungeon supplied with some versions of the game) | Big | Yes | 4806 | 6359 | |
DUNGEON.DAT (Atari ST 2.0 & 2.1 EN Game Disk, Amiga 3.1 & 3.5 EN Game Disk, Amiga 3.1 & 3.3 EN FR GE Game Disk)6695D2ACEBCE49F95DB1D8F3A5C733DE | Chaos Strikes Back Prison (where you can choose champions) | Big | Yes | 2098 | 2622 | Once converted to little endian, identical to DUNGEON.DAT (FM-Towns 3.1 EN) |
DUNGEONF.DAT (Amiga 3.1 & 3.3 EN FR GE Game Disk)5ECE6270669693F7F48BD2E1E350CDB6 | Chaos Strikes Back Prison (where you can choose champions) | Big | No | 2091 | 2624 | |
DUNGEONG.DAT (Amiga 3.1 & 3.3 EN FR GE Game Disk)7926A41466C7113C082A8D766B2E5A16 | Chaos Strikes Back Prison (where you can choose champions) | Big | No | 2076 | 2618 | |
DUNGEON.DAT (FM-Towns 3.1 EN)83C56CF1B779E7460A55C9299EBEB04B | Chaos Strikes Back Prison (where you can choose champions) | Little | Yes | 2098 | 2622 | Once converted to big endian, identical to DUNGEON.DAT (Atari ST 2.0 & 2.1 EN Game Disk, Amiga 3.1 & 3.5 EN Game Disk, Amiga 3.1 & 3.3 EN FR GE Game Disk) |
DUNGEON.DAT (FM-Towns 3.1 JP, PC-98 31. JP)7CA51C17EF8BD542CA5F0273672EC1A5 | Chaos Strikes Back Prison (where you can choose champions) | Little | No | 2065 | 2600 | |
DUNGEON.DAT (X68000 3.1 JP)8EEA67CFDF033031530E9B4F88D57066 | Chaos Strikes Back Prison (where you can choose champions) | Big | No | 2066 | 2602 | |
MINI.DAT (Atari ST 2.0 & 2.1 EN)9B5D7323884BE0FFA20F74D54B6A9039 | Chaos Strikes Back (extracted from MINI.DAT saved game) | Big | Yes | 32655 | ||
MINI.DAT (Amiga EN Release 1, 2 & 3)F12B500022EC4ED87C7220F12A072098 | Chaos Strikes Back (extracted from MINI.DAT saved game) | Big | Yes | 32688 | ||
MINIF.DAT (Amiga FR)E74F95A65907D6CDFEFCFC3D13A0DEAE | Chaos Strikes Back (extracted from MINI.DAT saved game) | Big | Yes | 32776 | ||
MINIG.DAT (Amiga GE)05E615C44984A0F168ACA867C646CD2F | Chaos Strikes Back (extracted from MINI.DAT saved game) | Big | Yes, Invalid! | 32780 | ||
MINI.DAT (FM-Towns 3.1 EN)9B7F387DCF7FC221F08274E6D5EA1531 | Chaos Strikes Back (extracted from MINI.DAT saved game) | Little | Yes | 32684 | ||
MINI.DAT (FM-Towns 3.1 JP)870E5764D6BA74BE3806C6ABEA733347 | Chaos Strikes Back (extracted from MINI.DAT saved game) | Little | Yes | 33116 | ||
MINI.DAT (PC-98 3.1 JP)05CF681CCF56F5B6B23A654868EA9CB8 | Chaos Strikes Back (extracted from MINI.DAT saved game) | Little | Yes | 33124 | ||
MINI.DAT (X68000 3.1 JP)9834E01A73F61306CA145D792193F737 | Chaos Strikes Back (extracted from MINI.DAT saved game) | Big | Yes | 33124 | ||
DUNGEON.DAT (PC Beta 0.9 EN)80D989890FFCA46BABC84442272E2089 | Dungeon Master II Beta version on PC | Little | Yes | 39554 | ||
DUNGEON.DAT (PC Demo 1.0 EN)9794F25CC83BEFA0BD798AE0442EAE9D | Dungeon Master II Demo | Little | Yes | 6535 | Once converted to big endian, identical to DUNGEON.DAT (Macintosh Demo 1.0 EN) | |
DUNGEON.DAT (Macintosh Demo 1.0 EN)C9C909CB8CC2ED68DEF20211B8C1CAF6 | Dungeon Master II Demo | Big | Yes | 6535 | Once converted to little endian, identical to DUNGEON.DAT (PC Demo 1.0 EN) | |
DUNGEON.DAT (Amiga 1.0 EN, Macintosh 1.0 EN)719AE78BC124027806C65491A256827D | Dungeon Master II | Big | Yes | 39411 | ||
DUNGEON.DAT (Macintosh 1.0 JP)29F386D5EC836BB5294155F6975F1E01 | Dungeon Master II | Big | Yes | 37957 | ||
DUNGEON.DAT (PC 1.0 EN, 1.0 FR, 1.0 GE)6CACCD7875009E82FE2E28E7F6D6ADC0 | Dungeon Master II | Little | Yes | 39437 | ||
DUNGEON.DAT (Sega CD 1.0 EN)918CA21778D88A028BB7541DC064BB41 | Dungeon Master II | Big | Yes | 37957 | ||
DUNGEON.DAT (Sega CD 1.0 JP)92F83C251FEC69E01C594BC01CE5CD51 | Dungeon Master II | Big | Yes | 37957 | ||
DUNGEON.DAT (FM-Towns 1.0 JP)74C7549F174574201988BF936385841A | Dungeon Master II | Little | Yes | 37954 | ||
DUNGEON.DAT (PC-9801 1.0 JP)74616DFE800CA2A5DAC76A60A95387E5 | Dungeon Master II | Little | Yes | 39004 | ||
DUNGEON.DAT (IBM PS-V 1.0 JP, PC-9821 1.0 JP)FA644B2451AF197874EE7DC3951E7033 | Dungeon Master II | Little | Yes | 37957 |
Notes
Here is a detailed description of the contents of the DUNGEON.DAT file from Dungeon Master for PC.
This example is used to show the structure of a dungeon file. Offsets would be different in other dungeons.
Notes:
In this part of the document, each section of the file is entitled with the following information: Offset hexadecimal (offset decimal) Size of section in bytes - Description of section.
Below the title of each section are details about its content.
Each map is defined by 16 bytes (14 maps * 16 bytes = 224 bytes)
00h (00) 1 word: Offset of map data in global map data
02h (02) 1 word: This word is not used by Dungeon Master and Chaos Strikes Back, where its value is always 0000. It is only used in Dungeon Master II.
This word is a bit field defining which components are used on the map:
The exact role of these bits is not clear.
If one bit for doors is set to 0 then the corresponding doors are not displayed and replaced by a grimacing face (the door frame is still displayed, though).
The other bits can be changed from 1 to 0 without any visible impact as things are still displayed correctly.
This word may be used to allocate memory for graphics or for color palette management. What is known is that the values are used by the code.
04h (04) 1 word: 0000 : Unused
06h (06) 1 byte: Map offset x
07h (07) 1 byte: Map offset y
08h (08) 1 word: Map size
0Ah (10) 1 word: Number of graphics
Note: The number of graphics available for random decorations must be smaller than the number of graphics available in the map. The first graphics in the lists of available graphics (defined at the end of each map data) are used for random decorations.
Random decorations are only placed on the sides of ‘Wall’ and ‘Floor’ tiles if they allow them (four bits to allow each side of the tile to receive a decoration). The program generates a random number between 0 and 29. If the random number is lesser than the number of graphics available for random decorations, then the decoration is displayed.
0Ch (12) 1 word:
0Eh (14) 1 word: Door indices. These indices define both the graphic to use and the door characteristics (used as an index in the ‘Door characteristics’ in Item 559)
The Dungeon Master dungeon contains 14 maps, one per level.
The Chaos Strikes Back Prison dungeon contains 2 maps, one per level.
The Chaos Strikes Back dungeon contains 11 maps, one per level. The last map is empty.
The Dungeon Master II dungeon contains 44 maps on 9 levels (there are maps on level 1 to 8, no map on level 9 and one on level 10). Here is a short description of each map:
This section contains one word for each column in each map of the dungeon, from left to right and above to below. The sum of the widths of all maps is 409. (409 columns * 2 bytes = 818 bytes)
Each word contains the number of tiles having one (or more) object(s) on them encountered so far while browsing all the dungeon columns. The first word is always 0 because at the beginning of the very first column, no object has been encountered yet. The second word contains the number of tiles having objects on them in the first column. The third word contains the number of tiles having objects on them in the first and second columns, etc… Consequently, each word value is greater or equal to the previous value. The last word in this section contains the number of tiles having objects on them in the whole dungeon, excepted those in the last column of the last map. As there are no objects in the last column of the original Dungeon Master dungeon, the last word contains exactly the number of tiles having objects on them in the whole dungeon (this value is 1300).
The content of this section is used as a shortcut as it can be rebuilt easily.
Each ID is defined by 2 bytes. 1679 (item list size) * 2 = 3358 bytes
There is free space at the end, filled with FF FF words. An FF FF word means that no object is referenced.
2600 bytes used (1300 objects), 758 (379 objects) FF bytes
Each tile has a bit to specify if there are objects on it. Tiles are ordered as in the dungeon file: from up to down, left to right, first map to the last map. The first object ID is located on the first tile having an object, etc…
When several objects are located on the same tile, only the first one is referenced here. Each object references the next object ID located on the same tile. The last object in a linked list has this next object ID: FFFEh
A given object should NOT be referenced by several other objects. The game engine does not allow this and will often crash or corrupt save games when you do so. However, there are few situations where it will work without causing any trouble.
Object ID
Four types of text strings are found in a dungeon:
Champion names, skills and statistics are stored in the graphics.dat file.
Some English text data is present in all Dungeon Master II dungeon.dat files (even in the non English versions). However this text data is not used in the dungeon (at least never visible while playing the game), except in Dungeon Master for PC 0.9 Beta. All other versions of Dungeon Master II store all the real text data in the graphics.dat file instead.
The game uses two fonts to print text on screen. There are two versions of each font, an ‘old’ font that is used only in Dungeon Master for Atari ST versions 1.0, 1.1 and 1.2 and a ’new’ font that is used in all other versions of Dungeon Master and Chaos Strikes Back. The differences between the two fonts are highlighted on the images below:
Some versions include a third font in graphics.dat item #12 but it is never used. Later versions of the games do not include it anymore.
Text data is stored as words. Each word contains 3 codes of 5 bits, and 1 unused bit:
Here is the meaning of each 5 bits code:
0 to 25: Letters ‘A’ to ‘Z’
26: ’ ’ (Space)
27: ‘.’
28: Separator
29: Escape code 1
30: Escape code 2
31: End of text
When the game engine decodes dungeon text data, it outputs a string of bytes where each byte is the index of a character in one of the two fonts. Because the two fonts are quite different (numbers of characters and character indices) the game decodes wall texts differently than other texts.
Codes 0 to 27: ‘A’ to ‘Z’, space and ‘.’
For example, if code 0 (letter ‘A’) is found in a wall text, a 00h byte is written in the output string because character 0 in the wall text font is an ‘A’. However, if code 0 is found in another type of text, a 41h byte is written instead because the ‘A’ character has index 41h in the other font (this matches the ASCII code for ‘A’).
Code 28: Separator
The separator character is decoded differently depending on the type of text:
Code 29: Escape code 1
When code 29 is found, the next code in the text data is used as an index in a table of zero terminated strings. The corresponding string in the table is appended to the output string. Nothing prevents this escape code from being used in a wall text however it cannot work because the character indices in the table are all higher than 35 which is the index of the last character in the font for wall texts.
Each string in the table contains a single character (2 bytes per string). The table is identical in all versions of Dungeon Master and Chaos Strikes Back:
61 00 62 00 63 00 64 00 65 00 66 00 67 00 68 00
69 00 6A 00 6B 00 6C 00 6D 00 6E 00 6F 00 70 00
71 00 72 00 73 00 74 00 75 00 76 00 77 00 78 00
30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00
Note that this escape code and the table above has no real use in the games.
This escape code is used only twice in the French dungeons in the following versions:
Both times it is followed by code 1Ah which outputs a ‘2’ character in the middle of strings where it is clearly a typo, in the message at (00,09,01) and in the scroll at (13,23,04).
The values in the table seem to refer to the magic symbols in the font, but with a shift of 1.
Code 30: Escape code 2
When code 30 is found, the next code in the text data is used as an index in a table of zero terminated strings. The corresponding string in the table is appended to the output string. There are two distinct tables, one is used when decoding wall texts and the other when decoding other types of texts.
Each string in the table contains up to 7 characters (8 bytes per string). The content of this table is not the same in all versions of Dungeon Master and Chaos Strikes Back.
Table for Escape code 2 in Wall texts: Each byte in these strings is a character index in the font for wall texts
Dungeon Master for Atari ST versions 1.0, 1.1 and 1.2 use this table:
String (Hex) Corresponding characters in font
Code 0-1: 00 00 00 00 00 00 00 00 ''
Code 2: 13 07 04 1A 00 00 00 00 'THE '
Code 3: 18 0E 14 1A 00 00 00 00 'YOU '
Codes 4-31: 00 00 00 00 00 00 00 00 ''
These versions of the game use the ‘old’ font.
Dungeon Master for Atari ST version 1.3 and all other versions of Dungeon Master and Chaos Strikes Back use this table:
String (Hex) Corresponding characters in font
Code 0: 1C 00 00 00 00 00 00 00 ' '
Code 1: 1D 00 00 00 00 00 00 00 ' '
Code 2: 13 07 04 1A 00 00 00 00 'THE '
Code 3: 18 0E 14 1A 00 00 00 00 'YOU '
Code 4: 1E 00 00 00 00 00 00 00 ' '
Code 5: 1F 00 00 00 00 00 00 00 ' '
Code 6: 20 00 00 00 00 00 00 00 ' '
Code 7: 21 00 00 00 00 00 00 00 '''
Code 8: 22 00 00 00 00 00 00 00 ' '
Code 9: 23 00 00 00 00 00 00 00 ' '
Codes 10-31: 00 00 00 00 00 00 00 00 ' '
These versions of the game use the ’new’ font.
Table for Escape code 2 in other texts: Each byte in these strings is a character index in the font for interface and scrolls.
Note that when printing scroll texts on screen, 64 is substracted from the character indices of letters (A to Z only) so that they use the characters #1 to #26 in the font instead of the default characters #65 to #90.
Dungeon Master for Atari ST versions 1.0, 1.1 and 1.2 use this table:
String (Hex) Corresponding characters in font
Code 0: 3F 00 00 00 00 00 00 00 '?'
Code 1: 21 00 00 00 00 00 00 00 '!'
Code 2: 54 48 45 20 00 00 00 00 'THE '
Code 3: 59 4F 55 20 00 00 00 00 'YOU '
Codes 4-31: 00 00 00 00 00 00 00 00 ''
These versions of the game use the ‘old’ font.
Dungeon Master for Atari ST version 1.3 and all other versions of Dungeon Master and Chaos Strikes Back use this table:
String (Hex) Corresponding characters in font
Code 0: 78 00 00 00 00 00 00 00 '?' Bug: this code is used in texts
Code 1: 79 00 00 00 00 00 00 00 ' ' <---- and should be '!' but character
Code 2: 54 48 45 20 00 00 00 00 'THE ' #79h is empty in the font.
Code 3: 59 4F 55 20 00 00 00 00 'YOU '
Code 4: 7A 00 00 00 00 00 00 00 ' '
Code 5: 7B 00 00 00 00 00 00 00 ' '
Code 6: 7C 00 00 00 00 00 00 00 ' '
Code 7: 7D 00 00 00 00 00 00 00 '''
Code 8: 7E 00 00 00 00 00 00 00 ' '
Code 9: 7F 00 00 00 00 00 00 00 ' '
Codes 10-31: 00 00 00 00 00 00 00 00 ''
These versions of the game use the ’new’ font.
Both tables are stored in item 559 in the Atari ST versions and directly in the executable in other versions (you can refer to Dungeon Master and Chaos Strikes Back Graphics.dat Item 559 for the Atari ST versions).
Code 31: End of text
When this code is found, text decoding stops.
The Dungeon Master dungeon contains four texts located on map (12, 0, 0) that are prefixed with a letter (A, B, C and D) and are displayed during the ‘Fuse’ sequence at the end of the game. There is specific code in the program to print these texts in the order specified by the first character and to not print this first character. In Dungeon Master for PC, these texts are not displayed (even if present in the dungeon) and replaced by the ending animation.
In Dungeon Master and Chaos Strikes Back, the initial champion statistics and skills are stored as text in the dungeon file. In Dungeon Master II, this information is stored in the graphics.dat file.
These special texts have the following structure:
Notes:
Each door is defined by 4 bytes. (170 doors * 4 bytes = 680 bytes)
Door objects must always be created on door tiles.
The attack power required to destroy a door depends on its type. The resistance values are stored in the graphics.dat file in item 559, offset 244h (4 words). Wooden doors are easy, grate doors are harder, iron doors are very hard and Ra doors are nearly indestructible.
Each teleporter is defined by 6 bytes. (179 doors * 6 bytes = 1074 bytes)
Teleporter objects must always be created on teleporter tiles.
Each text is defined by 4 bytes. (125 texts * 4 bytes = 500 bytes)
Each sensor is defined by 8 bytes. (684 sensors * 8 bytes = 5472 bytes)
Sensors are used to display decorations on walls and floors and to implement the dungeon mechanics.
There are many type of sensors. For some types, the effect of the sensor is different whether the sensor is on a floor tile or a wall tile.
Sensors can target a tile that can be any tile on the same map (‘Remote’ type) or the tile where the sensor itself is located (’local’ type).
Sensors can target other sensors, doors and pits (to open and close them), teleporters and trick walls (to enable or disable them) and texts.
1 word: Next object ID.
1 word:
1 word:
1 word: This word has different meaning depending on the action target type (Remote or Local).
For remote target:
For local target:
Notes:
You can refer to the Dungeon Master and Chaos Strikes Back Items properties page to find the complete list of index values to use in the Data field for each item.
Sensor type | Details |
---|---|
00 (Floor) Inactive floor sensor | Activated by: Nothing Example use: display a floor decoration Note: Once activated, the type of wall sensors that have the 'once only' flag is set to 'Inactive floor sensor'. |
01 (Floor) Floor sensor TPCI | Activated by: Theron, Party, Creatures, Items |
02 (Floor) Floor sensor TPC | Activated by: Theron, Party, Creatures (but not items) |
03 (Floor) Floor sensor P | Activated by: Party (but not Theron, Creatures and items). Activation also depends on the data value: - '0' Always activated - '1' Activated only if party faces north - '2' Activated only if party faces east - '3' Activated only if party faces south - '4' Activated only if party faces west |
04 (Floor) Floor sensor I | Activated by: The item specified in the Data field (but not Theron, Party or Creatures). The effect is triggered when at least one item of this type is placed on the tile and canceled when all of them are removed. |
05 (Floor) Stairs sensor | Activated by: Party when it arrives from stairs. This type of sensor can only be put on stairs tiles. Does not work before version 2.1 because of a bug in the code. |
06 (Floor) Creature generator | Activated by: Another sensor (via an event object of type 5). Generates a creature group on the tile. If the tile is occupied, for example by another creature group, the event stays in the queue for later processing until the tile is free. The two other words are used differently than for other sensors: 1 word: - Bits 15-12: Graphic number - Bit 11: Unused - Bit 10: Number of creatures - '0' Predefined number of generated creatures, stored in bits 9-7 - '1' Random number of generated creatures, their maximum number is stored in bits 9-7 - Bits 9-7: Value for the number of creatures. Allowed values: 1 à 4, others values can cause crashes. - Bit 6: Sound effect (teleport sound) - Bits 5-3: Unused - Bit 2: Once only sensor - Bits 1-0: Unused 1 word:
|
07 (Floor) Floor sensor C | Activated by: Creatures (but not by Theron, Party or Items) |
08 (Floor) Party possession detector | Activated by the Party if any champion has the item specified in the Data field in its possessions (including the item in hand). |
09 (Floor) Version checker | Implemented in engine version 2.0 and above of Dungeon Master and Chaos Strikes Back (no effect in earlier versions). Put the required version in the Data field as 10 x version + revision. Example: '21' for version 2.1. Activated if game engine version <= required version. Activated by Theron and Party only. Meynaf has created a custom dungeon that can detect the version of the game using this sensor: Version checker dungeon |
Sensor type | Details |
---|---|
00 (Wall) Inactive wall sensor | Activated by: Nothing Example use: display a wall decoration Note: Once activated, the type of wall sensors that have the 'once only' flag is set to 'Inactive wall sensor'. |
01 (Wall) | Activated by: Mouse click on decoration with empty hand or any item. For alcoves: any item placed in the alcove. |
02 (Wall) | Activated by: If the 'Revert effect' flag is not set: mouse click on decoration with any item but not with empty hand. If the 'Revert effect' flag is set: mouse click on decoration with empty hand but not with any item. For alcoves: can only be activated with the idem specified in the data field. |
03 (Wall) | Activated by: If the 'Revert effect' flag is not set: mouse click on decoration with the item specified in the data field but not with any other item or empty hand. If the 'Revert effect' flag is set: mouse click on decoration with any item but not with the item specified in the data field. For alcoves: Any item except the one specified in the data field. The item used to activate the sensor is not removed from the hand. |
04 (Wall) | Activated by: If the 'Revert effect' flag is not set: mouse click on decoration with the item specified in the data field but not with any other item or empty hand. If the 'Revert effect' flag is set: mouse click on decoration with any item but not with the item specified in the data field or empty hand. The item used to activate the sensor is removed from the hand. For alcoves: cannot be activated. |
05 (Wall) And / Or gate | Activated by: Another sensor. (A type 6 event is used to set/clear/toggle the bit specified by byte 8 (position) of the event object) The data field contains two 4 bits values. A reference state that is defined at design time, and a current state that can be changed through activations. The direction of an activation determines which bit of the current state is affected. - Bit 15: Unused - Bit 14: Reference state, West - Bit 13: Reference state, South - Bit 12: Reference state, East - Bit 11: Reference state, North - Bit 10: Current state, West - Bit 9: Current state, South - Bit 8: Current state, East - Bit 7: Current state, North Effect: If the two 4 bits values are identical, the effect is produced. |
06 (Wall) Counter | Activated by: Another sensor Direction of this sensor and direction of activation are ignore. The data field is used as a counter. Each 'open' activation increases the counter, each 'close' or 'toggle' activation decreases the counter. When the counter reaches 0, the effect of the sensor is triggered and the sensor is disabled definitively. The sensor is considered 'pressed' if the counter is non-zero. |
07 (Wall) Weapon missile shooter | Activated by: Another sensor Effect: Shoots a missile in the direction defined by the position of the sensor on the tile. The missile is shot randomly from the left or right. Direction of activation: Used. Example use: usually a wall decoration is displayed to show holes in the wall. The two other words are used differently than for other sensors: 1 word: - Bits 15-12: Graphic number - Bit 11: Always set to 1 but has no effect. - Bit 2: Once only sensor 1 word:
The data field defines the missile type (items are created, no supply needed):
|
08 (Wall) Magic missile shooter | Identical to type 7, but a magic missile is created based on the value of the Data field: - '0' Fireball - '1' Poison Blob - '2' Lightning Bolt - '3' Dispell - '4' Zo spell - '6' Poison Bolt - '7' Poison Cloud |
09 (Wall) Double weapon missile shooter | Identical to type 7 (Wall), but shoots two missiles (one on each side) |
10 (Wall) Double magic missile shooter | Identical to type 8 (Wall), but shoots two missiles (one on each side) |
11 (Wall) | Identical to type 4 with these two differences: - the sensor is moved to the beginning of the list when activated - the sensor can only be activated when it is at the end of the list |
12 (Wall) Item creator | Activated by: Mouse click with empty hand Effect: Creates an item of type specified in the Data field and puts it in the hand. The sensor is moved to the beginning of the list when activated. The sensor can only be activated when it is at the end of the list. Can also activate another sensor. |
13 (Wall) Item storage | Activated by: Mouse click with empty hand or Mouse click with an item of type specified in the Data field. Effect: When clicked with empty hand, an item of the type specified in the Data field is put in the hand if one can be found on the sensor tile (no matter which position on the tile). If no item is available on the tile there is no effect. When clicked with an item of the type specified in the Data field in hand, the item is removed from the hand and placed in the wall. Example use: a torch holder. You can put a torch and get it from the torch holder. Can also activate another sensor. |
14 (Wall) Item missile shooter | Activated by: Another sensor (by a type 6 event) Effect: Similar to type 7 but shoots the first item found on the sensor tile itself, on the same position as the sensor. When there are no more items to shoot, the game can crash or shoot magic missiles. This bug was fixed in CSBwin. |
15 (Wall) Double item missile shooter | Similar to type 14 but shoots the first two items. This sensor has the same bug when there are no more items to shoot. In Chaos Strikes Back, the "Give up - pull the lever" zone uses this sensor type and works fine only by chance (it crashes in Dungeon Master v1.2) |
16 (Wall) Item exchanger | Activated by: Mouse click with the item specified in the Data field in hand. The item is exchanged with the first item found on the sensor tile (its position on the tile is ignored). If no item is found on the tile, activation does not occur. |
17 (Wall) | Identical to type 11 but if it is not the only sensor on its wall side, the sensor is removed from the list. |
18 (Wall) End game | Activated by: Another sensor with any action and any direction. Effect: triggers the end of the game (simply displays portraits on ST versions). Only works with Chaos Strikes Back v2.0 and above. Starting with version 2.1, a delay in seconds can be configured in Bits 10-7 of the second word. The game is stopped during this delay. The delay is hard coded in version 2.0. The delay is removed in versions with an end sequence like Chaos Strikes Back for Amiga v3.3. Note : the Chaos Strikes Back dungeon does not use this delay and blocks the party with teleporters. Bug : the delay value is always multiplied by 60 to get a number of VBL to wait. This works fine for an NTSC system but for a PAL system the delay value should be multiplied by 50. The effect is that on PAL system the delay seems to be multiplied by 1,2 seconds. |
127 (Wall) Champion portrait (Dungeon Master and Chaos Strikes Back) | The Data field contains the champion graphic number to use (0 to 23). Here is the list of champions to use:
- 00 Elija / Airwing
- 01 Halk / Aroc
- 02 Syra / Talon
- 03 Hissssa / Leta
- 04 Zed / Dema
- 05 Chani / Algor
- 06 Hawk / Toadrot
- 07 Boris / Ven
- 08 Mophus / Mantia
- 09 Leif / Gnatu
- 10 Wu Tse / Slogar
- 11 Alex / Sting
- 12 Linflas / Skelar
- 13 Azizi / Deth
- 14 Iaido / Necro
- 15 Gando / Plague
- 16 Stamm / Tunda
- 17 Leyla / Lana
- 18 Tiggy / Buzzzz
- 19 Sonja / Petal
- 20 Nabi / Itza
- 21 Gothmog / Tula
- 22 Wuuf / Kazai
- 23 Daroou / Lor When the champion has been resurrected or reincarnated, the sensor is disabled (changed to type 0). However, if other sensors are present on the same tile, a bug allows cloning of the champion. |
Sensor type | Details |
---|---|
19 to 125 Unused in Dungeon Master and Chaos Strikes Back. Some are used in Dungeon Master II) | - |
126 Champion portrait (Dungeon Master II only) | - |
All of the Dungeon Master and Chaos Strikes Back sensors can also be used in Dungeon Master II except the champion portrait sensor which is not recognized. Dungeon Master II also includes many additional sensor types. Please visit kentaro.k-21’s web site for more information about them.
Each creature is defined by 16 bytes. (182 creatures * 16 bytes = 2912 bytes)
Notes:
Each weapon is defined by 4 bytes. (107 weapons * 4 bytes = 428 bytes)
Each clothe is defined by 4 bytes. (121 clothes * 4 bytes = 484 bytes)
Each scroll is defined by 4 bytes. (35 scrolls * 4 bytes = 680 bytes)
Notes:
Each potion is defined by 4 bytes. (56 potions * 4 bytes = 224 bytes)
Each container is defined by 8 bytes. (12 containers * 8 bytes = 96 bytes)
Each miscellaneous item is defined by 4 bytes. (280 miscellaneous items * 4 bytes = 1120 bytes)
Bits 15-14: Used for Waterskin / Compass / Bones
Also used by Illumulet & Jewel Symal (worn / not worn).
There is a function in the game to decrement the number of charges of an object and it would decrement this value when called for an object of type ‘Miscellaneous object’ however this never happens as all actions causing a decrement of the number of charges apply only to object of type ‘Weapon’.
Bits 13-8: Unused
Bits 7: Important item. An important item will not be flushed if the game has no more free space to store newly created items. Only non important items can be flushed. This bit is only set for specific items in the dungeon (defined by the creator) and for the bones of dead champions (created at runtime). All other items created at runtime (dropped by creatures or launched by missile launchers) have this bit cleared.
Bits 6-0: Item type. You can refer to the Dungeon Master and Chaos Strikes Back Items properties page to find the complete list of possible values.
Each missile is defined by 8 bytes.
Each cloud is defined by 4 bytes.
This section contains the data for each map in the dungeon, one after another without any separator. Each map is defined by a variable number of bytes consisting of the following parts and in this order:
Each tile is defined by 1 byte. Tile bytes are ordered by columns, from top to bottom.
The first byte is for the tile with coordinates X=0,Y=0
The second byte is for the tile with coordinates X=0,Y=1
After all the bytes of the first column, the next first byte represents the first tile of the second column with coordinates X=1,Y=0, and so on until the last column of tiles in the map.
Each creature graphic is defined by 1 byte. The number of bytes is specified in the map definition.
Each wall decoration graphic is defined by 1 byte. The number of bytes is specified in the map definition. Here is the list of possible values for Dungeon Master:
Each floor decoration graphic is defined by 1 byte. The number of bytes is specified in the map definition. Here is the list of possible values for Dungeon Master:
Each door decoration graphic is defined by 1 byte. The number of bytes is specified in the map definition. Here is the list of possible values for Dungeon Master:
This word contains the checksum of all the previous data in the file.
Tested on PC34ML version (to be tested with other versions): if checksum is not present, no problem. If present and correct value, no problem. If present but wrong value, then the message “The game is damaged!” is displayed by the game.
This section describes the format of a compressed dungeon file. Once uncompressed, the data obtained has exactly the same format as an uncompressed dungeon.
The most common bytes in the uncompressed dungeon data are encoded as three bits ‘0xx’. The two bits after the first ‘0’ bit define the index in the table of most common bytes.
The less common bytes in the uncompressed dungeon data are encoded as six bits ‘10xxxx’. The four bits after the first two ‘10’ bits define the index in the table of less common bytes.
The least common bytes in the uncompressed dungeon data are encoded as ten bits ‘11xxxxxxxx’. The eight bits after the first two ‘11’ bits directly define the byte value.
In each byte of compressed data, bits are read from the most significant one to the least significant one. Once all bits in a byte have been used, the next byte is read from the file.
I wish to thank Zyx and Meynaf for their dungeon.dat descriptions, Sphenx for his precious help, Beowuuf for his DMute Hex guide, kentaro.k-21 for his description of the Dungeon Master II sensors and Paul R. Stevens for the source code of Chaos Strikes Back for Windows and for help about the compression algorithm.