forked from mluparu/OpenTTD
-
Notifications
You must be signed in to change notification settings - Fork 1
/
landscape.html
1641 lines (1504 loc) · 50.3 KB
/
landscape.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="Author" content="Marcin Grzegorczyk">
<meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OpenTTD Landscape Internals</title>
</head>
<body>
<h3><a name="Landscape">Landscape</a></h3>
<p>
For a graphical representation of the tile-layout have a look at
<a href="landscape_grid.html">Landscape grid</a> page.
</p>
<p>Nine attributes (counting "<span style="font-weight: bold;">type</span>" and
"<span style="font-weight: bold;">height</span>") hold the information about a tile.<BR>
These attributes are referred to as
"<span style="font-weight: bold;">type</span>",
"<span style="font-weight: bold;">height</span>",
"<span style="font-weight: bold;">m1</span>", "<span style="font-weight: bold;">m2</span>",
"<span style="font-weight: bold;">m3</span>", "<span style="font-weight: bold;">m4</span>",
"<span style="font-weight: bold;">m5</span>", "<span style="font-weight: bold;">m6</span>"
and "<span style="font-weight: bold;">m7</span>".<br>
The most important value is the class of a tile, stored in the upper 4 bits
of the <span style="font-weight: bold;">type</span> attribute.
</p>
Frequently repeating patterns:
<ul>
<li><span style="font-weight: bold;">type</span>
<ul>
<li>
<a name="type"></a>
Bits 7..4:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">The tile type.</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>Ground</td></tr>
<tr><td><tt>01</tt></td><td>Railway tracks</td></tr>
<tr><td><tt>02</tt></td><td>Roads</td></tr>
<tr><td><tt>03</tt></td><td>Town building</td></tr>
<tr><td><tt>04</tt></td><td>Trees</td></tr>
<tr><td><tt>05</tt></td><td>Station tiles</td></tr>
<tr><td><tt>06</tt></td><td>Water</td></tr>
<tr><td><tt>07</tt></td><td>Void</td></tr>
<tr><td><tt>08</tt></td><td>Industries</td></tr>
<tr><td><tt>09</tt></td><td>Tunnel / bridge</td></tr>
<tr><td><tt>0A</tt></td><td>Objects</td></tr>
</table>
</li>
Bits 3..2:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Presence and direction of bridge above.</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>no bridge</td></tr>
<tr><td><tt>01</tt></td><td>Axis X (North-East)</td></tr>
<tr><td><tt>02</tt></td><td>Axis Y (South-West)</td></tr>
</table>
<li>
<a name="tropic_zone"></a>
Bits 1..0:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">Only meaningful in tropic climate. It contains the definition of the available zones</td></tr>
<tr><td style="width: 5em;"><tt>00</tt></td><td>normal</td></tr>
<tr><td><tt>01</tt></td><td>desert</td></tr>
<tr><td><tt>02</tt></td><td>rain forest</td></tr>
</table>
In any other climate these 2 bits are theoretically free of use, however using them does not seem useful.
</li>
</ul>
<li><span style="font-weight: bold;">m1</span>
<ul>
<li>
<a name="WaterClass"></a>
Bits 6..5:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">The type of water that is on a tile.
<tr><td style="width: 5em;"><tt>00</tt></td><td align=left>Sea</td></tr>
<tr><td><tt>01</tt></td><td align=left>Canal</td></tr>
<tr><td><tt>02</tt></td><td align=left>River</td></tr>
<tr><td><tt>03</tt></td><td align=left>Invalid, i.e. no water on this tile</td></tr>
</table>
Some tiles, such as houses, reuse these bits of other purposes.
</li>
<li>
<a name="OwnershipInfo"></a>
Bits 4..0:
<table border="1" style="width: 30em;">
<tr bgcolor="#CCCCCC"><td colspan="2">The owner of a tile can be either companies (human or AI) or "Game entities".
<tr><td style="width: 5em;"><tt>00..0E</tt></td><td align=left>Normal companies</td></tr>
<tr><td><tt>0F</tt></td><td align=left>a town owns the tile</td></tr>
<tr><td><tt>10</tt></td><td align=left>nobody owns the tile</td></tr>
<tr><td><tt>11</tt></td><td align=left>"water" owns the tile</td></tr>
<tr><td><tt>FF</tt></td><td align=left>spectator in MP or in scenario editor</td></tr>
</table>
Some tiles, such as houses and industries, reuse these bits of other purposes.
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m4:</span><br>
<a name="RoadType"></a>
Road roadtype. Used for all tiles with road (road, station, tunnelbridge).
<ul>
<li>
Bits 5..0: Road roadtype, 0x3F for no road.
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m8:</span><br>
<a name="TramType"></a>
Tram roadtype. Used for all tiles with road (road, station, tunnelbridge).
<ul>
<li>
Bits 11..6: Tram roadtype, 0x3F for no tram.
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m8:</span><br>
<ul>
<li>
<a name="RailType"></a>
Bits 5..0: Railtype. Used for all tiles with rail (road, rail, station, tunnelbridge).
</li>
</ul>
</li>
<li><span style="font-weight: bold;">m7:</span><br>
Animation frame/state. Used for houses, industries, objects and stations.
</li>
</ul>
<p>OTTD's class-specific periodic tile processing routine is called once every +256 ticks for each tile.</p>
<table border=1 cellpadding=3>
<tr bgcolor="#0099FF">
<th align=left><font color="#FFFFFF">Class</font></th>
<th align=left><font color="#FFFFFF">Meaning & details of encoding</font></th>
</tr>
<tr bgcolor="#CCCCCC">
<td align=left><strong><a name="Class0"><tt> 0 </tt></a></strong></td>
<td align=left> <strong>Ground </strong></td>
</tr>
<tr>
<td valign=top nowrap> </td>
<td>
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile (normally <tt>10</tt>)</li>
<li>m2: see fields</li>
<li>m3 bits 7..5: type of hedge on NE border of the tile</li>
<li>m3 bits 3..0: see fields</li>
<li>m3 bit 4: set if the tile is covered with snow</li>
<li>m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)</li>
<li>m4 bits 4..2: same as 7..5, but for the SE border</li>
<li>m5 bits 7..5: update counter, incremented on every periodic processing for tile types,
other than <tt>03</tt>, <tt>07</tt>, <tt>0B</tt>, <tt>10</tt> and above.<BR>
on wraparound, the tile is updated (for fields, the type of fields in m3 is increased, for other types the tile type in m5 is increased).<BR>
For snow and desert, these bits are not used, tile is updated on every periodic processing.</li>
<li>m5 bits 4..2: tile type:
<table>
<tr>
<td nowrap valign=top><tt>0</tt> </td>
<td align=left>bare land / grass</td>
</tr>
<tr>
<td nowrap valign=top><tt>1</tt> </td>
<td align=left>rough land (density must be 3)</td>
</tr>
<tr>
<td nowrap valign=top><tt>2</tt> </td>
<td align=left>rocks (density must be 3)</td>
</tr>
<tr>
<td nowrap valign=top><tt>3</tt> </td>
<td align=left>fields (density must be 3)
<ul>
<li>m2: index into the array of industries (farms), INVALID_INDUSTRY (0xFFFF) if farm has been removed</li>
<li>m3 bits 3..0: field type (legal values: 0 through 9)</li>
</ul>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>4</tt> </td>
<td align=left>snow</td>
</tr>
<tr>
<td nowrap valign=top><tt>5</tt> </td>
<td align=left>desert (density must be 1 or 3)</td>
</tr>
</table>
</li>
<li>m5 bits 1..0: density:
<table>
<tr>
<td nowrap valign=top><tt>0</tt> </td>
<td>bare land</td>
<td></td>
<td></td>
<td></td>
<td>1/4 snow</td>
<td></td>
</tr>
<tr>
<td nowrap valign=top><tt>1</tt> </td>
<td>1/3 grass</td>
<td></td>
<td></td>
<td></td>
<td>2/4 snow; </td>
<td>1/2 desert</td>
</tr>
<tr>
<td nowrap valign=top><tt>2</tt> </td>
<td>2/3 grass</td>
<td></td>
<td></td>
<td></td>
<td>3/4 snow</td>
<td></td>
</tr>
<tr>
<td nowrap valign=top><tt>3</tt> </td>
<td>full grass; </td>
<td>rough land; </td>
<td>rocks; </td>
<td>fields; </td>
<td>full snow; </td>
<td>full desert</td>
</tr>
</table>
</li>
<li>m6 bits 4..2: type of hedge on NW border of the tile</li>
</ul>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="Class1"><tt> 1</tt></a></strong></td>
<td><strong>Railway tracks</strong></td>
</tr>
<tr>
<td valign=top nowrap> </td>
<td>
<ul>
<li>m1 bit 7: Ship docking tile status (for half-tile with water)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the tile</li>
<li>m2: see signals</li>
<li>m3 bits 7..4: see signals</li>
<li>m8 bits 5..0 = <a name="TrackType">track type</a>:
<table>
<tr>
<td><tt>0</tt> </td>
<td>conventional railway</td>
</tr>
<tr>
<td><tt>1</tt> </td>
<td>electrified railway</td>
</tr>
<tr>
<td><tt>2</tt> </td>
<td>monorail</td>
</tr>
<tr>
<td><tt>3</tt> </td>
<td>maglev</td>
</tr>
</table>
</li>
<li>m4 bits 7..4: see signals</li>
<li>m4 bits 3..0: Ground type (values with fences are not valid for depots and checkpoints)
<table>
<tr>
<td nowrap valign=top><tt>0</tt> </td>
<td align=left>on bare land</td>
</tr>
<tr>
<td nowrap valign=top><tt>1</tt> </td>
<td align=left>on grass, no fences</td>
</tr>
<tr>
<td nowrap valign=top><tt>2</tt> </td>
<td align=left>fence on the NW side</td>
</tr>
<tr>
<td nowrap valign=top><tt>3</tt> </td>
<td align=left>fence on the SE side</td>
</tr>
<tr>
<td nowrap valign=top><tt>4</tt> </td>
<td align=left>fences on the NW and SE sides</td>
</tr>
<tr>
<td nowrap valign=top><tt>5</tt> </td>
<td align=left>fence on the NE side</td>
</tr>
<tr>
<td nowrap valign=top><tt>6</tt> </td>
<td align=left>fence on the SW side</td>
</tr>
<tr>
<td nowrap valign=top><tt>7</tt> </td>
<td align=left>fences on the NE and SW sides</td>
</tr>
<tr>
<td nowrap valign=top><tt>8</tt> </td>
<td align=left>fence on the E side (track in the W corner)</td>
</tr>
<tr>
<td nowrap valign=top><tt>9</tt> </td>
<td align=left>fence on the W side (track in the E corner)</td>
</tr>
<tr>
<td nowrap valign=top><tt>A</tt> </td>
<td align=left>fence on the S side (track in the N corner)</td>
</tr>
<tr>
<td nowrap valign=top><tt>B</tt> </td>
<td align=left>fence on the N side (track in the S corner)</td>
</tr>
<tr>
<td nowrap valign=top><tt>C</tt> </td>
<td align=left>on snow or desert</td>
</tr>
<tr>
<td nowrap valign=top><tt>D</tt> </td>
<td align=left>on grass with fence and shore or water on the free halftile</td>
</tr>
<tr>
<td nowrap valign=top><tt>E</tt> </td>
<td align=left>higher part on foundation with snow, lower without snow</td>
</tr>
</table>
</li>
<li>m5 bit 7 clear: railway track
<ul>
<li>m5 bits 5..0: track layout: bit set = track present:
<table>
<tr>
<td nowrap valign=top>bit 0: </td>
<td align=left>in the X direction</td>
</tr>
<tr>
<td nowrap valign=top>bit 1: </td>
<td align=left>in the Y direction</td>
</tr>
<tr>
<td nowrap valign=top>bit 2: </td>
<td align=left>in the north corner (direction W-E)</td>
</tr>
<tr>
<td nowrap valign=top>bit 3: </td>
<td align=left>in the south corner (direction W-E)</td>
</tr>
<tr>
<td nowrap valign=top>bit 4: </td>
<td align=left>in the west corner (direction N-S)</td>
</tr>
<tr>
<td nowrap valign=top>bit 5: </td>
<td align=left>in the east corner (direction N-S)</td>
</tr>
</table>
</li>
<li>m5 bit 6 set = with signals:<BR>
There are at most 4 signals on a tile. The signals 0..3 belong to the directions:
<table>
<tr>
<td></td>
<td>Track <tt>0</tt> (X) </td>
<td>Track <tt>1</tt> (Y) </td>
<td>Track <tt>2</tt> (north) </td>
<td>Track <tt>3</tt> (south) </td>
<td>Track <tt>4</tt> (west) </td>
<td>Track <tt>5</tt> (east)</td>
</tr>
<tr>
<td align=left>Signal <tt>0</tt> </td>
<td></td>
<td></td>
<td></td>
<td>west</td>
<td></td>
<td>south</td>
</tr>
<tr>
<td align=left>Signal <tt>1</tt> </td>
<td></td>
<td></td>
<td></td>
<td>east</td>
<td></td>
<td>north</td>
</tr>
<tr>
<td align=left>Signal <tt>2</tt> </td>
<td>south-west</td>
<td>north-west</td>
<td>west</td>
<td></td>
<td>south</td>
<td></td>
</tr>
<tr>
<td align=left>Signal <tt>3</tt> </td>
<td>north-east</td>
<td>south-east</td>
<td>east</td>
<td></td>
<td>north</td>
<td></td>
</tr>
</table>
<ul>
<li>m2 bit 7: Signal 0 and 1: set = semaphore signals, clear = light signals</li>
<li>m2 bit 3: Signal 2 and 3: set = semaphore signals, clear = light signals</li>
<li>m2 bits 6..4: type of signal 0 and 1 (same values as m2 bits 2..0)</li>
<li>m2 bits 2..0: type of signal 2 and 3
<table>
<tr>
<td nowrap="nowrap" valign="top"><tt>000</tt>: </td>
<td align="left">normal signals</td>
</tr>
<tr>
<td nowrap="nowrap" valign="top"><tt>001</tt>: </td>
<td align="left">pre-signals</td>
</tr>
<tr>
<td nowrap="nowrap" valign="top"><tt>010</tt>: </td>
<td align="left">exit-signals</td>
</tr>
<tr>
<td nowrap="nowrap" valign="top"><tt>011</tt>: </td>
<td align="left">combo-signals</td>
</tr>
<tr>
<td nowrap="nowrap" valign="top"><tt>100</tt>: </td>
<td align="left">pbs signals</td>
</tr>
<tr>
<td nowrap="nowrap" valign="top"><tt>101</tt>: </td>
<td align="left">no-entry signals</td>
</tr>
</table>
</li>
<li>m3 bits 7..4: bit set = signal 3..0 present</li>
<li>m4 bits 7..4: bit clear = signal 3..0 shows red</li>
</ul>
</li>
<li>m2 bits 8..10: track reserved for pbs
<table>
<tr>
<td><tt>0</tt> </td>
<td>not reserved</td>
</tr>
<tr>
<td><tt>1</tt> </td>
<td>X direction</td>
</tr>
<tr>
<td><tt>2</tt> </td>
<td>Y direction</td>
</tr>
<tr>
<td><tt>3</tt> </td>
<td>north corner (W-E)</td>
</tr>
<tr>
<td><tt>4</tt> </td>
<td>south corner (W-E)</td>
</tr>
<tr>
<td><tt>5</tt> </td>
<td>west corner (N-S)</td>
</tr>
<tr>
<td><tt>6</tt> </td>
<td>east corner (N-S)</td>
</tr>
</table>
</li>
<li>m2 bit 11: opposite track is reserved, too</li>
</ul>
</li>
<li>m5 bit 7 set, bit 6 set: railway depot
<ul>
<li>m2: Depot index</li>
<li>m5 bits 1..0: exit towards
<table>
<tr>
<td><tt>0</tt> </td>
<td>NE</td>
</tr>
<tr>
<td><tt>1</tt> </td>
<td>SE</td>
</tr>
<tr>
<td><tt>2</tt> </td>
<td>SW</td>
</tr>
<tr>
<td><tt>3</tt> </td>
<td>NW</td>
</tr>
</table>
</li>
<li>m5 bit 4: pbs reservation state</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="Class2"><tt> 2</tt></a></strong></td>
<td><strong>Roads</strong></td>
</tr>
<tr>
<td valign=top nowrap> </td>
<td>
<ul>
<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>
<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>)
<li>m4 bits 5..0: <a href="#RoadType">Roadtype</a></li>
<li>m7 bit 5 set = on snow or desert</li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m5 bits 7 clear: road or level-crossing
<ul>
<li>m6 bits 5..3:
<table>
<tr>
<td><tt>0</tt> </td>
<td>on bare land</td>
</tr>
<tr>
<td><tt>1</tt> </td>
<td>on grass</td>
</tr>
<tr>
<td><tt>2</tt> </td>
<td>paved</td>
</tr>
<tr>
<td><tt>3</tt> </td>
<td>with streetlights</td>
</tr>
<tr>
<td><tt>5</tt> </td>
<td>tree-lined</td>
</tr>
<tr>
<td><tt>6</tt> </td>
<td>on grass with road works</td>
</tr>
<tr>
<td><tt>7</tt> </td>
<td>paved with road works</td>
</tr>
</table>
</li>
<li>m5 bit 6 clear: road
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
<li>m7 bits 3..0: counter for the roadworks</li>
<li>m5 bits 3..0: road layout road type 0 (normal road): bit set = road piece present:
<table>
<tr>
<td align=left>bit 0: </td>
<td>NW piece</td>
</tr>
<tr>
<td align=left>bit 1: </td>
<td>SW piece</td>
</tr>
<tr>
<td align=left>bit 2: </td>
<td>SE piece</td>
</tr>
<tr>
<td align=left>bit 3: </td>
<td>NE piece</td>
</tr>
</table>
</li>
<li>m3 bits 0..3: road layout road type 1 (tram)</li>
<li>m5 bits 5..4: bits to disallow vehicles to go a specific direction
<table>
<tr>
<td align=left>bit 0: </td>
<td>set = disallow driving in south-west or south-east direction</td>
</tr>
<tr>
<td align=left>bit 1: </td>
<td>set = disallow driving in north-west or north-east direction</td>
</tr>
</table>
</li>
</ul>
</li>
<li>m5 bit 6 set: level crossing
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the railway track</li>
<li>m5 bit 5: set if crossing lights are on</li>
<li>m5 bit 4: pbs reservation state</li>
<li>m5 bit 0: direction
<table>
<tr>
<td align=left><tt>0</tt> </td>
<td align=left>road in the X direction, rail in Y</td>
</tr>
<tr>
<td align=left><tt>1</tt> </td>
<td align=left>road in the Y direction, rail in X</td>
</tr>
</table>
</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
<li>m8 bits 5..0: <a href="#TrackType">railway track type</a></li>
</ul>
</li>
</ul>
</li>
<li>m5 bit 7 set, bit 6 clear: road depot
<ul>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the depot</li>
<li>m2: Depot index</li>
<li>m5 bits 1..0: exit towards:
<table>
<tr>
<td><tt>0</tt> </td>
<td>NE</td>
</tr>
<tr>
<td><tt>1</tt> </td>
<td>SE</td>
</tr>
<tr>
<td><tt>2</tt> </td>
<td>SW</td>
</tr>
<tr>
<td><tt>3</tt> </td>
<td>NW</td>
</tr>
</table>
</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of the road type 0 (normal road)</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="Class3"><tt> 3</tt></a></strong></td>
<td><strong>Town building </strong></td>
</tr>
<tr>
<td valign=top nowrap> </td>
<td>
<ul>
<li>m1 : Random bits <a href="#newhouses">(newhouses)</a> </li>
<li>m2 : index into the array of towns</li>
<li>m3 bit 7 :
<ul>
<li> set : House is complete
<ul>
<li>m5 : Age of house in years, clamped at 255</li>
</ul>
</li>
<li> clear : House is in construction
<ul>
<li>m5 bits 7..5 : free</li>
<li>m5 bits 4..3 : construction stage</li>
<li>m5 bits 2..0 : construction counter</li>
</ul>
</li>
</ul>
<li>m3 bit 6 : bit 8 of house type (m4), allowing 512 different types.</li>
<li>m3 bit 5 : free</li>
<li>m3 bits 4..0 : triggers activated <a href="#newhouses">(newhouses)</a></li>
<li>m4 : <a href="landscape_externals.html">town building type</a> (with m3[6] bit)</li>
<li>m5 : see m3 bit 7</li>
<li>m6 :
<ul>
<li>If <a href="#newhouses">newhouses</a> is activated
<ul>
<li>bits 7..2 : Periodic processing time remaining</li>
</ul>
</li>
<li>Standard behaviour
<ul>
<li>bits 7..2 : lift position (for houses type 04 and 05)</li>
</ul>
</li>
</ul>
</li>
<li>m7 :
<ul>
<li>If <a href="#newhouses">newhouses</a> is activated
<ul>
<li>Current animation frame</li>
</ul>
</li>
<li>Standard behaviour (only for houses type 04 and 05)
<ul>
<li>bits 7..4 : free</li>
<li>bits 3..1 : lift destination. Values can be 0..6, except 1.<br>
So the building has 6 effective floors. This is due to the fact that the first floor is 2 'normal' floors high.<br>
One 'normal' floor has a height of 6 lift positions.
</li>
<li>bit 0 : Lift has destination when set</li>
</ul>
</li>
</ul>
</li>
</ul>
<small><a name="newhouses"></a>Newhouses is the name englobing a newGRF feature developed by TTDPatch devs (mainly Csaboka).<br>
It allows the replacement of the properties as well as the graphics of houses in the game.<br>
To distinguish between the standard behaviour and the newGRF one, HouseID (m4 + m3[6]) is tested for anything above 110.<br>
110 is the count of standard houses. So above 110 means there is a new definition of at least one house</small>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="Class4"><tt> 4 </tt></a></strong></td>
<td><strong>Trees </strong></td>
</tr>
<tr>
<td valign=top nowrap> </td>
<td>
<ul>
<li>m1 bits 6..5: water class (sea or land)</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> (normally <tt>10</tt>)</li>
<li>m2 bits 8..6: ground
<table>
<tr>
<td align=left><tt>0</tt> </td>
<td>on grass</td>
</tr>
<tr>
<td align=left><tt>1</tt> </td>
<td>on rough land (density must be 3)</td>
</tr>
<tr>
<td align=left><tt>2</tt> </td>
<td>on snow or desert</td>
</tr>
<tr>
<td align=left><tt>3</tt> </td>
<td>on shore (density must be 3)</td>
</tr>
<tr>
<td align=left><tt>4</tt> </td>
<td>on snow with rough land underneath</td>
</tr>
</table>
</li>
<li>m2 bits 5..4: ground density</li>
<li>m2 bits 3..0: update counter, incremented on every periodic processing.<br>
on wraparound the growth status is updated (or, if it's <tt>3</tt>, a random action is taken)</li>
<li>m3 bits 7..0: type of trees:
<table>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>0B</tt> </td>
<td align=left>temperate climate trees</td>
</tr>
<tr>
<td nowrap valign=top><tt>0C</tt>..<tt>13</tt> </td>
<td align=left>sub-arctic climate trees</td>
</tr>
<tr>
<td nowrap valign=top><tt>14</tt>..<tt>1A</tt> </td>
<td align=left>rainforest trees</td>
</tr>
<tr>
<td nowrap valign=top><tt>1B</tt> </td>
<td align=left>cactus plants</td>
</tr>
<tr>
<td nowrap valign=top><tt>1C</tt>..<tt>1F</tt> </td>
<td align=left>sub-tropical climate, non-rainforest, non-desert trees</td>
</tr>
<tr>
<td nowrap valign=top><tt>20</tt>..<tt>28</tt> </td>
<td align=left>toyland trees</td>
</tr>
</table>
<small>Note: the actually displayed set of trees depends on both type and number of trees</small>
</li>
<li>m5 bits 7..6: number of trees minus one</li>
<li>m5 bits 2..0: growth status:
<table border="0">
<tr>
<td><tt>0</tt>..<tt>2</tt> </td>
<td>one of trees is growing </td>
</tr>
<tr>
<td><tt>3</tt> </td>
<td>all trees are fully grown </td>
</tr>
<tr>
<td><tt>4</tt>..<tt>6</tt> </td>
<td>one of trees is withering </td>
</tr>
</table>
</li>
</ul>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td valign=top nowrap><strong><a name="Class5"><tt> 5</tt></a></strong></td>
<td><strong>Station tiles</strong></td>
</tr>
<tr>
<td valign=top nowrap> </td>
<td>
<ul>
<li>m1 bit 7: Ship docking tile status (for buoys)</li>
<li>m1 bits 6..5: water class for buoys, water part of docks and for airport tiles</li>
<li>m1 bits 4..0: <a href="#OwnershipInfo">owner</a> of the station</li>
<li>m2: index into the array of stations</li>
<li>m3 bits 7..4: persistent random data for railway stations/waypoints and airports)</li>
<li>m3 bits 7..4: <a href="#OwnershipInfo">owner</a> of tram tracks (road stop)</li>
<li>m4: custom station id; 0 means standard graphics</li>
<li>m4: <a href="#RoadType">Roadtype</a> for road stops</li>
<li>m5: graphics index (range from 0..255 for each station type):
<table>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>07</tt> </td>
<td align=left>railway station
<table>
<tr>
<td><tt>00</tt>..<tt>01</tt> </td>
<td align=left>open platform</td>
</tr>
<tr>
<td><tt>02</tt>..<tt>03</tt> </td>
<td align=left>open platform with station building</td>
</tr>
<tr>
<td><tt>04</tt>....<tt>07</tt> </td>
<td align=left>roofed platform</td>
</tr>
<tr>
<td colspan=2>bit 0: clear = in X direction, set = in Y direction</td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>01</tt></td>
<td align=left>waypoints
<table>
<tr>
<td><tt>00</tt> </td>
<td align=left>in X direction</td>
</tr>
<tr>
<td><tt>01</tt> </td>
<td align=left>in Y direction</td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>FF</tt></td>
<td align=left>all airports</td>
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>05</tt> </td>
<td align=left>road stops
<table>
<tr>
<td><tt>00</tt> </td>
<td align=left>exit towards NE</td>
</tr>
<tr>
<td><tt>01</tt> </td>
<td align=left>exit towards SE</td>
</tr>
<tr>
<td><tt>02</tt> </td>
<td align=left>exit towards SW</td>
</tr>
<tr>
<td><tt>03</tt> </td>
<td align=left>exit towards NW</td>
</tr>
<tr>
<td><tt>04</tt> </td>
<td align=left>drive through X</td>
</tr>
<tr>
<td><tt>05</tt> </td>
<td align=left>drive through Y</td>
</tr>
</table>
</td>
</tr>
<tr>
<td nowrap valign=top><tt>00</tt>..<tt>05</tt> </td>
<td align=left>ship dock
<table>
<tr>
<td><tt>00</tt> </td>
<td align=left>SW coast part</td>
</tr>
<tr>
<td><tt>01</tt> </td>
<td align=left>NW coast part</td>
</tr>
<tr>
<td><tt>02</tt> </td>
<td align=left>NE coast part</td>
</tr>
<tr>
<td><tt>03</tt> </td>
<td align=left>SE coast part</td>
</tr>
<tr>
<td><tt>04</tt> </td>
<td align=left>X direction water part</td>
</tr>
<tr>
<td><tt>05</tt> </td>
<td align=left>Y direction water part</td>
</tr>
</table>
</td>
</tr>
</table>
</li>
<li>m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)</li>
<li>m6 bit 2: pbs reservation state for railway stations/waypoints</li>
<li>m7 bits 4..0: <a href="#OwnershipInfo">owner</a> of road (road stops)</li>
<li>m7: animation frame (railway stations/waypoints, airports)</li>
<li>m8 bits 11..6: <a href="#TramType">Tramtype</a></li>
<li>m8 bits 5..0: <a href="#TrackType">track type</a> for railway stations/waypoints</li>