From DwarfFortressWiki
[edit] 0.27.176.38c
Dwarf Fortress .DAT files for this version are basically blocks of zlib compressed data. long + data... repeated throughout the file. The long represents the size of compressed data.
[edit] Structures
[edit] Basic Types
[edit] String
| Size
| Type
| Name
| Notes
|
| 2
| short
| Length
|
| x
| char
| String data of length size.
|
[edit] String List
| Size
| Type
| Name
| Notes
|
| 4
| long
| Count
|
|
| (2 + length) * count
| strings
| Strings
|
|
[edit] Byte List
| Size
| Type
| Name
| Notes
|
| 4
| long
| Count
|
|
| 1 * count
| bytes
| Bytes
|
|
[edit] Short List
| Size
| Type
| Name
| Notes
|
| 4
| long
| Count
|
|
| 2 * count
| shorts
| Shorts
|
|
[edit] Long List
| Size
| Type
| Name
| Notes
|
| 4
| long
| Count
|
|
| 4 * count
| longs
| Longs
|
|
[edit] Game Structures
[edit] Info Structure
| Size
| Type
| Name
| Notes
|
| variable
| string
|
|
|
| variable
| string
|
|
|
| 28
|
|
|
|
| 14
|
|
|
|
| 4
| long
|
|
|
| 2
| short
|
|
|
[edit] Unk89 Structure
| Size
| Type
| Name
| Notes
|
| 2
| short
|
|
|
| 4
| long
|
|
|
| 2
| short
|
|
|
[edit] Unk96 Structure
[edit] Unk96 Unk4 Structure
| Size
| Type
| Name
| Notes
|
| 1
| byte
|
|
|
| 1
| byte
|
|
|
| 2
| short
|
|
|
| 4
| long
|
|
|
| 2
| short
|
|
|
| 2
| short
|
|
|
| 2
| short
|
|
|
| 2
| short
|
|
|
[edit] Civilization Structure
[edit] Region Information
| Size
| Type
| Name
| Notes
|
| 1
| byte
|
| Following data for this block is not present if this is 0.
|
| variable
| string
|
|
|
| variable
| string
|
|
|
| 28
|
|
|
|
| 14
|
|
|
|
| 4
| long
|
|
|
| 2
| short
|
|
|
[edit] Region Information Container
[edit] Region Map
| Size
| Type
| Name
| Notes
|
| 4
| long
| follow buffer size
|
|
| variable
|
|
| byte * previous long
|
| 48
|
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 2
| short
|
|
|
[edit] Region Geology Subdata
| Size
| Type
| Name
| Notes
|
| 2
| short
|
|
|
| 2
| short
|
|
|
| variable
| shortarray
|
|
|
| variable
| shortarray
|
|
|
| variable
| bytearray
|
|
|
| variable
| bytearray
|
|
|
| 2
| short
|
|
|
| 2
| short
|
|
|
[edit] Region Geology
| Size
| Type
| Name
| Notes
|
| 2
| short
|
|
|
| 2
| short
|
|
|
| 2
| short
| Count of following subitems
|
|
| variable
| array of Region Geology Subdata
| array of Region Geology Subdata
|
|
[edit] Region Subregion
| Size
| Type
| Name
| Notes
|
| 4
| long
|
|
|
| variable
| Region Information
| region information
|
|
| 2
| short
|
|
|
| variable
| shortarray
|
|
|
| variable
| shortarray
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 204
|
|
|
|
| variable
| shortarray
|
|
|
| variable
| shortarray
|
|
|
| variable
| shortarray
|
|
|
| variable
| shortarray
|
|
|
| variable
| shortarray
|
|
|
| variable
| shortarray
|
|
|
| 1
| byte
|
|
|
| 1
| byte
|
|
|
| 1
| byte
|
|
|
| 1
| byte
|
|
|
| incomplete...
|
|
|
|
[edit] world.dat
[edit] Version Block
| Size
| Type
| Name
| Notes
|
| 4
| long
| Version?
| Currently 0x4B5 (1205).
|
| 2
| short
|
|
|
[edit] Header (1) Block
| Size
| Type
| Name
| Notes
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
| Number of historical figures?
|
|
| 4
| long
| Number of historical events
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 1
| byte
|
| Following block is not present if this is 0.
|
[edit] Optional Header Block
| Size
| Type
| Name
| Notes
|
| 2 + length
| string
|
|
|
| 2 + length
| string
|
|
|
| 28
| struct?
|
|
|
| 14
| struct?
|
|
|
| 4
| long
|
|
|
| 2
| short
|
|
|
[edit] Header (2) Block
| Size
| Type
| Name
| Notes
|
| 15
| struct?
|
|
|
| 2 + length
| string
| World name
|
|
[edit] Data Blocks
[edit] IDs Block
[edit] Civilization Data Block
| Size
| Type
| Name
| Notes
|
| 4
| long
|
| If this is a non-zero value some data follows, not sure of format yet.
|
| 4
| long
|
| If this is a non-zero value some data follows, not sure of format yet.
|
| variable
| longlist
| Civilization IDs?
|
|
| variable
| longlist
| Unit IDs?
|
|
| variable
| longlist
|
|
|
| variable
| longlist
|
|
|
| variable
| longlist
|
|
|
| variable
| civ struct * civ count
| Civilization data
|
|
[edit] Region Information Block
[edit] Region Dimensions Block
| Size
| Type
| Name
| Notes
|
| variable
| string
| *START REGION DIM SAVE*
|
|
| 2
| short
| Width
|
|
| 2
| short
| Height
|
|
| 4
| long
|
|
|
| 2
| short
|
|
|
| 4
| long
|
|
|
| 2
| short
|
| Depth? (as in z-layers)
|
[edit] Region Map Block
| Size
| Type
| Name
| Notes
|
| variable
| string
| *START REGION MAP SAVE*
|
|
| 1
| byte
| Has region maps
| Following region map array not present if this is 0.
|
|
| variable
| Array of Region Map
| Region Maps
| Count = Width * Height
|
| 1
| byte
| Has world map?
| Following world map not present if this is 0.
|
|
| variable
|
| World Map?
| size is ((width + 15) >> 4) * ((height + 15) >> 4) * 4 (16 bytes for 17x17 world)
|
| 4
| long
|
|
|
| 4
| long
|
|
|
| 4
| long
| Count of following region information container array
|
|
| variable
| Region Information Container
| Array of Region Information Container
|
|
[edit] Region Geology Block
| Size
| Type
| Name
| Notes
|
| variable
| string
| *START REGION GEOLOGY SAVE*
|
|
| 4
| long
| Count of geology information
|
|
| variable
| array of Region Gelogy
| Array of geology information, by previous count
|
|
[edit] Region Subregion Block
| Size
| Type
| Name
| Notes
|
| variable
| string
| *START REGION SUBREGION SAVE*
|
|
| 4
| long
| Count of subregion information
|
|
| variable
| array of Region Subregion
| Array of subregion information, by previous count
|
|