Map Data Structure - HoraceAndTheSpider/Bloodwych-68k GitHub Wiki
The main structure of a the BW map data, is contained with a 4096 byte ($1000 byte) block for each Tower or Dungeon. There are 6 map blocks in Bloodwych, and 4 map blocks in Extended Levels.
In the PC version of the game, this is found as a self contained .map
file, which is replicated in this source as a .map
file within bw-data
.
In the Amiga and ST versions, these blocks are found at various offsets in the BW game binary - see Data Locations below. The
Data Locations: (Amiga - IPF: 102)
[$0EC7C] [MapData1] The Keep
[$1007E] [MapData2] Serpent Tower
[$11480] [MapData3] Moon Tower
[$12882] [MapData4] Dragon Tower
[$13C84] [MapData5] Chaos Tower
[$15086] [MapData6] Zendicks Tower
Data Definition:
Each block contains $38 bytes of 'header' data, giving information about the layout of the Tower / Dungeon, this is then followed by $FC8 bytes of data containing the map data itself.
$00-$07 : contain the Width values of the respective Floors of the the Tower, starting with the lowest floor. $08-$0F : contain the Height values of the respective Floors of the the Tower, starting with the lowest floor.
$10-$1F : are used to contain the offset values of the respective Floors of the the Tower, starting with the lowest floor - these are equivalent to the offset values used to assign the position of objects within a map (see: Object Data Structure)
$20-$27 : contain the X-alignment values in relation to each other floor, for each of the respective Floors of the the Tower, starting with the lowest floor. $28-$2F : contain the Y-alignment values in relation to each other floor, for each of the respective Floors of the the Tower, starting with the lowest floor.
$30-31 : contains the width of one specifically specified floor for each tower - the relevance of this is unknown. $32-33 : contains the height of one specifically specified floor for each tower. (as above) $34-35 : contains the offset value of one specifically specified floor for each tower. (as above)
$36-37 : contains the number of the top floor of the tower.
$38-$0FFF : contain the map data for the tower.
Example Data: The Keep
0C 15 0F 1F 13 04 00 00 <<< Widths of Floors 0-7
01 15 0F 1F 13 05 00 00 <<< Heights of Floors 0-7
00 00 << offset at which floor 0 begins
00 18 << offset at which floor 1 begins
03 8A << offset at which floor 2 begins
05 4C << offset at which floor 3 begins
0C CE << offset at which floor 4 begins
0F A0 << offset at which floor 5 begins
0F C8 << offset at which floor 6 begins (although there is no floor 6 in the Keep)
00 00 << offset at which floor 7 begins
08 05 08 00 06 0B 00 00 <<< X offsets of Floors 0-7
05 05 08 00 06 0C 00 00 <<< Y offsets of Floors 0-7
00 15 00 15 <<<< Width / Height of "special" floor (floor 1 for the keep)
00 18 <<< offset at which "special" floor begins (floor 1 for the keep)
00 05 <<< Number of Top Floor
Map Location Data Table
The data is stored as consecutive two bytes (word) per map-location; AB CD
Value for D represents one of the following map types:
0 - Spaces
1 - Stone Walls
2 - Wooden Walls
3 - Misc.
4 - Stairs
5 - Metal Doors
6 - Pads, Triggers & Holes
7 - Magic Locations
C is usually used for "generic" detail (such as N/E/S/W rotation) for wall-types which fill the space. For map-data which is not "occupied" (e.g wood walls, trigger pads etc) , a more generic system is used for C which defines any other occupancy in that location. This can be found in the sub-section regarding 'Spaces'.
AB are used to define the detail of the map-data. This would be such as, colours of gems used, types of doors and locks etc.