Format:DAT (RollerCoaster Tycoon 2)
| Platforms | Windows x86 |
|---|---|
| Magic | none; byte 0 low nibble = object type (0-10) |
| Extensions | .DAT (.POB is accepted by OpenRCT2 as the same format) |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Object file format of Software:RollerCoaster Tycoon 2: one ride, scenery item, path, scenery group or other game object per .DAT file in ObjData. A 16-byte object entry (type and source flags, 8-character name, checksum) is followed by one Format:Sawyer chunk encoding chunk with the object data.
Header
| Offset | Size | Type | Name | Notes |
|---|---|---|---|---|
| 0x00 | 4 | uint32_t |
flags | Bits 0-3 object type, bits 4-7 source game |
| 0x04 | 8 | char[8] |
name | Space-padded, not NUL-terminated |
| 0x0C | 4 | uint32_t |
checksum | See the checksum fact |
The same 16-byte entry identifies objects everywhere: in the object list of Format:SV6 (RollerCoaster Tycoon 2), in front of packed objects and in track design scenery records. Two objects are the same when flags, name and checksum all match.
Structure
After the 16-byte entry comes one chunk. Its encoding depends on the object type: RLE (1) for types 0-9 and rotate (3) for type 10 (scenario text). The decoded data's layout depends on the type (ride, scenery and so on) and holds string tables and an image table; it is not documented here yet.
Pitfalls
- The checksum covers only byte 0 of the flags (not bytes 1-3), the 8 name bytes and the decoded data, never the checksum itself.
- OpenRCT2 makes an object with a wrong checksum valid again by appending 11 "salt" bytes to its data, chosen so that the checksum comes out to the stored value. Objects written by OpenRCT2 may therefore be 11 bytes longer than the original.
Tools that read/write it
- OpenRCT2 reads them (
src/openrct2/object/ObjectFactory.cpp, entry struct insrc/openrct2/object/Object.h) and writes packed objects back out (src/openrct2/object/ObjectRepository.cpp).