OpenTTD Landscape Internals - #2
Description: Structure of OpenTTD (OTTD) landscape arrays #2

### Landscape

Six attributes hold the information about a tile. This can be seen in the Landscape document. This page tries to give an overview of used and free bits of the array so you can quickly see what is used and what is not.

- O - bit is free
- X - bit is used
- - bit of attribute is abused for different purposes

- type_height - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits)
- m1 - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.)
- m2 - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array
- m3 - 8 bits in size, is used for general storage
- m4 - 8 bits in size, is used for general storage
- m5 - 8 bits in size, is used for general storage
- m6 - 8 bits in size, special meaning : lower 2 bits only valid in tropic climate, upper 2 bits for bridges
- m7 - 8 bits in size, is used for general storage

class | type_height (8) | m1 (8) | m2 (16) | m3 (8) | m4 (8) | m5 (8) | m6 (8) | m7 (8)
--- | --- | --- | --- | --- | --- | --- | --- | ---
bits | 7654 3210 | 7654 3210 | FEDC BA98 7654 3210 | 7654 3210 | 7654 3210 | 7654 3210 | 7654 3210 | 7654 3210
0 | ground | XXXX XXXX | XXXX XXXX | OOOO OOOO OOOO OOOO | OOOO OOOO | XXXX XXOO | XXXX XXXX | XXOO OOXX | OOOO OOOO
farmland | -inherit- | -inherit- | XXXX XXXX XXXX XXXX | OOOO XXXX | -inherit- | OOOX XXXX | XXOO OOXX | OOOO OOOO
1 | rail | XXXX XXXX | XXXX XXXX | OOOO OOOO OXXX OXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXOO OOXX | OOOO OOOO
depot | -inherit- | -inherit- | OOOO OOOO OOOO OOOO | OOOO XXXX | OOOO XXXX | XXOO OXXX | XXOO OOXX | OOOO OOOO
waypoint | -inherit- | -inherit- | XXXX XXXX XXXX XXXX | OOOO XXXX | OOOO XXXX | XXOO OXXX | XXOO OOXX | OOOO OOOO
2 | road | XXXX XXXX | XXXX XXXX | XXXX XXXX XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX
level crossing | -inherit- | -inherit- | -inherit- | XXXX XXXX | OXXX XXXX | XXOO XXXX | XXOO OOXX | XXXX XXXX
road depot | -inherit- | -inherit- | OOOO OOOO OOOO OOOO | XOOO OOOO | OOOO OOOO | XXOO XXXX | XXOO OOXX | XXXO OOOO
3 | house | XXXX XXXX | XXXX XXXX | XXXX XXXX XXXX XXXX | XXOX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX
4 | trees | XXXX XXXX | XXXX XXXX | OOOO OOOO XXXX XXXX | XXXX XXXX | XXXX XXOO | XXOO OXXX | OOOO OOXX | OOOO OOOO
5 | station | XXXX XXXX | XXXX XXXX | XXXX XXXX XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | OOXX XXXX | OOOO OOOO
6 | water | XXXX XXXX | XXXX XXXX | OOOO OOOO OOOO OOOO | OOOO OOOO | OOOO OOOO | OOOO OOXX | XXOO OOXX | OOOO OOOO
8 | industry | XXXX XXXX | XOOX XXXX | XXXX XXXX XXXX XXXX | XXXX XXXX | XXXX XXXX | XXXX XXXX | OOXX XXXX | XXXX XXXX
9 | tunnel entrance | XXXX XXXX | XXXX XXXX | OOOO OOOO OOOO OOOO | OOOO XXXX | XOOO OOOO | XOOO XXXX | XXOO OOXX | OOOO OOOO
bridge ramp | XXXX XXXX | XXXX XXXX | OOOO OOOO XXXX OOOO | OOOO XXXX | XOOO OOOO | XOOO XXXX | XXOO OOXX | OOOO OOOO
A | unmovables | XXXX XXXX | XXXX XXXX | OOOO OOOO OOOO OOOO | OOOO OOOO | OOOO OOOO | XXXX XXXX | XXOO OOXX | OOOO OOOO