~adrian-arroyocalle/freerct/freerct

« back to all changes in this revision

Viewing changes to graphics/rcd/data_format.rst

  • Committer: charlespigott at googlemail
  • Date: 2013-07-09 17:30:05 UTC
  • Revision ID: svn-v4:d3bf82d2-0c16-e458-5408-27be57bd1276:trunk:780
-Codechange: Reorganise the project files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
:Author: Alberth
 
2
:Version: $Id$
 
3
 
 
4
.. contents::
 
5
   :depth: 3
 
6
 
 
7
####################
 
8
RCD data file format
 
9
####################
 
10
 
 
11
.. Section levels  # = ~ .
 
12
 
 
13
License
 
14
=======
 
15
This file is part of FreeRCT.
 
16
FreeRCT is free software; you can redistribute it and/or modify it under the
 
17
terms of the GNU General Public License as published by the Free Software
 
18
Foundation, version 2.
 
19
FreeRCT is distributed in the hope that it will be useful, but WITHOUT ANY
 
20
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
21
PARTICULAR PURPOSE.
 
22
See the GNU General Public License for more details. You should have received a
 
23
copy of the GNU General Public License along with FreeRCT. If not, see
 
24
<http://www.gnu.org/licenses/>.
 
25
 
 
26
Introduction
 
27
============
 
28
FreeRCT is a game where you build roller-coasters in your theme park, hoping to
 
29
get lots of visitors paying for your investments. If you do it well, you might
 
30
get rich.
 
31
 
 
32
The program uses so-called RCD files, data files with a binary file format to
 
33
pack graphics and other game data, ready for use by the FreeRCT program. This
 
34
document describes the format, acting as an independent definition of the file
 
35
format.
 
36
 
 
37
Money
 
38
~~~~~
 
39
All money amounts in RCD files are signed integer numbers, expressing cents.
 
40
 
 
41
File header
 
42
~~~~~~~~~~~
 
43
Each data file starts with a file header indicating it is an RCD file.
 
44
The format is as follows
 
45
 
 
46
======  ======  ==========================================================
 
47
Offset  Length  Description
 
48
======  ======  ==========================================================
 
49
   0       4    Magic string 'RCDF'.
 
50
   4       4    Value '1', version number of the data file format.
 
51
   8            Total length.
 
52
======  ======  ==========================================================
 
53
 
 
54
Version history
 
55
...............
 
56
 
 
57
- 1 (20110915) Initial version.
 
58
 
 
59
 
 
60
Data blocks
 
61
===========
 
62
After the file header come the various data blocks.
 
63
The goal of data blocks is to provide blobs of information that are somewhat independent.
 
64
The data blocks are referenced by game blocks by their ID. The first data block
 
65
gets number 1, the second block number 2, etc.
 
66
 
 
67
A reference to data block 0 means 'not present'.
 
68
 
 
69
 
 
70
Sprite Pixels
 
71
~~~~~~~~~~~~~
 
72
A data block containing the actual image of a sprite (in 8bpp), and its
 
73
offset. Version 2 is supported by FreeRCT.
 
74
 
 
75
======  ======  =======  =================================================
 
76
Offset  Length  Version  Description
 
77
======  ======  =======  =================================================
 
78
   0       4      1-2    Magic string '8PXL'.
 
79
   4       4      1-2    Version number of the block.
 
80
   8       4      1-2    Length of the block excluding magic string,
 
81
                         version, and length.
 
82
  12       2      1-2    Width of the image.
 
83
  14       2      1-2    Height of the image, called 'h' below.
 
84
  16       2        2    (signed) X-offset.
 
85
  18       2        2    (signed) Y-offset.
 
86
  20     4*h      1-2    Jump table to pixel data of each line. Offset is
 
87
                         relative to the first entry of the jump table.
 
88
                         Value 0 means there is no data for that line.
 
89
   ?       ?      1-2    Pixels of each line.
 
90
   ?                     Variable length.
 
91
======  ======  =======  =================================================
 
92
 
 
93
 
 
94
Line data is a sequence of pixels with an offset. Its format is
 
95
 
 
96
======  ======  ==========================================================
 
97
Offset  Length  Description
 
98
======  ======  ==========================================================
 
99
   0       1    Relative offset (0-127), bit 7 means 'last entry of the
 
100
                line'.
 
101
   1       1    Number of pixels that follow this count, called n (0-255).
 
102
   2       n    Pixels, 1 byte per pixel (as it is 8bpp).
 
103
   ?            Variable length.
 
104
======  ======  ==========================================================
 
105
 
 
106
The offset byte is relative to the end of the previous pixels, thus an offset
 
107
of 0 means no gap between the pixels. A count of 0 is useful if the gap at a
 
108
line is longer than 127 pixels.
 
109
 
 
110
To decide: Some simple form of compressing may be useful in the pixels as it
 
111
           decreases the amount of memory transfers.
 
112
 
 
113
Version history
 
114
...............
 
115
 
 
116
- 1 (20110915) Initial version.
 
117
- 2 (20120623) Moved the offset from the SPRT block into the 8PXL block.
 
118
 
 
119
Texts
 
120
~~~~~
 
121
Text in various forms and shapes is very common. In particular, it needs to
 
122
support translations, and eventually run-time composition of text with respect
 
123
to genders, plurals, and cases.
 
124
The latter will be encoded in the text itself, and does not need to be handled
 
125
here (except perhaps for some simple translations).
 
126
 
 
127
What remains is a collection of names that are attached to text (the game
 
128
queries text by name), where the latter may exist in several languages. All
 
129
text is assumed to be UTF-8 encoded, and 0-terminated.
 
130
 
 
131
FreeRCT can read version 1 text blocks, which look like
 
132
 
 
133
======  ======  ==========================================================
 
134
Offset  Length  Description
 
135
======  ======  ==========================================================
 
136
   0       4    Magic string 'TEXT'.
 
137
   4       4    Version number of the block.
 
138
   8       4    Length of the block excluding magic string, version, and
 
139
                length.
 
140
  12       ?    First string.
 
141
   ?       ?    Second string.
 
142
  ...     ...
 
143
======  ======  ==========================================================
 
144
 
 
145
A string has the following structure.
 
146
 
 
147
======  ======  ==========================================================
 
148
Offset  Length  Description
 
149
======  ======  ==========================================================
 
150
   0       2    Length of the entire string, including these length bytes.
 
151
   2       1    Length of the identification name of the string (incl 0).
 
152
   3       ?    Identification name itself (0 terminated)
 
153
   ?       ?    First translation.
 
154
   ?       ?    Second translation.
 
155
  ...     ...
 
156
   ?       ?    Default translation.
 
157
======  ======  ==========================================================
 
158
 
 
159
A translation has the following structure.
 
160
 
 
161
======  ======  ==========================================================
 
162
Offset  Length  Description
 
163
======  ======  ==========================================================
 
164
   0       2    Length of this translation (including these length bytes).
 
165
   2       1    Length of the language name (incl 0).
 
166
   3       ?    Language name itself (0 terminated).
 
167
   ?       ?    Text of the string in the indicated language (incl 0).
 
168
======  ======  ==========================================================
 
169
 
 
170
The default language has no language name ie it is "" (the empty string).
 
171
Other languages use one of the following tags (currently ``name of language -
 
172
name of country area`` but that may change in the future).
 
173
 
 
174
=====  =========================
 
175
Tag    Description
 
176
=====  =========================
 
177
en_GB  Great Britain.
 
178
nl_NL  The Netherlands.
 
179
=====  =========================
 
180
 
 
181
String parameters
 
182
~~~~~~~~~~~~~~~~~
 
183
A character sequence of the form "%...%" is an escape sequence. The following
 
184
sequences are recognized:
 
185
 
 
186
- "%%": The character "%".
 
187
- "%n%" with "n" a decimal number: Insert parameter 'n'.
 
188
 
 
189
Version history
 
190
...............
 
191
 
 
192
- 1 (20120714) Initial version.
 
193
-   (20121215) Added string parameters.
 
194
 
 
195
 
 
196
Game blocks
 
197
===========
 
198
A game block is a piece of data that relates closely to a concept in the
 
199
game, like 'path' or 'roller coaster'. Normally it refers to one or more
 
200
data blocks.
 
201
 
 
202
Tile surface sprite sub-block
 
203
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
204
In several game blocks you can find a set of sprite for the ground. Below is
 
205
the layout of such a sub-block.
 
206
Note that the sprites should look to the north (thus, the sprite at 4 has its
 
207
back corner up).
 
208
 
 
209
The suffix is added to denote a specific sprite in a sequence inside another block.
 
210
 
 
211
======  ======  =======  ======  ===========================================================================
 
212
Offset  Length  Version  Suffix  Description
 
213
======  ======  =======  ======  ===========================================================================
 
214
   0       4      1-2    #       Flat surface tile.
 
215
   4       4      1-2    #n      North corner up.
 
216
   8       4      1-2    #e      East corner up.
 
217
  12       4      1-2    #ne     North, east corners up.
 
218
  16       4      1-2    #s      South corner up.
 
219
  20       4      1-2    #ns     North, south corners up.
 
220
  24       4      1-2    #es     East, south corners up.
 
221
  28       4      1-2    #nes    North, east, south corners up.
 
222
  32       4      1-2    #w      West corner up.
 
223
  36       4      1-2    #nw     West, north corners up.
 
224
  40       4      1-2    #ew     West, east corners up.
 
225
  44       4      1-2    #new    West, north, east corners up.
 
226
  48       4      1-2    #sw     West, south corners up.
 
227
  52       4      1-2    #nsw    West, north, south corners up.
 
228
  56       4      1-2    #esw    West, east, south corners up.
 
229
  60       4      1-2    #Nb     Steep north slope (bottom part).
 
230
  64       4      1-2    #Eb     Steep east slope  (bottom part).
 
231
  68       4      1-2    #Sb     Steep south slope (bottom part).
 
232
  72       4      1-2    #Wb     Steep west slope  (bottom part).
 
233
  76       4       2     #Nt     Steep north slope (top part).
 
234
  80       4       2     #Et     Steep east slope  (top part).
 
235
  84       4       2     #St     Steep south slope (top part).
 
236
  88       4       2     #Wt     Steep west slope  (top part).
 
237
  92                             Total length of the sub-block.
 
238
======  ======  =======  ======  ===========================================================================
 
239
 
 
240
Version history
 
241
...............
 
242
 
 
243
- 1 (20110915) Initial version.
 
244
- 2 (20130602) Steep slope sprites were split in a bottom and top part.
 
245
 
 
246
 
 
247
Ground tiles block
 
248
~~~~~~~~~~~~~~~~~~
 
249
A set of ground tiles that form a smooth surface. Current version in
 
250
FreeRCT is 4.
 
251
 
 
252
======  ======  =======  ===================================================================================
 
253
Offset  Length  Version  Description
 
254
======  ======  =======  ===================================================================================
 
255
   0       4      1-4    Magic string 'SURF'.
 
256
   4       4      1-4    Version number of the block.
 
257
   8       4      1-4    Length of the block excluding magic string, version, and length.
 
258
  12       2      2-4    Type of ground.
 
259
  14       2      1-4    Zoom-width of a tile of the surface.
 
260
  16       2      1-4    Change in Z height (in pixels) when going up or down a tile level.
 
261
  --      76      1-3    Tile surface sprite sub-block for north viewing direction.
 
262
  18      92       4     Tile surface sprite sub-block for north viewing direction.
 
263
  --      76      1-2    Tile surface sprite sub-block for east viewing direction.
 
264
  --      76      1-2    Tile surface sprite sub-block for south viewing direction.
 
265
  --      76      1-2    Tile surface sprite sub-block for west viewing direction.
 
266
 110                     Total length.
 
267
======  ======  =======  ===================================================================================
 
268
 
 
269
Known types of ground:
 
270
 
 
271
- Empty  (0), do not use in the RCD file.
 
272
- Grass  (16-19,) Green grass ground, with increasing length grass on it.
 
273
- Sand   (32), desert 'ground'.
 
274
- Cursor (48), cursor test tiles. Internal use. Defines what part of a
 
275
  tile is selected. Colour 181 means 'north corner', 182 means 'east corner',
 
276
  184 means 'west corner', 185 means 'south corner', and 183 means 'entire
 
277
  tile'.
 
278
 
 
279
To do: Move the cursor tile to another position.
 
280
 
 
281
Version history
 
282
...............
 
283
 
 
284
- 1 (20110915) Initial version.
 
285
- 2 (20110918) Added ground type.
 
286
- 3 (20110925) Removed sprite blocks for viewing in east, south, and west direction.
 
287
-   (20111014) Added 'Cursor' tiles type.
 
288
- 4 (20130602) Steep slope sprites split in a bottom and top part.
 
289
 
 
290
 
 
291
Tile selection
 
292
~~~~~~~~~~~~~~
 
293
A tile selection cursor. It is very similar to ground tiles, except there is
 
294
no type. FreeRCT can read blocks with version number 2.
 
295
 
 
296
======  ======  =======  ===================================================================================
 
297
Offset  Length  Version  Description
 
298
======  ======  =======  ===================================================================================
 
299
   0       4      1-2    Magic string 'TSEL'.
 
300
   4       4      1-2    Version number of the block.
 
301
   8       4      1-2    Length of the block excluding magic string, version, and length.
 
302
  12       2      1-2    Zoom-width of a tile of the surface.
 
303
  14       2      1-2    Change in Z height (in pixels) when going up or down a tile level.
 
304
  --      76       1     Tile surface sprite sub-block.
 
305
  16      92       2     Tile surface sprite sub-block.
 
306
 108                     Total length.
 
307
======  ======  =======  ===================================================================================
 
308
 
 
309
Version history
 
310
...............
 
311
 
 
312
- 1 (20110925) Initial version.
 
313
- 2 (20130602) Longer surface sprite block due to splitting the steep slope sprites.
 
314
 
 
315
 
 
316
Tile area selection
 
317
~~~~~~~~~~~~~~~~~~~
 
318
Sprites to point out a (selection of) tile(s) to the user.
 
319
FreeRCT can read blocks with version 2.
 
320
 
 
321
======  ======  =======  ===================================================================================
 
322
Offset  Length  Version  Description
 
323
======  ======  =======  ===================================================================================
 
324
   0       4      1-2    Magic string 'TARE'.
 
325
   4       4      1-2    Version number of the block.
 
326
   8       4      1-2    Length of the block excluding magic string, version, and length.
 
327
  12       2      1-2    zoom-width of a tile of the surface.
 
328
  14       2      1-2    Change in Z height (in pixels) when going up or down a tile level.
 
329
  --      76       1     Tile surface sprite sub-block.
 
330
  16      92       2     Tile surface sprite sub-block.
 
331
 108                     Total length.
 
332
======  ======  =======  ===================================================================================
 
333
 
 
334
Version history
 
335
...............
 
336
 
 
337
- 1 (20110925) Initial version.
 
338
- 2 (20130602) Longer surface sprite block due to splitting the steep slope sprites.
 
339
 
 
340
 
 
341
Patrol area selection
 
342
~~~~~~~~~~~~~~~~~~~~~
 
343
 
 
344
Tiles to display the patrol area of staff.
 
345
FreeRCT can read blocks with version 2.
 
346
 
 
347
======  ======  =======  ===================================================================================
 
348
Offset  Length  Version  Description
 
349
======  ======  =======  ===================================================================================
 
350
   0       4      1-2    Magic string 'PARE'.
 
351
   4       4      1-2    Version number of the block.
 
352
   8       4      1-2    Length of the block excluding magic string, version, and length.
 
353
  12       2      1-2    Zoom-width of a tile of the surface.
 
354
  14       2      1-2    Change in Z height (in pixels) when going up or down a tile level.
 
355
  --      76       1     Tile surface sprite sub-block.
 
356
  16      92       2     Tile surface sprite sub-block.
 
357
 108                     Total length.
 
358
======  ======  =======  ===================================================================================
 
359
 
 
360
Version history
 
361
...............
 
362
 
 
363
- 1 (20110925) Initial version.
 
364
- 2 (20130602) Longer surface sprite block due to splitting the steep slope sprites.
 
365
 
 
366
 
 
367
Tile corner selection block
 
368
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
369
Sprites for pointing to a single corner of a surface tile. Current version is 2.
 
370
 
 
371
======  ======  =======  ===================================================================================
 
372
Offset  Length  Version  Description
 
373
======  ======  =======  ===================================================================================
 
374
   0       4      1-2    Magic string 'TCOR'
 
375
   4       4      1-2    Version number of the block.
 
376
   8       4      1-2    Length of the block excluding magic string, version, and length.
 
377
  12       2      1-2    Zoom-width of a tile of the surface.
 
378
  14       2      1-2    Change in Z height (in pixels) when going up or down a tile level.
 
379
  --      76       1     Tile surface sprite sub-block for selected corner pointing north.
 
380
  16      92       2     Tile surface sprite sub-block for selected corner pointing north.
 
381
  --      76       1     Tile surface sprite sub-block for selected corner pointing east.
 
382
 108      92       2     Tile surface sprite sub-block for selected corner pointing east.
 
383
  --      76       1     Tile surface sprite sub-block for selected corner pointing south.
 
384
 200      92       2     Tile surface sprite sub-block for selected corner pointing south.
 
385
  --      76       1     Tile surface sprite sub-block for selected corner pointing west.
 
386
 292      92       2     Tile surface sprite sub-block for selected corner pointing west.
 
387
 384                     Total length.
 
388
======  ======  =======  ===================================================================================
 
389
 
 
390
Version history
 
391
...............
 
392
 
 
393
- 1 (20110925) Initial version.
 
394
- 2 (20130602) Longer surface sprite block due to splitting the steep slope sprites.
 
395
 
 
396
 
 
397
Shops/stalls
 
398
~~~~~~~~~~~~
 
399
One tile objects, selling useful things to guests. FreeRCT can read block version 4.
 
400
 
 
401
======  ======  =======  ===================================================================================
 
402
Offset  Length  Version  Description
 
403
======  ======  =======  ===================================================================================
 
404
   0       4      1-4    Magic string 'SHOP'.
 
405
   4       4      1-4    Version number of the block.
 
406
   8       4      1-4    Length of the block excluding magic string, version, and length.
 
407
  12       2      1-4    Zoom-width of a tile of the surface.
 
408
  14       1      1-4    Height of the shop in voxels. (versions 1-3 used a 16bit unsigned number).
 
409
  15       1       4     Shop flags.
 
410
  16       4      1-4    Unrotated view (ne).
 
411
  20       4      1-4    View after 1 quarter negative rotation (se).
 
412
  24       4      1-4    View after 2 quarter negative rotations (sw).
 
413
  28       4      1-4    View after 3 quarter negative rotations (nw).
 
414
  32       4      2-4    First recolouring specification.
 
415
  36       4      2-4    Second recolouring specification.
 
416
  40       4      2-4    Third recolouring specification.
 
417
  44       4       4     Cost of the first item.
 
418
  48       4       4     Cost of the second item.
 
419
  52       4       4     Monthly cost of having the shop.
 
420
  56       4       4     Additional monthly cost of having an opened shop.
 
421
  60       1       4     Item type of the first item.
 
422
  61       1       4     Item type of the second item.
 
423
  62       4      3-4    Text of the shop (reference to a TEXT block).
 
424
  66                     Total length.
 
425
======  ======  =======  ===================================================================================
 
426
 
 
427
Shop flags:
 
428
 
 
429
- bit 0 Set if the shop has an entrance to the NE in the unrotated view.
 
430
- bit 1 Set if the shop has an entrance to the SE in the unrotated view.
 
431
- bit 2 Set if the shop has an entrance to the SW in the unrotated view.
 
432
- bit 3 Set if the shop has an entrance to the NW in the unrotated view.
 
433
 
 
434
Item types:
 
435
 
 
436
- Nothing (0)
 
437
- A drink (8)
 
438
- An icecream (9)
 
439
- Non-salty food (16)
 
440
- Salty food (24)
 
441
- Umbrella (32)
 
442
- Map of the park (40)
 
443
 
 
444
Version history
 
445
...............
 
446
 
 
447
- 1 (20110925) Initial version.
 
448
- 2 (20120708) Added recolouring information.
 
449
- 3 (20120714) Added a TEXT block reference for the shop texts.
 
450
- 4 (20121005) Added Items to sell, and costs to pay.
 
451
 
 
452
 
 
453
Build direction arrows
 
454
~~~~~~~~~~~~~~~~~~~~~~
 
455
Arrows to point out direction of constructing new game elements. FreeRCT can
 
456
read blocks with version 1.
 
457
 
 
458
======  ======  ==========================================================
 
459
Offset  Length  Description
 
460
======  ======  ==========================================================
 
461
   0       4    Magic string 'BDIR'.
 
462
   4       4    Version number of the block.
 
463
   8       4    Length of the block excluding magic string, version, and
 
464
                length.
 
465
  12       2    Zoom-width of a tile of the surface.
 
466
  14       4    Arrow pointing to NE edge.
 
467
  18       4    Arrow pointing to SE edge.
 
468
  22       4    Arrow pointing to SW edge.
 
469
  26       4    Arrow pointing to NW edge.
 
470
  30            Total length.
 
471
======  ======  ==========================================================
 
472
 
 
473
Version history
 
474
...............
 
475
 
 
476
- 1 (20110925) Initial version.
 
477
 
 
478
 
 
479
Foundations block
 
480
~~~~~~~~~~~~~~~~~
 
481
Vertical foundations to close gaps in the smooth surface. FreeRCT can read
 
482
blocks with version 1.
 
483
 
 
484
======  ======  ==========================================================
 
485
Offset  Length  Description
 
486
======  ======  ==========================================================
 
487
   0       4    Magic string 'FUND'.
 
488
   4       4    Version number of the block.
 
489
   8       4    Length of the block excluding magic string, version, and
 
490
                length.
 
491
  12       2    Type of foundation.
 
492
  14       2    Zoom-width of a tile.
 
493
  16       2    Change in Z height of the tiles.
 
494
  18       4    Vertical south-east foundation, east  visible, south down.
 
495
  22       4    Vertical south-east foundation, east  down,    south visible.
 
496
  26       4    Vertical south-east foundation, east  visible, south visible.
 
497
  30       4    Vertical south-west foundation, south visible, west down.
 
498
  34       4    Vertical south-west foundation, south down,    west visible.
 
499
  38       4    Vertical south-west foundation, south visible, west visible.
 
500
  42            Total length
 
501
======  ======  ==========================================================
 
502
 
 
503
The semantics of 'visible' is that the foundation is visible for the entire
 
504
height of the foundation. The term 'up' means that just the point at the top is
 
505
used, and 'down' means the point at the bottom is used.
 
506
 
 
507
Note that the sprite-sheet also has 4 'up' sprites, but they are currently not
 
508
used.
 
509
 
 
510
 
 
511
Known types of foundation:
 
512
 
 
513
- Empty (0) Reserved, do not use in the RCD file.
 
514
- Ground (16)
 
515
- Wood (32)
 
516
- Brick (48)
 
517
 
 
518
The tile width and z-height are used to ensure the foundations match with the
 
519
surface tiles.
 
520
 
 
521
Version history
 
522
...............
 
523
 
 
524
- 1 (20110918) Initial version.
 
525
-   (20121207) Replaced sprites.
 
526
 
 
527
 
 
528
Path block
 
529
~~~~~~~~~~
 
530
Path coverage is a set of at most 47 flat images. Paths can connect to
 
531
neighbouring tiles through four edges, optionally also covering the corner
 
532
between two connecting edges.
 
533
 
 
534
Starting at offset 14 are the sprite block numbers of each sprite. As normal,
 
535
use 0 to denote absence of a sprite. Two letter words in the description
 
536
denote an edge connects, one letter words denote the corner is covered.
 
537
 
 
538
Besides the maximal 47 flat sprites there are also 4 sprites with one edge
 
539
raised. FreeRCT can read path blocks with version 1.
 
540
 
 
541
- Empty (0) Reserved, do not use in the RCD file.
 
542
- Concrete (16)
 
543
 
 
544
 
 
545
======  ======  ==========================================================
 
546
Offset  Length  Description
 
547
======  ======  ==========================================================
 
548
   0       4    Magic string 'PATH'.
 
549
   4       4    Version number of the block.
 
550
   8       4    Length of the block excluding magic string, version, and length.
 
551
  12       2    Type of path surface.
 
552
  14       2    Zoom-width of a tile.
 
553
  16       2    Change in Z height of the tiles.
 
554
  18       4    (empty).
 
555
  22       4    NE.
 
556
  26       4    SE.
 
557
  30       4    NE, SE.
 
558
  34       4    NE, SE, E.
 
559
  38       4    SW.
 
560
  42       4    NE, SW.
 
561
  46       4    SE, SW.
 
562
  50       4    SE, SW, S.
 
563
  54       4    NE, SE, SW.
 
564
  58       4    NE, SE, SW, E.
 
565
  62       4    NE, SE, SW, S.
 
566
  66       4    NE, SE, SW, E, S.
 
567
  70       4    NW.
 
568
  74       4    NE, NW.
 
569
  78       4    NE, NW, N.
 
570
  82       4    NW, SE.
 
571
  86       4    NE, NW, SE.
 
572
  90       4    NE, NW, SE, N.
 
573
  94       4    NE, NW, SE, E.
 
574
  98       4    NE, NW, SE, N, E.
 
575
 102       4    NW, SW.
 
576
 106       4    NW, SW, W.
 
577
 110       4    NE, NW, SW.
 
578
 114       4    NE, NW, SW, N.
 
579
 118       4    NE, NW, SW, W.
 
580
 122       4    NE, NW, SW, N, W.
 
581
 126       4    NW, SE, SW.
 
582
 130       4    NW, SE, SW, S.
 
583
 134       4    NW, SE, SW, W.
 
584
 138       4    NW, SE, SW, S, W.
 
585
 142       4    NE, NW, SE, SW.
 
586
 146       4    NE, NW, SE, SW, N.
 
587
 150       4    NE, NW, SE, SW, E.
 
588
 154       4    NE, NW, SE, SW, N, E.
 
589
 158       4    NE, NW, SE, SW, S.
 
590
 162       4    NE, NW, SE, SW, N, S.
 
591
 166       4    NE, NW, SE, SW, E, S.
 
592
 170       4    NE, NW, SE, SW, N, E, S.
 
593
 174       4    NE, NW, SE, SW, W.
 
594
 178       4    NE, NW, SE, SW, N, W.
 
595
 182       4    NE, NW, SE, SW, E, W.
 
596
 186       4    NE, NW, SE, SW, N, E, W.
 
597
 190       4    NE, NW, SE, SW, S, W.
 
598
 194       4    NE, NW, SE, SW, N, S, W.
 
599
 198       4    NE, NW, SE, SW, E, S, W.
 
600
 202       4    NE, NW, SE, SW, N, E, S, W.
 
601
 206       4    NE edge up.
 
602
 210       4    NW edge up.
 
603
 214       4    SE edge up.
 
604
 218       4    SW edge up.
 
605
 222            Length of one view direction.
 
606
======  ======  ==========================================================
 
607
 
 
608
Version history
 
609
...............
 
610
 
 
611
- 1 (20110925) Initial version.
 
612
- 2 (20110930) Added tile width and z-height fields.
 
613
 
 
614
 
 
615
Platforms
 
616
~~~~~~~~~
 
617
Platforms put up in the air, to carry the weight of a path.
 
618
FreeRCT can read blocks with version 2.
 
619
 
 
620
======  ======  =======  =================================================
 
621
Offset  Length  Version  Description
 
622
======  ======  =======  =================================================
 
623
   0       4      1-2    Magic string 'PLAT'.
 
624
   4       4      1-2    Version number of the block.
 
625
   8       4      1-2    Length of the block excluding magic string,
 
626
                         version, and length.
 
627
  12       2      1-2    Zoom-width of a tile of the surface.
 
628
  14       2      1-2    Change in Z height (in pixels) when going up or
 
629
                         down a tile level.
 
630
  16       2      1-2    Platform type.
 
631
  18       4      1-2    Flat platform for north and south view.
 
632
  22       4      1-2    Flat platform for east and west view.
 
633
  26       4      1-2    Platform with two legs is raised at the NE edge.
 
634
  30       4      1-2    Platform with two legs is raised at the SE edge.
 
635
  34       4      1-2    Platform with two legs is raised at the SW edge.
 
636
  38       4      1-2    Platform with two legs is raised at the NW edge.
 
637
  42       4       2     Platform with right leg is raised at the NE edge.
 
638
  46       4       2     Platform with right leg is raised at the SE edge.
 
639
  50       4       2     Platform with right leg is raised at the SW edge.
 
640
  54       4       2     Platform with right leg is raised at the NW edge.
 
641
  58       4       2     Platform with left leg is raised at the NE edge.
 
642
  62       4       2     Platform with left leg is raised at the SE edge.
 
643
  66       4       2     Platform with left leg is raised at the SW edge.
 
644
  70       4       2     Platform with left leg is raised at the NW edge.
 
645
  74                     Total length.
 
646
======  ======  =======  =================================================
 
647
 
 
648
 
 
649
Platform type:
 
650
 
 
651
- Empty 0, do not use.
 
652
- Wood 16.
 
653
 
 
654
 
 
655
Version history
 
656
...............
 
657
 
 
658
- 1 (20110925) Initial version.
 
659
- 2 (20121128) Added platforms sprites with one leg, for the steep slopes.
 
660
 
 
661
Platform supports
 
662
~~~~~~~~~~~~~~~~~
 
663
Structures to support platforms, so they don't fall down.
 
664
FreeRCT can read blocks with version 1.
 
665
 
 
666
 
 
667
======  ======  ==========================================================
 
668
Offset  Length  Description
 
669
======  ======  ==========================================================
 
670
   0       4    Magic string 'SUPP'.
 
671
   4       4    Version number of the block.
 
672
   8       4    Length of the block excluding magic string, version, and
 
673
                length.
 
674
  12       2    Type of support.
 
675
  14       2    Width of a tile.
 
676
  16       2    Change in Z height (in pixels) when going up or down a tile level.
 
677
  18       4    Single height for flat terrain, north and south view.
 
678
  22       4    Single height for flat terrain, east and west view.
 
679
  26       4    Double height for flat terrain, north and south view.
 
680
  30       4    Double height for flat terrain, east and west view.
 
681
  34       4    Double height for paths, north and south view.
 
682
  38       4    Double height for paths, east and west view.
 
683
  42       4    Single height, north leg up.
 
684
  46       4    Single height, east leg up.
 
685
  50       4    Single height, north, east legs up.
 
686
  54       4    Single height, south leg up.
 
687
  58       4    Single height, north, south legs up.
 
688
  62       4    Single height, east, south legs up.
 
689
  66       4    Single height, north, east, south legs up.
 
690
  70       4    Single height, west leg up.
 
691
  74       4    Single height, west, north legs up.
 
692
  78       4    Single height, west, east legs up.
 
693
  82       4    Single height, west, north, east legs up.
 
694
  86       4    Single height, west, south legs up.
 
695
  90       4    Single height, west, north, south legs up.
 
696
  94       4    Single height, west, east, south legs up.
 
697
  98       4    Double height for steep north slope.
 
698
 102       4    Double height for steep east slope.
 
699
 106       4    Double height for steep south slope.
 
700
 110       4    Double height for steep west slope.
 
701
 114            Total length of the sub-block.
 
702
======  ======  ==========================================================
 
703
 
 
704
Support type:
 
705
 
 
706
- Empty 0, do not use.
 
707
- Wood 16.
 
708
 
 
709
Version history
 
710
...............
 
711
 
 
712
- 1 (20121207) Initial version.
 
713
 
 
714
Roller coaster tracks
 
715
~~~~~~~~~~~~~~~~~~~~~
 
716
A ``RCST`` block contains all information of a single type of roller coaster.
 
717
It currently contains track piece definitions only. FreeRCT supports version 3
 
718
of the ``RCST`` block.
 
719
 
 
720
======  ======  =======  ==================  =================================================================
 
721
Offset  Length  Version  Field name          Description
 
722
======  ======  =======  ==================  =================================================================
 
723
   0       4      1-3                        Magic string 'RCST'.
 
724
   4       4      1-3                        Version number of the block.
 
725
   8       4      1-3                        Length of the block excluding magic string, version, and length.
 
726
  12       2      1-3    coaster_type        Type of roller coaster.
 
727
  14       1      2-3    platform_type       Platform type.
 
728
  15       4       3     texts               Texts of the coaster.
 
729
  19       2      1-3    <derived>           Number of track piece definitions (called 'n').
 
730
  21      4*n     1-3                        The track piece definitions (references to ``TRCK``).
 
731
21+4*n                                       Total length of the ``RCST`` block.
 
732
======  ======  =======  ==================  =================================================================
 
733
 
 
734
Currently defined coaster types:
 
735
 
 
736
- 1 Simple coaster tracks.
 
737
 
 
738
Currently define platform types:
 
739
 
 
740
- 1 Wood.
 
741
 
 
742
 
 
743
Version history
 
744
...............
 
745
 
 
746
- 1 (20130317) Initial version.
 
747
- 2 (20130430) Added type of platform.
 
748
- 3 (20130511) Added a TEXT reference.
 
749
 
 
750
Track pieces
 
751
~~~~~~~~~~~~
 
752
 
 
753
A track piece definition describes a single piece of track in a TRCK block.
 
754
FreeRCT can read blocks with version 3. Each piece needs
 
755
one or more voxels. The first voxel it needs is called the *entry* voxel. The
 
756
other voxels have coordinates relative to the entry voxel. The last voxel is
 
757
called the *exit* voxel. The *entry* voxel of a track piece is at the *exit*
 
758
voxel of its predecessor.
 
759
 
 
760
To control which track pieces can connect to each other, both the entry and
 
761
the exit have a *connection code*. Two track pieces can be connected only when
 
762
the connection code of the exit of the first piece is the same as the
 
763
connection code of the entry of the second piece.
 
764
 
 
765
While the connection code is just a single number in the RCD file, in the input
 
766
it is split in a 'name' and a 'direction' while defining the track pieces.
 
767
 
 
768
=======  ======  =======  ==================  ================================================================
 
769
Offset   Length  Version  Field name          Description
 
770
=======  ======  =======  ==================  ================================================================
 
771
   0        4      1-3                        Magic string 'TRCK'.
 
772
   4        4      1-3                        Version number of the block.
 
773
   8        4      1-3                        Length of the block excluding magic string, version, and length.
 
774
  12        1      1-3    entry_connection    Entry connection code
 
775
  13        1      1-3    exit_connection     Exit connection code
 
776
  14        1      2-3    exit_dx             Relative X position of the exit voxel.
 
777
  15        1      2-3    exit_dy             Relative Y position of the exit voxel.
 
778
  16        1      2-3    exit_dz             Relative Z position of the exit voxel.
 
779
  17        1      2-3    speed               If non-zero, the minimal speed of cars at the track.
 
780
  18        2      2-3    track_flags         Flags of the track piece (version 2 is 1 byte).
 
781
  20        4      2-3    cost                Cost of this track piece.
 
782
  24        2      1-3                        Number of voxels in this track piece (called 'n').
 
783
  26      36*n     1-3                        Voxel definitions
 
784
26+36*n                                       Total length of the ``TRCK`` block.
 
785
=======  ======  =======  ==================  ================================================================
 
786
 
 
787
The track flags are defined as follows:
 
788
 
 
789
- bit   0    *This track piece has platforms next to the track*.
 
790
- bits  1-2  *Direction of the platform* (if bit 0 is set).
 
791
- bit   3    *This track piece may be used for initial placement*.
 
792
- bits  4-5  *Direction of initial placement* (if bit 3 is set).
 
793
- bits  6-7  *Banking of the piece* (0=no banking, 1=banking to the left, 2=banking to the right).
 
794
- bits  8-10 *Level of the slope* (-3=vertical down, -2=steep down, -1=gentle down, 0=level, 1=gentle up,
 
795
  2=steep up, 3=vertical up).
 
796
- bits 11-13 *Size of the bend* (-3 to +3, negative is to the left, positive is to the right, bigger is a wider bend).
 
797
 
 
798
A voxel definition is
 
799
 
 
800
=======  ======  =======  ==================  ================================================================
 
801
Offset   Length  Version  Field name          Description
 
802
=======  ======  =======  ==================  ================================================================
 
803
   0       4       1-2    ne_back             Reference to the background tracks for north view.
 
804
   4       4        2     se_back             Reference to the background tracks for east view.
 
805
   8       4        2     sw_back             Reference to the background tracks for south view.
 
806
  12       4        2     nw_back             Reference to the background tracks for west view.
 
807
  16       4        2     ne_front            Reference to the front tracks for north view.
 
808
  20       4        2     se_front            Reference to the front tracks for east view.
 
809
  24       4        2     sw_front            Reference to the front tracks for south view.
 
810
  28       4        2     nw_front            Reference to the front tracks for west view.
 
811
  32       1       1-2    dx                  Relative X position of the voxel.
 
812
  33       1       1-2    dy                  Relative Y position of the voxel.
 
813
  34       1       1-2    dz                  Relative Z position of the voxel.
 
814
  35       1       1-2    space               Space requirements of the voxel.
 
815
  36                                          Total length of a voxel definition.
 
816
=======  ======  =======  ==================  ================================================================
 
817
 
 
818
The space requirements are defined as follows:
 
819
 
 
820
- bit 0: Northern quarter of the voxel is used by the piece.
 
821
- bit 1: Eastern quarter of the voxel is used by the piece.
 
822
- bit 2: Southern quarter of the voxel is used by the piece.
 
823
- bit 3: Western quarter of the voxel is used by the piece.
 
824
 
 
825
The remaining bits are reserved and should be ``0``.
 
826
 
 
827
Version history
 
828
...............
 
829
 
 
830
- 1 (20130317) Initial version.
 
831
- 2 (20130430) Entry and exit definitions, speed, flags, and sprites for other viewing directions added.
 
832
- 3 (20130622) Extended the ``track_flags`` from 1 byte to 2 bytes to add the track piece properties (banking, slope,
 
833
  and bend size).
 
834
 
 
835
GUI
 
836
===
 
837
GUI sprites, in various forms.
 
838
 
 
839
All GUI sprites should use the BEIGE ranges, that is colours 214 to 225
 
840
(inclusive).
 
841
 
 
842
Generic GUI border sprites
 
843
~~~~~~~~~~~~~~~~~~~~~~~~~~
 
844
The most common form of a widget is a rectangular shape.
 
845
To draw such a shape, nine sprites are needed around the border of the
 
846
rectangle.
 
847
 
 
848
        +-------------+---------------+--------------+
 
849
        | top-left    | top-middle    | top-right    |
 
850
        +-------------+---------------+--------------+
 
851
        | left        | middle        | right        |
 
852
        +-------------+---------------+--------------+
 
853
        | bottom-left | bottom-middle | bottom-right |
 
854
        +-------------+---------------+--------------+
 
855
 
 
856
 
 
857
The 'top-left', 'top-right', 'bottom-left' and 'bottom-right' sprites are used
 
858
for the corners of the widget or window. The 'top-middle', 'middle', and
 
859
'bottom-middle' should be equally wide, and are used to insert horizontal
 
860
space between the left and the right part (with step size equal to the width
 
861
of the sprites. The 'left', 'middle', and 'right' do the same, except their
 
862
common height is used for vertical resizing.
 
863
 
 
864
Except for the 'top-left' sprite any of the sprites can be dropped. If you
 
865
leave out 'top-middle', 'middle', or 'bottom-middle', horizontal resizing is
 
866
not possible. If you leave out 'left', 'middle', or 'right' vertical resizing
 
867
is not possible.
 
868
If you leave out 'top-right', the 'top-right', 'right', and 'bottom-right'
 
869
sprites are considered not needed. Similarly for the 'bottom-left' sprite.
 
870
Supplying the 'top-right' sprite but leaving out 'bottom-right' (and similarly
 
871
for 'bottom-left' and 'bottom-right') gives undefined behaviour.
 
872
 
 
873
A sprite coverage of the edge has four border width parameters (top, left,
 
874
right, and bottom), measured in pixels.
 
875
In addition, a horizontal and a vertical
 
876
offset needs to be specified relative to the bounding box of the widget
 
877
contents.
 
878
 
 
879
That leads to the following block. FreeRCT can read these blocks with version 1.
 
880
 
 
881
======  ======  ==========================================================
 
882
Offset  Length  Description
 
883
======  ======  ==========================================================
 
884
   0       4    Magic string 'GBOR'.
 
885
   4       4    Version number of the block.
 
886
   8       4    Length of the block excluding magic string, version, and
 
887
                length.
 
888
  12       2    Widget type.
 
889
  14       1    Border width of the top edge.
 
890
  15       1    Border width of the left edge.
 
891
  16       1    Border width of the right edge.
 
892
  17       1    Border width of the bottom edge.
 
893
  18       1    Minimal width of the border.
 
894
  19       1    Minimal height of the border.
 
895
  20       1    Horizontal stepsize of the border.
 
896
  21       1    Vertical stepsize of the border.
 
897
  22       4    Top-left sprite.
 
898
  26       4    Top-middle sprite.
 
899
  30       4    Top-right sprite.
 
900
  34       4    Left sprite.
 
901
  38       4    Middle sprite.
 
902
  42       4    Right sprite.
 
903
  46       4    Bottom-left sprite.
 
904
  50       4    Bottom-middle sprite.
 
905
  54       4    Bottom-right sprite.
 
906
  58            Total length.
 
907
======  ======  ==========================================================
 
908
 
 
909
Known widget types:
 
910
 
 
911
- 0 Invalid, do not use.
 
912
- 16 Window border.
 
913
- 32 Title bar.
 
914
- 48 button, 49 pressed button, 52 rounded button, 53 pressed rounded button.
 
915
- 64 frame.
 
916
- 68 panel.
 
917
- 80 inset frame.
 
918
 
 
919
Version history
 
920
...............
 
921
 
 
922
- 1 (20111023) Initial version.
 
923
-   (20111029) Added 'panel' type.
 
924
 
 
925
 
 
926
Check box and radio buttons
 
927
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
928
FreeRCT can read blocks with version 1.
 
929
 
 
930
======  ======  ==========================================================
 
931
Offset  Length  Description
 
932
======  ======  ==========================================================
 
933
   0       4    Magic string 'GCHK'.
 
934
   4       4    Version number of the block.
 
935
   8       4    Length of the block excluding magic string, version, and
 
936
                length.
 
937
  12       2    Widget type.
 
938
  14       4    Empty.
 
939
  18       4    Filled.
 
940
  22       4    Empty pressed.
 
941
  26       4    Filled pressed.
 
942
  30       4    Shaded empty button.
 
943
  34       4    Shaded filled button.
 
944
  38            Total length.
 
945
======  ======  ==========================================================
 
946
 
 
947
Known widget types:
 
948
 
 
949
- 96 Check box.
 
950
- 112 Radio-button.
 
951
 
 
952
Version history
 
953
...............
 
954
 
 
955
- 1 (20111023) Initial version.
 
956
 
 
957
 
 
958
Slider-bar elements
 
959
~~~~~~~~~~~~~~~~~~~
 
960
For slider-bar GUI elements, the following block should be used.
 
961
FreeRCT can read blocks with version 1.
 
962
 
 
963
======  ======  ==========================================================
 
964
Offset  Length  Description
 
965
======  ======  ==========================================================
 
966
   0       4    Magic string 'GSLI'.
 
967
   4       4    Version number of the block.
 
968
   8       4    Length of the block excluding magic string, version, and
 
969
                length.
 
970
  12       1    Minimal length of the bar.
 
971
  13       1    Stepsize of the bar.
 
972
  14       1    Width of the slider button.
 
973
  15       2    Widget type.
 
974
  17       4    Left sprite.
 
975
  21       4    Middle sprite.
 
976
  25       4    Right sprite.
 
977
  29       4    Slider button.
 
978
  33            Total length.
 
979
======  ======  ==========================================================
 
980
 
 
981
Known slider-bar widget types:
 
982
 
 
983
- 128 Horizontal slider bar + button.
 
984
- 129 Shaded horizontal slider bar + button.
 
985
- 144 Vertical slider bar + button.
 
986
- 145 Shaded vertical slider bar + button.
 
987
 
 
988
Version history
 
989
...............
 
990
 
 
991
- 1 (20111023) Initial version.
 
992
 
 
993
 
 
994
Scroll-bar elements
 
995
~~~~~~~~~~~~~~~~~~~
 
996
For scroll-bar GUI elements, the following block should be used.
 
997
FreeRCT can read blocks with version 1.
 
998
 
 
999
======  ======  ==================  ================================================================
 
1000
Offset  Length  Field name          Description
 
1001
======  ======  ==================  ================================================================
 
1002
   0       4                        Magic string 'GSCL'.
 
1003
   4       4                        Version number of the block.
 
1004
   8       4                        Length of the block excluding magic string, version, and length.
 
1005
  12       1    min_length          Minimal length scrollbar.
 
1006
  13       1    step_back           Stepsize of background.
 
1007
  14       1    min_bar_length      Minimal length bar.
 
1008
  15       1    bar_step            Stepsize of bar.
 
1009
  16       2    widget_type         Widget type.
 
1010
  18       4    left_button         Left/up button.
 
1011
  22       4    right_button        Right/down button.
 
1012
  26       4    left_pressed        Left/up pressed button.
 
1013
  30       4    right_pressed       Right/down pressed button.
 
1014
  34       4    left_bottom         Left/top bar bottom (the background).
 
1015
  38       4    middle_bottom       Middle bar bottom (the background).
 
1016
  42       4    right_bottom        Right/down bar bottom (the background).
 
1017
  46       4    left_top            Left/top bar top.
 
1018
  50       4    middle_top          Middle bar top.
 
1019
  54       4    right_top           Right/down bar top.
 
1020
  58       4    left_top_pressed    Left/top pressed bar top.
 
1021
  62       4    middle_top_pressed  Middle pressed bar top.
 
1022
  66       4    right_top_pressed   Right/down pressed bar top.
 
1023
  70                                Total length.
 
1024
======  ======  ==================  ================================================================
 
1025
 
 
1026
Known scroll-bar widget types:
 
1027
 
 
1028
- 160 Horizontal scroll bar + button.
 
1029
- 161 Shaded horizontal scroll bar + button.
 
1030
- 176 Vertical scroll bar + button.
 
1031
- 177 Shaded vertical scroll bar + button.
 
1032
 
 
1033
Version history
 
1034
...............
 
1035
 
 
1036
- 1 (20111023) Initial version.
 
1037
 
 
1038
Gui button sprites
 
1039
==================
 
1040
Sprites for use at buttons in the gui.
 
1041
 
 
1042
Gui Sprites
 
1043
~~~~~~~~~~~
 
1044
Several elements come with different slopes, and the user needs to select the
 
1045
right one. Similarly, there are rotation sprites and texts that are displayed
 
1046
in the gui.
 
1047
FreeRCT can read blocks with version 5.
 
1048
 
 
1049
======  ======  =======  ==================  ================================================================
 
1050
Offset  Length  Version  Field name          Description
 
1051
======  ======  =======  ==================  ================================================================
 
1052
   0       4      1-5                        Magic string 'GSLP' (Gui sprites).
 
1053
   4       4      1-5                        Version number of the block.
 
1054
   8       4      1-5                        Length of the block excluding magic string, version, and length.
 
1055
  12       4      1-5    vert_down           Slope going vertically down.
 
1056
  16       4      1-5    steep_down          Slope going steeply down.
 
1057
  20       4      1-5    gentle_down         Slope going gently down.
 
1058
  24       4      1-5    level               Level slope.
 
1059
  28       4      1-5    gentle_up           Slope going gently up.
 
1060
  32       4      1-5    steep_up            Slope going steeply up.
 
1061
  36       4      1-5    vert_up             Slope going vertically up.
 
1062
  40       4       5     wide_left           Wide bend to the left.
 
1063
  44       4       5     normal_left         Normal bend to the left.
 
1064
  48       4       5     tight_left          Tight bend to the left.
 
1065
  52       4       5     no_bend             No bends.
 
1066
  56       4       5     tight_right         Tight bend to the right.
 
1067
  60       4       5     normal_right        Normal bend to the right.
 
1068
  64       4       5     wide_right          Wide bend to the right.
 
1069
  68       4       5     no_banking          No banking.
 
1070
  72       4       5     bank_left           Bank to the left.
 
1071
  76       4       5     bank_right          Bank to the right.
 
1072
  80       4       5     triangle_right      Arrow triangle to the right.
 
1073
  84       4       5     triangle_left       Arrow triangle to the left.
 
1074
  88       4       5     triangle_up         Arrow triangle upwards.
 
1075
  92       4       5     triangle_bottom     Arrow triangle downwards.
 
1076
  96       4      2-5    pos_2d              Flat rotation positive direction (counter clock wise).
 
1077
 100       4      2-5    neg_2d              Flat rotation negative direction (clock wise).
 
1078
 104       4      2-5    pos_3d              Diametric rotation positive direction (counter clock wise).
 
1079
 108       4      2-5    neg_3d              Diametric rotation negative direction (clock wise).
 
1080
 112       4      3-5    close_button        Close Button.
 
1081
  --       4       3                         Maximise button.
 
1082
  --       4       3                         Minimise button.
 
1083
 116       4      4-5    terraform_dot       Terraform dot.
 
1084
 120       4      2-5    texts               Text of the guis (reference to a TEXT block).
 
1085
 124                                         Total length.
 
1086
======  ======  =======  ==================  ================================================================
 
1087
 
 
1088
Version history
 
1089
...............
 
1090
 
 
1091
- 1 (20120612) Initial version.
 
1092
- 2 (20120901) Moved GROT data into the block.
 
1093
- 3 (20121110) Added close, maximise, and minimise buttons.
 
1094
- 4 (20121202) Added terraform dot, removed maximise and minimise buttons.
 
1095
- 5 (20130706) Added bends, banking, and triangle arrow Gui sprites.
 
1096
 
 
1097
 
 
1098
Persons
 
1099
=======
 
1100
Persons are an important concept in the game. Their properties are defined in
 
1101
the game blocks below.
 
1102
FreeRCT can read blocks with version 1.
 
1103
 
 
1104
======  ======  ==========================================================
 
1105
Offset  Length  Description
 
1106
======  ======  ==========================================================
 
1107
   0       4    Magic string 'PRSG' (Person Graphics).
 
1108
   4       4    Version number of the block.
 
1109
   8       4    Length of the block excluding magic string, version, and
 
1110
                length.
 
1111
  12       1    Number of person graphics in this block (called 'n').
 
1112
  13     n*13   Graphics definitions of person types in this block.
 
1113
   ?            Total length.
 
1114
======  ======  ==========================================================
 
1115
 
 
1116
The person graphics of a person type is a set of colour range
 
1117
recolourings.
 
1118
 
 
1119
======  ======  ==========================================================
 
1120
Offset  Length  Description
 
1121
======  ======  ==========================================================
 
1122
   0       1    Person type being defined.
 
1123
   1       4    First recolouring.
 
1124
   5       4    Second recolouring.
 
1125
   9       4    Third recolouring.
 
1126
  13            Total length.
 
1127
======  ======  ==========================================================
 
1128
 
 
1129
A person type defines the kind of persons:
 
1130
 
 
1131
- *Any* (0) Any kind of person (eg persons are not shown).
 
1132
- *Pillar* (8) Guests from the Pillar Planet (test graphics).
 
1133
- *Earth* (16) Earth-bound persons.
 
1134
 
 
1135
The *any* kind is used as fall back.
 
1136
 
 
1137
Recolouring definition
 
1138
~~~~~~~~~~~~~~~~~~~~~~
 
1139
The program has 18 colour ranges (0 to 17). A recolouring is a mapping of a
 
1140
single range to a set of allowed destination ranges, encoded in 32 bit. Bits
 
1141
24-31 state the single range (where a value other than 0..17 denotes an unused
 
1142
recolouring), Each bit `i` in the range of bits 0..17 denotes whether range `i`
 
1143
is allowed as replacement.
 
1144
 
 
1145
 
 
1146
Version history
 
1147
...............
 
1148
 
 
1149
- 1 (20120708) Initial version.
 
1150
 
 
1151
 
 
1152
Animation
 
1153
=========
 
1154
Animations have two layers. The conceptual definition is in an 'ANIM'
 
1155
block. This definition contains the number of frames the timing, and the
 
1156
change in x and/or y position. These changes are in the internal voxel
 
1157
coordinate system (256 units to get from one side to the opposite side).
 
1158
 
 
1159
The sprites associated with an animation (at a tile width) are in 'ANSP'
 
1160
blocks. The latter get erased when the former is defined.
 
1161
Since the 'ANIM' sequence has to be useful for the largest tile width, for
 
1162
smaller tile sizes, an animation may contain more frames than really needed.
 
1163
Also, some changes in x or y may not be visible as they are in the sub-pixel
 
1164
range at the smaller tile size. The expected (and allowed) solution can be to
 
1165
display the same sprite in more frames.
 
1166
 
 
1167
 
 
1168
Animation sequences
 
1169
~~~~~~~~~~~~~~~~~~~
 
1170
 
 
1171
Animation sequences (without the sprites) are defined using the 'ANIM' block.
 
1172
FreeRCT can read blocks with version 2.
 
1173
 
 
1174
======  ======  ==========================================================
 
1175
Offset  Length  Description
 
1176
======  ======  ==========================================================
 
1177
   0       4    Magic string 'ANIM'.
 
1178
   4       4    Version number of the block.
 
1179
   8       4    Length of the block excluding magic string, version, and
 
1180
                length.
 
1181
  12       1    Person type.
 
1182
  13       2    Animation type.
 
1183
  15       2    Frame count (called 'f').
 
1184
  17      f*6   Data of all frames.
 
1185
   ?            Variable length.
 
1186
======  ======  ==========================================================
 
1187
 
 
1188
The animation type defines what the animation really shows. Currently, the
 
1189
following animations exist:
 
1190
 
 
1191
- Walk in north-east direction (1). May be looped.
 
1192
- Walk in south-east direction (2). May be looped.
 
1193
- Walk in south-west direction (3). May be looped.
 
1194
- Walk in north-west direction (4). May be looped.
 
1195
 
 
1196
Finally the actual frames of the animation are listed, prefixed by how
 
1197
many frames to expect. The animation type decides whether or not an animation
 
1198
can be repeated by looping.
 
1199
A single frame consists of the following data.
 
1200
 
 
1201
======  ======  ==========================================================
 
1202
Offset  Length  Description
 
1203
======  ======  ==========================================================
 
1204
   0       2    Duration of the frame in milli seconds.
 
1205
   2       2    (signed) X position change after displaying the frame.
 
1206
   4       2    (signed) Y position change after displaying the frame.
 
1207
   6            Total length.
 
1208
======  ======  ==========================================================
 
1209
 
 
1210
Position changes are in the 256 unit inside-voxel coordinate system.The z
 
1211
position is derived from the world data.
 
1212
 
 
1213
 
 
1214
Sprites of an animation sequence for a given tile width are then in an 'ANSP'
 
1215
block, defined below. The frame count should match with the count in the
 
1216
'ANIM' block.
 
1217
 
 
1218
Version history
 
1219
...............
 
1220
 
 
1221
- 1 (20120418) Initial version.
 
1222
- 2 (20120527) Removed tile width from 'ANIM' and sprite and frame number from the frame data.
 
1223
  The sprite moved to the 'ANSP' block.
 
1224
 
 
1225
Animation sprites
 
1226
~~~~~~~~~~~~~~~~~
 
1227
FreeRCT can read blocks with version 1.
 
1228
 
 
1229
======  ======  ==========================================================
 
1230
Offset  Length  Description
 
1231
======  ======  ==========================================================
 
1232
   0       4    Magic string 'ANSP'.
 
1233
   4       4    Version number of the block.
 
1234
   8       4    Length of the block excluding magic string, version, and
 
1235
                length.
 
1236
  12       2    Zoom-width of a tile.
 
1237
  14       1    Person type.
 
1238
  15       2    Animation type.
 
1239
  17       2    Frame count (called 'f').
 
1240
  19      f*4   Sprite for each frame.
 
1241
   ?            Variable length.
 
1242
======  ======  ==========================================================
 
1243
 
 
1244
Version history
 
1245
...............
 
1246
 
 
1247
- 1 (20120527) Initial version.
 
1248
 
 
1249
 
 
1250
Obsolete blocks
 
1251
===============
 
1252
 
 
1253
The following blocks existed once, but are not needed any more
 
1254
 
 
1255
==== =====================  =====================================================================
 
1256
Name Version                Description
 
1257
==== =====================  =====================================================================
 
1258
8PAL (20110915)-(20110925)  8bpp palette data (data is hard-coded in the program).
 
1259
SPRT (20110915)-(20120623)  X and Y offset of a sprite (data has been moved to the 8PXL block).
 
1260
GROT (20120612)-(20120901)  Rotation GUI sprites (data has been moved to the GSLP block)
 
1261
==== =====================  =====================================================================
 
1262
 
 
1263
.. vim: set spell