Update readme.md
[openttd-joker.git] / docs / landscape_grid.html
blobccbc3b833557c71211b5d27f337d710c28cb0db7
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="Description" content="Structure of OpenTTD (OTTD) landscape arrays #2">
6 <title>OpenTTD Landscape Internals - #2</title>
7 <style type="text/css">
8 span.abuse { font-family: "Courier New", Courier, mono; background-color: rgb(255, 58, 31); }
9 span.option{ font-family: "Courier New", Courier, mono; background-color: rgb(255,255, 30); }
10 span.free { font-family: "Courier New", Courier, mono; background-color: rgb(30, 178, 54); }
11 span.used { font-family: "Courier New", Courier, mono; }
12 span.used_p{ font-family: "Courier New", Courier, mono; background-color: cyan; }
13 td.bits { white-space: nowrap; text-align: center; font-family: "Courier New", Courier, mono; }
14 td.caption { white-space: nowrap; text-align: left; }
15 td li { white-space: nowrap; text-align: left; }
16 th { white-space: nowrap; text-align: center; }
17 </style>
18 </head>
19 <body style="direction: ltr;">
20 <h3 style="font-weight: bold;">Landscape</h3>
21 <span style="font-weight: bold;"></span>Nine attributes hold the information about a tile.
22 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
23 the array so you can quickly see what is used and what is not.
24 <ul>
25 <li><span style="font-weight: bold;"><span class="free">O</span></span> - bit is free</li>
26 <li><span style="font-weight: bold;"><span class="used">X</span></span> - bit is used</li>
27 <li><span style="font-weight: bold;"><span class="used_p">P</span></span> - bit is used by patch feature</li>
28 <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>
29 <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>
30 </ul>
31 <p>
32 <ul>
33 <li><span style="font-weight: bold;">type</span> - 8 bits in size, tile class (bits 4..7), bridge (bits 2..3) tropic zone (bits 0..1, only valid in tropic climate)</li>
34 <li><span style="font-weight: bold;">height</span> - 8 bits in size, stores tile height</li>
35 <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>
36 <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>
37 <li><span style="font-weight: bold;">m3</span> - 8 bits in size, is used for general storage; often used for the RailType</li>
38 <li><span style="font-weight: bold;">m4</span> - 8 bits in size, is used for general storage; often used for the Road-(Sub-)Types</li>
39 <li><span style="font-weight: bold;">m5</span> - 8 bits in size, is used for general storage</li>
40 <li><span style="font-weight: bold;">m6</span> - 8 bits in size, is used for general storage</li>
41 <li><span style="font-weight: bold;">m7</span> - 8 bits in size, is used for general storage; often used for NewGRF animation</li>
42 </ul>
44 <table align=center border="1" cellpadding="2" cellspacing="2">
45 <tbody>
46 <tr>
47 <th colspan=2>class</th>
48 <th>type (8)</th>
49 <th>height (8)</th>
50 <th>m1 (8)</th>
51 <th>m2 (16)</th>
52 <th>m3 (8)</th>
53 <th>m4 (8)</th>
54 <th>m5 (8)</th>
55 <th>m6 (8)</th>
56 <th>m7 (8)</th>
57 </tr>
58 <tr>
59 <td colspan=2 class="caption">bits</td>
60 <td class="bits">7654 3210</td>
61 <td class="bits">7654 3210</td>
62 <td class="bits">7654 3210</td>
63 <td class="bits">FEDC BA98 7654 3210</td>
64 <td class="bits">7654 3210</td>
65 <td class="bits">7654 3210</td>
66 <td class="bits">7654 3210</td>
67 <td class="bits">7654 3210</td>
68 <td class="bits">7654 3210</td>
69 </tr>
70 <tr>
71 <td rowspan="2">0</td>
72 <td class="caption">ground</td>
73 <td class="bits">XXXX XXXX</td>
74 <td class="bits">XXXX XXXX</td>
75 <td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
76 <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
77 <td class="bits">XXXX <span class="free">OOOO</span></td>
78 <td class="bits">XXXX XX<span class="free">OO</span></td>
79 <td class="bits">XXXX XXXX</td>
80 <td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
81 <td class="bits"><span class="free">OOOO OOOO</span></td>
82 </tr>
83 <tr>
84 <td class="caption">farmland</td>
85 <td class="bits">-inherit-</td>
86 <td class="bits">-inherit-</td>
87 <td class="bits">-inherit-</td>
88 <td class="bits">XXXX XXXX XXXX XXXX</td>
89 <td class="bits">XXXX XXXX</td>
90 <td class="bits">-inherit-</td>
91 <td class="bits">-inherit-</td>
92 <td class="bits"><span class="free">OOO</span>X XX<span class="free">OO</span></td>
93 <td class="bits"><span class="free">OOOO OOOO</span></td>
94 </tr>
95 <tr>
96 <td rowspan=3>1</td>
97 <td class="caption">rail</td>
98 <td class="bits">XXXX XXXX</td>
99 <td class="bits">XXXX XXXX</td>
100 <td class="bits"><span class="used_p">P</span><span class="free">OO</span>X XXXX</td>
101 <td class="bits"><span class="free">OOOO</span> XXXX <span class="free">OOOO OOOO</span></td>
102 <td class="bits"><span class="free">OOOO</span> XXXX</td>
103 <td class="bits"><span class="free">OOOO</span> XXXX</td>
104 <td class="bits">XXXX XXXX</td>
105 <td class="bits"><span class="free">OOOO OOOO</span></td>
106 <td class="bits"><span class="used_p">PPPP PPPP</span></td>
107 </tr>
108 <tr>
109 <td class="caption">rail with signals</td>
110 <td class="bits">-inherit-</td>
111 <td class="bits">-inherit-</td>
112 <td class="bits">-inherit-</td>
113 <td class="bits"><span class="free">OOO</span><span class="used_p">P</span> XXXX XXXX XXXX</td>
114 <td class="bits">XXXX XXXX</td>
115 <td class="bits">XXXX XXXX</td>
116 <td class="bits">-inherit-</td>
117 <td class="bits"><span class="free">OOOO OOOO</span></td>
118 <td class="bits"><span class="used_p">PPPP PPPP</span></td>
119 </tr>
120 <tr>
121 <td class="caption">depot</td>
122 <td class="bits">-inherit-</td>
123 <td class="bits">-inherit-</td>
124 <td class="bits">-inherit-</td>
125 <td class="bits">XXXX XXXX XXXX XXXX</td>
126 <td class="bits"><span class="free">OOOO</span> XXXX</td>
127 <td class="bits"><span class="free">OOOO</span> XXXX</td>
128 <td class="bits">XX<span class="free">O</span>X <span class="free">OO</span>XX</td>
129 <td class="bits"><span class="free">OOOO OOOO</span></td>
130 <td class="bits"><span class="free">OOOO OOOO</span></td>
131 </tr>
132 <tr>
133 <td rowspan=3>2</td>
134 <td class="caption">road</td>
135 <td class="bits">XXXX XXXX</td>
136 <td class="bits">XXXX XXXX</td>
137 <td class="bits"><span class="free">OOO</span>X XXXX</td>
138 <td class="bits">XXXX XXXX XXXX XXXX</td>
139 <td class="bits">XXXX XXXX</td>
140 <td class="bits">XXXX XXXX</td>
141 <td class="bits">XXXX XXXX</td>
142 <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
143 <td class="bits"><span class="used_p">PP</span>X<span class="free">O</span> XXXX</td>
144 </tr>
145 <tr>
146 <td class="caption">level crossing</td>
147 <td class="bits">-inherit-</td>
148 <td class="bits">-inherit-</td>
149 <td class="bits"><span class="used_p">P</span><span class="free">OO</span>X XXXX</td>
150 <td class="bits">-inherit-</td>
151 <td class="bits">XXXX XXXX</td>
152 <td class="bits">-inherit-</td>
153 <td class="bits">XXXX<span class="free"> OOO</span>X</td>
154 <td class="bits"><span class="free">OO</span>XX X<span class="free">OOO</span></td>
155 <td class="bits"><span class="used_p">PP</span>XX XXXX</td>
156 </tr>
157 <tr>
158 <td class="caption">road depot</td>
159 <td class="bits">-inherit-</td>
160 <td class="bits">-inherit-</td>
161 <td class="bits"><span class="free">OOO</span>X XXXX</td>
162 <td class="bits">-inherit-</td>
163 <td class="bits">XXXX <span class="free">OOOO</span></td>
164 <td class="bits">-inherit-</td>
165 <td class="bits">XX<span class="free">OO OO</span>XX</td>
166 <td class="bits"><span class="free">OOOO OOOO</span></td>
167 <td class="bits"><span class="used_p">PP</span>X<span class="free">O</span> XXXX</td>
168 </tr>
169 <tr>
170 <td>3</td>
171 <td class="caption">house</td>
172 <td class="bits">XXXX XXXX</td>
173 <td class="bits">XXXX XXXX</td>
174 <td class="bits">XXXX XXXX</td>
175 <td class="bits">XXXX XXXX XXXX XXXX</td>
176 <td class="bits">XX<span class="free">O</span><span class="option">~ ~~</span>XX</td>
177 <td class="bits">XXXX XXXX</td>
178 <td class="bits">XXX<span class="abuse">X XXXX</span></td>
179 <td class="bits"><span class="abuse">XXXX XX</span><span class="free">OO</span></td>
180 <td class="bits">XXXX <span class="abuse">XXXX</span></td>
181 </tr>
182 <tr>
183 <td>4</td>
184 <td class="caption">trees</td>
185 <td class="bits">XXXX XXXX</td>
186 <td class="bits">XXXX XXXX</td>
187 <td class="bits"><span class="free">OOO</span><span class="option">~ ~~~~</span></td>
188 <td class="bits"><span class="free">OOOO OOO</span>X XXXX XXXX</td>
189 <td class="bits"><span class="option">~~</span>XX XXXX</td>
190 <td class="bits"><span class="free">OOOO OOOO</span></td>
191 <td class="bits">XX<span class="free">OO O</span>XXX</td>
192 <td class="bits"><span class="free">OOOO OOOO</span></td>
193 <td class="bits"><span class="free">OOOO OOOO</span></td>
194 </tr>
195 <tr>
196 <td rowspan=7>5</td>
197 <td class="caption">rail station</td>
198 <td class="bits">XXXX XXXX</td>
199 <td class="bits">XXXX XXXX</td>
200 <td class="bits"><span class="used_p">P</span>XXX XXXX</td>
201 <td class="bits">XXXX XXXX XXXX XXXX</td>
202 <td class="bits">XXXX XXXX</td>
203 <td class="bits">XXXX XXXX</td>
204 <td class="bits">XXXX XXXX</td>
205 <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
206 <td class="bits">XXXX XXXX</td>
207 </tr>
208 <tr>
209 <td class="caption">rail waypoint</td>
210 <td class="bits">-inherit-</td>
211 <td class="bits">-inherit-</td>
212 <td class="bits">-inherit-</td>
213 <td class="bits">-inherit-</td>
214 <td class="bits">-inherit-</td>
215 <td class="bits">-inherit-</td>
216 <td class="bits">-inherit-</td>
217 <td class="bits">-inherit-</td>
218 <td class="bits">-inherit-</td>
219 </tr>
220 <tr>
221 <td class="caption">road stop</td>
222 <td class="bits">-inherit-</td>
223 <td class="bits">-inherit-</td>
224 <td class="bits">-inherit-</td>
225 <td class="bits">-inherit-</td>
226 <td class="bits">XXXX <span class="free">OOOO</span></td>
227 <td class="bits">XXXX XXXX</td>
228 <td class="bits"><span class="option">~~~~ ~</span>XXX</td>
229 <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
230 <td class="bits"><span class="used_p">PP</span><span class="free">O</span>X XXXX</td>
231 </tr>
232 <tr>
233 <td class="caption">dock</td>
234 <td class="bits">-inherit-</td>
235 <td class="bits">-inherit-</td>
236 <td class="bits">-inherit-</td>
237 <td class="bits">-inherit-</td>
238 <td class="bits"><span class="free">OOOO OOOO</span></td>
239 <td class="bits"><span class="free">OOOO OOOO</span></td>
240 <td class="bits"><span class="option">~~~~ ~</span>XXX</td>
241 <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
242 <td class="bits"><span class="free">OOOO OOOO</span></td>
243 </tr>
244 <tr>
245 <td class="caption">airport</td>
246 <td class="bits">-inherit-</td>
247 <td class="bits">-inherit-</td>
248 <td class="bits">-inherit-</td>
249 <td class="bits">-inherit-</td>
250 <td class="bits">XXXX <span class="free">OOOO</span></td>
251 <td class="bits"><span class="free">OOOO OOOO</span></td>
252 <td class="bits">XXXX XXXX</td>
253 <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
254 <td class="bits">XXXX XXXX</td>
255 </tr>
256 <tr>
257 <td class="caption">buoy</td>
258 <td class="bits">-inherit-</td>
259 <td class="bits">-inherit-</td>
260 <td class="bits">-inherit-</td>
261 <td class="bits">-inherit-</td>
262 <td class="bits"><span class="free">OOOO OOOO</span></td>
263 <td class="bits"><span class="free">OOOO OOOO</span></td>
264 <td class="bits"><span class="option">~~~~ ~~~~</span></td>
265 <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
266 <td class="bits"><span class="free">OOOO OOOO</span></td>
267 </tr>
268 <tr>
269 <td class="caption">oilrig</td>
270 <td class="bits">-inherit-</td>
271 <td class="bits">-inherit-</td>
272 <td class="bits">-inherit-</td>
273 <td class="bits">-inherit-</td>
274 <td class="bits"><span class="free">OOOO OOOO</span></td>
275 <td class="bits"><span class="free">OOOO OOOO</span></td>
276 <td class="bits"><span class="option">~~~~ ~~~~</span></td>
277 <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
278 <td class="bits"><span class="free">OOOO OOOO</span></td>
279 </tr>
280 <tr>
281 <td rowspan=3>6</td>
282 <td class="caption">sea, shore</td>
283 <td class="bits">XXXX XXXX</td>
284 <td class="bits">XXXX XXXX</td>
285 <td class="bits"><span class="free">O</span>XXX XXXX</td>
286 <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
287 <td class="bits"><span class="free">OOOO OOOO</span></td>
288 <td class="bits"><span class="free">OOOO OOOO</span></td>
289 <td class="bits">X<span class="option">~~</span>X XXXX</td>
290 <td class="bits"><span class="free">OOOO OOOO</span></td>
291 <td class="bits"><span class="free">OOOO OOOO</span></td>
292 </tr>
293 <tr>
294 <td class="caption">canal, river</td>
295 <td class="bits">-inherit-</td>
296 <td class="bits">-inherit-</td>
297 <td class="bits">-inherit-</td>
298 <td class="bits"><span class="free">OOOO OOOO OOOO OOOO</span></td>
299 <td class="bits"><span class="free">OOOO OOOO</span></td>
300 <td class="bits">XXXX XXXX</td>
301 <td class="bits">-inherit-</td>
302 <td class="bits"><span class="free">OOOO OOOO</span></td>
303 <td class="bits"><span class="free">OOOO OOOO</span></td>
304 </tr>
305 <tr>
306 <td class="caption">shipdepot</td>
307 <td class="bits">-inherit-</td>
308 <td class="bits">-inherit-</td>
309 <td class="bits">-inherit-</td>
310 <td class="bits">XXXX XXXX XXXX XXXX</td>
311 <td class="bits"><span class="free">OOOO OOOO</span></td>
312 <td class="bits"><span class="free">OOOO OOOO</span></td>
313 <td class="bits">-inherit-</td>
314 <td class="bits"><span class="free">OOOO OOOO</span></td>
315 <td class="bits"><span class="free">OOOO OOOO</span></td>
316 </tr>
317 <tr>
318 <td>8</td>
319 <td class="caption">industry</td>
320 <td class="bits">XXXX XXXX</td>
321 <td class="bits">XXXX XXXX</td>
322 <td class="bits">XXX<span class="free">O</span> <span class="abuse">XXXX</span></td>
323 <td class="bits">XXXX XXXX XXXX XXXX</td>
324 <td class="bits">XXXX XXXX</td>
325 <td class="bits">XXXX XXXX</td>
326 <td class="bits">XXXX XXXX</td>
327 <td class="bits"><span class="free">OO</span>XX XX<span class="free">OO</span></td>
328 <td class="bits">XXXX XXXX</td>
329 </tr>
330 <tr>
331 <td rowspan=2>9</td>
332 <td class="caption">tunnel entrance</td>
333 <td class="bits">XXXX XXXX</td>
334 <td class="bits">XXXX XXXX</td>
335 <td class="bits"><span class="used_p">P</span><span class="free">OO</span>X XXXX</td>
336 <td class="bits"><span class="used_p">PPPP PPPP PPPP PPPP</span></td>
337 <td class="bits">XXXX XXXX</td>
338 <td class="bits">XXXX XXXX</td>
339 <td class="bits">X<span class="used_p">PP</span>X XXXX</td>
340 <td class="bits"><span class="free">O</span><span class="used_p">P</span><span class="free">OO OO</span><span class="used_p">PP</span></td>
341 <td class="bits"><span class="used_p">PP</span>XX XXXX</td>
342 </tr>
343 <tr>
344 <td>bridge ramp</td>
345 <td class="bits">-inherit-</td>
346 <td class="bits">-inherit-</td>
347 <td class="bits">-inherit-</td>
348 <td class="bits"><span class="used_p">PPPP PPPP PPPP PPPP</span></td>
349 <td class="bits">-inherit-</td>
350 <td class="bits">-inherit-</td>
351 <td class="bits">-inherit-</td>
352 <td class="bits"><span class="free">O</span><span class="used_p">P</span>XX XX<span class="used_p">PP</span></td>
353 <td class="bits">-inherit-</td>
354 </tr>
355 <tr>
356 <td rowspan=2>A</td>
357 <td class="caption">objects</td>
358 <td class="bits">XXXX XXXX</td>
359 <td class="bits">XXXX XXXX</td>
360 <td class="bits"><span class="free">O</span>XXX XXXX</td>
361 <td class="bits">XXXX XXXX XXXX XXXX</td>
362 <td class="bits">XXXX XXXX</td>
363 <td class="bits"><span class="free">OOOO OOOO</span></td>
364 <td class="bits">XXXX XXXX</td>
365 <td class="bits"><span class="free">OOOO OOOO</span></td>
366 <td class="bits">XXXX XXXX</td>
367 </tr>
368 </tbody>
369 </table>
371 </body>
372 </html>