Darklands world map

Files with this format: "darkland.map".

Contains the wilderness map, with everything except for the dynamically generated locations (all non-cities listed in darkland.loc).

The map is constructed from tiles contained in two .pic files: "mapicons.pic" and "mapicon2.pic".

Table of Contents

Offsets

starting at 0x00

Offsets

Offset: starting at 0x00

0x00: max_x_coord: word = 0x147
Number of locations.
  • This word is stored high-byte first
0x02: max_y_coord: word = 0x3a3
Number of locations.
  • This word is stored high-byte first
0x04: row_offsets: array[ max_y_coord ] of dword
File offsets to row data.
[next]: map_data: array[ max_y_coord ] of array[ ] of byte
Map data.
  • This data is RLE compressed: each byte represents 1-7 map tiles.
  • The top three bits are the repeat count, and are always at least one (001xxxxx).
  • The next bit is the palette set: 0 for "mapicons.pic", 1 for "mapicon2.pic".
  • The four least bits indicate which row the tile comes from in the palette set.
  • Which column the map tile comes from depends on the four diagonally adjacent tiles:
    the 1's bit comes from the northwest tile's row's 8's bit;
    the 2's bit comes from the northeast tile's row's 4's bit;
    the 4's bit comes from the southwest tile's row's 2's bit;
    the 8's bit comes from the southeast tile's row's 1's bit.
  • W: Described recipe doesn't seem to work.
    The bits seems to be set by adjacent tile "similarity". Tile having same palette and row sets the bit. Plus there are other relations: river binds to bridge tile (and vice versa), most of "wet" tiles binds together, etc.
  • Odd lines (y%2 == 1) are shifted by half to the right. Therefore ie. for y==2 are north adjacent tiles coordinates x-1, y-1 and x, y-1, and for y==3 are north adjacent tiles coordinates x, y-1 and x+1, y-1.