Store lateness when drawing the arrival/departure panel
[openttd/fttd.git] / docs / landscape.html
blob6c015a1ee021664305351404df92891cb7ef102d
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 .mono { font-family: monospace; }
20 table.bitmap td { font-family: monospace; }
21 table.bitmap td.text { font-family: inherit; }
22 table.bitmap td a { text-decoration: none; }
23 </style>
24 </head>
26 <body>
28 <h1>Landscape</h1>
30 <p>
31 Tile data are stored in two structs, <b>TileZH</b> and <b>Tile</b>.
32 <b>TileZH</b> is used for generic landscape information and has two fields,
33 <b>height</b>, which contains the height of the tile (its northern corner),
34 and <b>zb</b>, which contains the tropical climate zone of the tile in
35 its highest 2 bits and the presence of a bridge over the tile in its lowest
36 2 bits; other bits in this field are currently unused.
37 The slope of a tile is computed combining its height with the heights
38 of its neighbours.
39 </p>
41 <table>
42 <tr> <th> height (8) <th> zone (8)
43 <tr> <td class="mono"> 7654-3210 <td class="mono"> 7654-3210
44 <tr> <td class="mono"> <span title="Tile height">[height-]</span>
45 <td class="mono"> <span title="Zone">zz</span>00-00<span
46 title="Bridge above along Y axis">y</span><span
47 title="Bridge above along X axis">x</span>
48 </table>
50 <p>
51 The zones currently defined for the tropical climate are the following.
52 </p>
54 <table class="field">
55 <tr> <th> Value <th> Meaning
56 <tr> <td class="mono"> 00 <td class="text"> Normal
57 <tr> <td class="mono"> 01 <td class="text"> Desert
58 <tr> <td class="mono"> 02 <td class="text"> Rain forest
59 </table>
61 <p>
62 The possible values for the bridge bits are the following.
63 </p>
65 <table class="field">
66 <tr> <th> Value <th> Meaning
67 <tr> <td class="mono"> 00 <td class="text"> No bridge
68 <tr> <td class="mono"> 01 <td class="text"> Bridge along X axis
69 <tr> <td class="mono"> 10 <td class="text"> Bridge along Y axis
70 </table>
73 <h2>Tile contents</h2>
75 <p>
76 The attributes <b>m0</b> &hellip; <b>m7</b> define the contents of a tile
77 proper, ie, what is built on the tile. Generally speaking, the higher bits
78 of <b>m0</b> determine the kind of object that is on the tile (its "class").
79 Also, the lower 2 bits of <b>m0</b> record whether there is a bridge over
80 the tile, for tile classes that allow this. <b>m1</b> contains the owner
81 of the tile and, for tile classes representing an indexed object,
82 <b>m2</b> contains the index of this object into the corresponding array.
83 The values of <b>m3</b>, <b>m4</b>, <b>m5</b> and <b>m7</b> are highly
84 dependent on the object class.
85 </p>
87 <p>
88 The following table describes the full encoding used in storing objects
89 into the tile structure; the possible values for each field are described
90 below.
91 </p>
93 <p>
94 <i>Legend:</i>
95 <span class="head"><span class="mono">XX</span></span> class mark;
96 <span class="free"><span class="mono">00</span></span> free;
97 </p>
99 <table class="bitmap">
100 <tr> <th colspan="2" class="text"> Object type <th> m0 (8)
101 <th> m1 (8) <th> m2 (16) <th> m3 (8) <th> m4 (8) <th> m5 (8) <th> m7 (8)
102 <tr> <th colspan="2" class="text"> Bits
103 <td> 7654-3210 <td> 7654-3210 <td> FEDC-BA98-7654-3210
104 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210
106 <!-- misc -->
108 <!-- void -->
109 <tr>
110 <td colspan="2" class="text"> Void
111 <td> <span class="head">0000</span>-<span class="free">0000</span>
112 <td> <span class="head">00</span><span class="free">00-0000</span>
113 <td> <span class="free">0000-0000-0000-0000</span>
114 <td> <span class="free">0000-0000</span>
115 <td> <span class="free">0000-0000</span>
116 <td> <span class="free">0000-0000</span>
117 <td> <span class="free">0000-0000</span>
119 <!-- ground -->
120 <tr> <td rowspan="3" class="text"> Ground
122 <!-- fields -->
123 <td class="text"> Fields
124 <td rowspan="3"> <span class="head">0000</span>-<span class="free">0000</span>
125 <td> <span class="head">01</span><span class="free">0</span><a
126 href="#owner" title="Owner">[ownr]</a>
127 <td> <span title="Industry index of farm">[-industry-index--]</span>
128 <td> <span title="Field type (0&hellip;9)">[ft]</span>-<a
129 href="#counter" title="Update counter">[##]</a>
130 <td> <a href="#hedge" title="Hedge on SW border">[h]</a><a
131 href="#hedge" title="Hedge on SE border">[-h]</a><span
132 class="free">00</span>
133 <td> <a href="#hedge" title="Hedge on NE border">[h]</a><a
134 href="#hedge" title="Hedge on NW border">[-h]</a><span
135 class="free">00</span>
136 <td rowspan="2"> <span class="free">0000-0000</span>
138 <!-- clear -->
139 <tr> <td class="text"> Clear
140 <td> <span class="head">10</span><span class="free">0</span><a
141 href="#owner" title="Owner">[ownr]</a>
142 <td rowspan="2"> <span class="free">0000-0000-0000-0000</span>
143 <td rowspan="2"> <a href="#ground" title="Ground type">[gt]</a>-<a
144 href="#counter" title="Update counter">[##]</a>
145 <td rowspan="2"> <span class="free">0000-00</span><a
146 href="#ground" title="Ground and density">%%</a>
147 <td> <span class="free">0000-0000</span>
149 <!-- trees -->
150 <tr> <td class="text"> Trees
151 <td> <span class="head">11</span><span class="free">0</span><a
152 href="#owner" title="Owner">[ownr]</a>
153 <td> <a href="#trees" title="Number of trees">[number-]</a>
154 <td> <a href="#trees" title="Types of trees">[-types-]</a>
156 <!-- objects -->
157 <tr> <td class="text" colspan="2"> Objects
158 <td> <span class="head">0001</span>-<span class="free">0000</span>
159 <td> <span class="free">0</span><span
160 title="Water class (sea, canal or river)">~~</span><a
161 href="#owner" title="Owner">[ownr]</a>
162 <td> <span title="Object index (lower 16 bits)">[-object-index-lo-]</span>
163 <td> <span title="Random data">[random-]</span>
164 <td> <span class="free">0000-0000</span>
165 <td> <span title="Object index (higher 8 bits)">[indexhi]</span>
166 <td> <span title="Animation frame">[-frame-]</span>
168 <!-- water -->
169 <tr> <td class="text" colspan="2"> Water
170 <td> <span class="head">0010</span>-<span class="free">0000</span>
171 <td> <span class="free">0</span><span
172 title="Water class (sea, canal or river)">~~</span><a
173 href="#owner" title="Owner">[ownr]</a>
174 <td> <span title="Depot index (for ship depots)">[---depot-index---]</span>
175 <td> <span title="Random data for canal or river tiles">[random-]</span>
176 <td> <a href="#water" title="Tile type">[-type--]</a>
177 <td> <span class="free">0000-00</span><a href="#direction"
178 title="Direction (for depots and locks)">&lt;&gt;</a>
179 <td> <span class="free">0000-0000</span>
181 <!-- (free) -->
182 <tr> <td colspan="2">
183 <td> <span class="head">0011</span>-<span class="free">0000</span>
184 <td> <td> <td> <td> <td> <td>
186 <!-- transport -->
188 <!-- railway track -->
189 <tr> <td class="text" rowspan="2"> Railway
190 <td class="text"> Track
191 <td rowspan="2"> <span class="head">0100</span>-<span
192 class="free">0000</span>
193 <td> <span class="head">00</span><span class="free">0</span><a
194 href="#owner" title="Owner">[ownr]</a>
195 <td> <span class="free">0000</span>-<a href="#pbs"
196 title="PBS reservation">[!!]</a>-<span class="free">00</span><a
197 href="#trackmask" title="Track layout bitmask">[-pcs-]</a>
198 <td> <a href="#fence" title="Ground and fence">[gf]</a>-<a
199 href="#track" title="Track type">[tt]</a>
200 <td rowspan="2"> <a href="#signal" title="First signal">[signal1]</a>
201 <td rowspan="2"> <span class="free">0000</span>-<a href="#track"
202 title="Second track type">[tt]</a>
203 <td rowspan="2"> <a href="#signal" title="Second signal">[signal2]</a>
204 <tr> <td class="text"> Bridgehead
205 <td> <span class="head">01</span><span class="free">0</span><a
206 href="#owner" title="Owner">[ownr]</a>
207 <td> <a href="#bridge" title="Bridge type">[bt]</a>-<a href="#pbs"
208 title="PBS reservation">[!!]</a>-<span class="free">0</span><span
209 title="PBS reservation for bridge">!</span><a href="#trackmask"
210 title="Track layout bitmask">[-pcs-]</a>
211 <td> <a href="#direction" title="Bridge direction">&lt;&gt;</a><span
212 class="free">0</span><span title="On snow or desert">g</span>-<a
213 href="#track" title="Track type">[tt]</a>
215 <!-- road -->
216 <tr> <td class="text" rowspan="2"> Road
217 <td class="text"> Road
218 <td rowspan="2"> <span class="head">0101</span>-<span
219 class="free">0000</span>
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="6"> <span class="head">0110</span>-<span
254 class="free">0000</span>
255 <td> <span class="head">00</span><span class="free">0</span><a
256 href="#owner" title="Track owner">[ownr]</a>
257 <td> <span
258 title="Town index (owning town if road is town-owned, else nearest town)"
259 >[---town-index----]</span>
260 <td> <span class="free">000</span><span
261 title="On snow or desert">g</span>-<a href="#track"
262 title="Track type">[tt]</a>
263 <td> <span title="PBS reservation">!</span><span
264 title="Crossing lights on">:</span><span
265 title="Direction (set: Y)">x</span><span class="free">0-0000</span>
266 <td> <span title="Reserved">X</span><a href="#pavement"
267 title="Ground and pavement">[p]</a>-<a href="#owner"
268 title="Tramway owner">[o1]</a>
269 <td> <a href="#roadbits" title="Present road types">==</a><span
270 title="Reserved">X</span><a href="#owner" title="Road owner">[own0]</a>
272 <!-- aqueduct -->
273 <tr> <td class="text" colspan="2"> Aqueduct
274 <td> <span class="head">01</span><span class="free">0</span><a
275 href="#owner" title="Owner">[ownr]</a>
276 <td> <span class="free">0000-0000-0000-0000</span>
277 <td> <a href="#direction" title="Tunnel direction">&lt;&gt;</a><span
278 class="free">0</span><span title="On snow or desert">g</span>-<span
279 class="free">0000</span>
280 <td> <span class="free">0000-0000</span>
281 <td> <span class="free">0000-0000</span>
282 <td> <span class="free">0000-0000</span>
284 <!-- simple tunnel -->
285 <tr> <td class="text" rowspan="2"> Tunnel
286 <td class="text"> Railway
287 <td rowspan="2"> <span class="head">10</span><span class="free">0</span><a
288 href="#owner" title="Owner">[ownr]</a>
289 <td rowspan="2"> <span class="free">0000-0000-0000-0000</span>
290 <td> <a href="#direction" title="Tunnel direction">&lt;&gt;</a><span
291 class="free">0</span><span title="On snow or desert">g</span>-<a
292 href="#track" title="Track type">[tt]</a>
293 <td rowspan="2"> <span class="free">0000-0000</span>
294 <td> <span class="head">00</span><span class="free"></span><span
295 title="PBS reservation for tunnel">!</span><span
296 title="PBS reservation for tunnelhead">!</span>-<span
297 class="free">0000</span>
298 <td> <span class="free">0000-0000</span>
299 <tr>
300 <td class="text"> Road
301 <td> <a href="#direction" title="Tunnel direction">&lt;&gt;</a><span
302 class="free">0</span><span title="On snow or desert">g</span>-<span
303 class="free">0000</span>
304 <td> <span class="head">01</span><span class="free">00</span>-<a
305 href="#owner" title="Tramway owner">[o1]</a>
306 <td> <a href="#roadbits" title="Present road types">==</a><span
307 title="Reserved">X</span><a
308 href="#owner" title="Road owner">[own0]</a>
310 <!-- ground depots -->
311 <tr> <td class="text" colspan="2"> Railway depot
312 <td> <span class="head">110</span><a
313 href="#owner" title="Owner">[ownr]</a>
314 <td rowspan="2"> <span title="Depot index">[---depot-index---]</span>
315 <td> <span class="free">000</span><span
316 title="On snow or desert">g</span>-<a
317 href="#track" title="Track type">[tt]</a>
318 <td rowspan="2"> <span class="free">0000-0000</span>
319 <td> <span class="free">000</span><span
320 title="PBS reservation">!</span>-<span class="free">00</span><a
321 href="#direction" title="Direction">&lt;&gt;</a>
322 <td> <span class="free">0000-0000</span>
323 <tr> <td class="text" colspan="2"> Road depot
324 <td> <span class="head">111</span><a
325 href="#owner" title="Owner">[ownr]</a>
326 <td> <span class="free">000</span><span
327 title="On snow or desert">g</span>-<span class="free">0000</span>
328 <td> <span class="free">0000-00</span><a href="#direction"
329 title="Direction">&lt;&gt;</a>
330 <td> <a href="#roadbits" title="Present road types">==</a><span
331 class="free">00-0000</span>
333 <!-- station -->
334 <tr> <td rowspan="8" class="text"> Station
336 <td class="text"> Railway
337 <td> <span class="head">0111-000</span><span
338 title="PBS reservation">!</span>
339 <td rowspan="8"> <span class="free">0</span><span
340 title="Water class (sea, canal or river)">~~</span><a
341 href="#owner" title="Owner">[ownr]</a>
342 <td rowspan="8"> <span title="Station index">[--station-index--]</span>
343 <td rowspan="2"> <span title="Persistent random data">[rd]</span>-<a
344 href="#track" title="Track type">[tt]</a>
345 <td rowspan="8"> <span
346 title="Custom station id (0 for standard)">[custom-]</span>
347 <td rowspan="8"> <span title="Graphics index">[-graph-]</span>
348 <td rowspan="2"> <span title="Animation frame">[-frame-]</span>
350 <tr> <td class="text"> Waypoint
351 <td> <span class="head">0111-111</span><span
352 title="PBS reservation">!</span>
354 <tr> <td class="text"> Lorry
355 <td> <span class="head">0111-010</span><span class="free">0</span>
356 <td rowspan="2"> <a href="#owner"
357 title="Tramway owner">[o1]</a>-<span title="Reserved">XXXX</span>
358 <td rowspan="2"> <a href="#roadbits" title="Present road types">==</a><span
359 title="Reserved">X</span><a
360 href="#owner" title="Road owner">[own0]</a>
362 <tr> <td class="text"> Bus
363 <td> <span class="head">0111-011</span><span class="free">0</span>
365 <tr> <td class="text"> Oilrig
366 <td> <span class="head">0111-100</span><span class="free">0</span>
367 <td rowspan="3"> <span class="free">0000-0000</span>
368 <td rowspan="3"> <span class="free">0000-0000</span>
370 <tr> <td class="text"> Dock
371 <td> <span class="head">0111-101</span><span class="free">0</span>
373 <tr> <td class="text"> Buoy
374 <td> <span class="head">0111-110</span><span class="free">0</span>
376 <tr> <td class="text"> Airport
377 <td> <span class="head">0111-001</span><span class="free">0</span>
378 <td> <span title="Persistent random data">[rd]</span>-<span
379 class="free">0000</span>
380 <td> <span title="Animation frame">[-frame-]</span>
382 <!-- industries -->
383 <tr> <td colspan="2" class="text"> <a href="#industries">Industry</a>
384 <td> <span class="head">10</span><span class="free">00</span>-<span
385 title="Tile type most significant bit">@</span><span
386 title="Triggers">[*]</span>
387 <td> <span title="Complete">+</span><span
388 title="Water class (sea, canal or river)">~~</span><span
389 class="free">0</span>-<span
390 title="Construction stage and counter">%%%%</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> <span title="Tile type">[tile-id]</span>
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><span
400 title="Triggers">[****]</span>
401 <td> <span title="Complete">+</span><span
402 title="Building type most significant bit">@</span><span
403 title="Processing time or lift position">[timer]</span>
404 <td> <span title="Town index">[---town-index----]</span>
405 <td> <span title="Random data">[random-]</span>
406 <td> <span title="Building type">[-house-]</span>
407 <td> <span
408 title="House age or construction stage and counter">[--age--]</span>
409 <td> <span title="Animation frame or lift destination">[-frame-]</span>
411 <tr> <th colspan="2" class="text"> Bits
412 <td> 7654-3210 <td> 7654-3210 <td> FEDC-BA98-7654-3210
413 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210 <td> 7654-3210
414 </table>
417 <h2>Field values</h2>
419 <h3 id="direction">Direction</h3>
421 <table class="field">
422 <tr> <th> Value <th> Meaning
423 <tr> <td class="mono"> 0 <td class="text"> NE
424 <tr> <td class="mono"> 1 <td class="text"> SE
425 <tr> <td class="mono"> 2 <td class="text"> SW
426 <tr> <td class="mono"> 3 <td class="text"> NW
427 </table>
430 <h3 id="owner">Owner</h3>
433 Owner of the tile or piece of road.
434 </p>
436 <table class="field">
437 <tr> <th> Value <th> Meaning
438 <tr> <td class="mono"> 00&hellip;0E <td class="text"> Companies
439 <tr> <td class="mono"> 0F <td class="text"> Town
440 <tr> <td class="mono"> 10 <td class="text"> Nobody
441 <tr> <td class="mono"> 11 <td class="text"> Water
442 <!-- <tr> <td class="mono"> FF <td class="text">
443 Spectator in MP or in scenario editor -->
444 </table>
447 <h3 id="counter">Update counter</h3>
450 An update counter is used in tiles that are to remain in a certain state
451 for a period of time and then change. The counter is increased on every
452 periodic processing of the tile, and the corresponding action is taken
453 when the counter reaches a preset value or wraps around.
454 </p>
457 <h3 id="ground">Ground and density</h3>
460 Ground type (grass, snow, desert, &hellip;) and density for clear or tree
461 tiles.
462 </p>
464 <table class="field">
465 <tr> <th> Value <th> Meaning <th> Densities
466 <tr> <td class="mono"> 0000 <td class="text"> Grass <td> 0&mdash;3
467 <tr> <td class="mono"> 0001 <td class="text"> Shore <td> N/A
468 <tr> <td class="mono"> 0010 <td class="text"> Roughland <td> N/A
469 <tr> <td class="mono"> 0011 <td class="text"> Rocks <td> N/A
470 <tr> <td class="mono"> 0100 <td class="text"> Desert <td> 1, 3
471 <tr> <td class="mono"> 1000 <td class="text"> Snow <td> 0&mdash;3
472 <tr> <td class="mono"> 1010 <td class="text"> Snow-covered roughland <td> 0&mdash;3
473 <tr> <td class="mono"> 1011 <td class="text"> Snow-covered rocks <td> 0&mdash;3
474 </table>
477 <h3 id="hedge">Hedge</h3>
480 Hedge on the border of a tile. It can take the values 1 through&nbsp;6,
481 or 0 for none.
482 </p>
485 <h3 id="trees">Trees</h3>
488 Both the number and type of trees fields jointly determine the set of trees
489 actually displayed at a tile. The lower 3 bits of the number field
490 represent the growth status of the trees (0&hellip;2 for growing; 3 for
491 fully grown; 4&hellip;7 for withering).
492 </p>
495 <h3 id="water">Water tile types</h3>
497 <table class="field">
498 <tr> <th> Value <th> Meaning
499 <tr> <td class="mono"> 0 <td class="text"> Plain water (water, canal or river)
500 <tr> <td class="mono"> 1 <td class="text"> Coast or riverbank
501 <tr> <td class="mono"> 2 <td class="text"> Depot part
502 <tr> <td class="mono"> 3 <td class="text"> Canal lock, middle part
503 <tr> <td class="mono"> 4 <td class="text"> Canal lock, lower part
504 <tr> <td class="mono"> 5 <td class="text"> Canal lock, upper part
505 </table>
508 <h3 id="bridge">Bridge types</h3>
510 <table class="field">
511 <tr> <th> Value <th> Max. speed (mph) <th> Meaning
512 <tr> <td class="mono"> 0 <td> 20 <td class="text"> Wooden
513 <tr> <td class="mono"> 1 <td> 30 <td class="text"> Concrete
514 <tr> <td class="mono"> 2 <td> 40 <td class="text"> Girder, steel
515 <tr> <td class="mono"> 3 <td> 50 <td class="text"> Suspension, concrete
516 <tr> <td class="mono"> 4 <td> 60 <td class="text"> Suspension, steel
517 <tr> <td class="mono"> 5 <td> 70 <td class="text"> Suspension, steel
518 <tr> <td class="mono"> 6 <td> 100 <td class="text"> Cantilever, steel
519 <tr> <td class="mono"> 7 <td> 130 <td class="text"> Cantilever, steel
520 <tr> <td class="mono"> 8 <td> 150 <td class="text"> Cantilever, steel
521 <tr> <td class="mono"> 9 <td> 160 <td class="text"> Girder, steel
522 <tr> <td class="mono"> A <td> 200 <td class="text"> Tubular, steel
523 <tr> <td class="mono"> B <td> 320 <td class="text"> Tubular, steel
524 <tr> <td class="mono"> C <td> 380 <td class="text"> Tubular, silicon
525 </table>
528 <h3 id="track">Track types</h3>
530 <table class="field">
531 <tr> <th> Value <th> Meaning
532 <tr> <td class="mono"> 0 <td class="text"> Conventional railway
533 <tr> <td class="mono"> 1 <td class="text"> Electrified railway
534 <tr> <td class="mono"> 2 <td class="text"> Monorail
535 <tr> <td class="mono"> 3 <td class="text"> Maglev
536 </table>
539 <h3 id="trackmask">Track layout</h3>
541 <table class="field">
542 <tr> <th> Bit <th> Track present
543 <tr> <td class="mono"> 01 <td class="text"> X direction
544 <tr> <td class="mono"> 02 <td class="text"> Y direction
545 <tr> <td class="mono"> 04 <td class="text"> North corner (WE)
546 <tr> <td class="mono"> 08 <td class="text"> South corner (WE)
547 <tr> <td class="mono"> 10 <td class="text"> West corner (NS)
548 <tr> <td class="mono"> 20 <td class="text"> East corner (NS)
549 </table>
552 <h3 id="pbs">PBS track reservations</h3>
554 <table class="field">
555 <tr> <th> Value <th> Reserved track
556 <tr> <td class="mono"> 0 <td class="text"> None
557 <tr> <td class="mono"> 1 <td class="text"> X direction
558 <tr> <td class="mono"> 2 <td class="text"> Y direction
559 <tr> <td class="mono"> 5 <td class="text"> North corner (WE)
560 <tr> <td class="mono"> 6 <td class="text"> South corner (WE)
561 <tr> <td class="mono"> 7 <td class="text"> North and south corners
562 <tr> <td class="mono"> 9 <td class="text"> West corner (NS)
563 <tr> <td class="mono"> 10 <td class="text"> East corner (NS)
564 <tr> <td class="mono"> 11 <td class="text"> West and east corners
565 </table>
568 <h3 id="fence">Ground and fence for railway tracks</h3>
570 <table class="field">
571 <tr> <th> Value <th> Meaning
572 <tr> <td class="mono"> 0 <td class="text"> Bareland
573 <tr> <td class="mono"> 1 <td class="text"> Grass, no fence
574 <tr> <td class="mono"> 2 <td class="text"> Fence on the NW side
575 <tr> <td class="mono"> 3 <td class="text"> Fence on the SE side
576 <tr> <td class="mono"> 4 <td class="text"> Fences on the NW and SE sides
577 <tr> <td class="mono"> 5 <td class="text"> Fence on the NE side
578 <tr> <td class="mono"> 6 <td class="text"> Fence on the SW side
579 <tr> <td class="mono"> 7 <td class="text"> Fences on the NE and SW sides
580 <tr> <td class="mono"> 8 <td class="text"> Fence on the E side
581 <tr> <td class="mono"> 9 <td class="text"> Fence on the W side
582 <tr> <td class="mono"> A <td class="text"> Fence on the S side
583 <tr> <td class="mono"> B <td class="text"> Fence on the N side
584 <tr> <td class="mono"> C <td class="text"> Snow or desert
585 <tr> <td class="mono"> D <td class="text">
586 Grass with fence and shore or water on the free halftile
587 <tr> <td class="mono"> E <td class="text">
588 Higher part on foundation with snow, lower without snow
589 </table>
592 <h3 id="signal">Signals</h3>
594 <table class="field">
595 <tr> <th> Value <th> Meaning
596 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1
597 <td class="text"> First signal is green
598 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;
599 <td class="text"> Second signal is green
600 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;
601 <td class="text"> First signal present
602 <tr> <td class="mono"> &nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;
603 <td class="text"> Second signal present
604 <tr> <td class="mono"> &nbsp;000&nbsp;&nbsp;&nbsp;&nbsp;
605 <td class="text"> Normal signals
606 <tr> <td class="mono"> &nbsp;001&nbsp;&nbsp;&nbsp;&nbsp;
607 <td class="text"> Pre-signals
608 <tr> <td class="mono"> &nbsp;010&nbsp;&nbsp;&nbsp;&nbsp;
609 <td class="text"> Exit-signals
610 <tr> <td class="mono"> &nbsp;011&nbsp;&nbsp;&nbsp;&nbsp;
611 <td class="text"> Combo-signals
612 <tr> <td class="mono"> &nbsp;100&nbsp;&nbsp;&nbsp;&nbsp;
613 <td class="text"> PBS signals
614 <tr> <td class="mono"> &nbsp;101&nbsp;&nbsp;&nbsp;&nbsp;
615 <td class="text"> PBS one-way signals
616 <tr> <td class="mono"> 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
617 <td class="text"> Semaphore signals
618 </table>
621 <h3 id="roadbits">Present road types</h3>
623 <table class="field">
624 <tr> <th> Bit <th> Meaning
625 <tr> <td class="mono"> 01 <td class="text"> Normal road
626 <tr> <td class="mono"> 10 <td class="text"> Tramway
627 </table>
630 <h3 id="pavement">Ground and pavement for roads</h3>
632 <table class="field">
633 <tr> <th> Value <th> Meaning
634 <tr> <td class="mono"> 0 <td class="text"> On bareland
635 <tr> <td class="mono"> 1 <td class="text"> On grass
636 <tr> <td class="mono"> 2 <td class="text"> Paved
637 <tr> <td class="mono"> 3 <td class="text"> Paved, with streetlights
638 <tr> <td class="mono"> 5 <td class="text"> Paved, tree-lined
639 </table>
642 <h3 id="roadmask">Road layout</h3>
644 <table class="field">
645 <tr> <th> Bit <th> Road piece present
646 <tr> <td class="mono"> 1 <td class="text"> NW piece
647 <tr> <td class="mono"> 2 <td class="text"> SW piece
648 <tr> <td class="mono"> 4 <td class="text"> SE piece
649 <tr> <td class="mono"> 8 <td class="text"> NE piece
650 </table>
653 <h3 id="industries">Industries</h3>
655 <ul>
657 <li> <b>m1</b> bit <b>7</b>: clear: under construction
658 <ul>
659 <li> <b>m1</b> bits <b>6&hellip;5</b>:
660 water class (sea, canal, river or land)
661 <li> <b>m1</b> bits <b>3&hellip;2</b>:
662 construction counter, for buildings under construction incremented
663 on every periodic tile processing
664 <li> <b>m1</b> bits <b>1&hellip;0</b>:
665 stage of construction (3 = completed), incremented when the
666 construction counter wraps around; the meaning is different for
667 some animated tiles which are never under construction
668 (types <span class="mono">01</span>,
669 <span class="mono">1E</span>&hellip;<span class="mono">20</span>,
670 <span class="mono">30</span>, <span class="mono">58</span>)
671 </ul>
673 <li> <b>m2</b>: index into the array of industries
675 <li> <b>m3</b>: random bits (NewGRF)
677 <li> <b>m4</b>: animation loop
679 <li> <b>m5</b>: <a href="landscape_industries.html">industry tile type</a>
680 (with <b>m0</b> bit <b>3</b>)
682 <li> <b>m7</b>: animation frame
684 <li> <b>m0</b> bit <b>3</b>: bit 8 of type (see <b>m5</b>)
686 <li> <b>m0</b> bits <b>2&hellip;0</b>: random triggers (NewGRF)
688 </ul>
691 <h3 id="houses">Houses</h3>
693 <ul>
695 <li> <b>m1</b> bit <b>7</b>:
696 <ul>
697 <li> set: house is complete
698 <ul>
699 <li> <b>m5</b>: age of house in years, clamped at 255
700 </ul>
701 <li> clear: house is under construction
702 <ul>
703 <li> <b>m5</b> bits <b>4&hellip;3</b>: construction stage
704 <li> <b>m5</b> bits <b>2&hellip;0</b>: construction counter
705 </ul>
706 </ul>
708 <li> <b>m1</b> bit <b>6</b>: bit <b>8</b> of house type (see <b>m4</b>),
709 allowing 512 different types.
711 <li> <b>m1</b> bits <b>5&hellip;0</b>:
712 <ul>
713 <li> If <a href="#newhouses">Newhouses</a> is activated:
714 periodic processing time remaining
715 <li> Standard behaviour: lift position (only for houses
716 type <span class="mono">04</span> and <span class="mono">05</span>)
717 </ul>
719 <li> <b>m2</b>: index into the array of towns
721 <li> <b>m3</b>: random bits (<a href="#newhouses">Newhouses</a>)
723 <li> <b>m4</b>: <a href="landscape_houses.html">town building type</a>
724 (with <b>m1</b> bit <b>6</b>)
726 <li> <b>m5</b>: see <b>m1</b> bit <b>7</b>
728 <li> <b>m7</b>:
729 <ul>
730 <li> If <a href="#newhouses">Newhouses</a> is activated:
731 current animation frame
732 <li> Standard behaviour: (only for houses
733 type <span class="mono">04</span> and <span class="mono">05</span>)
734 <ul>
735 <li> bit <b>3</b>: lift has destination when set
736 <li> bits <b>2&hellip;0</b>: lift destination. Values can be
737 0&hellip;6 except 1, so the building has 6 effective floors.
738 This is due to the fact that the first floor is 2 'normal'
739 floors high. One 'normal' floor has a height of 6 lift positions.
740 </ul>
741 </ul>
743 <li> <b>m0</b> bits <b>4&hellip;0</b>: triggers activated
744 (<a href="#newhouses">Newhouses</a>)
746 </ul>
748 <p id="newhouses">
749 Newhouses is the name englobing a newGRF feature developed by TTDPatch devs
750 (mainly Csaboka). It allows the replacement of the properties as well as
751 the graphics of houses in the game. To distinguish between the standard
752 behaviour and the newGRF one, HouseID (<b>m4+m1[6]</b>) is tested for
753 anything above 110. 110 is the count of standard houses, so anything
754 above 110 means that there is a new definition of at least one house.
755 </p>
758 </body>
760 </html>