summaryrefslogtreecommitdiff
path: root/docs/landscape_grid.html
blob: f47b7f43a8f5101b960a6482e3c06691410ec118 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="content-type">
  <meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays #2">
  <title>OpenTTD Landscape Internals - #2</title>
  <style type="text/css">
    span.abuse { font-family: "Courier New", Courier, mono; background-color: rgb(255, 58, 31); }
    span.option{ font-family: "Courier New", Courier, mono; background-color: rgb(255,255, 30); }
    span.free  { font-family: "Courier New", Courier, mono; background-color: rgb(30, 178, 54); }
    span.used  { font-family: "Courier New", Courier, mono; }
    td.bits    { white-space: nowrap; text-align: center; font-family: "Courier New", Courier, mono; }
    td.caption { white-space: nowrap; text-align: left; }
    td li      { white-space: nowrap; text-align: left; }
    th         { white-space: nowrap; text-align: center; }
  </style>
</head>
<body style="direction: ltr;">
<h3 style="font-weight: bold;">Landscape</h3>
<span style="font-weight: bold;"></span>Six attributes hold the information about a tile.
This can be seen in the <a href="landscape.html">Landscape</a> document. This page tries to give an overview of used and free bits of
the array so you can quickly see what is used and what is not.
<ul>
  <li><span style="font-weight: bold;"><span class="free">O</span></span> - bit is free</li>
  <li><span style="font-weight: bold;"><span class="used">X</span></span> - bit is used</li>
  <li><span style="font-weight: bold;"><span class="abuse">&nbsp;</span></span> - bit of attribute is abused for different purposes, i.e. other bits define the actual meaning.</li>
  <li><span style="font-weight: bold;"><span class="option">~</span></span> - bit is accessed, but does not really have a meaning (e.g. owner of clear land is always OWNER_NONE)</li>
</ul>
<p>
<ul>
  <li><span style="font-weight: bold;">type_height</span> - 8 bits in size, stores tile height (lower 4 bits) and tile class (upper 4 bits)</li>
  <li><span style="font-weight: bold;">m1</span> - 8 bits in size, used to identify the owner of that tile (eg piece of rail, bridge, etc.)</li>
  <li><span style="font-weight: bold;">m2</span> - 16 bits in size, used to identify the index of the given tile (object) in the (object-)array</li>
  <li><span style="font-weight: bold;">m3</span> - 8 bits in size, is used for general storage</li>
  <li><span style="font-weight: bold;">m4</span> - 8 bits in size, is used for general storage</li>
  <li><span style="font-weight: bold;">m5</span> - 8 bits in size, is used for general storage</li>
  <li><span style="font-weight: bold;">m6</span> - 8 bits in size, special meaning : lower 2 bits only valid in tropic climate, upper 2 bits for bridges</li>
  <li><span style="font-weight: bold;">m7</span> - 8 bits in size, is used for general storage</li>
</ul>

<table align=center border="1" cellpadding="2" cellspacing="2">
  <tbody>
    <tr>
      <th colspan=2>class</th>
      <th>type_height (8)</th>
      <th>m1 (8)</th>
      <th>m2 (16)</th>
      <th>m3 (8)</th>
      <th>m4 (8)</th>
      <th>m5 (8)</th>
      <th>m6 (8)</th>
      <th>m7 (8)</th>
    </tr>
    <tr>
      <td colspan=2 class="caption">bits</td>
      <td class="bits">7654 3210</td>
      <td class="bits">7654 3210</td>
      <td class="bits">FEDC BA98 7654 3210</td>
      <td class="bits">7654 3210</td>
      <td class="bits">7654 3210</td>
      <td class="bits">7654 3210</td>
      <td class="bits">7654 3210</td>
      <td class="bits">7654 3210</td>
    </tr>
    <tr>
      <td rowspan="2">0</td>
      <td class="caption">ground</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits">XXXX XX<span class="free">OO</span></td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">farmland</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits">XXXX XXXX XXXX XXXX</td>
      <td class="bits"><span class="free">OOOO</span> XXXX</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td rowspan=4>1</td>
      <td class="caption">rail</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~</span>X XXXX</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
      <td class="bits"><span class="free">OOOO</span> XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">rail with signals</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO O</span>XXX <span class="free">O</span>XXX</td>
      <td class="bits">XXXX <span class="option">~~</span>XX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">-inherit-</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">depot</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
      <td class="bits"><span class="free">OOOO</span> XXXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">waypoint</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">XXXX XXXX XXXX XXXX</td>
      <td class="bits"><span class="free">OOOO</span> <span class="option">~~</span>XX</td>
      <td class="bits"><span class="free">OOOO</span> XXXX</td>
      <td class="bits">XX<span class="free">OO OOO</span>X</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td rowspan=3>2</td>
      <td class="caption">road</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~</span>X XXXX</td>
      <td class="bits">XXXX XXXX XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
    </tr>
    <tr>
      <td class="caption">level crossing</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">XXXX <span class="option">~~</span>XX</td>
      <td class="bits"><span class="free">O</span>XXX XXXX</td>
      <td class="bits">XX<span class="free">OO</span> XXXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits">-inherit-</td>
    </tr>
    <tr>
      <td class="caption">road depot</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits">X<span class="free">OOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits">XXX<span class="free">O OOOO</span></td>
    </tr>
    <tr>
      <td>3</td>
      <td class="caption">house</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX XXXX XXXX</td>
      <td class="bits">XXX<span class="option">~ ~~</span>XX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXX<span class="abuse">X XXXX</span></td>
      <td class="bits"><span class="abuse">XXXX XX</span>XX</td>
      <td class="bits">XXXX <span class="abuse">XXXX</span></td>
    </tr>
    <tr>
      <td>4</td>
      <td class="caption">trees</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="free">OOOO OOOO</span> XXXX XXXX</td>
      <td class="bits"><span class="option">~~</span>XX XXXX</td>
      <td class="bits">XXXX XX<span class="free">OO</span></td>
      <td class="bits">XX<span class="free">OO O</span>XXX</td>
      <td class="bits"><span class="free">OOOO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td rowspan=6>5</td>
      <td class="caption">rail station</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~</span>X XXXX</td>
      <td class="bits">XXXX XXXX XXXX XXXX</td>
      <td class="bits">XXXX <span class="option">~~</span>XX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
      <td class="bits">XXXX XXXX</td>
    </tr>
    <tr>
      <td class="caption">road stop</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO O</span>XXX</td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="option">~~~~ ~</span>XXX</td>
      <td class="bits"><span class="free">OO</span>XX XXXX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">dock</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OO</span>XX</td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="option">~~~~ ~</span>XXX</td>
      <td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">airport</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">buoy</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OO</span>XX</td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">oilrig</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="option">~~~~ ~~~~</span></td>
      <td class="bits"><span class="free">OO</span>XX X<span class="free">O</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td rowspan=3>6</td>
      <td class="caption">sea, shore</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~</span>X XXXX</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits">X<span class="option">~~</span>X XXXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">canal, river</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OO</span>XX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">-inherit-</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">shipdepot</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits">-inherit-</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td>8</td>
      <td class="caption">industry</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">X<span class="free">OOO</span> <span class="abuse">
        XXXX</span></td>
      <td class="bits">XXXX XXXX XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="free">OO</span>XX XXXX</td>
      <td class="bits">XXXX XXXX</td>
    </tr>
    <tr>
      <td rowspan=2>9</td>
      <td class="caption">tunnel entrance</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~</span>X XXXX</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO</span> <span class="option">~</span><span class="abuse">XXX</span></td>
      <td class="bits">X<span class="free">OOO OOOO</span></td>
      <td class="bits">X<span class="free">OOO</span> <span class="option">~</span>XXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td>bridge ramp</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits"><span class="free">OOOO OOOO</span> XXXX <span class="free">OOOO</span></td>
      <td class="bits"><span class="free">OOOO</span> <span class="option">~</span><span class="abuse">XXX</span></td>
      <td class="bits">X<span class="free">OOO OOOO</span></td>
      <td class="bits">X<span class="free">OOO</span> <span class="option">~</span>XXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td rowspan=2>A</td>
      <td class="caption">unmovables</td>
      <td class="bits">XXXX XXXX</td>
      <td class="bits"><span class="option">~~~</span>X XXXX</td>
      <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits">X<span class="option">~~</span>X XXXX</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
    <tr>
      <td class="caption">company statue</td>
      <td class="bits">-inherit-</td>
      <td class="bits">-inherit-</td>
      <td class="bits">XXXX XXXX XXXX XXXX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
      <td class="bits">-inherit-</td>
      <td class="bits">XX<span class="free">OO OO</span>XX</td>
      <td class="bits"><span class="free">OOOO OOOO</span></td>
    </tr>
  </tbody>
</table>

</body>
</html>