Simplify calls to CalcClosestTownFromTile
[openttd/fttd.git] / docs / landscape.html
blobdee873afce451c0deb92a0bb13275ba9f5a0180d
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
4 <html>
6 <head>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8 <meta http-equiv="Content-Stype-Type" content="text/css">
9 <meta name="Author" content="Cirdan">
10 <meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays">
11 <style type="text/css">
12 body { text-align: justify; }
13 table { text-align: center; margin: auto; border-collapse: collapse; }
14 thead { text-align: center; margin: auto; }
15 td, th { border: solid thin; padding: 2px 5px; }
16 td.text, th.text { text-align: justify; }
17 span.head { background-color: cyan; }
18 span.free { background-color: lime; }
19 span.abuse { background-color: red; }
20 .mono { font-family: monospace; }
21 table.bitmap td { font-family: monospace; }
22 table.bitmap td.text { font-family: inherit; }
23 table.bitmap td a { text-decoration: none; }
24 </style>
25 </head>
27 <body>
29 <h1>Landscape</h1>
31 <p>
32 Seven attributes hold the information about a tile. These attributes are
33 <b>type_height</b>, <b>m0</b>, <b>m1</b>, <b>m2</b>, <b>m3</b>, <b>m4</b>,
34 <b>m5</b> and <b>m7</b>.
35 </p>
37 <p>
38 The attribute <b>type_height</b> contains the height of a tile stored in
39 its lower 4 bits. The slope of a tile is computed combining its height
40 with the heights of its neighbours. The higher bits of <b>type_height</b>
41 may contain additional information depending on the climate; currently,
42 the higher 2 bits contain the zone information in the tropical climate.
43 </p>
45 <table>
46 <tr> <th> type_height (8)
47 <tr> <td class="mono"> 7654-3210
48 <tr> <td class="mono">
49 <span title="Zone">zz</span>00-<span title="Tile height (0&ndash;15)">hhhh</span>
50 </table>
52 <p>
53 The zones currently defined for the tropical climate are the following.
54 </p>
56 <table class="field">
57 <tr> <th> Value <th> Meaning
58 <tr> <td class="mono"> 00 <td class="text"> Normal
59 <tr> <td class="mono"> 01 <td class="text"> Desert
60 <tr> <td class="mono"> 02 <td class="text"> Rain forest
61 </table>
64 <h2>Tile contents</h2>
66 <p>
67 The attributes <b>m0</b> &hellip; <b>m7</b> define the contents of a tile
68 proper, ie, what is built on the tile. Generally speaking, the higher bits
69 of <b>m0</b> determine the kind of object that is on the tile (its "class").
70 Also, the lower 2 bits of <b>m0</b> record whether there is a bridge over
71 the tile, for tile classes that allow this. <b>m1</b> contains the owner
72 of the tile and, for tile classes representing an indexed object,
73 <b>m2</b> contains the index of this object into the corresponding array.
74 The values of <b>m3</b>, <b>m4</b>, <b>m5</b> and <b>m7</b> are highly
75 dependent on the object class.
76 </p>
78 <p>
79 The following table describes the full encoding used in storing objects
80 into the tile structure; the possible values for each field are described
81 below.
82 </p>
84 <p>
85 <i>Legend:</i>
86 <span class="head"><span class="mono">XX</span></span> class mark;
87 <span class="free"><span class="mono">00</span></span> free;
88 <span class="abuse"><span class="mono">XX</span></span> abused
89 for different purposes
90 </p>
92 <table class="bitmap">
93 <tr> <th colspan="2" class="text"> Object type <th> m0 (8)
94 <th> m1 (8) <th> m2 (16) <th> m3 (8) <th> m4 (8) <th> m5 (8) <th> m7 (8)
95 <tr> <th colspan="2" class="text"> Bits
96 <td> 7654-3210 <td> 7654-3210 <td> FEDC-BA98-7654-3210
97 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210
99 <!-- misc -->
101 <!-- void -->
102 <tr>
103 <td colspan="2" class="text"> Void
104 <td> <span class="head">0000</span>-<span class="free">0000</span>
105 <td> <span class="head">00</span><span class="free">00-0000</span>
106 <td> <span class="free">0000-0000-0000-0000</span>
107 <td> <span class="free">0000-0000</span>
108 <td> <span class="free">0000-0000</span>
109 <td> <span class="free">0000-0000</span>
110 <td> <span class="free">0000-0000</span>
112 <!-- ground -->
113 <tr> <td rowspan="3" class="text"> Ground
115 <!-- fields -->
116 <td class="text"> Fields
117 <td> <span class="head">0000</span>-<span class="free">00</span><a
118 href="#bridgeabove" title="Bridge above">/\</a>
119 <td> <span class="head">01</span><span class="free">0</span><a
120 href="#owner" title="Owner">[ownr]</a>
121 <td> <span title="Industry index of farm">[-industry-index--]</span>
122 <td> <span title="Field type (0&hellip;9)">[ft]</span>-<a
123 href="#counter" title="Update counter">[##]</a>
124 <td> <a href="#hedge" title="Hedge on SW border">[h]</a><a
125 href="#hedge" title="Hedge on SE border">[-h]</a><span
126 class="free">00</span>
127 <td> <a href="#hedge" title="Hedge on NE border">[h]</a><a
128 href="#hedge" title="Hedge on NW border">[-h]</a><span
129 class="free">00</span>
130 <td rowspan="2"> <span class="free">0000-0000</span>
132 <!-- clear -->
133 <tr> <td class="text"> Clear
134 <td> <span class="head">0000</span>-<span class="free">00</span><a
135 href="#bridgeabove" title="Bridge above">/\</a>
136 <td> <span class="head">10</span><span class="free">0</span><a
137 href="#owner" title="Owner">[ownr]</a>
138 <td rowspan="2"> <span class="free">0000-0000-0000-0000</span>
139 <td rowspan="2"> <a href="#ground" title="Ground type">[gt]</a>-<a
140 href="#counter" title="Update counter">[##]</a>
141 <td rowspan="2"> <span class="free">0000-00</span><a
142 href="#ground" title="Ground and density">%%</a>
143 <td> <span class="free">0000-0000</span>
145 <!-- trees -->
146 <tr> <td class="text"> Trees
147 <td> <span class="head">0000</span>-<span class="free">0000</span>
148 <td> <span class="head">11</span><span class="free">0</span><a
149 href="#owner" title="Owner">[ownr]</a>
150 <td> <a href="#trees" title="Number of trees">[number-]</a>
151 <td> <a href="#trees" title="Types of trees">[-types-]</a>
153 <!-- objects -->
154 <tr> <td class="text" colspan="2"> Objects
155 <td> <span class="head">0001</span>-<span class="free">00</span><a
156 href="#bridgeabove" title="Bridge above">/\</a>
157 <td> <span class="free">0</span><span
158 title="Water class (sea, canal or river)">~~</span><a
159 href="#owner" title="Owner">[ownr]</a>
160 <td> <span title="Object index (lower 16 bits)">[-object-index-lo-]</span>
161 <td> <span title="Random data">[random-]</span>
162 <td> <span class="free">0000-0000</span>
163 <td> <span title="Object index (higher 8 bits)">[indexhi]</span>
164 <td> <span title="Animation frame">[-frame-]</span>
166 <!-- water -->
167 <tr> <td class="text" colspan="2"> Water
168 <td> <span class="head">0010</span>-<span class="free">00</span><a
169 href="#bridgeabove" title="Bridge above">/\</a>
170 <td> <span class="free">0</span><span
171 title="Water class (sea, canal or river)">~~</span><a
172 href="#owner" title="Owner">[ownr]</a>
173 <td> <span class="free">0000-0000-0000-0000</span>
174 <td> <span title="Random data for canal or river tiles">[random-]</span>
175 <td> <span class="free">0000-0000</span>
176 <td> <a href="#water" title="Tile type">[-type--]</a>
177 <td> <span class="free">0000-0000</span>
179 <!-- (free) -->
180 <tr> <td colspan="2">
181 <td> <span class="head">0011</span>-<span class="free">0000</span>
182 <td> <td> <td> <td> <td> <td>
184 <!-- transport -->
186 <!-- railway track -->
187 <tr> <td class="text" rowspan="2"> Railway
188 <td class="text"> Track
189 <td rowspan="2"> <span class="head">0100</span>-<span
190 class="free">00</span<a href="#bridgeabove"
191 title="Bridge above">/\</a>
192 <td> <span class="head">00</span><span class="free">0</span><a
193 href="#owner" title="Owner">[ownr]</a>
194 <td> <span class="free">0000</span>-<a href="#pbs"
195 title="PBS reservation">[!!]</a>-<span class="free">00</span><a
196 href="#trackmask" title="Track layout bitmask">[-pcs-]</a>
197 <td> <a href="#fence" title="Ground and fence">[gf]</a>-<a
198 href="#track" title="Track type">[tt]</a>
199 <td rowspan="2"> <a href="#signal" title="First signal">[signal1]</a>
200 <td rowspan="2"> <span class="free">0000</span>-<a href="#track"
201 title="Second track type">[tt]</a>
202 <td rowspan="2"> <a href="#signal" title="Second signal">[signal2]</a>
203 <tr> <td class="text"> Bridgehead
204 <td> <span class="head">01</span><span class="free">0</span><a
205 href="#owner" title="Owner">[ownr]</a>
206 <td> <a href="#bridge" title="Bridge type">[bt]</a>-<a href="#pbs"
207 title="PBS reservation">[!!]</a>-<span class="free">0</span><span
208 title="PBS reservation for bridge">!</span><a href="#trackmask"
209 title="Track layout bitmask">[-pcs-]</a>
210 <td> <a href="#direction" title="Bridge direction">&lt;&gt;</a><span
211 class="free">0</span><span title="On snow or desert">g</span>-<a
212 href="#track" title="Track type">[tt]</a>
214 <!-- road -->
215 <tr> <td class="text" rowspan="2"> Road
216 <td class="text"> Road
217 <td rowspan="2"> <span class="head">0101</span>-<span
218 class="free">00</span><a href="#bridgeabove"
219 title="Bridge above">/\</a>
220 <td> <span class="head">00</span><span class="free">0</span><a
221 href="#owner" title="Road owner">[ownr]</a>
222 <td rowspan="2"> <span
223 title="Town index (owning town if town-owned, else nearest town)"
224 >[---town-index----]</span>
225 <td> <span
226 title="One-way status, disallow driving to the north">^</span><span
227 title="One-way status, disallow driving to the south">v</span><span
228 class="free">0</span><span
229 title="On snow or desert">g</span>-<span title="Reserved">XXXX</span>
230 <td rowspan="2"> <a href="#roadmask" title="Tram layout">[l1]</a>-<a
231 href="#roadmask" title="Road layout">[l0]</a>
232 <td> <span title="Reserved">X</span><a href="#pavement"
233 title="Ground and pavement">[p]</a>-<a href="#owner"
234 title="Tramway owner">[o1]</a>
235 <td> <a href="#roadbits" title="Present road types">==</a><span
236 title="Reserved">XX</span>-<span
237 title="Roadworks counter">[rw]</span>
238 <tr> <td class="text"> Bridgehead
239 <td> <span class="head">01</span><span class="free">0</span><a
240 href="#owner" title="Road owner">[ownr]</a>
241 <td> <a href="#direction" title="Bridge direction">&lt;&gt;</a><span
242 class="free">0</span><span
243 title="On snow or desert">g</span>-<span
244 title="Reserved">XXXX</span>
245 <td> <span title="Reserved">X</span><span class="free">000</span>-<a
246 href="#owner" title="Tramway owner">[o1]</a>
247 <td> <a href="#roadbits" title="Present road types">==</a><span
248 title="Reserved">XX</span>-<a href="#bridge"
249 title="Bridge type">[bt]</a>
251 <!-- level crossing -->
252 <tr> <td class="text" colspan="2"> Level crossing
253 <td rowspan="4"> <span class="head">0110</span>-<span
254 class="free">00</span><a href="#bridgeabove"
255 title="Bridge above">/\</a>
256 <td> <span class="head">00</span><span class="free">0</span><a
257 href="#owner" title="Track owner">[ownr]</a>
258 <td> <span
259 title="Town index (owning town if road is town-owned, else nearest town)"
260 >[---town-index----]</span>
261 <td> <span class="free">000</span><span
262 title="On snow or desert">g</span>-<a href="#track"
263 title="Track type">[tt]</a>
264 <td> <span title="PBS reservation">!</span><span
265 title="Crossing lights on">:</span><span
266 title="Direction (set: Y)">x</span><span class="free">0-0000</span>
267 <td> <span title="Reserved">X</span><a href="#pavement"
268 title="Ground and pavement">[p]</a>-<a href="#owner"
269 title="Tramway owner">[o1]</a>
270 <td> <a href="#roadbits" title="Present road types">==</a><span
271 title="Reserved">X</span><a href="#owner" title="Road owner">[own0]</a>
273 <!-- aqueduct -->
274 <tr> <td class="text" colspan="2"> Aqueduct
275 <td> <span class="head">01</span><span class="free">0</span><a
276 href="#owner" title="Owner">[ownr]</a>
277 <td> <span class="free">0000-0000-0000-0000</span>
278 <td> <a href="#direction" title="Tunnel direction">&lt;&gt;</a><span
279 class="free">0</span><span title="On snow or desert">g</span>-<span
280 class="free">0000</span>
281 <td> <span class="free">0000-0000</span>
282 <td> <span class="free">0000-0000</span>
283 <td> <span class="free">0000-0000</span>
285 <!-- simple tunnel -->
286 <tr> <td class="text" rowspan="2"> Tunnel
287 <td class="text"> Railway
288 <td rowspan="2"> <span class="head">10</span><span class="free">0</span><a
289 href="#owner" title="Owner">[ownr]</a>
290 <td rowspan="2"> <span class="free">0000-0000-0000-0000</span>
291 <td> <a href="#direction" title="Tunnel direction">&lt;&gt;</a><span
292 class="free">0</span><span title="On snow or desert">g</span>-<a
293 href="#track" title="Track type">[tt]</a>
294 <td rowspan="2"> <span class="free">0000-0000</span>
295 <td> <span class="head">00</span><span class="free"></span><span
296 title="PBS reservation for tunnel">!</span><span
297 title="PBS reservation for tunnelhead">!</span>-<span
298 class="free">0000</span>
299 <td> <span class="free">0000-0000</span>
300 <tr>
301 <td class="text"> Road
302 <td> <a href="#direction" title="Tunnel direction">&lt;&gt;</a><span
303 class="free">0</span><span title="On snow or desert">g</span>-<span
304 class="free">0000</span>
305 <td> <span class="head">01</span><span class="free">00</span>-<a
306 href="#owner" title="Tramway owner">[o1]</a>
307 <td> <a href="#roadbits" title="Present road types">==</a><span
308 title="Reserved">X</span><a
309 href="#owner" title="Road owner">[own0]</a>
311 <!-- ground depots -->
312 <tr> <td class="text" colspan="2"> Railway depot
313 <td rowspan="2"> <span class="head">0110</span>-<span
314 class="free">0000</span>
315 <td> <span class="head">110</span><a
316 href="#owner" title="Owner">[ownr]</a>
317 <td rowspan="2"> <span title="Nearest town index">[---depot-index---]</span>
318 <td> <span class="free">000</span><span
319 title="On snow or desert">g</span>-<a
320 href="#track" title="Track type">[tt]</a>
321 <td rowspan="2"> <span class="free">0000-0000</span>
322 <td> <span class="free">000</span><span
323 title="PBS reservation">!</span>-<span class="free">00</span><a
324 href="#direction" title="Direction">&lt;&gt;</a>
325 <td> <span class="free">0000-0000</span>
326 <tr> <td class="text" colspan="2"> Road depot
327 <td> <span class="head">111</span><a
328 href="#owner" title="Owner">[ownr]</a>
329 <td> <span class="free">000</span><span
330 title="On snow or desert">g</span>-<span class="free">0000</span>
331 <td> <span class="free">0000-00</span><a href="#direction"
332 title="Direction">&lt;&gt;</a>
333 <td> <a href="#roadbits" title="Present road types">==</a><span
334 class="free">00-0000</span>
336 <!-- station -->
337 <tr> <td rowspan="8" class="text"> Station
339 <td class="text"> Railway
340 <td> <span class="head">0111-000</span><span
341 title="PBS reservation">!</span>
342 <td rowspan="8"> <span class="free">0</span><span
343 title="Water class (sea, canal or river)">~~</span><a
344 href="#owner" title="Owner">[ownr]</a>
345 <td rowspan="8"> <span title="Station index">[--station-index--]</span>
346 <td rowspan="2"> <span title="Persistent random data">[rd]</span>-<a
347 href="#track" title="Track type">[tt]</a>
348 <td rowspan="8"> <span
349 title="Custom station id (0 for standard)">[custom-]</span>
350 <td rowspan="8"> <span title="Graphics index">[-graph-]</span>
351 <td rowspan="2"> <span title="Animation frame">[-frame-]</span>
353 <tr> <td class="text"> Waypoint
354 <td> <span class="head">0111-111</span><span
355 title="PBS reservation">!</span>
357 <tr> <td class="text"> Lorry
358 <td> <span class="head">0111-010</span><span class="free">0</span>
359 <td rowspan="2"> <a href="#owner"
360 title="Tramway owner">[o1]</a>-<span title="Reserved">XXXX</span>
361 <td rowspan="2"> <a href="#roadbits" title="Present road types">==</a><span
362 title="Reserved">X</span><a
363 href="#owner" title="Road owner">[own0]</a>
365 <tr> <td class="text"> Bus
366 <td> <span class="head">0111-011</span><span class="free">0</span>
368 <tr> <td class="text"> Oilrig
369 <td> <span class="head">0111-100</span><span class="free">0</span>
370 <td rowspan="3"> <span class="free">0000-0000</span>
371 <td rowspan="3"> <span class="free">0000-0000</span>
373 <tr> <td class="text"> Dock
374 <td> <span class="head">0111-101</span><span class="free">0</span>
376 <tr> <td class="text"> Buoy
377 <td> <span class="head">0111-110</span><span class="free">0</span>
379 <tr> <td class="text"> Airport
380 <td> <span class="head">0111-001</span><span class="free">0</span>
381 <td> <span title="Persistent random data">[rd]</span>-<span
382 class="free">0000</span>
383 <td> <span title="Animation frame">[-frame-]</span>
385 <!-- industries -->
386 <tr> <td colspan="2" class="text"> <a href="#industries">Industry</a>
387 <td> <span class="head">10</span><span class="free">00</span>-XXXX
388 <td> <span title="Complete">X</span><span
389 title="Water class (sea, canal or river)">~~</span><span
390 class="free">0</span>-<span class="abuse">XXXX</span>
391 <td> <span title="Industry index">[-industry-index--]</span>
392 <td> <span title="Random data">[random-]</span>
393 <td> <span title="Animation loop">[-anim--]</span>
394 <td> XXXX-XXXX
395 <td> <span title="Animation frame">[-frame-]</span>
397 <!-- houses -->
398 <tr> <td colspan="2" class="text"> <a href="#houses">House</a>
399 <td> <span class="head">11</span><span class="free">0</span>X-XXXX
400 <td> XX<span class="abuse">XX-XXXX</span>
401 <td> <span title="Town index">[---town-index----]</span>
402 <td> <span title="Random data">[random-]</span>
403 <td> XXXX-XXXX
404 <td> XXX<span class="abuse">X-XXXX</span>
405 <td> XXXX-<span class="abuse">XXXX</span>
407 <tr> <th colspan="2" class="text"> Bits
408 <td> 7654-3210 <td> 7654-3210 <td> FEDC-BA98-7654-3210
409 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210
410 </table>
413 <h2>Field values</h2>
415 <h3 id="bridgeabove">Bridge above</h3>
418 Whether there is a bridge above the tile, and its direction.
419 </p>
421 <table class="field">
422 <tr> <th> Value <th> Meaning
423 <tr> <td class="mono"> 00 <td class="text"> No bridge
424 <tr> <td class="mono"> 01 <td class="text"> Bridge along X axis
425 <tr> <td class="mono"> 10 <td class="text"> Bridge along Y axis
426 </table>
429 <h3 id="direction">Direction</h3>
431 <table class="field">
432 <tr> <th> Value <th> Meaning
433 <tr> <td class="mono"> 0 <td class="text"> NE
434 <tr> <td class="mono"> 1 <td class="text"> SE
435 <tr> <td class="mono"> 2 <td class="text"> SW
436 <tr> <td class="mono"> 3 <td class="text"> NW
437 </table>
440 <h3 id="owner">Owner</h3>
443 Owner of the tile or piece of road.
444 </p>
446 <table class="field">
447 <tr> <th> Value <th> Meaning
448 <tr> <td class="mono"> 00&hellip;0E <td class="text"> Companies
449 <tr> <td class="mono"> 0F <td class="text"> Town
450 <tr> <td class="mono"> 10 <td class="text"> Nobody
451 <tr> <td class="mono"> 11 <td class="text"> Water
452 <!-- <tr> <td class="mono"> FF <td class="text">
453 Spectator in MP or in scenario editor -->
454 </table>
457 <h3 id="counter">Update counter</h3>
460 An update counter is used in tiles that are to remain in a certain state
461 for a period of time and then change. The counter is increased on every
462 periodic processing of the tile, and the corresponding action is taken
463 when the counter reaches a preset value or wraps around.
464 </p>
467 <h3 id="ground">Ground and density</h3>
470 Ground type (grass, snow, desert, &hellip;) and density for clear or tree
471 tiles.
472 </p>
474 <table class="field">
475 <tr> <th> Value <th> Meaning <th> Densities
476 <tr> <td class="mono"> 0000 <td class="text"> Grass <td> 0&mdash;3
477 <tr> <td class="mono"> 0001 <td class="text"> Shore <td> N/A
478 <tr> <td class="mono"> 0010 <td class="text"> Roughland <td> N/A
479 <tr> <td class="mono"> 0011 <td class="text"> Rocks <td> N/A
480 <tr> <td class="mono"> 0100 <td class="text"> Desert <td> 1, 3
481 <tr> <td class="mono"> 1000 <td class="text"> Snow <td> 0&mdash;3
482 <tr> <td class="mono"> 1010 <td class="text"> Snow-covered roughland <td> 0&mdash;3
483 <tr> <td class="mono"> 1011 <td class="text"> Snow-covered rocks <td> 0&mdash;3
484 </table>
487 <h3 id="hedge">Hedge</h3>
490 Hedge on the border of a tile. It can take the values 1 through&nbsp;6,
491 or 0 for none.
492 </p>
495 <h3 id="trees">Trees</h3>
498 Both the number and type of trees fields jointly determine the set of trees
499 actually displayed at a tile. The lower 3 bits of the number field
500 represent the growth status of the trees (0&hellip;2 for growing; 3 for
501 fully grown; 4&hellip;7 for withering).
502 </p>
505 <h3 id="water">Water tile types</h3>
507 <table class="field">
508 <tr> <th> Value <th> Meaning
509 <tr> <td class="mono"> 00 <td class="text"> Water, canal or river
510 <tr> <td class="mono"> 01 <td class="text"> Coast or riverbank
511 <tr> <td class="mono"> 10 <td class="text"> Canal lock, middle part, SW-NE
512 <tr> <td class="mono"> 11 <td class="text"> Canal lock, middle part, NW-SE
513 <tr> <td class="mono"> 12 <td class="text"> Canal lock, middle part, NE-SW
514 <tr> <td class="mono"> 13 <td class="text"> Canal lock, middle part, SE-NW
515 <tr> <td class="mono"> 14 <td class="text"> Canal lock, lower part, SW-NE
516 <tr> <td class="mono"> 15 <td class="text"> Canal lock, lower part, NW-SE
517 <tr> <td class="mono"> 16 <td class="text"> Canal lock, lower part, NE-SW
518 <tr> <td class="mono"> 17 <td class="text"> Canal lock, lower part, SE-NW
519 <tr> <td class="mono"> 18 <td class="text"> Canal lock, upper part, SW-NE
520 <tr> <td class="mono"> 19 <td class="text"> Canal lock, upper part, NW-SE
521 <tr> <td class="mono"> 1A <td class="text"> Canal lock, upper part, NE-SW
522 <tr> <td class="mono"> 1B <td class="text"> Canal lock, upper part, SE-NW
523 <tr> <td class="mono"> 80 <td class="text"> Ship depot, X direction, NE part
524 <tr> <td class="mono"> 81 <td class="text"> Ship depot, Y direction, SE part
525 <tr> <td class="mono"> 82 <td class="text"> Ship depot, X direction, SW part
526 <tr> <td class="mono"> 83 <td class="text"> Ship depot, Y direction, NW part
527 </table>
530 <h3 id="bridge">Bridge types</h3>
532 <table class="field">
533 <tr> <th> Value <th> Max. speed (mph) <th> Meaning
534 <tr> <td class="mono"> 0 <td> 20 <td class="text"> Wooden
535 <tr> <td class="mono"> 1 <td> 30 <td class="text"> Concrete
536 <tr> <td class="mono"> 2 <td> 40 <td class="text"> Girder, steel
537 <tr> <td class="mono"> 3 <td> 50 <td class="text"> Suspension, concrete
538 <tr> <td class="mono"> 4 <td> 60 <td class="text"> Suspension, steel
539 <tr> <td class="mono"> 5 <td> 70 <td class="text"> Suspension, steel
540 <tr> <td class="mono"> 6 <td> 100 <td class="text"> Cantilever, steel
541 <tr> <td class="mono"> 7 <td> 130 <td class="text"> Cantilever, steel
542 <tr> <td class="mono"> 8 <td> 150 <td class="text"> Cantilever, steel
543 <tr> <td class="mono"> 9 <td> 160 <td class="text"> Girder, steel
544 <tr> <td class="mono"> A <td> 200 <td class="text"> Tubular, steel
545 <tr> <td class="mono"> B <td> 320 <td class="text"> Tubular, steel
546 <tr> <td class="mono"> C <td> 380 <td class="text"> Tubular, silicon
547 </table>
550 <h3 id="track">Track types</h3>
552 <table class="field">
553 <tr> <th> Value <th> Meaning
554 <tr> <td class="mono"> 0 <td class="text"> Conventional railway
555 <tr> <td class="mono"> 1 <td class="text"> Electrified railway
556 <tr> <td class="mono"> 2 <td class="text"> Monorail
557 <tr> <td class="mono"> 3 <td class="text"> Maglev
558 </table>
561 <h3 id="trackmask">Track layout</h3>
563 <table class="field">
564 <tr> <th> Bit <th> Track present
565 <tr> <td class="mono"> 01 <td class="text"> X direction
566 <tr> <td class="mono"> 02 <td class="text"> Y direction
567 <tr> <td class="mono"> 04 <td class="text"> North corner (WE)
568 <tr> <td class="mono"> 08 <td class="text"> South corner (WE)
569 <tr> <td class="mono"> 10 <td class="text"> West corner (NS)
570 <tr> <td class="mono"> 20 <td class="text"> East corner (NS)
571 </table>
574 <h3 id="pbs">PBS track reservations</h3>
576 <table class="field">
577 <tr> <th> Value <th> Reserved track
578 <tr> <td class="mono"> 0 <td class="text"> None
579 <tr> <td class="mono"> 1 <td class="text"> X direction
580 <tr> <td class="mono"> 2 <td class="text"> Y direction
581 <tr> <td class="mono"> 5 <td class="text"> North corner (WE)
582 <tr> <td class="mono"> 6 <td class="text"> South corner (WE)
583 <tr> <td class="mono"> 7 <td class="text"> North and south corners
584 <tr> <td class="mono"> 9 <td class="text"> West corner (NS)
585 <tr> <td class="mono"> 10 <td class="text"> East corner (NS)
586 <tr> <td class="mono"> 11 <td class="text"> West and east corners
587 </table>
590 <h3 id="fence">Ground and fence for railway tracks</h3>
592 <table class="field">
593 <tr> <th> Value <th> Meaning
594 <tr> <td class="mono"> 0 <td class="text"> Bareland
595 <tr> <td class="mono"> 1 <td class="text"> Grass, no fence
596 <tr> <td class="mono"> 2 <td class="text"> Fence on the NW side
597 <tr> <td class="mono"> 3 <td class="text"> Fence on the SE side
598 <tr> <td class="mono"> 4 <td class="text"> Fences on the NW and SE sides
599 <tr> <td class="mono"> 5 <td class="text"> Fence on the NE side
600 <tr> <td class="mono"> 6 <td class="text"> Fence on the SW side
601 <tr> <td class="mono"> 7 <td class="text"> Fences on the NE and SW sides
602 <tr> <td class="mono"> 8 <td class="text"> Fence on the E side
603 <tr> <td class="mono"> 9 <td class="text"> Fence on the W side
604 <tr> <td class="mono"> A <td class="text"> Fence on the S side
605 <tr> <td class="mono"> B <td class="text"> Fence on the N side
606 <tr> <td class="mono"> C <td class="text"> Snow or desert
607 <tr> <td class="mono"> D <td class="text">
608 Grass with fence and shore or water on the free halftile
609 <tr> <td class="mono"> E <td class="text">
610 Higher part on foundation with snow, lower without snow
611 </table>
614 <h3 id="signal">Signals</h3>
616 <table class="field">
617 <tr> <th> Value <th> Meaning
618 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1
619 <td class="text"> First signal is green
620 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;
621 <td class="text"> Second signal is green
622 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;
623 <td class="text"> First signal present
624 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;
625 <td class="text"> Second signal present
626 <tr> <td class="mono"> &nbsp;000&nbsp;&nbsp;&nbsp;&nbsp;
627 <td class="text"> Normal signals
628 <tr> <td class="mono"> &nbsp;001&nbsp;&nbsp;&nbsp;&nbsp;
629 <td class="text"> Pre-signals
630 <tr> <td class="mono"> &nbsp;010&nbsp;&nbsp;&nbsp;&nbsp;
631 <td class="text"> Exit-signals
632 <tr> <td class="mono"> &nbsp;011&nbsp;&nbsp;&nbsp;&nbsp;
633 <td class="text"> Combo-signals
634 <tr> <td class="mono"> &nbsp;100&nbsp;&nbsp;&nbsp;&nbsp;
635 <td class="text"> PBS signals
636 <tr> <td class="mono"> &nbsp;101&nbsp;&nbsp;&nbsp;&nbsp;
637 <td class="text"> PBS one-way signals
638 <tr> <td class="mono"> 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
639 <td class="text"> Semaphore signals
640 </table>
643 <h3 id="roadbits">Present road types</h3>
645 <table class="field">
646 <tr> <th> Bit <th> Meaning
647 <tr> <td class="mono"> 01 <td class="text"> Normal road
648 <tr> <td class="mono"> 10 <td class="text"> Tramway
649 </table>
652 <h3 id="pavement">Ground and pavement for roads</h3>
654 <table class="field">
655 <tr> <th> Value <th> Meaning
656 <tr> <td class="mono"> 0 <td class="text"> On bareland
657 <tr> <td class="mono"> 1 <td class="text"> On grass
658 <tr> <td class="mono"> 2 <td class="text"> Paved
659 <tr> <td class="mono"> 3 <td class="text"> Paved, with streetlights
660 <tr> <td class="mono"> 5 <td class="text"> Paved, tree-lined
661 </table>
664 <h3 id="roadmask">Road layout</h3>
666 <table class="field">
667 <tr> <th> Bit <th> Road piece present
668 <tr> <td class="mono"> 1 <td class="text"> NW piece
669 <tr> <td class="mono"> 2 <td class="text"> SW piece
670 <tr> <td class="mono"> 4 <td class="text"> SE piece
671 <tr> <td class="mono"> 8 <td class="text"> NE piece
672 </table>
675 <h3 id="industries">Industries</h3>
677 <ul>
679 <li> <b>m1</b> bit <b>7</b>: clear: under construction
680 <ul>
681 <li> <b>m1</b> bits <b>6&hellip;5</b>:
682 water class (sea, canal, river or land)
683 <li> <b>m1</b> bits <b>3&hellip;2</b>:
684 construction counter, for buildings under construction incremented
685 on every periodic tile processing
686 <li> <b>m1</b> bits <b>1&hellip;0</b>:
687 stage of construction (3 = completed), incremented when the
688 construction counter wraps around; the meaning is different for
689 some animated tiles which are never under construction
690 (types <span class="mono">01</span>,
691 <span class="mono">1E</span>&hellip;<span class="mono">20</span>,
692 <span class="mono">30</span>, <span class="mono">58</span>)
693 </ul>
695 <li> <b>m2</b>: index into the array of industries
697 <li> <b>m3</b>: random bits (NewGRF)
699 <li> <b>m4</b>: animation loop
701 <li> <b>m5</b>: <a href="landscape_industries.html">industry tile type</a>
702 (with <b>m0</b> bit <b>3</b>)
704 <li> <b>m7</b>: animation frame
706 <li> <b>m0</b> bit <b>3</b>: bit 8 of type (see <b>m5</b>)
708 <li> <b>m0</b> bits <b>2&hellip;0</b>: random triggers (NewGRF)
710 </ul>
713 <h3 id="houses">Houses</h3>
715 <ul>
717 <li> <b>m1</b> bit <b>7</b>:
718 <ul>
719 <li> set: house is complete
720 <ul>
721 <li> <b>m5</b>: age of house in years, clamped at 255
722 </ul>
723 <li> clear: house is under construction
724 <ul>
725 <li> <b>m5</b> bits <b>4&hellip;3</b>: construction stage
726 <li> <b>m5</b> bits <b>2&hellip;0</b>: construction counter
727 </ul>
728 </ul>
730 <li> <b>m1</b> bit <b>6</b>: bit <b>8</b> of house type (see <b>m4</b>),
731 allowing 512 different types.
733 <li> <b>m1</b> bits <b>5&hellip;0</b>:
734 <ul>
735 <li> If <a href="#newhouses">Newhouses</a> is activated:
736 periodic processing time remaining
737 <li> Standard behaviour: lift position (only for houses
738 type <span class="mono">04</span> and <span class="mono">05</span>)
739 </ul>
741 <li> <b>m2</b>: index into the array of towns
743 <li> <b>m3</b>: random bits (<a href="#newhouses">Newhouses</a>)
745 <li> <b>m4</b>: <a href="landscape_houses.html">town building type</a>
746 (with <b>m1</b> bit <b>6</b>)
748 <li> <b>m5</b>: see <b>m1</b> bit <b>7</b>
750 <li> <b>m7</b>:
751 <ul>
752 <li> If <a href="#newhouses">Newhouses</a> is activated:
753 current animation frame
754 <li> Standard behaviour: (only for houses
755 type <span class="mono">04</span> and <span class="mono">05</span>)
756 <ul>
757 <li> bit <b>3</b>: lift has destination when set
758 <li> bits <b>2&hellip;0</b>: lift destination. Values can be
759 0&hellip;6 except 1, so the building has 6 effective floors.
760 This is due to the fact that the first floor is 2 'normal'
761 floors high. One 'normal' floor has a height of 6 lift positions.
762 </ul>
763 </ul>
765 <li> <b>m0</b> bits <b>4&hellip;0</b>: triggers activated
766 (<a href="#newhouses">Newhouses</a>)
768 </ul>
770 <p id="newhouses">
771 Newhouses is the name englobing a newGRF feature developed by TTDPatch devs
772 (mainly Csaboka). It allows the replacement of the properties as well as
773 the graphics of houses in the game. To distinguish between the standard
774 behaviour and the newGRF one, HouseID (<b>m4+m1[6]</b>) is tested for
775 anything above 110. 110 is the count of standard houses, so anything
776 above 110 means that there is a new definition of at least one house.
777 </p>
780 </body>
782 </html>