Revision as of 17:35, 7 December 2010
The object files consists of a header of 16 bytes, and a block containing the details.
Most of this information comes from the source-code of Locotool.
Object file format
.DAT: Object data files
| Block
|
Short description
|
| DAT Header
|
This is not stored without the block header of 5 bytes.
|
| Object data
|
Information about the object.
|
Object header format
| Offset
|
Type
|
Description
|
+00000001
|
1 byte
|
The class of the object.
|
+00000001
|
3 bytes
|
The subclass of the object.
|
+00000004
|
8 byte
|
The internal name of the object, padded with spaces.
|
+0000000C
|
4 byte
|
The checksum of the object file, before decoding, not including the 16-byte header.
|
It is possible that the subclass has some other purpose, since the fourth byte is always 0x11.
Valid classes
| Value
|
Var size
|
Name
|
Comment
|
0x00
|
24
|
Interfaces
|
The buttons
|
0x01
|
12
|
Sound effects
|
|
0x02
|
12
|
Currencies
|
|
0x03
|
40
|
Exhaust effects
|
Smoke, sparks, etc.
|
0x04
|
6
|
Cliff faces
|
The vertical sides of the terrain
|
0x05
|
14
|
Water
|
|
0x06
|
30
|
Ground
|
|
0x07
|
26
|
Town names
|
|
0x08
|
31
|
Cargos
|
|
0x09
|
10
|
Fences
|
|
0x0A
|
30
|
Signals
|
|
0x0B
|
18
|
Crossings
|
|
0x0C
|
12
|
Street lights
|
|
0x0D
|
6
|
Tunnels
|
|
0x0E
|
44
|
Bridges
|
|
0x0F
|
174
|
Train stations
|
|
0x10
|
18
|
Track modifications
|
I.e. Overhead electric wires
|
0x11
|
54
|
Tracks
|
|
0x12
|
110
|
Road stations
|
|
0x13
|
18
|
Road modifications
|
I.e. Overhead electric wires
|
0x14
|
48
|
Roads
|
|
0x15
|
186
|
Airports
|
|
0x16
|
40
|
Docks
|
|
0x17
|
350
|
Vehicles
|
Trains, Trucks, Trams, Airplanes, Helicopters
|
0x18
|
76
|
Trees
|
|
0x19
|
6
|
Snow
|
Texture for snow
|
0x1A
|
10
|
Climates
|
Settings for the seasons and snow-levels
|
0x1B
|
14
|
Shapes
|
Height maps. Probably used for generating random maps.
|
0x1C
|
190
|
Buildings
|
|
0x1D
|
18
|
Scaffolding
|
Parts of buildings being constructed
|
0x1E
|
244
|
Industries
|
|
0x1F
|
18
|
Regions
|
|
0x20
|
56
|
Companies
|
AI opponents
|
0x21
|
6
|
Texts
|
Scenario descriptions etc.
|
Object data
Depending on the class of the file, this block can have different sections. The size of each section varies with it's content. The general layout is as follows.
| Section
|
Type
|
Content
|
| 0
|
objdata
|
Various kinds of data, but for each class, the size is always the same.
|
| 1
|
lang
|
One or more tables of names in different languages.
|
The different types used in the table above and in the rest of this page is these:
| Type
|
Descripton
|
| objdata
|
Variable data
|
| lang
|
List of strings, one entry for each language.
|
| useobj
|
List of object dependencies.
|
| auxdata
|
|
| auxdatafix
|
|
| auxdatavar
|
|
| strtable
|
|
| cargo
|
|
| sprites
|
Images used in the game.
|
| sounds
|
Sounds used in the game.
|
Class 00: Interfaces
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 01: Sounds
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sounds
|
|
Class 02: Currencies
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
lang
|
|
| 3
|
lang
|
|
| 4
|
sprites
|
|
Class 03: Exhaust FX
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
auxdatavar
|
|
| 3
|
auxdatavar
|
|
| 4
|
useobj
|
|
| 5
|
sprites
|
|
Class 04: Cliff faces
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 05: Water
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 06: Ground
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
useobj
|
|
| 3
|
sprites
|
|
Class 07: Town names
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
strtable
|
|
| 3
|
strtable
|
|
| 4
|
strtable
|
|
| 5
|
strtable
|
|
| 6
|
strtable
|
|
| 7
|
strtable
|
|
Class 08: Cargo types
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
lang
|
|
| 3
|
lang
|
|
| 4
|
lang
|
|
| 5
|
sprites
|
|
Class 09: Fences
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 0A: Signals
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
lang
|
|
| 3
|
sprites
|
|
Class 0B: Crossings
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 0C: Street lights
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 0D: Tunnels
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 0E: Bridges
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 0F: Train stations
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
auxdatavar
|
|
| 3
|
sprites
|
|
Class 10: Track mods
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 11: Tracks
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
useobj
|
|
| 3
|
useobj
|
|
| 4
|
useobj
|
|
| 5
|
useobj
|
|
| 6
|
useobj
|
|
| 7
|
useobj
|
|
| 8
|
sprites
|
|
Class 12: Road stations
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
useobj
|
|
| 3
|
auxdatavar
|
|
| 4
|
sprites
|
|
Class 13: Road mods
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 14: Roads
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
useobj
|
|
| 3
|
useobj
|
|
| 4
|
useobj
|
|
| 5
|
useobj
|
|
| 6
|
useobj
|
|
| 7
|
sprites
|
|
Class 15: Airports
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
auxdata
|
|
| 3
|
auxdata
|
|
| 4
|
auxdatavar
|
|
| 5
|
auxdatavar
|
|
| 6
|
auxdata
|
|
| 7
|
auxdata
|
|
| 8
|
sprites
|
|
Class 16: Docks
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
auxdata
|
|
| 3
|
auxdata
|
|
| 4
|
auxdatavar
|
|
| 5
|
sprites
|
|
Class 17: Vehicles
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
useobj
|
|
| 3
|
useobj
|
|
| 4
|
cargo
|
|
| 5
|
useobj
|
|
| 6
|
useobj
|
|
| 7
|
useobj
|
|
| 8
|
useobj
|
|
| 9
|
useobj
|
|
| 10
|
useobj
|
|
| 11
|
sprites
|
|
Class 18: Trees
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 19: Snow
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 1A: Climates
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
Class 1B: Shapes
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 1C: Buildings
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
auxdata
|
|
| 3
|
auxdata
|
|
| 4
|
auxdatavar
|
|
| 5
|
useobj
|
|
| 6
|
auxdatafix
|
|
| 7
|
sprites
|
|
Class 1D: Scaffolding
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
sprites
|
|
Class 1E: Industries
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
lang
|
|
| 3
|
lang
|
|
| 4
|
lang
|
|
| 5
|
lang
|
|
| 6
|
lang
|
|
| 7
|
lang
|
|
| 8
|
lang
|
|
| 9
|
auxdata
|
|
| 10
|
auxdata
|
|
| 11
|
auxdatafix
|
|
| 12
|
auxdatavar
|
|
| 13
|
auxdatavar
|
|
| 14
|
auxdata
|
|
| 15
|
useobj
|
|
| 16
|
useobj
|
|
| 17
|
useobj
|
|
| 18
|
sprites
|
|
Class 1F: Regions
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
useobj
|
|
| 3
|
useobj
|
|
| 4
|
sprites
|
|
Class 20: Companies
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
lang
|
|
| 3
|
sprites
|
|
Class 21: Texts
| Section
|
Type
|
Content
|
| 0
|
objdata
|
|
| 1
|
lang
|
|
| 2
|
lang
|
|