TTDPatch Landscape Data usage
Introduction / Usage
This document tries to collect all usage of bits in the landscape data of a TTD(Patch) Game,
If you have a css capable browser the red line marks will show bits with different meaning, red texts means important aspects, green are planned features.
Version History
- 1.2 - Class9 L3 bits 8-13 for advzfunctions, Class A: newobjects
- 1.1a - Class5 L3 bit7 - town owned drive drive-through station
- 1.1 - Class9 documented bridge head L5 bit 5 - south bridge head
- 1.0 - Class6 added river bit, random informations,
added Class 9 L8 usage
new fast navigation bar at the bottom
- 0.9a - Class9 added aqueduct/canal bridge bit, removed L7 double description
- 0.9 - Class9 added new enhancetunnel bit usage,
added Class1 trace restrict bit
- 0.8 - Class9 added missing tunnel type (road/rail),
added planned L8 usage,
added Class4 tree info (5..4 2 is snow or desert)
- 0.7a - Class9 added sealevel canal bit, made the css a bit more IE friendly, fixed XHTML structure (a) seelevel canal buoy bit
- 0.6 - Class5 added tram and truck stops, corrected trams on bridgeheads
- 0.5a - Class8 tile description, added newindustries note, (a) removed wrong Class5 tram bit
- 0.4 - added Class5 Station Tile description
- 0.3 - Class 6,7,8,9,A still missing industry/house tile descriptions
- 0.2b - Class 2, Class 3, Class 4, Class 5, Intro
- 0.1 - First Release only Class 0 and Class 1
Landscape Classes
Landscape Array 4 (L4) holds the class in bits 7..4 and the height of the north corner in 3..0
L6 and above are TTDPatch specific "extra" arrays and are zeroed by default.
Class 0 - Grass
- L7: unused
- L6: unused
- L5:
7..5: | Update Counter incremented on every periodic processing for tile types other than 03, 07, 0B and 10 and above on wraparound the tile is updated (for fields, the type of fields in L3 is increased, for other types the tile type in L5 is increased) (for snow and desert, these bits are not used, tile is updated on every periodic processing) |
4..0: | Type:
0x00 bare land
0x01 1/3 grass
0x02 2/3 grass
0x03 full grass
0x07 rough land
0x0B rocks
0x0F fields; type of fields in L3 bits 3..0
0x10 1/4 snow
0x11 2/4 snow
0x12 3/4 snow
0x13 full snow
0x15 partial desert
0x17 full desert
|
- L3:
15..13: | type of hedge on the SW border of the tile (1 through 6, or 0=none) |
12..10: | same for the SE border |
3..0: | Fields: type of fields (legal values: 0 through 9) |
- L2: unused
- L1: owner of the tile (normally 0x10)
Class 1 - Railway & Rail Depots
- L8: (planned build year)
- L7: unused (planned abadone rail)
- L6:
7..4: | PBS for track with signals (with the same meaning as L2) |
3: | PBS for track with signals bit 3 indicates that it's a PBS signal |
5..0: | PBS for plain track (with the same meaning as L5) |
- L5:
7: | railway track (clear) or depot (set) |
6: | has signal, set by depots aswell |
5..0: | track layout:
bit 0: in the X direction
bit 1: in the Y direction
bit 2: in the north corner (direction W-E)
bit 3: in the south corner (direction W-E)
bit 4: in the west corner (direction N-S)
bit 5: in the east corner (direction N-S)
or depot exit: 00 = NE, 01 = SE, 02 = SW, 03 = NW
|
- L3:
15..8: | Presignals:
bit 8: set if pre-signal bits are valid (used for automatic pre-signal setups)
bit 9: set for pre-signals and combo signals
bit 10: set for exit signals and combo signals
bit 11: set = semaphore signals, clear = light signals
bit 12: set = Trace restriction, Signal is restricted
bit 15: set = manual pre-signal setup
|
7..4: | Signal present
- For track in the X direction:
bit 6: signal in the SW direction
bit 7: signal in the NE direction
- For track in the Y direction:
bit 6: signal in the NW direction
bit 7: signal in the SE direction
- For tracks in the W-E direction:
bit 4: signal in the W direction on the track in the S corner
bit 5: signal in the E direction on the track in the S corner
bit 6: signal in the W direction on the track in the N corner
bit 7: signal in the E direction on the track in the N corner
- For tracks in the N-S direction:
bit 4: signal in the S direction on the track in the E corner
bit 5: signal in the N direction on the track in the E corner
bit 6: signal in the S direction on the track in the W corner
bit 7: signal in the N direction on the track in the W corner
|
3..0: | track type |
- L2:
7..4: | if signal: bit set = signal shows green; same bits as in L3 |
3..0: | type of land & fence for railway tracks:
0x00 on bare land
0x01 on grass, no fences
0x02 fence on the NW side
0x03 fence on the SE side
0x04 fences on the NW and SE sides
0x05 fence on the NE side
0x06 fence on the SW side
0x07 fences on the NE and SW sides
0x08 fence on the E side (track in the W corner)
0x09 fence on the W side (track in the E corner)
0x0A fence on the S side (track in the N corner)
0x0B fence on the N side (track in the S corner)
0x0C on snow or desert
|
- L1: owner of the track/depot
Class 2 - Street, Crossings & Road Depots
- L8: (planned build year)
- L7: One-way roads
4..7: | unused |
0..3: | One-way remove routeing bits |
- L6: Abandoned roads; time until being abandoned
- L5:
7..6: | cleared, unused? |
5: | Set = Road depot |
4: | Set = Crossing Rail/Road |
3..0: | Road layout:
bit 0: NW piece
bit 1: SW piece
bit 2: SE piece
bit 3: NE piece
or road depot exit: 00 = NE, 01 = SE, 02 = SW, 03 = NW
|
3: | Crossing: Set = road in Y direction |
2: | Crossing: Set = enabled crossing light |
- L3:
15: | On snow or desert |
14..12: | unknown/unused? |
11..8: | Crossings: track type |
0..7: | Crossings: owner of the road |
0..3: | Tram routeing bits, same as L5; for depots bit 0 set = tram depot |
- L2:
7..3: | unknown/unused? |
0..2: | 0 - on bare land, 1 - on grass, 2 - paved, 3 - with streetlights, 5 - tree-lined, 6 - on grass with road works, 7 - paved with road
Crossings: all above 1 = paved |
- L1: owner of the road / road depot or railway track
Class 3 - Townbuilding
- L7: Newhouses: Year of construction
- L6: Newhouses: Random bits
- L5:
7: | Final position of lift in 5..0 (building types 04 and 05) |
7..3: | Newhouses current animation frame |
5..0: | If bit 7 is set, final position of lift divided by 6 (valid values 0..6 except 1) (types 04 and 05) |
2..0: | Construction counter, for buildings under construction incremented on every periodic tile processing, on wraparound the stage of construction in L3 is increased |
- L3:
15..8: | Newhouses real building type (for new house types) or zero (meaning it's an old type) |
7..6: | Stage of construction (3 = completed) |
5..0: | Newhouses random triggers activated so far |
- L2: building type / newhouses substitute building type (valid 0x00 till 0x6D)
- L1:
7..0: | Newhouses periodic processings remaining before activating random triggers 1 and 2 |
7: | Set = lift moveing (types 04 and 05) |
6..0: | Lift position (types 04 and 05) |
Class 4 - Trees
- L7: unused
- L6: unused
- L5:
7..6: | Tree count minus one |
2..0: | Growth status: 0..2 - one of trees is growing, 3 - all trees are fully grown, 4..6 - one of trees is withering |
- L3:
15..13: | Type of hedge on the SW border of the tile (1 through 6, or 0=none) |
12..10: | Type of hedge on the SE border of the tile (1 through 6, or 0=none) |
9..8: | unknown/unused? |
7..0: | Tree types:
0x00..0x0B temperate climate trees
0x0C..0x13 sub-arctic climate trees
0x14..0x1A rainforest trees
0x1B cactus plants
0x1C..0x1F sub-tropical climate, non-rainforest, non-desert trees
0x20..0x28 toyland trees
|
- L2:
7..6: | amount of snow or desert (desert always set 3 in TTD) |
5..4: | 0 = on grass, 1 = on rough land, 2 = on snow or desert |
3..0: | update counter, incremented on every periodic processing, on wraparound the growth status is updated (or, if it's 3, a random action is taken) |
- L1: owner of the trees (normally 0x10)
Class 5 - Stations
- L8: (planned build year)
- L7: reversed for PBS usage
- L6: NewStations random bits
- L5: Tile type:
0x00..0x07 railway station (bit 0 set Y else X direction)
00..01 open platform
02..03 open platform with station building
04..07 roofed platform
0x08..0x33 large airport
0B,21,22 pad 1, pad 3, pad 2
16..1A runway middle, 1A runway ending
1C control tower
20 hangar
27..32 radar (animated)
33 transmitter
0x34..0x41 small airport
3A..3D wind meter (animated)
3E..40 runway: south,middle,north
41 hangar
0x42 heliport
0x43..0x46 lorry loading area; exits: NE,SE,SW,NW
0x47..0x4A bus station; exits: NE,SE,SW,NW
0x4B oilfield
0x4C..0x51 ship dock; coast parts SW,NW,NE,SE; water parts: 0x50 = X direction, 0x51 = Y direction
0x52 buoy
0x53..0x54 busstop
0x55..0x56 tramstop
0x57..0x58 truckstop
0x59..0x5A cargotramstop
- L3:
15..8: | Newstations stationgrfid |
7: | PBS State |
7: | For stops the road belongs to a town |
6..4: | unknown/unused |
3..0: | Track type of railway stations, otherwise must be 0. |
0: | Set if buoy is in a seelevel canal |
- L2: Index into the array of stations
- L1: owner of the station
Class 6 - Water & Canals
- L7: unused
- L6: random byte for canals/river
- L5: Tile type:
0x00 water
0x01 coast or riverbank
0x02 canals: lock/lift
0x03 river rapids
0x80 ship depot, NE part (X direction)
0x81 ship depot, SW part (X direction)
0x82 ship depot, NW part (Y direction)
0x83 ship depot, SE part (Y direction)
- L3:
15..2: | unused |
1..0: | canals/river type: 1 = canals, 3 = rivers Not stored fo height > 0 in old TTDPatch versions |
- L2: canals, type of locks (valid 0x00..0x0B) if L5 set to 0x02
- L1: owner of the tile, usually 0x11 or owner of depot
Class 7 - Bordertiles
Border tiles are invisible tiles to prevent algorithms to warparound. (they are added at the south edges of the map), some TTD functions accidentally overwrite bits there!
Class 8 - Industry
- L7: Newindustries random triggers activated so far
- L6: Newindustries random bits
- L5: Tile type (valid 00..AE) (not the same as in the array of industries, substitute type for newindustries):
0x00..0x06 coal mine 0x00 wheel tower,
0x01 wheel tower animated, state in L1 bits 5..0; L1 bit 6 set = sound generated
0x07..0x0A power station 0x08 chimney,
0x0A transformer with animation progress in L1 bits 5..2 (valid range 0..7)
0x0B..0x0F sawmill
0x10..0x11 forest 0x11 trees cut down
0x12..0x17 oil refinery
0x18..0x1C oil rig
0x1D..0x20 oil wells 0x1D not animated,
0x1E..0x20 with various stages of animation; progress of animation in L1 bits 1..0
0x21..0x26 farm
0x27..0x2A factory (temperate climate)
0x2B..0x2E printing works
0x2F..ßx33 copper ore mine 0x2F wheel tower,
0x30 wheel tower animated, state in L1 bits 5..0; L1 bit 6 set = sound generated
0x31 chimney
0x34..0x39 steel mill
0x3A..0x3B bank (temperate climate)
0x3C..0x3F food processing plant
0x40..0x47 paper mill
0x48..0x58 gold mine 0x4F wheel tower,
0x58 wheel tower animated, state in L1 bits 5..0; L1 bit 6 set = sound generated
0x59..0x5A bank (sub-arctic or sub-tropical climate)
0x5B..0x63 diamond mine
0x64..0x73 iron ore mine
0x74 fruit plantation
0x75 rubber plantation
0x76..0x77 water supply
0x78 water tower
0x79..0x7C factory (sub-tropical climate)
0x7D..0x80 lumber mill
0x81..0x82 candyfloss forest 0x82 candyfloss 'trees' cut down
0x83..0x86 sweet factory
0x87..0x88 battery farm 0x88 batteries 'reaped'
0x89 cola wells
0x8A..0x8D toy shop
0x8E..0x93 toy factory 0x8F animated, state in low byte L3 (valid 0x00..0x31) uses L3 high byte, see note.
0x94..0x9B plastic fountains (various stages of cyclic animation)
0x9C..0x9F fizzy drink factory
0xA0..0xA3 bubble generator
0xA1 generators
0xA2..bubble capture facility, animation state in low byte of L3 (valid 0x00..0x27)
0xA4..0xA6 toffee quarry 0xA5 animated, state in low byte L3 (valid range 0x00..0x45)
0xA7..0xAE sugar mine 0xAE animated, state in low byte L3 (valid range 0x00..0x5F)
Note for 0x8F toy factory:
Tile animation is started (high byte of L3 zeroed) on the periodic processing if industry array field 2C is nonzero.
While it is in progress the high byte of L3 holds the number of animation cycles that have already taken place;
when this number reaches 8 the animation is stopped.
- L3:
15..8: | Toy factory: Number of animation cycles that have already taken place; when this number reaches 8 the animation is stopped. (depends on the industry array field 2C) |
15..8: | Newindustries: new type (zero if old type) The toy factories will only run the first animation with newindustries enabled without touching this. |
7..0: | Toyland industries: Animation state (range of valid stages depend on tile type) |
- L2: Index into the array of industries
- L1:
7: | set = construction finished |
6: | set = sound already generated |
5..0: | Animation state |
5..2: | Transformer (0x0A): Animation state (valid range 0..7) |
4..2: | construction counter, for buildings under construction incremented on every periodic tile processing |
1..0: | stage of construction (3 = completed) |
Class 9 - Bridges & Tunnels
- L8:
15..8: | build year for bridgeheads otherwise 0 |
7..0: | type of bridge (with newbridges) otherwise 0 |
- L7: Higherbridges, height or enhanced tunnels
7..0: | Height for Higherbridges |
7: | Set = Enhancetunnels |
6: | Diagonal track direction 2 present
L5 bit 0-1 give tunnel direction. Diagonal track number = Direction as route bit numbers.
Tunnel direction 0 (NE) 1=5, 2=2
Tunnel direction 1 (SE) 1=3, 2=5
Tunnel direction 2 (SW) 1=3, 2=4
Tunnel direction 3 (NW) 1=2, 2=4
|
5: | Diagonal track direction 1 present |
4: | Set = Perpendicular track not present |
3..0: | Track type |
- L6: Rail PBS or
Abandoned roads time until being abandoned
- L5:
7: | Set = Bridge else Tunnel |
6: | Set = Bridge middle part else bridgehead (for tunnels clear) |
5: | Set = Route under Bridge, else land or water (see 4..3) bridgeheads = south end, for tunnels clear |
4: | Tunnel: clear |
3..2: | Tunnel: 0 - railway tunnel, 1 - road tunnel |
4..3: | Bridges: If Bit 5 set transport route under bridge (0 = railway, 1 = road) else
land under bridge: 0 - grass, snow or desert, 1 - water |
2..1: | Bridges: 0 - railway bridge, 1 - road bridge, 2 - aqueduct |
1..0: | Tunnel: entrance towards: 0 = NE, 1 = SE, 2 = SW, 3 = NW |
0: | Bridges: Set = Bridge in Y direction else in X direction |
- L3:
15: | Set = on snow or desert |
13..8: | advzfunctions: track route bits to xor with the perpendicular track direction |
11..8: | Tram routeing bits for custombridgeheads |
9..4: | Custombridgeheads route bits, for roads 7..4 |
7..4: | Track type on the bridge, must be 0 for road bridge |
3..0: | Track type of tunnel, on bridgehead or under bridge, must be 0 for road |
0..1: | 1 = Canals or 3 = river if L5 defines a water tile |
- L2:
7..4: | Bridge type:
0x00 wooden
0x01 concrete
0x02 girder, steel
0x03 suspension, concrete
0x04 suspension, steel
0x05 suspension, steel
0x06 cantilever, steel
0x07 cantilever, steel
0x08 cantilever, steel
0x09 girder, steel
0x0A tubular, steel
|
3..0: | Bridge Piece for middle parts (0..5) |
- L1: owner of the tile, bridgehead owner or for bridgesmiddle parts the owner of the land under it.
Class A - HQ & Landscape objects
Additional Info
Owner
Owner values 0x00 through 0x07 are companies (they're indices into the array of companies), 0x10 is no owner, 0x11 appears to be reserved for water, 80 and above are towns (in this case the low 7 bits contain an index into the town array).
Track Type
TTD track types: 0 - conventional railway, 1 - monorail, 2 - maglev
Landscape Classes
Copyright
Most class descriptions are copied from "TTD savegame internals" by Marcin Grzegorczyk
Copyright © 2006-2008 Oskar Eisemuth, 2003-2006 by Marcin Grzegorczyk.