Darklands city definitions

Files with this format: "darkland.cty".

Contains names, location names, coordinates, and other data specific to cities. Non-city locations are stored in darkland.loc.

Table of Contents

Offsets

starting at 0x00

Structures

city
city_data

Enumerations

ruler

Offsets

Offset: starting at 0x00

0x00: num_cities: byte = 0x5c
Number of cities.
0x01: cities: array[ num_cities ] of struct city (each size 0x26e)
City definitions.
  • The order of these is the "definitive" order, since the full name is the best unique identifier.

Structures

Structure: city

Size 0x26e.

0x00: short_name: string(32)
0x20: full_name: string(32)
0x40: city_data: struct city_data (size 0x2e)
0x6e: leader_name: string(32)
0x8e: ruler_name: string(32)
0xae: unknown string(32)
  • TODO: is this non-empty ever? (ditto for other two unknowns)
0xce: polit_name: string(32)
Name of the political center or town square.
  • TODO: describe what empty values look like
0xee: town_hall_name: string(32)
0x10e: fortress_name: string(32)
Name of the city fortress or castle.
0x12e: cathedral_name: string(32)
0x14e: church_name: string(32)
0x16e: market_name: string(32)
Name of the marketplace.
0x18e: unknown string(32)
  • Often contains "Munzenplatz". Possibly this is "central square name".
0x1ae: slum_name: string(32)
0x1ce: unknown string(32)
  • Many places have "Zeughaus", which translates to "armoury"; others end in "-turm" (tower?) or "-tor" (gate?). Quite possible this is for one of the unused "rebellion" codepath.
0x1ee: pawnshop_name: string(32)
Name of the pawnshop.
  • All pawnshops are named the same; this is either 'Leifhaus' or is empty.
0x20e: kloster_name: string(32)
Name of the kloster (church law and administration building).
0x22e: inn_name: string(32)
0x24e: university_name: string(32)

Structure: city_data

Size 0x2e.

0x00: city_size: word
Size of the city.
  • Ranges from 3 (small) to 8 (Koln).
0x02: entry_coords: struct coordinates (size )
City location on the map.
0x06: exit_coords: struct coordinates (size )
Party coordinates when leaving a city.
  • When you leave a city, you don't exit at the same point as you entered. The exit coordinates were (usually) selected so as not to place you in an untenable position (the ocean, trapped by a river loop, etc).
0x0a: dock_destinations: array[ 4 ] of word
Dock destination cities.
  • This contains the indices (in the cities array) of the destinations available via the city docks the docks.
  • 0xffff is used for "no destination". Inland cities have all 0xffffs.
0x12: word
if coastal, side of the river ???[Hamburg] TODO.
  • Values are: 0xffff (inland), 0 (north of the river), 1 (south of the river)
  • 0 and 1 cities are on or near tidal zones (swamps), and may be subject to flooding.
0x14: word [constant: 4]
0x16: word
Pseudo-ordinal.
  • At first glance, this looks like an ordinal offset running from 0 to 0x5b, but 0x18 is missing, and 0x3c repeats.
  • This value is probably not used.
0x18: city_type: word (enum ruler)
Type of city
0x1a: unknown word
  • 0, 1, 2, or 3.
0x1c: word [constant: 0]
0x1e: city_contents: bitmask[16 bits]
Buildings and locations in the city.
  • Bits are on iff there is one of that type of building.
bit 1: is_kloster: Is there a kloster?
bit 2: is_slums: Is there a slums?
bit 3: unknown
bit 4: is_cathedral: Is there a cathedral?
bit 5: unknown
bit 6: is_no_fortress: Is there no city fortress?
  • A rare case of a reversed boolean. Possibly it's a "has something else" flag, and fortresses are added if it doesn't have the other?
bit 7: is_town_hall: Is there a town hall?
bit 8: is_polit: [constant: 1] Is there a political center?
bit 9: [constant: 0]
bit 10: [constant: 0]
bit 11: [constant: 0]
bit 12: [constant: 0]
bit 13: docks: Are there docks?
bit 14: unknown
bit 15: is_pawnshop: Is there a liefhaus (pawnshop)?
bit 16: is_university: Is there a university?
0x20: word [constant: 0]
0x22: qual_black: byte
Quality of the blacksmith.
  • This, and the other nine qualities, all seem to work in the same way.
  • A zero value indicates that the city does not have that particular shop.
  • Non-zero values do not exactly equal the quality of the items available, but merely indicate relative qualities! For example, Nurnberg has a 0x31 (49) listed for the armory, but offers q37 (0x25) armor. However, if one city has a higher value than another, then that city's items will be of equal or greater quality.
  • The quality of the healer is not stored here, but is apparently random. (TODO: verify?)
  • TODO: comments about Quality of the alchemist, university, pharmacist being the seed thing.
0x23: qual_merch: byte
Quality of the merchant.
0x24: qual_sword: byte
Quality of the swordsmith.
0x25: qual_armor: byte
Quality of the armorer.
0x26: qual_unk1: unknown byte
0x27: qual_bow: byte
Quality of the bowyer.
0x28: qual_tink: byte
Quality of the tinker.
0x29: qual_unk2: unknown byte
0x2a: qual_cloth: byte
Quality of the clothing merchant.
0x2b: byte [constant: 0]
0x2c: unknown byte
  • Since the following byte is 0 or 1, this and that might actually be a single word value.
0x2d: unknown byte
  • Either zero or one (only a couple of ones).

Enumerations

Enumeration: ruler

Type of city (free, ruled, capital)

Data Value Meaning
0 Free City
1 Ruled City
2 Capital