Landscape
Seven attributes hold the information about a tile. These attributes are
type_height, m0, m1, m2, m3, m4,
m5 and m7.
The attribute type_height contains the height of a tile stored in
its lower 4 bits. The slope of a tile is computed combining its height
with the heights of its neighbours. The higher bits of type_height
may contain additional information depending on the climate; currently,
the higher 2 bits contain the zone information in the tropical climate.
type_height (8)
|
7654-3210
|
zz00-hhhh
|
The zones currently defined for the tropical climate are the following.
Value | Meaning
|
00 | Normal
|
01 | Desert
|
02 | Rain forest
|
Tile contents
The attributes m0 … m7 define the contents of a tile
proper, ie, what is built on the tile. Generally speaking, the higher bits
of m0 determine the kind of object that is on the tile (its "class").
Also, the lower 2 bits of m0 record whether there is a bridge over
the tile, for tile classes that allow this. m1 contains the owner
of the tile and, for tile classes representing an indexed object,
m2 contains the index of this object into the corresponding array.
The values of m3, m4, m5 and m7 are highly
dependent on the object class.
The following table describes the full encoding used in storing objects
into the tile structure; the possible values for each field are described
below.
Legend:
XX class mark;
00 free;
XX abused
for different purposes
Field values
Bridge above
Whether there is a bridge above the tile, and its direction.
Value | Meaning
|
00 | No bridge
|
01 | Bridge along X axis
|
10 | Bridge along Y axis
|
Direction
Value | Meaning
|
0 | NE
|
1 | SE
|
2 | SW
|
3 | NW
|
Owner
Owner of the tile or piece of road.
Value | Meaning
|
00…0E | Companies
|
0F | Town
|
10 | Nobody
|
11 | Water
|
Update counter
An update counter is used in tiles that are to remain in a certain state
for a period of time and then change. The counter is increased on every
periodic processing of the tile, and the corresponding action is taken
when the counter reaches a preset value or wraps around.
Ground and density
Ground type (grass, snow, desert, …) and density for clear or tree
tiles.
Value | Meaning | Densities
|
0000 | Grass | 0—3
|
0001 | Shore | N/A
|
0010 | Roughland | N/A
|
0011 | Rocks | N/A
|
0100 | Desert | 1, 3
|
1000 | Snow | 0—3
|
1010 | Snow-covered roughland | 0—3
|
1011 | Snow-covered rocks | 0—3
|
Hedge
Hedge on the border of a tile. It can take the values 1 through 6,
or 0 for none.
Trees
Both the number and type of trees fields jointly determine the set of trees
actually displayed at a tile. The lower 3 bits of the number field
represent the growth status of the trees (0…2 for growing; 3 for
fully grown; 4…7 for withering).
Water tile types
Value | Meaning
|
00 | Water, canal or river
|
01 | Coast or riverbank
|
10 | Canal lock, middle part, SW-NE
|
11 | Canal lock, middle part, NW-SE
|
12 | Canal lock, middle part, NE-SW
|
13 | Canal lock, middle part, SE-NW
|
14 | Canal lock, lower part, SW-NE
|
15 | Canal lock, lower part, NW-SE
|
16 | Canal lock, lower part, NE-SW
|
17 | Canal lock, lower part, SE-NW
|
18 | Canal lock, upper part, SW-NE
|
19 | Canal lock, upper part, NW-SE
|
1A | Canal lock, upper part, NE-SW
|
1B | Canal lock, upper part, SE-NW
|
80 | Ship depot, X direction, NE part
|
81 | Ship depot, X direction, SW part
|
82 | Ship depot, Y direction, NW part
|
83 | Ship depot, Y direction, SE part
|
Object types
Value | Meaning
|
00 | Transmitter
|
01 | Lighthouse
|
02 | Company statue
|
03 | Company-owned land
|
80…93
| Company headquarters (5 sets of 4 tiles each)
|
Bridge types
Value | Max. speed (mph) | Meaning
|
0 | 20 | Wooden
|
1 | 30 | Concrete
|
2 | 40 | Girder, steel
|
3 | 50 | Suspension, concrete
|
4 | 60 | Suspension, steel
|
5 | 70 | Suspension, steel
|
6 | 100 | Cantilever, steel
|
7 | 130 | Cantilever, steel
|
8 | 150 | Cantilever, steel
|
9 | 160 | Girder, steel
|
A | 200 | Tubular, steel
|
B | 320 | Tubular, steel
|
C | 380 | Tubular, silicon
|
Track types
Value | Meaning
|
0 | Conventional railway
|
1 | Electrified railway
|
2 | Monorail
|
3 | Maglev
|
Track layout
Bit | Track present
|
01 | X direction
|
02 | Y direction
|
04 | North corner (WE)
|
08 | South corner (WE)
|
10 | West corner (NS)
|
20 | East corner (NS)
|
PBS track reservations
Value | Reserved track
|
0 | None
|
1 | X direction
|
2 | Y direction
|
3 | North corner (WE)
|
4 | South corner (WE)
|
5 | West corner (NS)
|
6 | East corner (NS)
|
8 | Opposite track also reserved
|
Ground and fence for railway tracks
Value | Meaning
|
0 | Bareland
|
1 | Grass, no fence
|
2 | Fence on the NW side
|
3 | Fence on the SE side
|
4 | Fences on the NW and SE sides
|
5 | Fence on the NE side
|
6 | Fence on the SW side
|
7 | Fences on the NE and SW sides
|
8 | Fence on the E side
|
9 | Fence on the W side
|
A | Fence on the S side
|
B | Fence on the N side
|
C | Snow or desert
|
D |
Grass with fence and shore or water on the free halftile
|
E |
Higher part on foundation with snow, lower without snow
|
Signals
Value | Meaning
|
000
| No signals
|
001
| Normal signals
|
010
| Pre-signals
|
011
| Exit-signals
|
100
| Combo-signals
|
101
| PBS signals
|
110
| PBS one-way signals
|
1
| First signal present
|
1
| Second signal present
|
1
| First signal is green
|
1
| Second signal is green
|
1
| Semaphore signals
|
Present road types
Bit | Meaning
|
001 | Normal road
|
010 | Tramway
|
100 | Reserved
|
Ground and pavement for roads
Value | Meaning
|
0 | On bareland
|
1 | On grass
|
2 | Paved
|
3 | Paved, with streetlights
|
5 | Paved, tree-lined
|
6 | On grass, with road works
|
7 | Paved, with roadworks
|
Road layout
Bit | Road piece present
|
1 | NW piece
|
2 | SW piece
|
4 | SE piece
|
8 | NE piece
|
Tunnels
Industries
- m1 bit 7: clear: under construction
- m1 bits 6…5:
water class (sea, canal, river or land)
- m1 bits 3…2:
construction counter, for buildings under construction incremented
on every periodic tile processing
- m1 bits 1…0:
stage of construction (3 = completed), incremented when the
construction counter wraps around; the meaning is different for
some animated tiles which are never under construction
(types 01,
1E…20,
30, 58)
- m2: index into the array of industries
- m3: random bits (NewGRF)
- m4: animation loop
- m5: industry tile type (with m0 bit 3)
- m7: animation frame
- m0 bit 3: bit 8 of type (see m5)
- m0 bits 2…0: random triggers (NewGRF)
Houses
- m1: random bits (Newhouses)
- m2: index into the array of towns
- m3 bit 7:
- set: house is complete
- m5: age of house in years, clamped at 255
- clear: house is under construction
- m5 bits 4…3: construction stage
- m5 bits 2…0: construction counter
- m3 bit 6: bit 8 of house type (see m4),
allowing 512 different types.
- m3 bit 5: free
- m3 bits 4…0: triggers activated
(Newhouses)
- m4: town building type
(with m3 bit 6)
- m5: see m3 bit 7
- m0 bits 5…0:
- If Newhouses is activated:
periodic processing time remaining
- Standard behaviour: lift position (only for houses
type 04 and 05)
- m7:
- If Newhouses is activated:
current animation frame
- Standard behaviour: (only for houses
type 04 and 05)
- bits 3…1: lift destination. Values can be
0…6 except 1, so the building has 6 effective floors.
This is due to the fact that the first floor is 2 'normal'
floors high. One 'normal' floor has a height of 6 lift positions.
- bit 0: lift has destination when set
Newhouses is the name englobing a newGRF feature developed by TTDPatch devs
(mainly Csaboka). It allows the replacement of the properties as well as
the graphics of houses in the game. To distinguish between the standard
behaviour and the newGRF one, HouseID (m4+m3[6]) is tested for
anything above 110. 110 is the count of standard houses, so anything
above 110 means that there is a new definition of at least one house.