docs/landscape.html
changeset 2149 e5ae969b26b9
parent 2017 16c2d8b875d1
child 2229 c82f7c143f91
equal deleted inserted replaced
2148:47ba4a1b1c3b 2149:e5ae969b26b9
     9 </head>
     9 </head>
    10 <body>
    10 <body>
    11 
    11 
    12 <h3><a name="Landscape">Landscape</a></h3>
    12 <h3><a name="Landscape">Landscape</a></h3>
    13 <p>
    13 <p>
    14 Five arrays are used to encode the information of the contents of each tile. These arrays are referred to as "<span style="font-weight: bold;">map_owner</span>", "<span style="font-weight: bold;">map2</span>", "<span style="font-weight: bold;">map3_lo|_hi</span>", "<span style="font-weight: bold;">map_type_and_height</span>" and "<span style="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 <a href="landscape_grid.html">Landscape grid</a> page.
    14 Five attributes hold the information about a tile.
       
    15 These attributes are referred to as
       
    16   "<span style="font-weight: bold;">type_height</span>",
       
    17   "<span style="font-weight: bold;">owner</span>",
       
    18   "<span style="font-weight: bold;">m2</span>",
       
    19   "<span style="font-weight: bold;">m3</span>",
       
    20   "<span style="font-weight: bold;">m4</span>" and
       
    21   "<span style="font-weight: bold;">m5</span>".
       
    22 The most important value is the class of a tile, stored in the upper 4 bits of the type_height array.
       
    23 The lower 4 bits are used to encode the height and slope data.
       
    24 For a graphical represenation of the tile-layout have a look at <a href="landscape_grid.html">Landscape grid</a> page.
    15 </p>
    25 </p>
    16 <p>
    26 <p>
    17 OTTD's class-specific periodic tile processing routine is called once every +256 ticks for each tile.
    27 OTTD's class-specific periodic tile processing routine is called once every +256 ticks for each tile.
    18 </p>
    28 </p>
    19 
    29 
    20 <table border=1 cellpadding=3>
    30 <table border=1 cellpadding=3>
    21 <tr><th align=left>Class</th><th align=left>Meaning & details of encoding</th></tr>
    31 <tr><th align=left>Class</th><th align=left>Meaning & details of encoding</th></tr>
    22 
    32 
    23 <tr><td valign=top nowrap><a name="Class0"><tt> 0 </tt></a></td><td>
    33 <tr><td valign=top nowrap><a name="Class0"><tt> 0 </tt></a></td><td>
    24 <ul>
    34 <ul>
    25 <li>map5 bits 4..0: tile type:
    35 <li>m5 bits 4..0: tile type:
    26 <table>
    36 <table>
    27 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>bare land</td></tr>
    37 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>bare land</td></tr>
    28 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>1/3 grass</td></tr>
    38 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>1/3 grass</td></tr>
    29 <tr><td nowrap valign=top><tt>02</tt>&nbsp; </td><td align=left>2/3 grass</td></tr>
    39 <tr><td nowrap valign=top><tt>02</tt>&nbsp; </td><td align=left>2/3 grass</td></tr>
    30 <tr><td nowrap valign=top><tt>03</tt>&nbsp; </td><td align=left>full grass</td></tr>
    40 <tr><td nowrap valign=top><tt>03</tt>&nbsp; </td><td align=left>full grass</td></tr>
    31 <tr><td nowrap valign=top><tt>07</tt>&nbsp; </td><td align=left>rough land</td></tr>
    41 <tr><td nowrap valign=top><tt>07</tt>&nbsp; </td><td align=left>rough land</td></tr>
    32 <tr><td nowrap valign=top><tt>0B</tt>&nbsp; </td><td align=left>rocks</td></tr>
    42 <tr><td nowrap valign=top><tt>0B</tt>&nbsp; </td><td align=left>rocks</td></tr>
    33 <tr><td nowrap valign=top><tt>0F</tt>&nbsp; </td><td align=left>fields; type of fields in map3_lo bits 3..0 (legal values: 0 through 9)</td></tr>
    43 <tr><td nowrap valign=top><tt>0F</tt>&nbsp; </td><td align=left>fields; type of fields in m3 bits 3..0 (legal values: 0 through 9)</td></tr>
    34 <tr><td nowrap valign=top><tt>10</tt>&nbsp; </td><td align=left>1/4 snow</td></tr>
    44 <tr><td nowrap valign=top><tt>10</tt>&nbsp; </td><td align=left>1/4 snow</td></tr>
    35 <tr><td nowrap valign=top><tt>11</tt>&nbsp; </td><td align=left>2/4 snow</td></tr>
    45 <tr><td nowrap valign=top><tt>11</tt>&nbsp; </td><td align=left>2/4 snow</td></tr>
    36 <tr><td nowrap valign=top><tt>12</tt>&nbsp; </td><td align=left>3/4 snow</td></tr>
    46 <tr><td nowrap valign=top><tt>12</tt>&nbsp; </td><td align=left>3/4 snow</td></tr>
    37 <tr><td nowrap valign=top><tt>13</tt>&nbsp; </td><td align=left>full snow</td></tr>
    47 <tr><td nowrap valign=top><tt>13</tt>&nbsp; </td><td align=left>full snow</td></tr>
    38 <tr><td nowrap valign=top><tt>15</tt>&nbsp; </td><td align=left>partial desert</td></tr>
    48 <tr><td nowrap valign=top><tt>15</tt>&nbsp; </td><td align=left>partial desert</td></tr>
    39 <tr><td nowrap valign=top><tt>17</tt>&nbsp; </td><td align=left>full desert</td></tr>
    49 <tr><td nowrap valign=top><tt>17</tt>&nbsp; </td><td align=left>full desert</td></tr>
    40 </table>
    50 </table>
    41 </li>
    51 </li>
    42 <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)
    52 <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)
    43 <br>(for snow and desert, these bits are not used, tile is updated on every periodic processing)
    53 <br>(for snow and desert, these bits are not used, tile is updated on every periodic processing)
    44 </li>
    54 </li>
    45 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)
    55 <li>owner: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)
    46 </li>
    56 </li>
    47 <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
    57 <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
    48 </li>
    58 </li>
    49 </ul>
    59 </ul>
    50 </td></tr>
    60 </td></tr>
    51 
    61 
    52 <tr><td valign=top nowrap><a name="Class1"><tt> 1 </tt></a></td><td>
    62 <tr><td valign=top nowrap><a name="Class1"><tt> 1 </tt></a></td><td>
    53 map5 bit 7 clear: railway track
    63 m5 bit 7 clear: railway track
    54 <ul>
    64 <ul>
    55 <li>map5 bits 0..5: track layout: bit set = track present:
    65 <li>m5 bits 0..5: track layout: bit set = track present:
    56 <table>
    66 <table>
    57 <tr><td nowrap valign=top>bit 0: </td><td align=left>in the X direction</td></tr>
    67 <tr><td nowrap valign=top>bit 0: </td><td align=left>in the X direction</td></tr>
    58 <tr><td nowrap valign=top>bit 1: </td><td align=left>in the Y direction</td></tr>
    68 <tr><td nowrap valign=top>bit 1: </td><td align=left>in the Y direction</td></tr>
    59 <tr><td nowrap valign=top>bit 2: </td><td align=left>in the north corner (direction W-E)</td></tr>
    69 <tr><td nowrap valign=top>bit 2: </td><td align=left>in the north corner (direction W-E)</td></tr>
    60 <tr><td nowrap valign=top>bit 3: </td><td align=left>in the south corner (direction W-E)</td></tr>
    70 <tr><td nowrap valign=top>bit 3: </td><td align=left>in the south corner (direction W-E)</td></tr>
    61 <tr><td nowrap valign=top>bit 4: </td><td align=left>in the west corner (direction N-S)</td></tr>
    71 <tr><td nowrap valign=top>bit 4: </td><td align=left>in the west corner (direction N-S)</td></tr>
    62 <tr><td nowrap valign=top>bit 5: </td><td align=left>in the east corner (direction N-S)</td></tr>
    72 <tr><td nowrap valign=top>bit 5: </td><td align=left>in the east corner (direction N-S)</td></tr>
    63 </table></li>
    73 </table></li>
    64 <li>map5 bit 6 set = with signals:
    74 <li>m5 bit 6 set = with signals:
    65 <ul>
    75 <ul>
    66 <li>map3_lo bits 7..4: bit set = signal present:
    76 <li>m3 bits 7..4: bit set = signal present:
    67 <ul>
    77 <ul>
    68 <li>For track in the X direction:
    78 <li>For track in the X direction:
    69 <table>
    79 <table>
    70 <tr><td nowrap valign=top>bit 6: </td><td align=left>signal in the SW direction</td></tr>
    80 <tr><td nowrap valign=top>bit 6: </td><td align=left>signal in the SW direction</td></tr>
    71 <tr><td nowrap valign=top>bit 7: </td><td align=left>signal in the NE direction</td></tr>
    81 <tr><td nowrap valign=top>bit 7: </td><td align=left>signal in the NE direction</td></tr>
    88 <tr><td nowrap valign=top>bit 5: </td><td align=left>signal in the N direction on the track in the E corner</td></tr>
    98 <tr><td nowrap valign=top>bit 5: </td><td align=left>signal in the N direction on the track in the E corner</td></tr>
    89 <tr><td nowrap valign=top>bit 6: </td><td align=left>signal in the S direction on the track in the W corner</td></tr>
    99 <tr><td nowrap valign=top>bit 6: </td><td align=left>signal in the S direction on the track in the W corner</td></tr>
    90 <tr><td nowrap valign=top>bit 7: </td><td align=left>signal in the N direction on the track in the W corner</td></tr>
   100 <tr><td nowrap valign=top>bit 7: </td><td align=left>signal in the N direction on the track in the W corner</td></tr>
    91 </table></li>
   101 </table></li>
    92 </ul></li>
   102 </ul></li>
    93 <li>map2 bits 7..4: bit clear = signal shows red; same bits as in map3_lo</li>
   103 <li>m2 bits 7..4: bit clear = signal shows red; same bits as in m3</li>
    94 <li>OpenTTD bits in map3_hi:
   104 <li>OpenTTD bits in m4:
    95 <table>
   105 <table>
    96 <tr><td nowrap valign=top>bits 2..0: </td><td align=left>type of signal:</td></tr>
   106 <tr><td nowrap valign=top>bits 2..0: </td><td align=left>type of signal:</td></tr>
    97 <tr><td nowrap valign=top><tt>000</tt>: </td><td align=left>normal signals</td></tr>
   107 <tr><td nowrap valign=top><tt>000</tt>: </td><td align=left>normal signals</td></tr>
    98 <tr><td nowrap valign=top><tt>001</tt>: </td><td align=left>pre-signals</td></tr>
   108 <tr><td nowrap valign=top><tt>001</tt>: </td><td align=left>pre-signals</td></tr>
    99 <tr><td nowrap valign=top><tt>010</tt>: </td><td align=left>exit-signals</td></tr>
   109 <tr><td nowrap valign=top><tt>010</tt>: </td><td align=left>exit-signals</td></tr>
   100 <tr><td nowrap valign=top><tt>011</tt>: </td><td align=left>combo-signals</td></tr>
   110 <tr><td nowrap valign=top><tt>011</tt>: </td><td align=left>combo-signals</td></tr>
   101 <tr><td nowrap valign=top><tt>100</tt>: </td><td align=left>PBS signals</td></tr>
   111 <tr><td nowrap valign=top><tt>100</tt>: </td><td align=left>PBS signals</td></tr>
   102 <tr><td nowrap valign=top>bit 3: </td><td align=left>set = semaphore signals, clear = light signals</td></tr>
   112 <tr><td nowrap valign=top>bit 3: </td><td align=left>set = semaphore signals, clear = light signals</td></tr>
   103 </table></li>
   113 </table></li>
   104 </ul></li>
   114 </ul></li>
   105 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the track
   115 <li>owner: <a href="#OwnershipInfo">owner</a> of the track
   106 </li>
   116 </li>
   107 <li>map2 bits 0..3:
   117 <li>m2 bits 0..3:
   108 <table>
   118 <table>
   109 <tr><td nowrap valign=top><tt>0</tt>&nbsp; </td><td align=left>on bare land</td></tr>
   119 <tr><td nowrap valign=top><tt>0</tt>&nbsp; </td><td align=left>on bare land</td></tr>
   110 <tr><td nowrap valign=top><tt>1</tt>&nbsp; </td><td align=left>on grass, no fences</td></tr>
   120 <tr><td nowrap valign=top><tt>1</tt>&nbsp; </td><td align=left>on grass, no fences</td></tr>
   111 <tr><td nowrap valign=top><tt>2</tt>&nbsp; </td><td align=left>fence on the NW side</td></tr>
   121 <tr><td nowrap valign=top><tt>2</tt>&nbsp; </td><td align=left>fence on the NW side</td></tr>
   112 <tr><td nowrap valign=top><tt>3</tt>&nbsp; </td><td align=left>fence on the SE side</td></tr>
   122 <tr><td nowrap valign=top><tt>3</tt>&nbsp; </td><td align=left>fence on the SE side</td></tr>
   118 <tr><td nowrap valign=top><tt>9</tt>&nbsp; </td><td align=left>fence on the W side (track in the E corner)</td></tr>
   128 <tr><td nowrap valign=top><tt>9</tt>&nbsp; </td><td align=left>fence on the W side (track in the E corner)</td></tr>
   119 <tr><td nowrap valign=top><tt>A</tt>&nbsp; </td><td align=left>fence on the S side (track in the N corner)</td></tr>
   129 <tr><td nowrap valign=top><tt>A</tt>&nbsp; </td><td align=left>fence on the S side (track in the N corner)</td></tr>
   120 <tr><td nowrap valign=top><tt>B</tt>&nbsp; </td><td align=left>fence on the N side (track in the S corner)</td></tr>
   130 <tr><td nowrap valign=top><tt>B</tt>&nbsp; </td><td align=left>fence on the N side (track in the S corner)</td></tr>
   121 <tr><td nowrap valign=top><tt>C</tt>&nbsp; </td><td align=left>on snow or desert</td></tr>
   131 <tr><td nowrap valign=top><tt>C</tt>&nbsp; </td><td align=left>on snow or desert</td></tr>
   122 </table></li>
   132 </table></li>
   123 <li>map3_hi bits 0..3 = <a name="TrackType">track type</a>: <tt>0</tt> - conventional railway, <tt>1</tt> - monorail, <tt>2</tt> - maglev
   133 <li>m4 bits 0..3 = <a name="TrackType">track type</a>: <tt>0</tt> - conventional railway, <tt>1</tt> - monorail, <tt>2</tt> - maglev
   124 <li>map3_hi bits 4..7 = Pbs reserved status:
   134 <li>m4 bits 4..7 = Pbs reserved status:
   125 <table>
   135 <table>
   126 <tr><td nowrap valign=top><tt>bits 4..6</tt>&nbsp; </td><td align=left>'Track'number of reserved track + 1, if this is zero it means nothing is reserved on this tile</td></tr>
   136 <tr><td nowrap valign=top><tt>bits 4..6</tt>&nbsp; </td><td align=left>'Track'number of reserved track + 1, if this is zero it means nothing is reserved on this tile</td></tr>
   127 <tr><td nowrap valign=top><tt>bit 7</tt>&nbsp; </td><td align=left>If this is set, then the opposite track ('Track'number^1) is also reserved</td></tr>
   137 <tr><td nowrap valign=top><tt>bit 7</tt>&nbsp; </td><td align=left>If this is set, then the opposite track ('Track'number^1) is also reserved</td></tr>
   128 </table></li>
   138 </table></li>
   129 </ul>
   139 </ul>
   130 map5 bits 7 and 6 set: railway depot / checkpoints
   140 m5 bits 7 and 6 set: railway depot / checkpoints
   131 <ul>
   141 <ul>
   132 <li>map5 value C0..C3: railway depot
   142 <li>m5 value C0..C3: railway depot
   133 <br>map5 bits 1..0 - direction: exit towards: <tt>00</tt> = NE, <tt>01</tt> = SE, <tt>02</tt> = SW, <tt>03</tt> = NW</li>
   143 <br>m5 bits 1..0 - direction: exit towards: <tt>00</tt> = NE, <tt>01</tt> = SE, <tt>02</tt> = SW, <tt>03</tt> = NW</li>
   134 <li>map5 value C4..C5: checkpoint
   144 <li>m5 value C4..C5: checkpoint
   135 <br>bit 0: clear = in X direction, set = in Y direction
   145 <br>bit 0: clear = in X direction, set = in Y direction
   136 <br>
   146 <br>
   137 <br>
   147 <br>
   138 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the depot / checkpoint</li>
   148 <li>owner: <a href="#OwnershipInfo">owner</a> of the depot / checkpoint</li>
   139 <li>map3_lo bits 0..3 = <a href="#TrackType">track type</a></li>
   149 <li>m3 bits 0..3 = <a href="#TrackType">track type</a></li>
   140 <li>map3_lo bit 4 = use custom sprite (valid only for the checkpoint)</li>
   150 <li>m3 bit 4 = use custom sprite (valid only for the checkpoint)</li>
   141 <li>map3_lo bit 6 = track on this tile is reserved by pbs</li>
   151 <li>m3 bit 6 = track on this tile is reserved by pbs</li>
   142 <li>map3_hi = custom station id</li>
   152 <li>m4 = custom station id</li>
   143 </ul>
   153 </ul>
   144 </td></tr>
   154 </td></tr>
   145 
   155 
   146 <tr><td valign=top nowrap><a name="Class2"><tt> 2 </tt></a></td><td>
   156 <tr><td valign=top nowrap><a name="Class2"><tt> 2 </tt></a></td><td>
   147 map5 bits 7..4 clear: road
   157 m5 bits 7..4 clear: road
   148 <ul>
   158 <ul>
   149 <li>map5 bits 3..0: road layout: bit set = road piece present:
   159 <li>m5 bits 3..0: road layout: bit set = road piece present:
   150 <table>
   160 <table>
   151 <tr><td nowrap valign=top>bit 0: </td><td align=left>NW piece</td></tr>
   161 <tr><td nowrap valign=top>bit 0: </td><td align=left>NW piece</td></tr>
   152 <tr><td nowrap valign=top>bit 1: </td><td align=left>SW piece</td></tr>
   162 <tr><td nowrap valign=top>bit 1: </td><td align=left>SW piece</td></tr>
   153 <tr><td nowrap valign=top>bit 2: </td><td align=left>SE piece</td></tr>
   163 <tr><td nowrap valign=top>bit 2: </td><td align=left>SE piece</td></tr>
   154 <tr><td nowrap valign=top>bit 3: </td><td align=left>NE piece</td></tr>
   164 <tr><td nowrap valign=top>bit 3: </td><td align=left>NE piece</td></tr>
   155 </table></li>
   165 </table></li>
   156 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the road</li>
   166 <li>owner: <a href="#OwnershipInfo">owner</a> of the road</li>
   157 <li>map2: Index into the array of towns, 0 for non-town roads</li>
   167 <li>m2: Index into the array of towns, 0 for non-town roads</li>
   158 <li>map3_hi bits 0..3: counter for the roadworks</li>
   168 <li>m4 bits 0..3: counter for the roadworks</li>
   159 <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>
   169 <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>
   160 <li>map3_hi bit 7 set = on snow or desert</li>
   170 <li>m4 bit 7 set = on snow or desert</li>
   161 </ul>
   171 </ul>
   162 map5 bit 4 set, bits 7..5 clear: level crossing
   172 m5 bit 4 set, bits 7..5 clear: level crossing
   163 <ul>
   173 <ul>
   164 <li>map5 bit 3: clear - road in the X direction, set - road in the Y direction (railway track always perpendicular)</li>
   174 <li>m5 bit 3: clear - road in the X direction, set - road in the Y direction (railway track always perpendicular)</li>
   165 <li>map5 bit 2: set if crossing lights are on</li>
   175 <li>m5 bit 2: set if crossing lights are on</li>
   166 <li>map5 bit 0: set if rail track is reserved by pbs</li>
   176 <li>m5 bit 0: set if rail track is reserved by pbs</li>
   167 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the railway track</li>
   177 <li>owner: <a href="#OwnershipInfo">owner</a> of the railway track</li>
   168 <li>map2: Index into the array of towns, 0 for non-town roads</li>
   178 <li>m2: Index into the array of towns, 0 for non-town roads</li>
   169 <li>map3_lo bits 0..7: <a href="#OwnershipInfo">owner</a> of the road</li>
   179 <li>m3 bits 0..7: <a href="#OwnershipInfo">owner</a> of the road</li>
   170 <li>map3_hi bits 3..0: <a href="#TrackType">track type</a></li>
   180 <li>m4 bits 3..0: <a href="#TrackType">track type</a></li>
   171 <li>map3_hi bits 4..6: <tt>0</tt> - on bare land, <tt>1</tt> - on grass, <tt>2</tt> or higher - paved</li>
   181 <li>m4 bits 4..6: <tt>0</tt> - on bare land, <tt>1</tt> - on grass, <tt>2</tt> or higher - paved</li>
   172 <li>map3_hi bit 7 set = on snow or desert</li>
   182 <li>m4 bit 7 set = on snow or desert</li>
   173 </ul>
   183 </ul>
   174 map5 bit 5 set: road depot
   184 m5 bit 5 set: road depot
   175 <ul>
   185 <ul>
   176 <li>map5 bits 3..0 - direction: exit towards: <tt>0</tt> = NE, <tt>1</tt> = SE, <tt>2</tt> = SW, <tt>3</tt> = NW</li>
   186 <li>m5 bits 3..0 - direction: exit towards: <tt>0</tt> = NE, <tt>1</tt> = SE, <tt>2</tt> = SW, <tt>3</tt> = NW</li>
   177 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the depot</li>
   187 <li>owner: <a href="#OwnershipInfo">owner</a> of the depot</li>
   178 <li>map3_hi bit 7 set = on snow or desert (not displayed, but set internally)</li>
   188 <li>m4 bit 7 set = on snow or desert (not displayed, but set internally)</li>
   179 </ul>
   189 </ul>
   180 </td></tr>
   190 </td></tr>
   181 
   191 
   182 <tr><td valign=top nowrap><a name="Class3"><tt> 3 </tt></a></td><td>
   192 <tr><td valign=top nowrap><a name="Class3"><tt> 3 </tt></a></td><td>
   183 Town building
   193 Town building
   184 <ul>
   194 <ul>
   185 <li>map2: Index into the array of towns</li>
   195 <li>m2: Index into the array of towns</li>
   186 <li>map3_hi: <a name="HouseTypes">town building type</a>:
   196 <li>m4: <a name="HouseTypes">town building type</a>:
   187 <p><small>Note: In the climate list, 'sub-arctic' means below the <a href="#_snowline">snow line</a>, and 'snow' means above the snow line in the sub-arctic climate.</small></p>
   197 <p><small>Note: In the climate list, 'sub-arctic' means below the <a href="#_snowline">snow line</a>, and 'snow' means above the snow line in the sub-arctic climate.</small></p>
   188 <table>
   198 <table>
   189 <tr><th align=left>Type&nbsp;</th><th align=left>Size&nbsp;</th><th align=left>Climates&nbsp;</th><th align=left>Description</th></tr>
   199 <tr><th align=left>Type&nbsp;</th><th align=left>Size&nbsp;</th><th align=left>Climates&nbsp;</th><th align=left>Description</th></tr>
   190 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td>1&times;1</td><td>temperate</td><td align=left>tall office block</td></tr>
   200 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td>1&times;1</td><td>temperate</td><td align=left>tall office block</td></tr>
   191 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td>1&times;1</td><td>temperate</td><td align=left>office block</td></tr>
   201 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td>1&times;1</td><td>temperate</td><td align=left>office block</td></tr>
   271 <tr><td nowrap valign=top><tt>6B</tt>&nbsp; </td><td>1&times;1</td><td>toyland</td><td align=left>statue</td></tr>
   281 <tr><td nowrap valign=top><tt>6B</tt>&nbsp; </td><td>1&times;1</td><td>toyland</td><td align=left>statue</td></tr>
   272 <tr><td nowrap valign=top><tt>6C</tt>&nbsp; </td><td>1&times;1</td><td>toyland</td><td align=left>teapot-house</td></tr>
   282 <tr><td nowrap valign=top><tt>6C</tt>&nbsp; </td><td>1&times;1</td><td>toyland</td><td align=left>teapot-house</td></tr>
   273 <tr><td nowrap valign=top><tt>6D</tt>&nbsp; </td><td>1&times;1</td><td>toyland</td><td align=left>piggy-bank</td></tr>
   283 <tr><td nowrap valign=top><tt>6D</tt>&nbsp; </td><td>1&times;1</td><td>toyland</td><td align=left>piggy-bank</td></tr>
   274 <tr><td colspan=2></td></tr> <!-- spacer -- -- (and I don't mean a walk) -->
   284 <tr><td colspan=2></td></tr> <!-- spacer -- -- (and I don't mean a walk) -->
   275 </table></li>
   285 </table></li>
   276 <li>map3_lo bits 7..6: stage of construction (<tt>3</tt> = completed)</li>
   286 <li>m3 bits 7..6: stage of construction (<tt>3</tt> = completed)</li>
   277 <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>
   287 <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>
   278 <li>for large office blocks (types <tt>04</tt> and <tt>05</tt>):
   288 <li>for large office blocks (types <tt>04</tt> and <tt>05</tt>):
   279 <ul>
   289 <ul>
   280 <li>map_owner bits 6..0: position of the lift</li>
   290 <li>owner bits 6..0: position of the lift</li>
   281 <li>map_owner bit 7: if set the lift is moving</li>
   291 <li>owner bit 7: if set the lift is moving</li>
   282 <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>
   292 <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>
   283 </ul></li>
   293 </ul></li>
   284 </ul>
   294 </ul>
   285 </td></tr>
   295 </td></tr>
   286 
   296 
   287 <tr><td valign=top nowrap><a name="Class4"><tt> 4 </tt></a></td><td>
   297 <tr><td valign=top nowrap><a name="Class4"><tt> 4 </tt></a></td><td>
   288 Trees
   298 Trees
   289 <ul>
   299 <ul>
   290 <li>map5 bits 7..6: number of trees minus one</li>
   300 <li>m5 bits 7..6: number of trees minus one</li>
   291 <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>
   301 <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>
   292 <li>map3_lo bits 7..0: type of trees:
   302 <li>m3 bits 7..0: type of trees:
   293 <table>
   303 <table>
   294 <tr><td nowrap valign=top><tt>00</tt>..<tt>0B</tt>&nbsp; </td><td align=left>temperate climate trees</td></tr>
   304 <tr><td nowrap valign=top><tt>00</tt>..<tt>0B</tt>&nbsp; </td><td align=left>temperate climate trees</td></tr>
   295 <tr><td nowrap valign=top><tt>0C</tt>..<tt>13</tt>&nbsp; </td><td align=left>sub-arctic climate trees</td></tr>
   305 <tr><td nowrap valign=top><tt>0C</tt>..<tt>13</tt>&nbsp; </td><td align=left>sub-arctic climate trees</td></tr>
   296 <tr><td nowrap valign=top><tt>14</tt>..<tt>1A</tt>&nbsp; </td><td align=left>rainforest trees</td></tr>
   306 <tr><td nowrap valign=top><tt>14</tt>..<tt>1A</tt>&nbsp; </td><td align=left>rainforest trees</td></tr>
   297 <tr><td nowrap valign=top><tt>1B</tt> </td><td align=left>cactus plants</td></tr>
   307 <tr><td nowrap valign=top><tt>1B</tt> </td><td align=left>cactus plants</td></tr>
   298 <tr><td nowrap valign=top><tt>1C</tt>..<tt>1F</tt>&nbsp; </td><td align=left>sub-tropical climate, non-rainforest, non-desert trees</td></tr>
   308 <tr><td nowrap valign=top><tt>1C</tt>..<tt>1F</tt>&nbsp; </td><td align=left>sub-tropical climate, non-rainforest, non-desert trees</td></tr>
   299 <tr><td nowrap valign=top><tt>20</tt>..<tt>28</tt>&nbsp; </td><td align=left>toyland trees</td></tr>
   309 <tr><td nowrap valign=top><tt>20</tt>..<tt>28</tt>&nbsp; </td><td align=left>toyland trees</td></tr>
   300 </table>
   310 </table>
   301 (note: the actually displayed set of trees depends on both type and number of trees)
   311 (note: the actually displayed set of trees depends on both type and number of trees)
   302 </li>
   312 </li>
   303 <li>map3_hi bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
   313 <li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
   304 <li>map3_hi bits 4..2: type of hedge on the SE border of the tile (1 through 6, or 0=none)</li>
   314 <li>m4 bits 4..2: type of hedge on the SE border of the tile (1 through 6, or 0=none)</li>
   305 <li>map2 bits 5..4:
   315 <li>m2 bits 5..4:
   306 <table>
   316 <table>
   307 <tr><td nowrap valign=top><tt>0</tt>&nbsp; </td><td align=left>on grass</td></tr>
   317 <tr><td nowrap valign=top><tt>0</tt>&nbsp; </td><td align=left>on grass</td></tr>
   308 <tr><td nowrap valign=top><tt>1</tt>&nbsp; </td><td align=left>on rough land</td></tr>
   318 <tr><td nowrap valign=top><tt>1</tt>&nbsp; </td><td align=left>on rough land</td></tr>
   309 <tr><td nowrap valign=top><tt>2</tt>&nbsp; </td><td align=left>on snow or desert; map2 bits 7..6 - amount of snow or desert (for desert always set to 3 in TTD)
   319 <tr><td nowrap valign=top><tt>2</tt>&nbsp; </td><td align=left>on snow or desert; m2 bits 7..6 - amount of snow or desert (for desert always set to 3 in TTD)
   310 </td></tr>
   320 </td></tr>
   311 </table></li>
   321 </table></li>
   312 <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>
   322 <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>
   313 <li>map_owner: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
   323 <li>owner: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
   314 </ul>
   324 </ul>
   315 </td></tr>
   325 </td></tr>
   316 
   326 
   317 <tr><td valign=top nowrap><a name="Class5"><tt> 5 </tt></a></td><td>
   327 <tr><td valign=top nowrap><a name="Class5"><tt> 5 </tt></a></td><td>
   318 Station tile
   328 Station tile
   319 <ul>
   329 <ul>
   320 <li>map5: tile type:
   330 <li>m5: tile type:
   321 <table>
   331 <table>
   322 <tr><td nowrap valign=top><tt>00</tt>..<tt>07</tt>&nbsp; </td><td align=left>railway station
   332 <tr><td nowrap valign=top><tt>00</tt>..<tt>07</tt>&nbsp; </td><td align=left>railway station
   323 <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
   333 <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
   324 <br>bit 0: clear = in X direction, set = in Y direction
   334 <br>bit 0: clear = in X direction, set = in Y direction
   325 </td></tr>
   335 </td></tr>
   373 <tr><td nowrap valign=top><tt>52</tt> </td><td align=left>buoy</td></tr>
   383 <tr><td nowrap valign=top><tt>52</tt> </td><td align=left>buoy</td></tr>
   374 </td></tr>
   384 </td></tr>
   375 <tr><td colspan=2></td></tr> <!-- spacer -->
   385 <tr><td colspan=2></td></tr> <!-- spacer -->
   376 </table>
   386 </table>
   377 </li>
   387 </li>
   378 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the station</li>
   388 <li>owner: <a href="#OwnershipInfo">owner</a> of the station</li>
   379 <li>map2: index into the <a href="#_StationArray">array of stations</a></li>
   389 <li>m2: index into the <a href="#_StationArray">array of stations</a></li>
   380 <li>map3_lo bits 0..3: <a href="#TrackType">track type</a> for railway stations, must be 0 for all the other stations</li>
   390 <li>m3 bits 0..3: <a href="#TrackType">track type</a> for railway stations, must be 0 for all the other stations</li>
   381 <li>map3_lo bit 4 = use custom sprite (valid only railway stations FOR NOW)</li>
   391 <li>m3 bit 4 = use custom sprite (valid only railway stations FOR NOW)</li>
   382 <li>map3lo bit 6 set = track is reserved by pbs (railway stations only)</li>
   392 <li>m3 bit 6 set = track is reserved by pbs (railway stations only)</li>
   383 <li>map3_hi = custom station id</li>
   393 <li>m4 = custom station id</li>
   384 </ul>
   394 </ul>
   385 </td></tr>
   395 </td></tr>
   386 
   396 
   387 <tr><td valign=top nowrap><a name="Class6"><tt> 6 </tt></a></td><td>
   397 <tr><td valign=top nowrap><a name="Class6"><tt> 6 </tt></a></td><td>
   388 <ul>
   398 <ul>
   389 <li>map5: tile type:
   399 <li>m5: tile type:
   390 <table>
   400 <table>
   391 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>water</td></tr>
   401 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>water</td></tr>
   392 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>coast or riverbank</td></tr>
   402 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>coast or riverbank</td></tr>
   393 <tr><td nowrap valign=top><tt>10</tt>..<tt>1B</tt>&nbsp; </td><td align=left>canal locks
   403 <tr><td nowrap valign=top><tt>10</tt>..<tt>1B</tt>&nbsp; </td><td align=left>canal locks
   394 <table>
   404 <table>
   415 </td></tr>
   425 </td></tr>
   416 
   426 
   417 </table>
   427 </table>
   418 </td></tr>
   428 </td></tr>
   419 </table></li>
   429 </table></li>
   420 <li>map_owner: <a href="#OwnershipInfo">owner</a> (for water and coasts normally <tt>11</tt>)</li>
   430 <li>owner: <a href="#OwnershipInfo">owner</a> (for water and coasts normally <tt>11</tt>)</li>
   421 </ul>
   431 </ul>
   422 </td></tr>
   432 </td></tr>
   423 
   433 
   424 <tr><td valign=top nowrap><a name="Class7"><tt> 7 </tt></a></td><td>
   434 <tr><td valign=top nowrap><a name="Class7"><tt> 7 </tt></a></td><td>
   425 Void
   435 Void
   429 </td></tr>
   439 </td></tr>
   430 
   440 
   431 <tr><td valign=top nowrap><a name="Class8"><tt> 8 </tt></a></td><td>
   441 <tr><td valign=top nowrap><a name="Class8"><tt> 8 </tt></a></td><td>
   432 Industry tile
   442 Industry tile
   433 <ul>
   443 <ul>
   434 <li>map5: type:
   444 <li>m5: type:
   435 <br><small>(note: this is not the same as the <a href="#industry.type">industry type</a> stored in the <a href="#_IndustryArray">array of industries</a>)</small>
   445 <br><small>(note: this is not the same as the <a href="#industry.type">industry type</a> stored in the <a href="#_IndustryArray">array of industries</a>)</small>
   436 <table>
   446 <table>
   437 <tr><td nowrap valign=top><tt>00</tt>..<tt>06</tt>&nbsp; </td><td align=left>coal mine
   447 <tr><td nowrap valign=top><tt>00</tt>..<tt>06</tt>&nbsp; </td><td align=left>coal mine
   438 <table>
   448 <table>
   439 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>wheel tower when not animated</td></tr>
   449 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>wheel tower when not animated</td></tr>
   440 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>wheel tower when animated; animation state in map_owner bits 5..0; map_owner bit 6 set = sound already generated</td></tr>
   450 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>wheel tower when animated; animation state in owner bits 5..0; owner bit 6 set = sound already generated</td></tr>
   441 </table>
   451 </table>
   442 </td></tr>
   452 </td></tr>
   443 <tr><td nowrap valign=top><tt>07</tt>..<tt>0A</tt>&nbsp; </td><td align=left>power station
   453 <tr><td nowrap valign=top><tt>07</tt>..<tt>0A</tt>&nbsp; </td><td align=left>power station
   444 <table>
   454 <table>
   445 <tr><td nowrap valign=top><tt>08</tt>&nbsp; </td><td align=left>chimney</td></tr>
   455 <tr><td nowrap valign=top><tt>08</tt>&nbsp; </td><td align=left>chimney</td></tr>
   446 <tr><td nowrap valign=top><tt>0A</tt>&nbsp; </td><td align=left>transformer; animation progress in map_owner bits 5..2 (valid range <tt>0</tt>..<tt>7</tt>)</td></tr>
   456 <tr><td nowrap valign=top><tt>0A</tt>&nbsp; </td><td align=left>transformer; animation progress in owner bits 5..2 (valid range <tt>0</tt>..<tt>7</tt>)</td></tr>
   447 </table>
   457 </table>
   448 </td></tr>
   458 </td></tr>
   449 <tr><td nowrap valign=top><tt>0B</tt>..<tt>0F</tt>&nbsp; </td><td align=left>sawmill</td></tr>
   459 <tr><td nowrap valign=top><tt>0B</tt>..<tt>0F</tt>&nbsp; </td><td align=left>sawmill</td></tr>
   450 <tr><td nowrap valign=top><tt>10</tt>..<tt>11</tt>&nbsp; </td><td align=left>forest
   460 <tr><td nowrap valign=top><tt>10</tt>..<tt>11</tt>&nbsp; </td><td align=left>forest
   451 <table>
   461 <table>
   455 <tr><td nowrap valign=top><tt>12</tt>..<tt>17</tt>&nbsp; </td><td align=left>oil refinery</td></tr>
   465 <tr><td nowrap valign=top><tt>12</tt>..<tt>17</tt>&nbsp; </td><td align=left>oil refinery</td></tr>
   456 <tr><td nowrap valign=top><tt>18</tt>..<tt>1C</tt>&nbsp; </td><td align=left>oil rig</td></tr>
   466 <tr><td nowrap valign=top><tt>18</tt>..<tt>1C</tt>&nbsp; </td><td align=left>oil rig</td></tr>
   457 <tr><td nowrap valign=top><tt>1D</tt>..<tt>20</tt>&nbsp; </td><td align=left>oil wells
   467 <tr><td nowrap valign=top><tt>1D</tt>..<tt>20</tt>&nbsp; </td><td align=left>oil wells
   458 <table>
   468 <table>
   459 <tr><td nowrap valign=top><tt>1D</tt>&nbsp; </td><td align=left>not animated</td></tr>
   469 <tr><td nowrap valign=top><tt>1D</tt>&nbsp; </td><td align=left>not animated</td></tr>
   460 <tr><td nowrap valign=top><tt>1E</tt>..<tt>20</tt>&nbsp; </td><td align=left>various stages of animation; progress of animation in map_owner bits 1..0</td></tr>
   470 <tr><td nowrap valign=top><tt>1E</tt>..<tt>20</tt>&nbsp; </td><td align=left>various stages of animation; progress of animation in owner bits 1..0</td></tr>
   461 </table>
   471 </table>
   462 </td></tr>
   472 </td></tr>
   463 <tr><td nowrap valign=top><tt>21</tt>..<tt>26</tt>&nbsp; </td><td align=left>farm</td></tr>
   473 <tr><td nowrap valign=top><tt>21</tt>..<tt>26</tt>&nbsp; </td><td align=left>farm</td></tr>
   464 <tr><td nowrap valign=top><tt>27</tt>..<tt>2A</tt>&nbsp; </td><td align=left>factory (temperate climate)</td></tr>
   474 <tr><td nowrap valign=top><tt>27</tt>..<tt>2A</tt>&nbsp; </td><td align=left>factory (temperate climate)</td></tr>
   465 <tr><td nowrap valign=top><tt>2B</tt>..<tt>2E</tt>&nbsp; </td><td align=left>printing works</td></tr>
   475 <tr><td nowrap valign=top><tt>2B</tt>..<tt>2E</tt>&nbsp; </td><td align=left>printing works</td></tr>
   466 <tr><td nowrap valign=top><tt>2F</tt>..<tt>33</tt>&nbsp; </td><td align=left>copper ore mine
   476 <tr><td nowrap valign=top><tt>2F</tt>..<tt>33</tt>&nbsp; </td><td align=left>copper ore mine
   467 <table>
   477 <table>
   468 <tr><td nowrap valign=top><tt>2F</tt>&nbsp; </td><td align=left>wheel tower when not animated</td></tr>
   478 <tr><td nowrap valign=top><tt>2F</tt>&nbsp; </td><td align=left>wheel tower when not animated</td></tr>
   469 <tr><td nowrap valign=top><tt>30</tt>&nbsp; </td><td align=left>wheel tower when animated; animation state in map_owner bits 5..0; map_owner bit 6 set = sound already generated</td></tr>
   479 <tr><td nowrap valign=top><tt>30</tt>&nbsp; </td><td align=left>wheel tower when animated; animation state in owner bits 5..0; owner bit 6 set = sound already generated</td></tr>
   470 <tr><td nowrap valign=top><tt>31</tt>&nbsp; </td><td align=left>chimney</td></tr>
   480 <tr><td nowrap valign=top><tt>31</tt>&nbsp; </td><td align=left>chimney</td></tr>
   471 </table>
   481 </table>
   472 </td></tr>
   482 </td></tr>
   473 <tr><td nowrap valign=top><tt>34</tt>..<tt>39</tt>&nbsp; </td><td align=left>steel mill</td></tr>
   483 <tr><td nowrap valign=top><tt>34</tt>..<tt>39</tt>&nbsp; </td><td align=left>steel mill</td></tr>
   474 <tr><td nowrap valign=top><tt>3A</tt>..<tt>3B</tt>&nbsp; </td><td align=left>bank (temperate climate)</td></tr>
   484 <tr><td nowrap valign=top><tt>3A</tt>..<tt>3B</tt>&nbsp; </td><td align=left>bank (temperate climate)</td></tr>
   475 <tr><td nowrap valign=top><tt>3C</tt>..<tt>3F</tt>&nbsp; </td><td align=left>food processing plant</td></tr>
   485 <tr><td nowrap valign=top><tt>3C</tt>..<tt>3F</tt>&nbsp; </td><td align=left>food processing plant</td></tr>
   476 <tr><td nowrap valign=top><tt>40</tt>..<tt>47</tt>&nbsp; </td><td align=left>paper mill</td></tr>
   486 <tr><td nowrap valign=top><tt>40</tt>..<tt>47</tt>&nbsp; </td><td align=left>paper mill</td></tr>
   477 <tr><td nowrap valign=top><tt>48</tt>..<tt>58</tt>&nbsp; </td><td align=left>gold mine
   487 <tr><td nowrap valign=top><tt>48</tt>..<tt>58</tt>&nbsp; </td><td align=left>gold mine
   478 <table>
   488 <table>
   479 <tr><td nowrap valign=top><tt>4F</tt>&nbsp; </td><td align=left>wheel tower when not animated</td></tr>
   489 <tr><td nowrap valign=top><tt>4F</tt>&nbsp; </td><td align=left>wheel tower when not animated</td></tr>
   480 <tr><td nowrap valign=top><tt>58</tt>&nbsp; </td><td align=left>wheel tower when animated; animation state in map_owner bits 5..0; map_owner bit 6 set = sound already generated</td></tr>
   490 <tr><td nowrap valign=top><tt>58</tt>&nbsp; </td><td align=left>wheel tower when animated; animation state in owner bits 5..0; owner bit 6 set = sound already generated</td></tr>
   481 </table>
   491 </table>
   482 </td></tr>
   492 </td></tr>
   483 <tr><td nowrap valign=top><tt>59</tt>..<tt>5A</tt>&nbsp; </td><td align=left>bank (sub-arctic or sub-tropical climate)</td></tr>
   493 <tr><td nowrap valign=top><tt>59</tt>..<tt>5A</tt>&nbsp; </td><td align=left>bank (sub-arctic or sub-tropical climate)</td></tr>
   484 <tr><td nowrap valign=top><tt>5B</tt>..<tt>63</tt>&nbsp; </td><td align=left>diamond mine</td></tr>
   494 <tr><td nowrap valign=top><tt>5B</tt>..<tt>63</tt>&nbsp; </td><td align=left>diamond mine</td></tr>
   485 <tr><td nowrap valign=top><tt>64</tt>..<tt>73</tt>&nbsp; </td><td align=left>iron ore mine</td></tr>
   495 <tr><td nowrap valign=top><tt>64</tt>..<tt>73</tt>&nbsp; </td><td align=left>iron ore mine</td></tr>
   502 </td></tr>
   512 </td></tr>
   503 <tr><td nowrap valign=top><tt>89</tt></td><td align=left>cola wells</td></tr>
   513 <tr><td nowrap valign=top><tt>89</tt></td><td align=left>cola wells</td></tr>
   504 <tr><td nowrap valign=top><tt>8A</tt>..<tt>8D</tt>&nbsp; </td><td align=left>toy shop</td></tr>
   514 <tr><td nowrap valign=top><tt>8A</tt>..<tt>8D</tt>&nbsp; </td><td align=left>toy shop</td></tr>
   505 <tr><td nowrap valign=top><tt>8E</tt>..<tt>93</tt>&nbsp; </td><td align=left>toy factory
   515 <tr><td nowrap valign=top><tt>8E</tt>..<tt>93</tt>&nbsp; </td><td align=left>toy factory
   506 <table>
   516 <table>
   507 <tr><td nowrap valign=top><tt>8F</tt>&nbsp; </td><td align=left>animated part; animation state in map3_lo (valid range <tt>00</tt>..<tt>31</tt>)<br>
   517 <tr><td nowrap valign=top><tt>8F</tt>&nbsp; </td><td align=left>animated part; animation state in m3 (valid range <tt>00</tt>..<tt>31</tt>)<br>
   508 tile animation is started (map3_hi zeroed) on the periodic processing if <a href="#industry.didtransform">field <tt>2C</tt></a> in the corresponding industry array entry is nonzero<br>
   518 tile animation is started (m4 zeroed) on the periodic processing if <a href="#industry.didtransform">field <tt>2C</tt></a> in the corresponding industry array entry is nonzero<br>
   509 while the animation is in progress (see the <a href="#_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>
   519 while the animation is in progress (see the <a href="#_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>
   510 </table>
   520 </table>
   511 </td></tr>
   521 </td></tr>
   512 <tr><td nowrap valign=top><tt>94</tt>..<tt>9B</tt>&nbsp; </td><td align=left>plastic fountains (various stages of cyclic animation)</td></tr>
   522 <tr><td nowrap valign=top><tt>94</tt>..<tt>9B</tt>&nbsp; </td><td align=left>plastic fountains (various stages of cyclic animation)</td></tr>
   513 <tr><td nowrap valign=top><tt>9C</tt>..<tt>9F</tt>&nbsp; </td><td align=left>fizzy drink factory</td></tr>
   523 <tr><td nowrap valign=top><tt>9C</tt>..<tt>9F</tt>&nbsp; </td><td align=left>fizzy drink factory</td></tr>
   514 <tr><td nowrap valign=top><tt>A0</tt>..<tt>A3</tt>&nbsp; </td><td align=left>bubble generator
   524 <tr><td nowrap valign=top><tt>A0</tt>..<tt>A3</tt>&nbsp; </td><td align=left>bubble generator
   515 <table>
   525 <table>
   516 <tr><td nowrap valign=top><tt>A1</tt>&nbsp; </td><td align=left>generators</td></tr>
   526 <tr><td nowrap valign=top><tt>A1</tt>&nbsp; </td><td align=left>generators</td></tr>
   517 <tr><td nowrap valign=top><tt>A2</tt>&nbsp; </td><td align=left>bubble capture facility; animation state in map3_lo (valid range <tt>00</tt>..<tt>27</tt>)</td></tr>
   527 <tr><td nowrap valign=top><tt>A2</tt>&nbsp; </td><td align=left>bubble capture facility; animation state in m3 (valid range <tt>00</tt>..<tt>27</tt>)</td></tr>
   518 </table>
   528 </table>
   519 </td></tr>
   529 </td></tr>
   520 <tr><td nowrap valign=top><tt>A4</tt>..<tt>A6</tt>&nbsp; </td><td align=left>toffee quarry
   530 <tr><td nowrap valign=top><tt>A4</tt>..<tt>A6</tt>&nbsp; </td><td align=left>toffee quarry
   521 <table>
   531 <table>
   522 <tr><td nowrap valign=top><tt>A5</tt>&nbsp; </td><td align=left>animated part; animation state in map3_lo (valid range <tt>00</tt>..<tt>45</tt>)</td></tr>
   532 <tr><td nowrap valign=top><tt>A5</tt>&nbsp; </td><td align=left>animated part; animation state in m3 (valid range <tt>00</tt>..<tt>45</tt>)</td></tr>
   523 </table>
   533 </table>
   524 </td></tr>
   534 </td></tr>
   525 <tr><td nowrap valign=top><tt>A7</tt>..<tt>AE</tt>&nbsp; </td><td align=left>sugar mine
   535 <tr><td nowrap valign=top><tt>A7</tt>..<tt>AE</tt>&nbsp; </td><td align=left>sugar mine
   526 <table>
   536 <table>
   527 <tr><td nowrap valign=top><tt>AE</tt>&nbsp; </td><td align=left>animated part; animation state in map3_lo (valid range <tt>00</tt>..<tt>5F</tt>)</td></tr>
   537 <tr><td nowrap valign=top><tt>AE</tt>&nbsp; </td><td align=left>animated part; animation state in m3 (valid range <tt>00</tt>..<tt>5F</tt>)</td></tr>
   528 </table>
   538 </table>
   529 </td></tr>
   539 </td></tr>
   530 <tr><td colspan=2></td></tr> <!-- spacer -->
   540 <tr><td colspan=2></td></tr> <!-- spacer -->
   531 </table></li>
   541 </table></li>
   532 <li>map2: index into the <a href="#_IndustryArray">array of industries</a>
   542 <li>m2: index into the <a href="#_IndustryArray">array of industries</a>
   533 </li>
   543 </li>
   534 <li>map_owner bit 7: clear = under construction
   544 <li>owner bit 7: clear = under construction
   535 <ul>
   545 <ul>
   536 <li>map_owner bits 4..2: construction counter, for buildings under construction incremented on every periodic tile processing
   546 <li>owner bits 4..2: construction counter, for buildings under construction incremented on every periodic tile processing
   537 </li>
   547 </li>
   538 </ul></li>
   548 </ul></li>
   539 <li>map_owner bits 1..0: stage of construction (<tt>3</tt> = completed), incremented when the construction counter wraps around
   549 <li>owner bits 1..0: stage of construction (<tt>3</tt> = completed), incremented when the construction counter wraps around
   540 <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)
   550 <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)
   541 </li>
   551 </li>
   542 </ul>
   552 </ul>
   543 </td></tr>
   553 </td></tr>
   544 
   554 
   545 <tr><td valign=top nowrap><a name="Class9"><tt> 9 </tt></a></td><td>
   555 <tr><td valign=top nowrap><a name="Class9"><tt> 9 </tt></a></td><td>
   546 map5 bits 7..4 clear: tunnel entrance/exit
   556 m5 bits 7..4 clear: tunnel entrance/exit
   547 <ul>
   557 <ul>
   548 <li>map5 bits 3..2: <tt>0</tt> - railway tunnel, <tt>1</tt> - road tunnel</li>
   558 <li>m5 bits 3..2: <tt>0</tt> - railway tunnel, <tt>1</tt> - road tunnel</li>
   549 <li>map5 bits 1..0 - direction: entrance towards: <tt>0</tt> = NE, <tt>1</tt> = SE, <tt>2</tt> = SW, <tt>3</tt> = NW</li>
   559 <li>m5 bits 1..0 - direction: entrance towards: <tt>0</tt> = NE, <tt>1</tt> = SE, <tt>2</tt> = SW, <tt>3</tt> = NW</li>
   550 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the tunnel</li>
   560 <li>owner: <a href="#OwnershipInfo">owner</a> of the tunnel</li>
   551 <li>map3_lo bits 3..0 = <a href="#TrackType">track type</a> for railway tunnel, must be 0 for road tunnel</li>
   561 <li>m3 bits 3..0 = <a href="#TrackType">track type</a> for railway tunnel, must be 0 for road tunnel</li>
   552 <li>map3_hi bit 7 set = on snow or desert</li>
   562 <li>m4 bit 7 set = on snow or desert</li>
   553 <li>map3hi bit 0 set = track with 'Track'number 0 is reserved by pbs</li>
   563 <li>m4 bit 0 set = track with 'Track'number 0 is reserved by pbs</li>
   554 <li>map3hi bit 1 set = track with 'Track'number 1 is reserved by pbs</li>
   564 <li>m4 bit 1 set = track with 'Track'number 1 is reserved by pbs</li>
   555 </ul>
   565 </ul>
   556 map5 bit 7 set: bridge
   566 m5 bit 7 set: bridge
   557 <ul><li>
   567 <ul><li>
   558 map5 bit 6 clear: bridge ending
   568 m5 bit 6 clear: bridge ending
   559 <ul>
   569 <ul>
   560 <li>map5 bit 5: clear - northern, set - southern ending</li>
   570 <li>m5 bit 5: clear - northern, set - southern ending</li>
   561 <li>map3_lo bits 3..0 = <a href="#TrackType">type of track</a> on the bridge, must be 0 for road bridge</li>
   571 <li>m3 bits 3..0 = <a href="#TrackType">type of track</a> on the bridge, must be 0 for road bridge</li>
   562 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the bridge</li>
   572 <li>owner: <a href="#OwnershipInfo">owner</a> of the bridge</li>
   563 </ul>
   573 </ul>
   564 map5 bit 6 set: bridge middle part
   574 m5 bit 6 set: bridge middle part
   565 <ul>
   575 <ul>
   566 <li>map5 bit 5 clear:
   576 <li>m5 bit 5 clear:
   567 <ul>
   577 <ul>
   568 <li>map5 bits 4..3: land under bridge: <tt>0</tt> - grass, snow or desert, <tt>1</tt> - water</li>
   578 <li>m5 bits 4..3: land under bridge: <tt>0</tt> - grass, snow or desert, <tt>1</tt> - water</li>
   569 </ul>
   579 </ul>
   570 map5 bit 5 set:
   580 m5 bit 5 set:
   571 <ul>
   581 <ul>
   572 <li>map5 bits 4..3: transport route under bridge: <tt>0</tt> - railway, <tt>1</tt> - road</li>
   582 <li>m5 bits 4..3: transport route under bridge: <tt>0</tt> - railway, <tt>1</tt> - road</li>
   573 </ul>
   583 </ul>
   574 <li>map3_lo bits 7..4 = <a href="#TrackType">type of track</a> on the bridge, must be 0 for road bridge</li>
   584 <li>m3 bits 7..4 = <a href="#TrackType">type of track</a> on the bridge, must be 0 for road bridge</li>
   575 <li>map3_lo bits 3..0 = <a href="#TrackType">type of track</a> under the bridge, if any</li>
   585 <li>m3 bits 3..0 = <a href="#TrackType">type of track</a> under the bridge, if any</li>
   576 <li>map2 bits 3..0: bridge piece (<tt>0</tt>..<tt>5</tt>)
   586 <li>m2 bits 3..0: bridge piece (<tt>0</tt>..<tt>5</tt>)
   577 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the land under bridge</li>
   587 <li>owner: <a href="#OwnershipInfo">owner</a> of the land under bridge</li>
   578 </ul></li>
   588 </ul></li>
   579 <li>map5 bits 2..1: <tt>0</tt> - railway bridge, <tt>1</tt> - road bridge</li>
   589 <li>m5 bits 2..1: <tt>0</tt> - railway bridge, <tt>1</tt> - road bridge</li>
   580 <li>map5 bit 0: clear - bridge in the X direction, set - bridge in the Y direction</li>
   590 <li>m5 bit 0: clear - bridge in the X direction, set - bridge in the Y direction</li>
   581 <li>map2 bits 7..4: <a name="BridgeType">bridge type</a>:
   591 <li>m2 bits 7..4: <a name="BridgeType">bridge type</a>:
   582 <table>
   592 <table>
   583 <tr><th align=left>Type&nbsp;</th><th align=left>Max. speed (mph)&nbsp;</th><th align=left>Description</th></tr>
   593 <tr><th align=left>Type&nbsp;</th><th align=left>Max. speed (mph)&nbsp;</th><th align=left>Description</th></tr>
   584 <tr><td nowrap valign=top><tt>0</tt>&nbsp; </td><td align=center>20</td><td align=left>wooden</td></tr>
   594 <tr><td nowrap valign=top><tt>0</tt>&nbsp; </td><td align=center>20</td><td align=left>wooden</td></tr>
   585 <tr><td nowrap valign=top><tt>1</tt>&nbsp; </td><td align=center>30</td><td align=left>concrete</td></tr>
   595 <tr><td nowrap valign=top><tt>1</tt>&nbsp; </td><td align=center>30</td><td align=left>concrete</td></tr>
   586 <tr><td nowrap valign=top><tt>2</tt>&nbsp; </td><td align=center>40</td><td align=left>girder, steel</td></tr>
   596 <tr><td nowrap valign=top><tt>2</tt>&nbsp; </td><td align=center>40</td><td align=left>girder, steel</td></tr>
   591 <tr><td nowrap valign=top><tt>7</tt>&nbsp; </td><td align=center>130</td><td align=left>cantilever, steel</td></tr>
   601 <tr><td nowrap valign=top><tt>7</tt>&nbsp; </td><td align=center>130</td><td align=left>cantilever, steel</td></tr>
   592 <tr><td nowrap valign=top><tt>8</tt>&nbsp; </td><td align=center>150</td><td align=left>cantilever, steel</td></tr>
   602 <tr><td nowrap valign=top><tt>8</tt>&nbsp; </td><td align=center>150</td><td align=left>cantilever, steel</td></tr>
   593 <tr><td nowrap valign=top><tt>9</tt>&nbsp; </td><td align=center>160</td><td align=left>girder, steel</td></tr>
   603 <tr><td nowrap valign=top><tt>9</tt>&nbsp; </td><td align=center>160</td><td align=left>girder, steel</td></tr>
   594 <tr><td nowrap valign=top><tt>A</tt>&nbsp; </td><td align=center>200</td><td align=left>tubular, steel</td></tr>
   604 <tr><td nowrap valign=top><tt>A</tt>&nbsp; </td><td align=center>200</td><td align=left>tubular, steel</td></tr>
   595 </table></li>
   605 </table></li>
   596 <li>map3_hi bit 7 set = on snow or desert</li>
   606 <li>m4 bit 7 set = on snow or desert</li>
   597 </ul>
   607 </ul>
   598 </td></tr>
   608 </td></tr>
   599 
   609 
   600 <tr><td valign=top nowrap><a name="ClassA"><tt> A </tt></a></td><td>
   610 <tr><td valign=top nowrap><a name="ClassA"><tt> A </tt></a></td><td>
   601 <ul>
   611 <ul>
   602 <li>map5: tile type:
   612 <li>m5: tile type:
   603 <table>
   613 <table>
   604 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>transmitter</td></tr>
   614 <tr><td nowrap valign=top><tt>00</tt>&nbsp; </td><td align=left>transmitter</td></tr>
   605 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>lighthouse</td></tr>
   615 <tr><td nowrap valign=top><tt>01</tt>&nbsp; </td><td align=left>lighthouse</td></tr>
   606 <tr><td nowrap valign=top><tt>02</tt>&nbsp; </td><td align=left>company statue</td></tr>
   616 <tr><td nowrap valign=top><tt>02</tt>&nbsp; </td><td align=left>company statue</td></tr>
   607 <tr><td nowrap valign=top><tt>03</tt>&nbsp; </td><td align=left>company-owned land</td></tr>
   617 <tr><td nowrap valign=top><tt>03</tt>&nbsp; </td><td align=left>company-owned land</td></tr>
   608 <tr><td nowrap valign=top><tt>80</tt>..<tt>93</tt>&nbsp; </td><td align=left>company headquarters (5 sets of 4 tiles each, updated quarterly depending on the company performance)</td></tr>
   618 <tr><td nowrap valign=top><tt>80</tt>..<tt>93</tt>&nbsp; </td><td align=left>company headquarters (5 sets of 4 tiles each, updated quarterly depending on the company performance)</td></tr>
   609 </table>
   619 </table>
   610 </li>
   620 </li>
   611 <li>map_owner: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
   621 <li>owner: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
   612 </ul>
   622 </ul>
   613 </td></tr>
   623 </td></tr>
   614 
   624 
   615 <tr><td colspan=2>
   625 <tr><td colspan=2>
   616 Classes <tt>B</tt> through <tt>F</tt> are reserved. The presence of a tile in one of the reserved classes will crash OTTD.
   626 Classes <tt>B</tt> through <tt>F</tt> are reserved. The presence of a tile in one of the reserved classes will crash OTTD.