This page describes the structure of data containing the coordinates and layout of graphics on screen. Such data is present in:
The DMCOORD.DAT file from Dungeon Master II for PC version 0.9 Beta
LAY1 items = entries of type 4 as specified in ENT1 item in graphics.dat file (see Data Files) from all other versions of Dungeon Master II
Item 696 in the graphics.dat files from all versions 3.x of the game engine:
Dungeon Master for Amiga version 3.6 (English, French, German)
Dungeon Master for PC versions 3.4 (English) and 3.4 (English, French, German)
Chaos Strikes Back for Amiga versions 3.1 (English), 3.1 (English, French, German), 3.3 (English, French, German) and 3.5 (English).
Chaos Strikes Back for FM-Towns versions 3.1 (English) and 3.1 (Japanese)
Chaos Strikes Back for PC-9801 version 3.1 (Japanese)
Chaos Strikes Back for X68000 version 3.1 (Japanese)
This item is not found in any other version of the games.
There are 6 variations in the content of this item with 3 possible sizes:
Dungeon Master for Amiga version 3.6 (English, French, German), Chaos Strikes Back for Amiga versions 3.1 (English) and 3.1 (English, French, German). (9176 bytes)
Chaos Strikes Back for Amiga versions 3.3 (English, French, German) and 3.5 (English). (9160 bytes)
Dungeon Master for PC versions 3.4 (English), 3.4 (English, French, German) and Chaos Strikes Back for FM-Towns version 3.1 (English). (9160 bytes)
Chaos Strikes Back for PC-9801 version 3.1 (Japanese) and Chaos Strikes Back for FM-Towns version 3.1 (Japanese). (9160 bytes)
Chaos Strikes Back for X68000 version 3.1 (Japanese). (9160 bytes)
Dungeon Master II for PC version 0.9 Beta DMCOORD.DAT. (18480 bytes)
The data entirely consists of signed words. Depending on the platform, the words are stored as little endian (PC, PC-9801 or FM-Towns) or big endian (like Amiga or X68000). If you compare items 696 between a big endian version and a little endian version , they are always nearly identical if you swap bytes in each word of little endian data. There are only very few differing bytes. The 9176 bytes large version has 16 bytes added somewhere in the middle of the item, but all other parts remain very similar with other variants.
The data represents hierachical storage of screen coordinates and area dimensions that are used to position things on screen. Each record in the file refers to a parent record so that they define lists of records. Some records contain coordinates relative to the position of their parent area. In order to get the absolute coordinates, the full list of linked records must be processed. Some record lists define the screen coordinates for buttons (screen areas that will trigger an event when clicked on) but the buttons themselves are defined elsewhere (in file FIRES in the case of Dungeon Master for PC) and refer to indices in item 696 for coordinates. Please check the Excel spreadsheet available on Dungeon Files for button declarations.
Detailed structure
Offset 0: A word: File signature 0xFC0D Offset 2: A word: Number of index ranges (23 ranges in item 696, 29 ranges in DMCOORD.DAT) Offset 4: Ranges. Each range has the following structure:
Word: First index
Word: Last index
In each range, First index < Last index. The [First index..Last index] intervals never overlap. The sum of all (Last index - First index + 1) is the number of 8 bytes records found in the rest of the file. Offset X (X = 4 + 4 x number of index ranges): A series of 8 bytes records until the end of the item. Each record has the following structure:
Word: Record type. Values found in item 696:
0: Center at coordinates (Data words are X and Y coordinates)
1: Align top left at coordinates (Data words are X and Y coordinates)
2: Align top right at coordinates (Data words are X and Y coordinates)
3: Align bottom right at coordinates (Data words are X and Y coordinates)
4: Align bottom left at coordinates (Data words are X and Y coordinates)
5: Align top and center horizontally at coordinates (Data words are X and Y coordinates)
6: Align right and center vertically at coordinates (Data words are X and Y coordinates)
7: Align bottom and center horizontally at coordinates (Data words are X and Y coordinates)
8: Align left and center vertically at coordinates (Data words are X and Y coordinates)
9: Dimensions Width x Height (Data words are width and height). Only type that never starts a list.
10: Unknown
11: Unknown
12: Unknown
14: Unknown
15: Apply margins from top left, align top and center horizontally in container box (Data words are margin values from top left corner of container box)
17: Unknown
18: Apply margins from top left, align left and center vertically in container box (Data words are margin values from top left corner of container box)
Word: Index of parent record. 0 means no parent (end of list of records)
Word: Data word whose meaning depends on the type of record (see above).
Word: Data word whose meaning depends on the type of record (see above).