Update map documentation
[openttd-joker.git] / docs / landscape.html
blobecd03e6663afd2dc31f8e8a44554ff445a256e7a
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
4 <head>
5 <meta name="Author" content="Marcin Grzegorczyk">
6 <meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays">
7 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8 <title>OpenTTD Landscape Internals</title>
9 </head>
11 <body>
13 <h3><a name="Landscape">Landscape</a></h3>
14 <p>
15 For a graphical representation of the tile-layout have a look at
16 <a href="landscape_grid.html">Landscape grid</a> page.
17 </p>
18 <p>Nine attributes (counting &quot;<span style="font-weight: bold;">type</span>&quot; and
19 &quot;<span style="font-weight: bold;">height</span>&quot;) hold the informations about a tile.<BR>
20 These attributes are referred to as
21 &quot;<span style="font-weight: bold;">type</span>",
22 &quot;<span style="font-weight: bold;">height</span>",
23 &quot;<span style="font-weight: bold;">m1</span>&quot;, &quot;<span style="font-weight: bold;">m2</span>&quot;,
24 &quot;<span style="font-weight: bold;">m3</span>&quot;, &quot;<span style="font-weight: bold;">m4</span>&quot;,
25 &quot;<span style="font-weight: bold;">m5</span>&quot;, &quot;<span style="font-weight: bold;">m6</span>&quot;
26 and "<span style="font-weight: bold;">m7</span>".<br>
27 The most important value is the class of a tile, stored in the upper 4 bits
28 of the <span style="font-weight: bold;">type</span> attribute.
29 </p>
31 Frequently repeating patterns:
32 <ul>
33 <li><span style="font-weight: bold;">type</span>
34 <ul>
35 <li>
36 <a name="type"></a>
37 Bits 7..4:
38 <table border="1" style="width: 30em;">
39 <tr bgcolor="#CCCCCC"><td colspan="2">The tile type.</td></tr>
40 <tr><td style="width: 5em;"><tt>00</tt></td><td>Ground</td></tr>
41 <tr><td><tt>01</tt></td><td>Railway tracks</td></tr>
42 <tr><td><tt>02</tt></td><td>Roads</td></tr>
43 <tr><td><tt>03</tt></td><td>Town building</td></tr>
44 <tr><td><tt>04</tt></td><td>Trees</td></tr>
45 <tr><td><tt>05</tt></td><td>Station tiles</td></tr>
46 <tr><td><tt>06</tt></td><td>Water</td></tr>
47 <tr><td><tt>07</tt></td><td>Void</td></tr>
48 <tr><td><tt>08</tt></td><td>Industries</td></tr>
49 <tr><td><tt>09</tt></td><td>Tunnel / bridge</td></tr>
50 <tr><td><tt>0A</tt></td><td>Objects</td></tr>
51 </table>
52 </li>
53 Bits 3..2:
54 <table border="1" style="width: 30em;">
55 <tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above.</td></tr>
56 <tr><td style="width: 5em;"><tt>00</tt></td><td>no bridge</td></tr>
57 <tr><td><tt>01</tt></td><td>Axis X (North-East)</td></tr>
58 <tr><td><tt>02</tt></td><td>Axis Y (South-West)</td></tr>
59 </table>
60 <li>
61 <a name="tropic_zone"></a>
62 Bits 1..0:
63 <table border="1" style="width: 30em;">
64 <tr bgcolor="#CCCCCC"><td colspan="2">Only meaningfull in tropic climate. It contains the definition of the available zones</td></tr>
65 <tr><td style="width: 5em;"><tt>00</tt></td><td>normal</td></tr>
66 <tr><td><tt>01</tt></td><td>desert</td></tr>
67 <tr><td><tt>02</tt></td><td>rain forest</td></tr>
68 </table>
69 In any other climate these 2 bits are theoretically free of use, however using them does not seem useful.
70 </li>
71 </ul>
72 <li><span style="font-weight: bold;">m1</span>
73 <ul>
74 <li>
75 <a name="WaterClass"></a>
76 Bits 6..5:
77 <table border="1" style="width: 30em;">
78 <tr bgcolor="#CCCCCC"><td colspan="2">The type of water that is on a tile.
79 <tr><td style="width: 5em;"><tt>00</tt></td><td align=left>Sea</td></tr>
80 <tr><td><tt>01</tt></td><td align=left>Canal</td></tr>
81 <tr><td><tt>02</tt></td><td align=left>River</td></tr>
82 <tr><td><tt>03</tt></td><td align=left>Invalid, i.e. no water on this tile</td></tr>
83 </table>
84 Some tiles, such as houses, reuse these bits of other purposes.
85 </li>
86 <li>
87 <a name="OwnershipInfo"></a>
88 Bits 4..0:
89 <table border="1" style="width: 30em;">
90 <tr bgcolor="#CCCCCC"><td colspan="2">The owner of a tile can be either companies (human or AI) or "Game entities".
91 <tr><td style="width: 5em;"><tt>00..0E</tt></td><td align=left>Normal companies</td></tr>
92 <tr><td><tt>0F</tt></td><td align=left>a town owns the tile</td></tr>
93 <tr><td><tt>10</tt></td><td align=left>nobody owns the tile</td></tr>
94 <tr><td><tt>11</tt></td><td align=left>"water" owns the tile</td></tr>
95 <tr><td><tt>FF</tt></td><td align=left>spectator in MP or in scenario editor</td></tr>
96 </table>
97 Some tiles, such as houses and industries, reuse these bits of other purposes.
98 </li>
99 </ul>
100 </li>
101 <li><span style="font-weight: bold;">m3:</span><br>
102 <ul>
103 <li>
104 <a name="RailType"></a>
105 Bits 3..0: Railtype. Used for all tiles with rail (road, rail, station, tunnelbridge).
106 </li>
107 </ul>
108 </li>
109 <li><span style="font-weight: bold;">m4:</span><br>
110 <a name="RoadType"></a>
111 Road-(sub-)types. Used for all tiles with road (road, station, tunnelbridge).
112 <ul>
113 <li>
114 Bits 7..4: Tram sub type, 0xF for no tram.
115 </li>
116 <li>
117 Bits 3..0: Road sub type, 0xF for no road.
118 </li>
119 </ul>
120 </li>
121 <li><span style="font-weight: bold;">m7:</span><br>
122 Animation frame/state. Used for houses, industries, objects and stations.
123 </li>
124 </ul>
126 <p>OTTD's class-specific periodic tile processing routine is called once every +256 ticks for each tile.</p>
128 <table border=1 cellpadding=3>
129 <tr bgcolor="#0099FF">
130 <th align=left><font color="#FFFFFF">Class</font></th>
131 <th align=left><font color="#FFFFFF">Meaning & details of encoding</font></th>
132 </tr>
133 <tr bgcolor="#CCCCCC">
134 <td align=left><strong><a name="Class0"><tt> 0 </tt></a></strong></td>
135 <td align=left>&nbsp;<strong>Ground </strong></td>
136 </tr>
137 <tr>
138 <td valign=top nowrap>&nbsp;</td>
139 <td>
140 <ul>
141 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)</li>
142 <li>m2: see fields</li>
143 <li>m3 bits 7..5: type of hedge on NE border of the tile</li>
144 <li>m3 bits 3..0: see fields</li>
145 <li>m3 bit 4: set if the tile is covered with snow</li>
146 <li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
147 <li>m4 bits 4..2: same as 7..5, but for the SE border</li>
148 <li>m5 bits 7..5: update counter, incremented on every periodic processing for tile types,
149 other than <tt>03</tt>, <tt>07</tt>, <tt>0B</tt>, <tt>10</tt> and above.<BR>
150 on wraparound, the tile is updated (for fields, the type of fields in m3 is increased, for other types the tile type in m5 is increased).<BR>
151 For snow and desert, these bits are not used, tile is updated on every periodic processing.</li>
152 <li>m5 bits 4..2: tile type:
153 <table>
154 <tr>
155 <td nowrap valign=top><tt>0</tt>&nbsp; </td>
156 <td align=left>bare land / grass</td>
157 </tr>
159 <tr>
160 <td nowrap valign=top><tt>1</tt>&nbsp; </td>
161 <td align=left>rough land (density must be 3)</td>
162 </tr>
164 <tr>
165 <td nowrap valign=top><tt>2</tt>&nbsp; </td>
166 <td align=left>rocks (density must be 3)</td>
167 </tr>
169 <tr>
170 <td nowrap valign=top><tt>3</tt>&nbsp; </td>
171 <td align=left>fields (density must be 3)
172 <ul>
173 <li>m2: index into the array of industries (farms), INVALID_INDUSTRY (0xFFFF) if farm has been removed</li>
174 <li>m3 bits 3..0: field type (legal values: 0 through 9)</li>
175 </ul>
176 </td>
177 </tr>
179 <tr>
180 <td nowrap valign=top><tt>4</tt>&nbsp; </td>
181 <td align=left>snow</td>
182 </tr>
184 <tr>
185 <td nowrap valign=top><tt>5</tt>&nbsp; </td>
186 <td align=left>desert (density must be 1 or 3)</td>
187 </tr>
188 </table>
189 </li>
190 <li>m5 bits 1..0: density:
191 <table>
192 <tr>
193 <td nowrap valign=top><tt>0</tt>&nbsp; </td>
194 <td>bare land</td>
195 <td></td>
196 <td></td>
197 <td></td>
198 <td>1/4 snow</td>
199 <td></td>
200 </tr>
202 <tr>
203 <td nowrap valign=top><tt>1</tt>&nbsp; </td>
204 <td>1/3 grass</td>
205 <td></td>
206 <td></td>
207 <td></td>
208 <td>2/4 snow;&nbsp;</td>
209 <td>1/2 desert</td>
210 </tr>
212 <tr>
213 <td nowrap valign=top><tt>2</tt>&nbsp; </td>
214 <td>2/3 grass</td>
215 <td></td>
216 <td></td>
217 <td></td>
218 <td>3/4 snow</td>
219 <td></td>
220 </tr>
222 <tr>
223 <td nowrap valign=top><tt>3</tt>&nbsp; </td>
224 <td>full grass;&nbsp;</td>
225 <td>rough land;&nbsp;</td>
226 <td>rocks;&nbsp;</td>
227 <td>fields;&nbsp;</td>
228 <td>full snow;&nbsp;</td>
229 <td>full desert</td>
230 </tr>
231 </table>
232 </li>
233 <li>m6 bits 4..2: type of hedge on NW border of the tile</li>
234 </ul>
235 </td>
236 </tr>
238 <tr bgcolor="#CCCCCC">
239 <td valign=top nowrap><strong><a name="Class1"><tt> 1</tt></a></strong></td>
240 <td><strong>Railway tracks</strong></td>
241 </tr>
242 <tr>
243 <td valign=top nowrap>&nbsp;</td>
244 <td>
245 <ul>
246 <li style="color: blue">m1 bit 7: bit 4 of track type (more rail types patch)</li>
247 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile</li>
248 <li>m2: see signals</li>
249 <li>m3 bits 7..4: see signals</li>
250 <li>m3 bits 3..0 = <a href="#RailType">track type</a></li>
251 <li>m4 bits 7..4: see signals</li>
252 <li>m4 bits 3..0: Ground type (values with fences are not valid for depots and checkpoints)
253 <table>
254 <tr>
255 <td nowrap valign=top><tt>0</tt>&nbsp; </td>
256 <td align=left>on bare land</td>
257 </tr>
259 <tr>
260 <td nowrap valign=top><tt>1</tt>&nbsp; </td>
261 <td align=left>on grass, no fences</td>
262 </tr>
264 <tr>
265 <td nowrap valign=top><tt>2</tt>&nbsp; </td>
266 <td align=left>fence on the NW side</td>
267 </tr>
269 <tr>
270 <td nowrap valign=top><tt>3</tt>&nbsp; </td>
271 <td align=left>fence on the SE side</td>
272 </tr>
274 <tr>
275 <td nowrap valign=top><tt>4</tt>&nbsp; </td>
276 <td align=left>fences on the NW and SE sides</td>
277 </tr>
279 <tr>
280 <td nowrap valign=top><tt>5</tt>&nbsp; </td>
281 <td align=left>fence on the NE side</td>
282 </tr>
284 <tr>
285 <td nowrap valign=top><tt>6</tt>&nbsp; </td>
286 <td align=left>fence on the SW side</td>
287 </tr>
289 <tr>
290 <td nowrap valign=top><tt>7</tt>&nbsp; </td>
291 <td align=left>fences on the NE and SW sides</td>
292 </tr>
294 <tr>
295 <td nowrap valign=top><tt>8</tt>&nbsp; </td>
296 <td align=left>fence on the E side (track in the W corner)</td>
297 </tr>
299 <tr>
300 <td nowrap valign=top><tt>9</tt>&nbsp; </td>
301 <td align=left>fence on the W side (track in the E corner)</td>
302 </tr>
304 <tr>
305 <td nowrap valign=top><tt>A</tt>&nbsp; </td>
306 <td align=left>fence on the S side (track in the N corner)</td>
307 </tr>
309 <tr>
310 <td nowrap valign=top><tt>B</tt>&nbsp; </td>
311 <td align=left>fence on the N side (track in the S corner)</td>
312 </tr>
314 <tr>
315 <td nowrap valign=top><tt>C</tt>&nbsp; </td>
316 <td align=left>on snow or desert</td>
317 </tr>
319 <tr>
320 <td nowrap valign=top><tt>D</tt>&nbsp; </td>
321 <td align=left>on grass with fence and shore or water on the free halftile</td>
322 </tr>
324 <tr>
325 <td nowrap valign=top><tt>E</tt>&nbsp; </td>
326 <td align=left>higher part on foundation with snow, lower without snow</td>
327 </tr>
328 </table>
329 </li>
330 <li>m5 bit 7 clear: railway track
331 <ul>
332 <li>m5 bits 5..0: track layout: bit set = track present:
333 <table>
334 <tr>
335 <td nowrap valign=top>bit 0: </td>
336 <td align=left>in the X direction</td>
337 </tr>
339 <tr>
340 <td nowrap valign=top>bit 1: </td>
341 <td align=left>in the Y direction</td>
342 </tr>
344 <tr>
345 <td nowrap valign=top>bit 2: </td>
346 <td align=left>in the north corner (direction W-E)</td>
347 </tr>
349 <tr>
350 <td nowrap valign=top>bit 3: </td>
351 <td align=left>in the south corner (direction W-E)</td>
352 </tr>
354 <tr>
355 <td nowrap valign=top>bit 4: </td>
356 <td align=left>in the west corner (direction N-S)</td>
357 </tr>
359 <tr>
360 <td nowrap valign=top>bit 5: </td>
361 <td align=left>in the east corner (direction N-S)</td>
362 </tr>
363 </table>
364 </li>
365 <li>m5 bit 6 set = with signals:<BR>
366 There are at most 4 signals on a tile. The signals 0..3 belong to the directions:
367 <table>
368 <tr>
369 <td></td>
370 <td>Track <tt>0</tt> (X)&nbsp;</td>
371 <td>Track <tt>1</tt> (Y)&nbsp;</td>
372 <td>Track <tt>2</tt> (north)&nbsp;</td>
373 <td>Track <tt>3</tt> (south)&nbsp;</td>
374 <td>Track <tt>4</tt> (west)&nbsp;</td>
375 <td>Track <tt>5</tt> (east)</td>
376 </tr>
378 <tr>
379 <td align=left>Signal <tt>0</tt>&nbsp;</td>
380 <td></td>
381 <td></td>
382 <td></td>
383 <td>west</td>
384 <td></td>
385 <td>south</td>
386 </tr>
388 <tr>
389 <td align=left>Signal <tt>1</tt>&nbsp;</td>
390 <td></td>
391 <td></td>
392 <td></td>
393 <td>east</td>
394 <td></td>
395 <td>north</td>
396 </tr>
398 <tr>
399 <td align=left>Signal <tt>2</tt>&nbsp;</td>
400 <td>south-west</td>
401 <td>north-west</td>
402 <td>west</td>
403 <td></td>
404 <td>south</td>
405 <td></td>
406 </tr>
408 <tr>
409 <td align=left>Signal <tt>3</tt>&nbsp;</td>
410 <td>north-east</td>
411 <td>south-east</td>
412 <td>east</td>
413 <td></td>
414 <td>north</td>
415 <td></td>
416 </tr>
417 </table>
418 <ul>
419 <li>m2 bit 7: Signal 0 and 1: set = semaphore signals, clear = light signals</li>
420 <li>m2 bit 3: Signal 2 and 3: set = semaphore signals, clear = light signals</li>
421 <li>m2 bits 6..4: type of signal 0 and 1 (same values as m2 bits 2..0)</li>
422 <li>m2 bits 2..0: type of signal 2 and 3
423 <table>
424 <tr>
425 <td nowrap="nowrap" valign="top"><tt>000</tt>: </td>
426 <td align="left">normal signals</td>
427 </tr>
429 <tr>
430 <td nowrap="nowrap" valign="top"><tt>001</tt>: </td>
431 <td align="left">pre-signals</td>
432 </tr>
434 <tr>
435 <td nowrap="nowrap" valign="top"><tt>010</tt>: </td>
436 <td align="left">exit-signals</td>
437 </tr>
439 <tr>
440 <td nowrap="nowrap" valign="top"><tt>011</tt>: </td>
441 <td align="left">combo-signals</td>
442 </tr>
444 <tr>
445 <td nowrap="nowrap" valign="top"><tt>100</tt>: </td>
446 <td align="left">pbs signals</td>
447 </tr>
449 <tr>
450 <td nowrap="nowrap" valign="top"><tt>101</tt>: </td>
451 <td align="left">no-entry signals</td>
452 </tr>
453 </table>
454 </li>
455 <li style="color: blue">m2 bit 12: this signal tile has 1 or more restricted signals (tracerestrict patch)</li>
457 <li>m3 bits 7..4: bit set = signal 3..0 present</li>
458 <li>m4 bits 7..4: bit clear = signal 3..0 shows red</li>
459 </ul>
460 </li>
461 <li>m2 bits 8..10: track reserved for pbs
462 <table>
463 <tr>
464 <td><tt>0</tt>&nbsp; </td>
465 <td>not reserved</td>
466 </tr>
467 <tr>
468 <td><tt>1</tt>&nbsp; </td>
469 <td>X direction</td>
470 </tr>
471 <tr>
472 <td><tt>2</tt>&nbsp; </td>
473 <td>Y direction</td>
474 </tr>
475 <tr>
476 <td><tt>3</tt>&nbsp; </td>
477 <td>north corner (W-E)</td>
478 </tr>
479 <tr>
480 <td><tt>4</tt>&nbsp; </td>
481 <td>south corner (W-E)</td>
482 </tr>
483 <tr>
484 <td><tt>5</tt>&nbsp; </td>
485 <td>west corner (N-S)</td>
486 </tr>
487 <tr>
488 <td><tt>6</tt>&nbsp; </td>
489 <td>east corner (N-S)</td>
490 </tr>
491 </table>
492 </li>
493 <li>m2 bit 11: opposite track is reserved, too</li>
494 </ul>
495 </li>
496 <li>m5 bit 7 set, bit 6 set: railway depot
497 <ul>
498 <li>m2: Depot index</li>
499 <li>m5 bits 1..0: exit towards
500 <table>
501 <tr>
502 <td><tt>0</tt>&nbsp; </td>
503 <td>NE</td>
504 </tr>
506 <tr>
507 <td><tt>1</tt>&nbsp; </td>
508 <td>SE</td>
509 </tr>
511 <tr>
512 <td><tt>2</tt>&nbsp; </td>
513 <td>SW</td>
514 </tr>
516 <tr>
517 <td><tt>3</tt>&nbsp; </td>
518 <td>NW</td>
519 </tr>
520 </table>
521 </li>
522 <li>m5 bit 4: pbs reservation state</li>
523 </ul>
524 </li>
525 <li style="color: blue">m7: Track age used to show overgrowth (not used for depots)</li>
526 </ul>
527 </td>
528 </tr>
530 <tr bgcolor="#CCCCCC">
531 <td valign=top nowrap><strong><a name="Class2"><tt> 2</tt></a></strong></td>
532 <td><strong>Roads</strong></td>
533 </tr>
534 <tr>
535 <td valign=top nowrap>&nbsp;</td>
536 <td>
537 <ul>
538 <li>m2: Index into the array of towns (owning town for town roads; closest town otherwise, INVALID_TOWN if there is no town or we are creating a town)</li>
539 <li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of road type 1 (tram); OWNER_NONE (<tt>10</tt>) is stored as OWNER_TOWN (<tt>0F</tt>)
540 <li>m4: <a href="#RoadType">Road-(sub-)types</a></li>
541 <li>m7 bit 5 set = on snow or desert</li>
542 <li>m5 bits 7 clear: road or level-crossing
543 <ul>
544 <li>m6 bits 5..3:
545 <table>
546 <tr>
547 <td><tt>0</tt>&nbsp; </td>
548 <td>on bare land</td>
549 </tr>
550 <tr>
551 <td><tt>1</tt>&nbsp; </td>
552 <td>on grass</td>
553 </tr>
554 <tr>
555 <td><tt>2</tt>&nbsp; </td>
556 <td>paved</td>
557 </tr>
558 <tr>
559 <td><tt>3</tt>&nbsp; </td>
560 <td>with streetlights</td>
561 </tr>
562 <tr>
563 <td><tt>5</tt>&nbsp; </td>
564 <td>tree-lined</td>
565 </tr>
566 <tr>
567 <td><tt>6</tt>&nbsp; </td>
568 <td>on grass with road works</td>
569 </tr>
570 <tr>
571 <td><tt>7</tt>&nbsp; </td>
572 <td>paved with road works</td>
573 </tr>
574 </table>
575 </li>
576 <li>m5 bit 6 clear: road
577 <ul>
578 <li style="color: blue">m1 bit 7: bit 4 of track type (more rail types patch)</li>
579 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
580 <li>m7 bits 3..0: counter for the roadworks</li>
581 <li>m5 bits 3..0: road layout road type 0 (normal road): bit set = road piece present:
582 <table>
583 <tr>
584 <td align=left>bit 0: </td>
585 <td>NW piece</td>
586 </tr>
587 <tr>
588 <td align=left>bit 1: </td>
589 <td>SW piece</td>
590 </tr>
591 <tr>
592 <td align=left>bit 2: </td>
593 <td>SE piece</td>
594 </tr>
595 <tr>
596 <td align=left>bit 3: </td>
597 <td>NE piece</td>
598 </tr>
599 </table>
600 </li>
601 <li>m3 bits 0..3: road layout road type 1 (tram)</li>
602 <li>m5 bits 5..4: bits to disallow vehicles to go a specific direction
603 <table>
604 <tr>
605 <td align=left>bit 0: </td>
606 <td>set = disallow driving in south-west or south-east direction</td>
607 </tr>
608 <tr>
609 <td align=left>bit 1: </td>
610 <td>set = disallow driving in north-west or north-east direction</td>
611 </tr>
612 </table>
613 </li>
614 </ul>
615 </li>
616 <li>m5 bit 6 set: level crossing
617 <ul>
618 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the railway track</li>
619 <li>m3 bits 3..0: <a href="#RailType">railway track type</a></li>
620 <li>m5 bit 0: direction
621 <table>
622 <tr>
623 <td align=left><tt>0</tt>&nbsp; </td>
624 <td align=left>road in the X direction, rail in Y</td>
625 </tr>
626 <tr>
627 <td align=left><tt>1</tt>&nbsp; </td>
628 <td align=left>road in the Y direction, rail in X</td>
629 </tr>
630 </table>
631 </li>
632 <li>m5 bit 5: set if crossing lights are on</li>
633 <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
634 <li>m5 bit 4: pbs reservation state</li>
635 </ul>
636 </li>
637 </ul>
638 </li>
639 <li>m5 bit 7 set, bit 6 clear: road depot
640 <ul>
641 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the depot</li>
642 <li>m2: Depot index</li>
643 <li>m5 bits 1..0: exit towards:
644 <table>
645 <tr>
646 <td><tt>0</tt>&nbsp; </td>
647 <td>NE</td>
648 </tr>
650 <tr>
651 <td><tt>1</tt>&nbsp; </td>
652 <td>SE</td>
653 </tr>
655 <tr>
656 <td><tt>2</tt>&nbsp; </td>
657 <td>SW</td>
658 </tr>
660 <tr>
661 <td><tt>3</tt>&nbsp; </td>
662 <td>NW</td>
663 </tr>
664 </table>
665 </li>
666 <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
667 </ul>
668 </li>
669 </ul>
670 </td>
671 </tr>
673 <tr bgcolor="#CCCCCC">
674 <td valign=top nowrap><strong><a name="Class3"><tt> 3</tt></a></strong></td>
675 <td><strong>Town building </strong></td>
676 </tr>
677 <tr>
678 <td valign=top nowrap>&nbsp;</td>
679 <td>
680 <ul>
681 <li>m1 : Random bits <a href="#newhouses">(newhouses)</a> </li>
682 <li>m2 : index into the array of towns</li>
683 <li>m3 bit 7 :
684 <ul>
685 <li> set : House is complete
686 <ul>
687 <li>m5 : Age of house in years, clamped at 255</li>
688 </ul>
689 </li>
690 <li> clear : House is in construction
691 <ul>
692 <li>m5 bits 7..5 : free</li>
693 <li>m5 bits 4..3 : construction stage</li>
694 <li>m5 bits 2..0 : construction counter</li>
695 </ul>
696 </li>
697 </ul>
698 <li>m3 bit 6 : bit 8 of house type (m4), allowing 512 different types.</li>
699 <li>m3 bit 5 : free</li>
700 <li>m3 bits 4..0 : triggers activated <a href="#newhouses">(newhouses)</a></li>
701 <li>m4 : <a href="landscape_externals.html">town building type</a> (with m3[6] bit)</li>
702 <li>m5 : see m3 bit 7</li>
703 <li>m6 :
704 <ul>
705 <li>If <a href="#newhouses">newhouses</a> is activated
706 <ul>
707 <li>bits 7..2 : Periodic processing time remaining</li>
708 </ul>
709 </li>
710 <li>Standard behaviour
711 <ul>
712 <li>bits 7..2 : lift position (for houses type 04 and 05)</li>
713 </ul>
714 </li>
715 </ul>
716 </li>
717 <li>m7 :
718 <ul>
719 <li>If <a href="#newhouses">newhouses</a> is activated
720 <ul>
721 <li>Current animation frame</li>
722 </ul>
723 </li>
724 <li>Standard behaviour (only for houses type 04 and 05)
725 <ul>
726 <li>bits 7..4 : free</li>
727 <li>bits 3..1 : lift destination. Values can be 0..6, except 1.<br>
728 So the building has 6 effective floors. This is due to the fact that the first floor is 2 'normal' floors high.<br>
729 One 'normal' floor has a height of 6 lift positions.
730 </li>
731 <li>bit 0 : Lift has destination when set</li>
732 </ul>
733 </li>
734 </ul>
735 </li>
736 </ul>
737 <small><a name="newhouses"></a>Newhouses is the name englobing a newGRF feature developped by TTDPatch devs (mainly Csaboka).<br>
738 It allows the replacement of the properties as well as the graphics of houses in the game.<br>
739 To distinguish between the standard behaviour and the newGRF one, HouseID (m4 + m3[6]) is tested for anything above 110.<br>
740 110 is the count of standard houses. So above 110 means there is a new definition of at least one house</small>
741 </td>
742 </tr>
744 <tr bgcolor="#CCCCCC">
745 <td valign=top nowrap><strong><a name="Class4"><tt> 4 </tt></a></strong></td>
746 <td><strong>Trees </strong></td>
747 </tr>
748 <tr>
749 <td valign=top nowrap>&nbsp;</td>
750 <td>
751 <ul>
752 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
753 <li>m2 bits 8..6: ground
754 <table>
756 <tr>
757 <td align=left><tt>0</tt>&nbsp; </td>
758 <td>on grass</td>
759 </tr>
761 <tr>
762 <td align=left><tt>1</tt>&nbsp; </td>
763 <td>on rough land (density must be 3)</td>
764 </tr>
766 <tr>
767 <td align=left><tt>2</tt>&nbsp; </td>
768 <td>on snow or desert</td>
769 </tr>
771 <tr>
772 <td align=left><tt>3</tt>&nbsp; </td>
773 <td>on shore (density must be 3)</td>
774 </tr>
776 <tr>
777 <td align=left><tt>4</tt>&nbsp; </td>
778 <td>on snow with rough land underneed</td>
779 </tr>
780 </table>
781 </li>
782 <li>m2 bits 5..4: ground density</li>
783 <li>m2 bits 3..0: update counter, incremented on every periodic processing.<br>
784 on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
785 <li>m3 bits 7..0: type of trees:
786 <table>
787 <tr>
788 <td nowrap valign=top><tt>00</tt>..<tt>0B</tt>&nbsp; </td>
789 <td align=left>temperate climate trees</td>
790 </tr>
792 <tr>
793 <td nowrap valign=top><tt>0C</tt>..<tt>13</tt>&nbsp; </td>
794 <td align=left>sub-arctic climate trees</td>
795 </tr>
797 <tr>
798 <td nowrap valign=top><tt>14</tt>..<tt>1A</tt>&nbsp; </td>
799 <td align=left>rainforest trees</td>
800 </tr>
802 <tr>
803 <td nowrap valign=top><tt>1B</tt> </td>
804 <td align=left>cactus plants</td>
805 </tr>
807 <tr>
808 <td nowrap valign=top><tt>1C</tt>..<tt>1F</tt>&nbsp; </td>
809 <td align=left>sub-tropical climate, non-rainforest, non-desert trees</td>
810 </tr>
812 <tr>
813 <td nowrap valign=top><tt>20</tt>..<tt>28</tt>&nbsp; </td>
814 <td align=left>toyland trees</td>
815 </tr>
816 </table>
817 <small>Note: the actually displayed set of trees depends on both type and number of trees</small>
818 </li>
819 <li>m5 bits 7..6: number of trees minus one</li>
820 <li>m5 bits 2..0: growth status:
821 <table border="0">
822 <tr>
823 <td><tt>0</tt>..<tt>2</tt>&nbsp;</td>
824 <td>one of trees is growing&nbsp;</td>
825 </tr>
826 <tr>
827 <td><tt>3</tt>&nbsp;</td>
828 <td>all trees are fully grown&nbsp;</td>
829 </tr>
830 <tr>
831 <td><tt>4</tt>..<tt>6</tt>&nbsp;</td>
832 <td>one of trees is withering&nbsp;</td>
833 </tr>
834 </table>
835 </li>
836 </ul>
837 </td>
838 </tr>
840 <tr bgcolor="#CCCCCC">
841 <td valign=top nowrap><strong><a name="Class5"><tt> 5</tt></a></strong></td>
842 <td><strong>Station tiles</strong></td>
843 </tr>
844 <tr>
845 <td valign=top nowrap>&nbsp;</td>
846 <td>
847 <ul>
848 <li style="color: blue">m1 bit 7: bit 4 of track type (more rail types patch)</li>
849 <li>m1 bits 6..5: water class for buoys, water part of docks and for airport tiles</li>
850 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the station</li>
851 <li>m2: index into the array of stations</li>
852 <li>m3 bits 7..4: persistent random data for railway stations/waypoints and airports)</li>
853 <li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram tracks (road stop)</li>
854 <li>m3 bits 3..0: <a href="#RailType">track type</a> for railway stations/waypoints</li>
855 <li>m4: custom station id; 0 means standard graphics</li>
856 <li>m4: <a href="#RoadType">Road-(sub-)types</a> for road stops</li>
857 <li>m5: graphics index (range from 0..255 for each station type):
858 <table>
859 <tr>
860 <td nowrap valign=top><tt>00</tt>..<tt>07</tt>&nbsp; </td>
861 <td align=left>railway station
862 <table>
863 <tr>
864 <td><tt>00</tt>..<tt>01</tt>&nbsp; </td>
865 <td align=left>open platform</td>
866 </tr>
867 <tr>
868 <td><tt>02</tt>..<tt>03</tt>&nbsp; </td>
869 <td align=left>open platform with station building</td>
870 </tr>
871 <tr>
872 <td><tt>04</tt>....<tt>07</tt>&nbsp; </td>
873 <td align=left>roofed platform</td>
874 </tr>
875 <tr>
876 <td colspan=2>bit 0: clear = in X direction, set = in Y direction</td>
877 </tr>
878 </table>
879 </td>
880 </tr>
882 <tr>
883 <td nowrap valign=top><tt>00</tt>..<tt>01</tt></td>
884 <td align=left>waypoints
885 <table>
886 <tr>
887 <td><tt>00</tt>&nbsp; </td>
888 <td align=left>in X direction</td>
889 </tr>
890 <tr>
891 <td><tt>01</tt>&nbsp; </td>
892 <td align=left>in Y direction</td>
893 </tr>
894 </table>
895 </td>
896 </tr>
898 <tr>
899 <td nowrap valign=top><tt>00</tt>..<tt>FF</tt></td>
900 <td align=left>all airports</td>
901 </tr>
903 <tr>
904 <td nowrap valign=top><tt>00</tt>..<tt>05</tt>&nbsp; </td>
905 <td align=left>road stops
906 <table>
907 <tr>
908 <td><tt>00</tt>&nbsp; </td>
909 <td align=left>exit towards NE</td>
910 </tr>
911 <tr>
912 <td><tt>01</tt>&nbsp; </td>
913 <td align=left>exit towards SE</td>
914 </tr>
915 <tr>
916 <td><tt>02</tt>&nbsp; </td>
917 <td align=left>exit towards SW</td>
918 </tr>
919 <tr>
920 <td><tt>03</tt>&nbsp; </td>
921 <td align=left>exit towards NW</td>
922 </tr>
923 <tr>
924 <td><tt>04</tt>&nbsp; </td>
925 <td align=left>drive through X</td>
926 </tr>
927 <tr>
928 <td><tt>05</tt>&nbsp; </td>
929 <td align=left>drive through Y</td>
930 </tr>
931 </table>
932 </td>
933 </tr>
935 <tr>
936 <td nowrap valign=top><tt>00</tt>..<tt>05</tt>&nbsp; </td>
937 <td align=left>ship dock
938 <table>
939 <tr>
940 <td><tt>00</tt>&nbsp; </td>
941 <td align=left>SW coast part</td>
942 </tr>
943 <tr>
944 <td><tt>01</tt>&nbsp; </td>
945 <td align=left>NW coast part</td>
946 </tr>
947 <tr>
948 <td><tt>02</tt>&nbsp; </td>
949 <td align=left>NE coast part</td>
950 </tr>
951 <tr>
952 <td><tt>03</tt>&nbsp; </td>
953 <td align=left>SE coast part</td>
954 </tr>
955 <tr>
956 <td><tt>04</tt>&nbsp; </td>
957 <td align=left>X direction water part</td>
958 </tr>
959 <tr>
960 <td><tt>05</tt>&nbsp; </td>
961 <td align=left>Y direction water part</td>
962 </tr>
963 </table>
964 </td>
965 </tr>
966 </table>
967 </li>
968 <li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
969 <li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
971 <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
972 <li>m7: animation frame (railway stations/waypoints, airports)</li>
973 </ul>
974 </td>
975 </tr>
977 <tr bgcolor="#CCCCCC">
978 <td valign=top nowrap><strong><a name="Class6"><tt> 6 </tt></a></strong></td>
979 <td><strong>Water</strong></td>
980 </tr>
981 <tr>
982 <td valign=top nowrap>&nbsp;</td>
983 <td>
984 <ul>
985 <li>m1 bits 6..5 : Water class (sea, canal or river)
986 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (for sea, rivers, and coasts normally <tt>11</tt>)</li>
987 <li>m2: Depot index (for depots only)</li>
988 <li>m4: Random data for canal or river tiles</li>
989 <li>m5: tile type:
990 <table>
991 <tr>
992 <td nowrap valign=top><tt>00</tt>&nbsp; </td>
993 <td align=left>water, canal or river</td>
994 </tr>
996 <tr>
997 <td nowrap valign=top><tt>01</tt>&nbsp; </td>
998 <td align=left>coast or riverbank</td>
999 </tr>
1001 <tr>
1002 <td nowrap valign=top><tt>10</tt>..<tt>1B</tt>&nbsp; </td>
1003 <td align=left>canal locks
1004 <table>
1005 <tr>
1006 <td nowrap valign=top><tt>10</tt>&nbsp; </td>
1007 <td align=left>middle part, (SW-NE direction)</td>
1008 </tr>
1009 <tr>
1010 <td nowrap valign=top><tt>11</tt>&nbsp; </td>
1011 <td align=left>middle part, (NW-SE direction)</td>
1012 </tr>
1013 <tr>
1014 <td nowrap valign=top><tt>12</tt>&nbsp; </td>
1015 <td align=left>middle part, (NE-SW direction)</td>
1016 </tr>
1017 <tr>
1018 <td nowrap valign=top><tt>13</tt>&nbsp; </td>
1019 <td align=left>middle part, (SE-NW direction)</td>
1020 </tr>
1021 <tr>
1022 <td nowrap valign=top><tt>14</tt>&nbsp; </td>
1023 <td align=left>lower part, (SW-NE direction)</td>
1024 </tr>
1025 <tr>
1026 <td nowrap valign=top><tt>15</tt>&nbsp; </td>
1027 <td align=left>lower part, (NW-SE direction)</td>
1028 </tr>
1029 <tr>
1030 <td nowrap valign=top><tt>16</tt>&nbsp; </td>
1031 <td align=left>lower part, (NE-SW direction)</td>
1032 </tr>
1033 <tr>
1034 <td nowrap valign=top><tt>17</tt>&nbsp; </td>
1035 <td align=left>lower part, (SE-NW direction)</td>
1036 </tr>
1037 <tr>
1038 <td nowrap valign=top><tt>18</tt>&nbsp; </td>
1039 <td align=left>upper part, (SW-NE direction)</td>
1040 </tr>
1041 <tr>
1042 <td nowrap valign=top><tt>19</tt>&nbsp; </td>
1043 <td align=left>upper part, (NW-SE direction)</td>
1044 </tr>
1045 <tr>
1046 <td nowrap valign=top><tt>1A</tt>&nbsp; </td>
1047 <td align=left>upper part, (NE-SW direction)</td>
1048 </tr>
1049 <tr>
1050 <td nowrap valign=top><tt>1B</tt>&nbsp; </td>
1051 <td align=left>upper part, (SE-NW direction)</td>
1052 </tr>
1053 </table>
1054 </td>
1055 </tr>
1057 <tr>
1058 <td nowrap valign=top><tt>80</tt>..<tt>83</tt>&nbsp; </td>
1059 <td align=left>ship depots
1060 <table>
1061 <tr>
1062 <td nowrap valign=top><tt>80</tt>&nbsp; </td>
1063 <td align=left>ship depot, NE part (X direction)</td>
1064 </tr>
1065 <tr>
1066 <td nowrap valign=top><tt>81</tt>&nbsp; </td>
1067 <td align=left>ship depot, SW part (X direction)</td>
1068 </tr>
1069 <tr>
1070 <td nowrap valign=top><tt>82</tt>&nbsp; </td>
1071 <td align=left>ship depot, NW part (Y direction)</td>
1072 </tr>
1073 <tr>
1074 <td nowrap valign=top><tt>83</tt>&nbsp; </td>
1075 <td align=left>ship depot, SE part (Y direction)</td>
1076 </tr>
1077 </table>
1078 </td>
1079 </tr>
1080 </table>
1081 </li>
1082 </ul>
1083 </td>
1084 </tr>
1086 <tr bgcolor="#CCCCCC">
1087 <td valign=top nowrap><strong><a name="Class7"><tt> 7 </tt></a></strong></td>
1088 <td><strong>Void </strong></td>
1089 </tr>
1090 <tr>
1091 <td valign=top nowrap>&nbsp;</td>
1092 <td>Tiles of this class form an invisible, one tile wide border at the south (bottom) edges of the map,<br>
1093 so as to protect several algorithms from the consequences of a wraparound at the edges.
1094 </td>
1095 </tr>
1097 <tr bgcolor="#CCCCCC">
1098 <td valign=top nowrap><strong><a name="Class8"><tt> 8</tt></a></strong></td>
1099 <td><strong>Industries </strong></td>
1100 </tr>
1101 <tr>
1102 <td valign=top nowrap>&nbsp;</td>
1103 <td>
1104 <ul>
1105 <li>m1 bit 7: clear = under construction
1106 <ul>
1107 <li>m1 bits 6..5 : Water class (sea, canal, river or land)
1108 <li>m1 bits 3..2: construction counter, for buildings under construction incremented on every periodic tile processing</li>
1109 <li>m1 bits 1..0: stage of construction (<tt>3</tt> = completed), incremented when the construction counter wraps around<br>
1110 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)</li>
1111 </ul>
1112 </li>
1113 <li>m2: index into the array of industries</li>
1114 <li>m3: random bits (NewGRF)</li>
1115 <li>m4: animation loop</li>
1116 <li>m5: type (plus m6 bit 2):<br>
1117 <small>(note: this is not the same as the industry type, which is stored in the array of industries)</small>
1119 <table>
1120 <tr>
1121 <td nowrap valign=top><tt>00</tt>..<tt>06</tt>&nbsp; </td>
1122 <td align=left>coal mine
1123 <table>
1124 <tr>
1125 <td nowrap valign=top><tt>00</tt>&nbsp; </td>
1126 <td align=left>wheel tower when not animated</td>
1127 </tr>
1128 <tr>
1129 <td nowrap valign=top><tt>01</tt>&nbsp; </td>
1130 <td align=left>wheel tower when animated<br>
1131 animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
1132 </tr>
1133 </table>
1134 </td>
1135 </tr>
1137 <tr>
1138 <td nowrap valign=top><tt>07</tt>..<tt>0A</tt>&nbsp; </td>
1139 <td align=left>power station
1140 <table>
1141 <tr>
1142 <td nowrap valign=top><tt>08</tt>&nbsp; </td>
1143 <td align=left>chimney</td>
1144 </tr>
1145 <tr>
1146 <td nowrap valign=top><tt>0A</tt>&nbsp; </td>
1147 <td align=left>transformer; animation progress in m7(valid range <tt>0</tt>..<tt>7</tt>)</td>
1148 </tr>
1149 </table>
1150 </td>
1151 </tr>
1153 <tr>
1154 <td nowrap valign=top><tt>0B</tt>..<tt>0F</tt>&nbsp; </td>
1155 <td align=left>sawmill</td>
1156 </tr>
1158 <tr>
1159 <td nowrap valign=top><tt>10</tt>..<tt>11</tt>&nbsp; </td>
1160 <td align=left>forest
1161 <table>
1162 <tr>
1163 <td nowrap valign=top><tt>11</tt>&nbsp; </td>
1164 <td align=left>trees cut down</td>
1165 </tr>
1166 </table>
1167 </td>
1168 </tr>
1170 <tr>
1171 <td nowrap valign=top><tt>12</tt>..<tt>17</tt>&nbsp; </td>
1172 <td align=left>oil refinery</td>
1173 </tr>
1175 <tr>
1176 <td nowrap valign=top><tt>18</tt>..<tt>1C</tt>&nbsp; </td>
1177 <td align=left>oil rig</td>
1178 </tr>
1180 <tr>
1181 <td nowrap valign=top><tt>1D</tt>..<tt>20</tt>&nbsp; </td>
1182 <td align=left>oil wells
1183 <table>
1184 <tr>
1185 <td nowrap valign=top><tt>1D</tt>&nbsp; </td>
1186 <td align=left>not animated</td>
1187 </tr>
1188 <tr>
1189 <td nowrap valign=top><tt>1E</tt>..<tt>20</tt>&nbsp; </td>
1190 <td align=left>various stages of animation; progress of animation in m7</td>
1191 </tr>
1192 </table>
1193 </td>
1194 </tr>
1196 <tr>
1197 <td nowrap valign=top><tt>21</tt>..<tt>26</tt>&nbsp; </td>
1198 <td align=left>farm</td>
1199 </tr>
1201 <tr>
1202 <td nowrap valign=top><tt>27</tt>..<tt>2A</tt>&nbsp; </td>
1203 <td align=left>factory (temperate climate)</td>
1204 </tr>
1206 <tr>
1207 <td nowrap valign=top><tt>2B</tt>..<tt>2E</tt>&nbsp; </td>
1208 <td align=left>printing works</td>
1209 </tr>
1211 <tr>
1212 <td nowrap valign=top><tt>2F</tt>..<tt>33</tt>&nbsp; </td>
1213 <td align=left>copper ore mine
1214 <table>
1215 <tr>
1216 <td nowrap valign=top><tt>2F</tt>&nbsp; </td>
1217 <td align=left>wheel tower when not animated</td>
1218 </tr>
1219 <tr>
1220 <td nowrap valign=top><tt>30</tt>&nbsp; </td>
1221 <td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
1222 </tr>
1223 <tr>
1224 <td nowrap valign=top><tt>31</tt>&nbsp; </td>
1225 <td align=left>chimney</td>
1226 </tr>
1227 </table>
1228 </td>
1229 </tr>
1231 <tr>
1232 <td nowrap valign=top><tt>34</tt>..<tt>39</tt>&nbsp; </td>
1233 <td align=left>steel mill</td>
1234 </tr>
1236 <tr>
1237 <td nowrap valign=top><tt>3A</tt>..<tt>3B</tt>&nbsp; </td>
1238 <td align=left>bank (temperate climate)</td>
1239 </tr>
1241 <tr>
1242 <td nowrap valign=top><tt>3C</tt>..<tt>3F</tt>&nbsp; </td>
1243 <td align=left>food processing plant</td>
1244 </tr>
1246 <tr>
1247 <td nowrap valign=top><tt>40</tt>..<tt>47</tt>&nbsp; </td>
1248 <td align=left>paper mill</td>
1249 </tr>
1251 <tr>
1252 <td nowrap valign=top><tt>48</tt>..<tt>58</tt>&nbsp; </td>
1253 <td align=left>gold mine
1254 <table>
1255 <tr>
1256 <td nowrap valign=top><tt>4F</tt>&nbsp; </td>
1257 <td align=left>wheel tower when not animated</td>
1258 </tr>
1259 <tr>
1260 <td nowrap valign=top><tt>58</tt>&nbsp; </td>
1261 <td align=left>wheel tower when animated; animation state in m7 bits 5..0; m7 bit 6 set = sound already generated</td>
1262 </tr>
1263 </table></td>
1264 </tr>
1266 <tr>
1267 <td nowrap valign=top><tt>59</tt>..<tt>5A</tt>&nbsp; </td>
1268 <td align=left>bank (sub-arctic or sub-tropical climate)</td>
1269 </tr>
1271 <tr>
1272 <td nowrap valign=top><tt>5B</tt>..<tt>63</tt>&nbsp; </td>
1273 <td align=left>diamond mine</td>
1274 </tr>
1276 <tr>
1277 <td nowrap valign=top><tt>64</tt>..<tt>73</tt>&nbsp; </td>
1278 <td align=left>iron ore mine</td>
1279 </tr>
1281 <tr>
1282 <td nowrap valign=top><tt>74</tt></td>
1283 <td align=left>fruit plantation</td>
1284 </tr>
1286 <tr>
1287 <td nowrap valign=top><tt>75</tt></td>
1288 <td align=left>rubber plantation</td>
1289 </tr>
1291 <tr>
1292 <td nowrap valign=top><tt>76</tt>..<tt>77</tt>&nbsp; </td>
1293 <td align=left>water supply</td>
1294 </tr>
1296 <tr>
1297 <td nowrap valign=top><tt>78</tt></td>
1298 <td align=left>water tower</td>
1299 </tr>
1301 <tr>
1302 <td nowrap valign=top><tt>79</tt>..<tt>7C</tt>&nbsp; </td>
1303 <td align=left>factory (sub-tropical climate)</td>
1304 </tr>
1306 <tr>
1307 <td nowrap valign=top><tt>7D</tt>..<tt>80</tt>&nbsp; </td>
1308 <td align=left>lumber mill</td>
1309 </tr>
1311 <tr>
1312 <td nowrap valign=top><tt>81</tt>..<tt>82</tt>&nbsp; </td>
1313 <td align=left>candyfloss forest
1314 <table>
1315 <tr>
1316 <td nowrap valign=top><tt>82</tt>&nbsp; </td>
1317 <td align=left>candyfloss 'trees' cut down</td>
1318 </tr>
1319 </table>
1320 </td>
1321 </tr>
1323 <tr>
1324 <td nowrap valign=top><tt>83</tt>..<tt>86</tt>&nbsp; </td>
1325 <td align=left>sweet factory</td>
1326 </tr>
1328 <tr>
1329 <td nowrap valign=top><tt>87</tt>..<tt>88</tt>&nbsp; </td>
1330 <td align=left>battery farm
1331 <table>
1332 <tr>
1333 <td nowrap valign=top><tt>88</tt>&nbsp; </td>
1334 <td align=left>batteries 'reaped'</td>
1335 </tr>
1336 </table>
1337 </td>
1338 </tr>
1340 <tr>
1341 <td nowrap valign=top><tt>89</tt></td>
1342 <td align=left>cola wells</td>
1343 </tr>
1345 <tr>
1346 <td nowrap valign=top><tt>8A</tt>..<tt>8D</tt>&nbsp; </td>
1347 <td align=left>toy shop</td>
1348 </tr>
1350 <tr>
1351 <td nowrap valign=top><tt>8E</tt>..<tt>93</tt>&nbsp; </td>
1352 <td align=left>toy factory
1353 <table>
1354 <tr>
1355 <td nowrap valign=top><tt>8F</tt>&nbsp; </td>
1356 <td align=left>Animated part; animation state in m7 (valid range <tt>00</tt>..<tt>31</tt>)<br>
1357 Tile animation is started (m4 zeroed) on the periodic processing.<br>
1358 While the animation is in progress, m4 holds the number
1359 of animation cycles that have already taken place.<br>
1360 when this number reaches 8 the animation is stopped.</td>
1361 </tr>
1362 </table>
1363 </td>
1364 </tr>
1366 <tr>
1367 <td nowrap valign=top><tt>94</tt>..<tt>9B</tt>&nbsp; </td>
1368 <td align=left>plastic fountains (various stages of cyclic animation)</td>
1369 </tr>
1371 <tr>
1372 <td nowrap valign=top><tt>9C</tt>..<tt>9F</tt>&nbsp; </td>
1373 <td align=left>fizzy drink factory</td>
1374 </tr>
1376 <tr>
1377 <td nowrap valign=top><tt>A0</tt>..<tt>A3</tt>&nbsp; </td>
1378 <td align=left>bubble generator
1379 <table>
1380 <tr>
1381 <td nowrap valign=top><tt>A1</tt>&nbsp; </td>
1382 <td align=left>generators</td>
1383 </tr>
1384 <tr>
1385 <td nowrap valign=top><tt>A2</tt>&nbsp; </td>
1386 <td align=left>bubble capture facility; animation state in m7 (valid range <tt>00</tt>..<tt>27</tt>)</td>
1387 </tr>
1388 </table>
1389 </td>
1390 </tr>
1392 <tr>
1393 <td nowrap valign=top><tt>A4</tt>..<tt>A6</tt>&nbsp; </td>
1394 <td align=left>toffee quarry
1395 <table>
1396 <tr>
1397 <td nowrap valign=top><tt>A5</tt>&nbsp; </td>
1398 <td align=left>animated part; animation state in m3 (valid range <tt>00</tt>..<tt>45</tt>)</td>
1399 </tr>
1400 </table>
1401 </td>
1402 </tr>
1404 <tr>
1405 <td nowrap valign=top><tt>A7</tt>..<tt>AE</tt>&nbsp; </td>
1406 <td align=left>sugar mine
1407 <table>
1408 <tr>
1409 <td nowrap valign=top><tt>AE</tt>&nbsp; </td>
1410 <td align=left>animated part; animation state in m3 (valid range <tt>00</tt>..<tt>5F</tt>)</td>
1411 </tr>
1412 </table>
1413 </td>
1414 </tr>
1415 <tr>
1416 <td nowrap valign=top><tt>AF</tt>..<tt>1FF</tt>&nbsp; </td>
1417 <td align=left>NewGRF industries industry</td>
1418 </tr>
1419 </table>
1420 </li>
1421 <li>m6 bits 5..3: random triggers (NewGRF)</li>
1422 <li>m6 bit 2: bit 8 of type (see m5)</li>
1423 <li>m7: animation frame</li>
1424 </ul>
1425 </td>
1426 </tr>
1428 <tr bgcolor="#CCCCCC">
1429 <td valign=top nowrap><strong><a name="Class9"><tt> 9</tt></a></strong></td>
1430 <td><strong>Tunnel / bridge</strong></td>
1431 </tr>
1432 <tr>
1433 <td valign=top nowrap>&nbsp;</td>
1434 <td>
1435 <ul>
1436 <li style="color: blue">m1 bit 7: bit 4 of track type (more rail types patch)</li>
1437 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a></li>
1438 <li style="color: blue">m2 bits 15..0: tunnel ID lookup (tunnel entrances only)<br>
1439 <li style="color: blue">m2 bits 7..0: custom road bridge heads (flat bridge heads only)<br>
1440 Road/tram bits below are XORed with the axial bridge direction road bits.<br>
1441 A non-custom bridge head configuration will have a value of 0.
1442 <ul>
1443 <li>m2 bits 7..4: Road bits<br>
1444 Valid only if m7 bit 6 is set
1445 </li>
1446 <li>m2 bits 3..0: Tram bits<br>
1447 Valid only if m7 bit 7 is set
1448 </li>
1449 </ul>
1450 <table style="color: blue">
1451 <tr>
1452 <td align=left>bit 0: </td>
1453 <td>NW piece</td>
1454 </tr>
1455 <tr>
1456 <td align=left>bit 1: </td>
1457 <td>SW piece</td>
1458 </tr>
1459 <tr>
1460 <td align=left>bit 2: </td>
1461 <td>SE piece</td>
1462 </tr>
1463 <tr>
1464 <td align=left>bit 3: </td>
1465 <td>NE piece</td>
1466 </tr>
1467 </table>
1468 </li>
1469 <li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram</li>
1470 <li>m3 bits 3..0: <a href="#RailType">track type</a> for railway</li>
1471 <li>m4: <a href="#RoadType">Road-(sub-)types</a></li>
1472 <li>m5 bit 4: pbs reservation state for railway</li>
1473 <li>m5 bit 7 clear: tunnel entrance/exit</li>
1474 <li>m5 bit 7 set: bridge ramp
1475 <ul>
1476 <li>m6 bits 5..2: <a name="BridgeType">bridge type</a>:
1477 <table>
1478 <tr>
1479 <th align=left>Type&nbsp;</th>
1480 <th align=left>Max. speed (mph)&nbsp;</th>
1481 <th align=left>Description</th>
1482 </tr>
1484 <tr>
1485 <td nowrap valign=top><tt>0</tt>&nbsp; </td>
1486 <td align=center>20</td>
1487 <td align=left>wooden</td>
1488 </tr>
1490 <tr>
1491 <td nowrap valign=top><tt>1</tt>&nbsp; </td>
1492 <td align=center>30</td>
1493 <td align=left>concrete</td>
1494 </tr>
1496 <tr>
1497 <td nowrap valign=top><tt>2</tt>&nbsp; </td>
1498 <td align=center>40</td>
1499 <td align=left>girder, steel</td>
1500 </tr>
1502 <tr>
1503 <td nowrap valign=top><tt>3</tt>&nbsp; </td>
1504 <td align=center>50</td>
1505 <td align=left>suspension, concrete</td>
1506 </tr>
1508 <tr>
1509 <td nowrap valign=top><tt>4</tt>&nbsp; </td>
1510 <td align=center>60</td>
1511 <td align=left>suspension, steel</td>
1512 </tr>
1514 <tr>
1515 <td nowrap valign=top><tt>5</tt>&nbsp; </td>
1516 <td align=center>70</td>
1517 <td align=left>suspension, steel</td>
1518 </tr>
1520 <tr>
1521 <td nowrap valign=top><tt>6</tt>&nbsp; </td>
1522 <td align=center>100</td>
1523 <td align=left>cantilever, steel</td>
1524 </tr>
1526 <tr>
1527 <td nowrap valign=top><tt>7</tt>&nbsp; </td>
1528 <td align=center>130</td>
1529 <td align=left>cantilever, steel</td>
1530 </tr>
1532 <tr>
1533 <td nowrap valign=top><tt>8</tt>&nbsp; </td>
1534 <td align=center>150</td>
1535 <td align=left>cantilever, steel</td>
1536 </tr>
1538 <tr>
1539 <td nowrap valign=top><tt>9</tt>&nbsp; </td>
1540 <td align=center>160</td>
1541 <td align=left>girder, steel</td>
1542 </tr>
1544 <tr>
1545 <td nowrap valign=top><tt>A</tt>&nbsp; </td>
1546 <td align=center>200</td>
1547 <td align=left>tubular, steel</td>
1548 </tr>
1550 <tr>
1551 <td nowrap valign=top><tt>B</tt>&nbsp; </td>
1552 <td align=center>320</td>
1553 <td align=left>tubular, steel</td>
1554 </tr>
1556 <tr>
1557 <td nowrap valign=top><tt>C</tt>&nbsp; </td>
1558 <td align=center>380</td>
1559 <td align=left>tubular, silicon</td>
1560 </tr>
1561 </table>
1562 </li>
1563 </ul>
1564 </li>
1565 <li style="color: blue">m5 bits 6..5: signal simulation (signals on bridge/tunnels patch)
1566 <table style="color: blue">
1567 <tr>
1568 <td><tt>0</tt>&nbsp;</td>
1569 <td>no signal simulation</td>
1570 </tr>
1572 <tr>
1573 <td><tt>1</tt>&nbsp;</td>
1574 <td>signal simulation entrance (bit 5 set)</td>
1575 </tr>
1577 <tr>
1578 <td><tt>2</tt>&nbsp;</td>
1579 <td>signal simulation exit (bit 6 set)</td>
1580 </tr>
1581 </table>
1582 If signal simulation entrance or exit:
1583 <ul>
1584 <li>m6 bit 6: set = PBS signals, clear = block signals</li>
1585 <li>m6 bit 1: set = semaphore signals, clear = light signals</li>
1586 <li>m6 bit 0: set = signal shows green, clear = signal shows red</li>
1587 <li>m2 bit 15: for bridge entrances only: storage for visual red/green state of signals starting from 15 is allocated outside the map array</li>
1588 <li>m2 bits 14..0: for bridge entrances only: for signals 0..14 on bridge, signal is visually red if corresponding bit in 0..14 is set</li>
1589 </ul>
1590 </li>
1591 <li>m5 bits 3..2: transport type
1592 <table>
1593 <tr>
1594 <td><tt>0</tt>&nbsp;</td>
1595 <td>railway</td>
1596 </tr>
1598 <tr>
1599 <td><tt>1</tt>&nbsp;</td>
1600 <td>road</td>
1601 </tr>
1603 <tr>
1604 <td><tt>2</tt>&nbsp;</td>
1605 <td>water</td>
1606 </tr>
1607 </table>
1608 </li>
1609 <li>m5 bits 1..0: direction onto the bridge / out of the tunnel
1610 <table>
1611 <tr>
1612 <td><tt>0</tt>&nbsp; </td>
1613 <td>NE</td>
1614 </tr>
1616 <tr>
1617 <td><tt>1</tt>&nbsp; </td>
1618 <td>SE</td>
1619 </tr>
1621 <tr>
1622 <td><tt>2</tt>&nbsp; </td>
1623 <td>SW</td>
1624 </tr>
1626 <tr>
1627 <td><tt>3</tt>&nbsp; </td>
1628 <td>NW</td>
1629 </tr>
1630 </table>
1631 </li>
1632 <li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road</li>
1633 <li>m7 bit 5 set = on snow or desert</li>
1634 </ul>
1635 </td>
1636 </tr>
1638 <tr bgcolor="#CCCCCC">
1639 <td valign=top nowrap><strong><a name="ClassA"><tt> A</tt></a></strong></td>
1640 <td><strong><tt>Objects</tt></strong></td>
1641 </tr>
1642 <tr>
1643 <td valign=top nowrap>&nbsp;</td>
1644 <td>
1645 <ul>
1646 <li>m1 bits 6..5 : Water class (sea, canal, river or land)</li>
1647 <li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the object (for lighthouses and transmitters normally <tt>10</tt>)</li>
1648 <li>m2: index into the array of objects, bits 0 to 15 (upper bits in m5)</li>
1649 <li>m3: random bits</li>
1650 <li>m5: index into the array of objects, bits 16 to 23 (lower bits in m2)</li>
1651 <li>m7: animation counter</li>
1652 </ul>
1653 </td>
1654 </tr>
1655 <tr>
1656 <td colspan=2>Classes <tt>B</tt> through <tt>F</tt> are reserved. The presence
1657 of a tile in one of the reserved classes will crash OTTD.</td>
1658 </tr>
1659 </table>
1662 <hr>
1663 Original Copyright &copy; 2003 by Marcin Grzegorczyk for TTDLX.<br>
1664 Transport Tycoon and Transport Tycoon Deluxe are Copyright &copy; by Chris Sawyer.<br>
1665 All the other trademarks are the property of their respective owners.<br>
1666 </body>
1668 </html>