Five arrays are used to encode the information of the contents of each tile. These arrays are referred to as "<spanstyle="font-weight: bold;">map_owner</span>", "<spanstyle="font-weight: bold;">map2</span>", "<spanstyle="font-weight: bold;">map3_lo|_hi</span>", "<spanstyle="font-weight: bold;">map_type_and_height</span>" and "<spanstyle="font-weight: bold;">map5</span>". The known encodings are listed in the table below. The most important value is the class of a tile, stored in the upper 4 bits of the type_and_height array. The lower 4 bits are used to encode the height and slope data. For a graphical represenation of the tile-layout have a look at <ahref="landscape_grid.html">Landscape grid</a> page.
Five attributes hold the information about a tile.
<li>map5 bits 7..6: update counter, incremented on every periodic processing for tile types other than <tt>03</tt>, <tt>07</tt>, <tt>0B</tt> and <tt>10</tt> and above, on wraparound the tile is updated (for fields, the type of fields in map3_lo is increased, for other types the tile type in map5 is increased)
<li>m5 bits 7..6: update counter, incremented on every periodic processing for tile types other than <tt>03</tt>, <tt>07</tt>, <tt>0B</tt> and <tt>10</tt> and above, on wraparound the tile is updated (for fields, the type of fields in m3 is increased, for other types the tile type in m5 is increased)
<br>(for snow and desert, these bits are not used, tile is updated on every periodic processing)
</li>
<li>map_owner: <ahref="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)
<li>owner: <ahref="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)
</li>
<li>map3_hi bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none); bits 4..2: same for the SE border
<li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none); bits 4..2: same for the SE border
<tr><tdnowrapvalign=top><tt>bits 4..6</tt> </td><tdalign=left>'Track'number of reserved track + 1, if this is zero it means nothing is reserved on this tile</td></tr>
<tr><tdnowrapvalign=top><tt>bit 7</tt> </td><tdalign=left>If this is set, then the opposite track ('Track'number^1) is also reserved</td></tr>
</table></li>
</ul>
map5 bits 7 and 6 set: railway depot / checkpoints
<li>map_owner: <ahref="#OwnershipInfo">owner</a> of the road</li>
<li>map2: Index into the array of towns, 0 for non-town roads</li>
<li>map3_hi bits 0..3: counter for the roadworks</li>
<li>map3_hi bits 4..6: <tt>0</tt> - on bare land, <tt>1</tt> - on grass, <tt>2</tt> - paved, <tt>3</tt> - with streetlights, <tt>5</tt> - tree-lined, <tt>6</tt> - on grass with road works, <tt>7</tt> - paved with road works</li>
<li>map3_hi bit 7 set = on snow or desert</li>
<li>owner: <ahref="#OwnershipInfo">owner</a> of the road</li>
<li>m2: Index into the array of towns, 0 for non-town roads</li>
<li>m4 bits 0..3: counter for the roadworks</li>
<li>m4 bits 4..6: <tt>0</tt> - on bare land, <tt>1</tt> - on grass, <tt>2</tt> - paved, <tt>3</tt> - with streetlights, <tt>5</tt> - tree-lined, <tt>6</tt> - on grass with road works, <tt>7</tt> - paved with road works</li>
<li>m4 bit 7 set = on snow or desert</li>
</ul>
map5 bit 4 set, bits 7..5 clear: level crossing
m5 bit 4 set, bits 7..5 clear: level crossing
<ul>
<li>map5 bit 3: clear - road in the X direction, set - road in the Y direction (railway track always perpendicular)</li>
<li>map5 bit 2: set if crossing lights are on</li>
<li>map5 bit 0: set if rail track is reserved by pbs</li>
<li>map_owner: <ahref="#OwnershipInfo">owner</a> of the railway track</li>
<li>map2: Index into the array of towns, 0 for non-town roads</li>
<li>map3_lo bits 0..7: <ahref="#OwnershipInfo">owner</a> of the road</li>
<li>map3_hi: <aname="HouseTypes">town building type</a>:
<li>m2: Index into the array of towns</li>
<li>m4: <aname="HouseTypes">town building type</a>:
<p><small>Note: In the climate list, 'sub-arctic' means below the <ahref="#_snowline">snow line</a>, and 'snow' means above the snow line in the sub-arctic climate.</small></p>
<tr><tdcolspan=2></td></tr><!-- spacer ---- (and I don't mean a walk) -->
</table></li>
<li>map3_lo bits 7..6: stage of construction (<tt>3</tt> = completed)</li>
<li>map5 bits 2..0: construction counter, for buildings under construction incremented on every periodic tile processing, on wraparound the stage of construction in map3_lo is increased</li>
<li>m3 bits 7..6: stage of construction (<tt>3</tt> = completed)</li>
<li>m5 bits 2..0: construction counter, for buildings under construction incremented on every periodic tile processing, on wraparound the stage of construction in m3 is increased</li>
<li>for large office blocks (types <tt>04</tt> and <tt>05</tt>):
<ul>
<li>map_owner bits 6..0: position of the lift</li>
<li>map_owner bit 7: if set the lift is moving</li>
<li>map5 bit 7: if set then map5 bits 5..0 hold the final position of the lift divided by 6 (valid values 0..6 except 1)</li>
<li>owner bits 6..0: position of the lift</li>
<li>owner bit 7: if set the lift is moving</li>
<li>m5 bit 7: if set then m5 bits 5..0 hold the final position of the lift divided by 6 (valid values 0..6 except 1)</li>
<li>map5 bits 7..6: number of trees minus one</li>
<li>map5 bits 2..0: growth status: <tt>0</tt>..<tt>2</tt> - one of trees is growing, <tt>3</tt> - all trees are fully grown, <tt>4</tt>..<tt>6</tt> - one of trees is withering</li>
<li>map3_lo bits 7..0: type of trees:
<li>m5 bits 7..6: number of trees minus one</li>
<li>m5 bits 2..0: growth status: <tt>0</tt>..<tt>2</tt> - one of trees is growing, <tt>3</tt> - all trees are fully grown, <tt>4</tt>..<tt>6</tt> - one of trees is withering</li>
<tr><tdnowrapvalign=top><tt>2</tt> </td><tdalign=left>on snow or desert; map2 bits 7..6 - amount of snow or desert (for desert always set to 3 in TTD)
<tr><tdnowrapvalign=top><tt>2</tt> </td><tdalign=left>on snow or desert; m2 bits 7..6 - amount of snow or desert (for desert always set to 3 in TTD)
</td></tr>
</table></li>
<li>map2 bits 3..0: update counter, incremented on every periodic processing, on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
<li>m2 bits 3..0: update counter, incremented on every periodic processing, on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
<tr><tdnowrapvalign=top><tt>00</tt>..<tt>07</tt> </td><tdalign=left>railway station
<br><tt>00</tt>..<tt>01</tt> - open platform, <tt>02</tt>..<tt>03</tt> - open platform with station building, <tt>04</tt>....<tt>07</tt> - roofed platform
<br><small>(note: this is not the same as the <ahref="#industry.type">industry type</a> stored in the <ahref="#_IndustryArray">array of industries</a>)</small>
<tr><tdnowrapvalign=top><tt>00</tt> </td><tdalign=left>wheel tower when not animated</td></tr>
<tr><tdnowrapvalign=top><tt>01</tt> </td><tdalign=left>wheel tower when animated; animation state in map_owner bits 5..0; map_owner bit 6 set = sound already generated</td></tr>
<tr><tdnowrapvalign=top><tt>01</tt> </td><tdalign=left>wheel tower when animated; animation state in owner bits 5..0; owner bit 6 set = sound already generated</td></tr>
</table>
</td></tr>
<tr><tdnowrapvalign=top><tt>07</tt>..<tt>0A</tt> </td><tdalign=left>power station
<tr><tdnowrapvalign=top><tt>0A</tt> </td><tdalign=left>transformer; animation progress in map_owner bits 5..2 (valid range <tt>0</tt>..<tt>7</tt>)</td></tr>
<tr><tdnowrapvalign=top><tt>0A</tt> </td><tdalign=left>transformer; animation progress in owner bits 5..2 (valid range <tt>0</tt>..<tt>7</tt>)</td></tr>
<tr><tdnowrapvalign=top><tt>1E</tt>..<tt>20</tt> </td><tdalign=left>various stages of animation; progress of animation in map_owner bits 1..0</td></tr>
<tr><tdnowrapvalign=top><tt>1E</tt>..<tt>20</tt> </td><tdalign=left>various stages of animation; progress of animation in owner bits 1..0</td></tr>
<tr><tdnowrapvalign=top><tt>2F</tt> </td><tdalign=left>wheel tower when not animated</td></tr>
<tr><tdnowrapvalign=top><tt>30</tt> </td><tdalign=left>wheel tower when animated; animation state in map_owner bits 5..0; map_owner bit 6 set = sound already generated</td></tr>
<tr><tdnowrapvalign=top><tt>30</tt> </td><tdalign=left>wheel tower when animated; animation state in owner bits 5..0; owner bit 6 set = sound already generated</td></tr>
<tr><tdnowrapvalign=top><tt>4F</tt> </td><tdalign=left>wheel tower when not animated</td></tr>
<tr><tdnowrapvalign=top><tt>58</tt> </td><tdalign=left>wheel tower when animated; animation state in map_owner bits 5..0; map_owner bit 6 set = sound already generated</td></tr>
<tr><tdnowrapvalign=top><tt>58</tt> </td><tdalign=left>wheel tower when animated; animation state in owner bits 5..0; owner bit 6 set = sound already generated</td></tr>
</table>
</td></tr>
<tr><tdnowrapvalign=top><tt>59</tt>..<tt>5A</tt> </td><tdalign=left>bank (sub-arctic or sub-tropical climate)</td></tr>
<tr><tdnowrapvalign=top><tt>8F</tt> </td><tdalign=left>animated part; animation state in map3_lo (valid range <tt>00</tt>..<tt>31</tt>)<br>
tile animation is started (map3_hi zeroed) on the periodic processing if <ahref="#industry.didtransform">field <tt>2C</tt></a> in the corresponding industry array entry is nonzero<br>
while the animation is in progress (see the <ahref="#_AnimatedTilesList">array at <tt>04328</tt></a>) map3_hi holds the number of animation cycles that have already taken place; when this number reaches 8 the animation is stopped</td></tr>
<tr><tdnowrapvalign=top><tt>8F</tt> </td><tdalign=left>animated part; animation state in m3 (valid range <tt>00</tt>..<tt>31</tt>)<br>
tile animation is started (m4 zeroed) on the periodic processing if <ahref="#industry.didtransform">field <tt>2C</tt></a> in the corresponding industry array entry is nonzero<br>
while the animation is in progress (see the <ahref="#_AnimatedTilesList">array at <tt>04328</tt></a>) m4 holds the number of animation cycles that have already taken place; when this number reaches 8 the animation is stopped</td></tr>
</table>
</td></tr>
<tr><tdnowrapvalign=top><tt>94</tt>..<tt>9B</tt> </td><tdalign=left>plastic fountains (various stages of cyclic animation)</td></tr>
@ -514,71 +524,71 @@ while the animation is in progress (see the <a href="#_AnimatedTilesList">array
<tr><tdnowrapvalign=top><tt>A2</tt> </td><tdalign=left>bubble capture facility; animation state in map3_lo (valid range <tt>00</tt>..<tt>27</tt>)</td></tr>
<tr><tdnowrapvalign=top><tt>A2</tt> </td><tdalign=left>bubble capture facility; animation state in m3 (valid range <tt>00</tt>..<tt>27</tt>)</td></tr>
<tr><tdnowrapvalign=top><tt>AE</tt> </td><tdalign=left>animated part; animation state in map3_lo (valid range <tt>00</tt>..<tt>5F</tt>)</td></tr>
<tr><tdnowrapvalign=top><tt>AE</tt> </td><tdalign=left>animated part; animation state in m3 (valid range <tt>00</tt>..<tt>5F</tt>)</td></tr>
</table>
</td></tr>
<tr><tdcolspan=2></td></tr><!-- spacer -->
</table></li>
<li>map2: index into the <ahref="#_IndustryArray">array of industries</a>
<li>m2: index into the <ahref="#_IndustryArray">array of industries</a>
</li>
<li>map_owner bit 7: clear = under construction
<li>owner bit 7: clear = under construction
<ul>
<li>map_owner bits 4..2: construction counter, for buildings under construction incremented on every periodic tile processing
<li>owner bits 4..2: construction counter, for buildings under construction incremented on every periodic tile processing
</li>
</ul></li>
<li>map_owner bits 1..0: stage of construction (<tt>3</tt> = completed), incremented when the construction counter wraps around
<li>owner bits 1..0: stage of construction (<tt>3</tt> = completed), incremented when the construction counter wraps around
<br>the meaning is different for some animated tiles which are never under construction (types <tt>01</tt>, <tt>1E</tt>..<tt>20</tt>, <tt>30</tt>, <tt>58</tt>; see above)
<tr><tdnowrapvalign=top><tt>80</tt>..<tt>93</tt> </td><tdalign=left>company headquarters (5 sets of 4 tiles each, updated quarterly depending on the company performance)</td></tr>
</table>
</li>
<li>map_owner: <ahref="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
<li>owner: <ahref="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
<spanstyle="font-weight: bold;"></span>Five arrays are used to encode the information of the contents of the tile.
<spanstyle="font-weight: bold;"></span>Five attributes hold the information about a tile.
This can be seen in the <ahref="landscape.html">Landscape</a> 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.
<ul>
<li><spanstyle="font-weight: bold;"><spanclass="freebits">O</span></span> - bit is free</li>
<li><spanstyle="font-weight: bold;">X</span> - bit is used</li>
<li><spanstyle="font-weight: bold;"><spanclass="abuse"> </span></span> - bit of _map_* is abused for different purposes</li>
<li><spanstyle="font-weight: bold;"><spanclass="abuse"> </span></span> - bit of attribute is abused for different purposes</li>
<li><b>NOTE: </b>counting the bits starts with bit0 in the most left position (eg. a bit screwed LE format; BIT by BIT) </li>
</ul>
<p>
<ul>
<li><spanstyle="font-weight: bold;">_map_owner[]</span> - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.).</li>
<li><spanstyle="font-weight: bold;">_map2[]</span> - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array.</li>
<li><spanstyle="font-weight: bold;">_map3[]</span> - 16 bits in size, which is split up into _map3lo[] and _map3hi[] is used for general storage.</li>
<li><spanstyle="font-weight: bold;">_map_type_and_height[]</span> - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits).</li>
<li><spanstyle="font-weight: bold;">_map5[]</span> - 8 bits in size, is used for general storage.</li>
<li><spanstyle="font-weight: bold;">type_height</span> - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits)</li>
<li><spanstyle="font-weight: bold;">owner</span> - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.)</li>
<li><spanstyle="font-weight: bold;">m2</span> - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array</li>
<li><spanstyle="font-weight: bold;">m3/m4</span> - 16 bits in size, which is split up into m3 and m4 is used for general storage</li>
<li><spanstyle="font-weight: bold;">m5</span> - 8 bits in size, is used for general storage</li>