-
Notifications
You must be signed in to change notification settings - Fork 1
/
imhex-schema.txt
406 lines (360 loc) · 8.7 KB
/
imhex-schema.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
enum CourseKind : u32 {
None = 0,
Custom = 1,
RegularEditorial = 2,
Tutorial = 4,
DownloadUser = 5,
Recovery = 6,
DownloadEditorial = 7,
InAppPurchase = 8,
ProEditorial = 9,
PowerEditorial = 10
};
enum ObjectiveKind : u32 {
None = 0
};
enum TileKind : u32 {
None = 0,
Starter = 1,
Curve = 2,
Catch = 3,
GoalBasin = 4,
Drop = 5,
Catapult = 7,
Cross = 8,
Threeway = 9,
TwoWay = 10,
Spiral = 11,
Splash = 12,
Loop = 13,
Cannon = 14,
Stacker = 15,
StackerSmall = 16,
SwitchLeft = 17,
SwitchRight = 18,
GoalRail = 19,
StackerBatch = 20,
Cascade = 21,
StraightTunnel = 22,
CurveTunnel = 23,
SwitchTunnel = 24,
Trampolin0 = 25,
Trampolin1 = 26,
Trampolin2 = 27,
LiftSmall = 28,
LiftLarge = 29,
Flip = 30,
TipTube = 31,
Volcano = 32,
Jumper = 33,
Transfert = 34,
ZiplineStart = 35,
ZiplineEnd = 36,
Bridge = 37,
ScrewSmall = 38,
ScrewMedium = 39,
ScrewLarge = 40,
MixerOffsetExits = 41,
Splitter = 42,
StackerTowerClosed = 43,
StackerTowerOpened = 44,
DoubleBalcony = 45,
MixerSameExits = 46,
DipperLeft = 47,
DipperRight = 48,
Helix = 49,
Turntable = 50,
Spinner = 51,
TwoInOneSmallCurveA = 52,
TwoInOneSmallCurveB = 53,
FlexibleTwoInOneB = 54,
RibbonCurve = 55,
ThreeEntranceFunnel = 56,
CurveCrossing = 57,
DoubleBigCurve = 58,
DoubleSmallCurve = 59,
MultiJunction = 60,
StraightCurveCrossing = 61,
TripleSmallCurve = 62,
FlexibleTwoInOneA = 63,
ColorSwapEmpty = 64,
ColorSwapPreloaded = 65,
CarouselSameExits = 66,
CarouselOffsetExits = 67,
DomeStarter = 68,
FinishTrigger = 69,
FinishArena = 70,
Trigger = 71,
DropdownSwitchLeft = 72,
DropdownSwitchRight = 73,
Queue = 74,
Lever = 75,
Elevator = 77,
LightBase = 78,
LightStacker = 79,
LightStackerSmall = 80,
LightStackerBatch = 81,
Releaser1 = 82,
Releaser2 = 83,
Releaser3 = 84,
Releaser4 = 85
};
enum LayerKind : u32 {
BaselayerPiece = 0,
Baselayer = 1,
LargeLayer = 2,
LargeGhostLayer = 3,
SmallLayer = 4,
};
enum PowerSignalMode : u32 {
None = 2147483648,
Off = 0,
Red = 1,
Green = 2,
Blue = 3,
Automatic = 4
};
enum LightStoneColorMode : u32 {
None = 2147483648,
Off = 0,
Alternating = 1,
Red = 2,
Green = 3,
Blue = 4,
White = 5,
};
enum CourseElementGeneration : u32 {
InitialLaunch = 0,
Christmas2018 = 1,
Easter2019 = 2,
Autumn2019 = 3,
Easter2020 = 4,
Pro = 5,
Fall2021 = 6,
Spring2022 = 7,
Power = 8,
Autumn2023 = 9
};
enum CourseSaveDataVersion : u32 {
InitialLaunch = 100101,
RailRework2018 = 100201,
PersistenceRefactor2019 = 1,
ZiplineAdded2019 = 2,
Pro2020 = 3,
Power2022 = 4,
LightStones2023 = 5
};
CourseSaveDataVersion current_save_data_version;
enum RailKind : u32 {
Straight = 0,
Bernoulli = 1,
DropHill = 3,
DropValley = 4,
UTurn = 5,
Narrow = 6,
Slow = 7,
BernoulliSmallStraight = 8,
BernoulliSmallLeft = 9,
BernoulliSmallRight = 10,
FlexTube0 = 11,
FlexTube60 = 12,
FlexTube120 = 13,
FlexTube180 = 14,
FlexTube240 = 15,
FlexTube300 = 16
};
enum RopeKind : u32 {
None = 0,
Straight = 1
};
enum WallSide : s32 {
West = 0,
East = 1,
};
struct String {
u8 length [[hidden]];
char bytes[length];
};
struct SaveDataHeader {
u128 guid;
CourseSaveDataVersion version;
};
struct CourseMetaData {
u64 creation_timestamp;
String title [[inline]];
u32 order_number;
CourseKind course_kind;
ObjectiveKind objective_kind;
u32 difficulty;
bool completed;
};
/*
SerializationUtils$$ReadHexVectorFromStream seems to read y before x
TODO: double check how it's written
*/
struct HexVector {
s32 y;
s32 x;
};
/*
Used by:
- Power 2022
TODO: retainer_id und power_signal_mode sind Optional
*/
struct TileTowerConstructionData {
TileKind kind;
u32 height_in_small_stacker;
u32 hex_rotation;
s32 retainer_id;
if (current_save_data_version == CourseSaveDataVersion::Power2022 || current_save_data_version == CourseSaveDataVersion::LightStones2023) {
PowerSignalMode power_signal_mode;
}
if (current_save_data_version == CourseSaveDataVersion::LightStones2023) {
LightStoneColorMode light_stone_color_mode;
}
};
/*
Used by:
- Power2022
*/
struct TileTowerTreeNodeData {
u32 index;
u32 children_count;
TileTowerConstructionData construction_data;
TileTowerTreeNodeData children[children_count];
};
/*
Used by:
- Power2022
*/
struct CellConstructionData {
HexVector local_hex_position;
TileTowerTreeNodeData tree_node_data;
};
/*
Used by:
- Power2022
*/
struct RailConstructionExitIdentifier {
u32 retainer_id;
HexVector cell_local_hex_pos;
u32 side_hex_rot;
float exit_local_pos_y;
};
/*
Used by:
- Power2022
*/
struct RailConstructionData {
RailConstructionExitIdentifier exit_1_identifier;
RailConstructionExitIdentifier exit_2_identifier;
RailKind rail_kind;
};
/*
Used by:
- ZiplineAdded2019
- Power2022
*/
struct PillarConstructionData {
u32 lower_layer_id;
HexVector lower_cell_local_position;
u32 upper_layer_id;
HexVector upper_cell_local_position;
};
struct WallCoordinate {
s32 column;
s32 row;
};
/*
Used by:
- ZiplineAdded2019
- Power2022
*/
struct WallBalconyConstructionData {
s32 retainer_id;
WallSide wall_side;
WallCoordinate wall_coordinate;
bool has_cell_construction_data;
if (has_cell_construction_data) {
CellConstructionData cell_construction_data;
}
};
/*
Used by:
- ZiplineAdded2019
- Power2022
*/
struct WallConstructionData {
s32 lower_stacker_tower_1_retainer_id;
HexVector lower_stacker_tower_1_local_hex_pos;
s32 lower_stacker_tower_2_retainer_id;
HexVector lower_stacker_tower_2_local_hex_pos;
s32 balcony_construction_data_size;
WallBalconyConstructionData balcony_construction_data[balcony_construction_data_size];
};
namespace ZiplineAdded2019 {
struct CellConstructionData {
s32 hex_rotation;
HexVector local_hex_position;
s32 tile_kind_size;
TileKind tile_kinds[tile_kind_size];
};
struct RailConstructionExitIdentifier {
s32 retainer_id;
HexVector local_hex_pos;
s32 side_hex_rot;
};
struct RailConstructionData {
RailConstructionExitIdentifier exit_1_identifier;
RailConstructionExitIdentifier exit_2_identifier;
RailKind rail_kind;
bool materialized;
};
struct RopeConstructionData {
u32 start_tile_layer_index;
HexVector start_tile_local_hex_pos;
u32 end_tile_layer_index;
HexVector end_tile_local_hex_pos;
RopeKind rope_kind;
};
}
/*
Used by:
- ZiplineAdded2019
- Power2022
*/
struct LayerConstructionData {
u32 layer_id;
LayerKind layer_kind;
float layer_height;
HexVector hex_vector;
u32 cell_construction_data_size;
if (current_save_data_version == CourseSaveDataVersion::ZiplineAdded2019) {
ZiplineAdded2019::CellConstructionData cell_construction_data[cell_construction_data_size];
} else {
CellConstructionData cell_construction_data[cell_construction_data_size];
}
};
struct Course {
SaveDataHeader header;
CourseMetaData meta_data;
current_save_data_version = header.version;
u32 layer_construction_data_size;
LayerConstructionData layer_construction_data[layer_construction_data_size];
u32 rail_construction_data_size;
if (current_save_data_version == CourseSaveDataVersion::ZiplineAdded2019) {
ZiplineAdded2019::RailConstructionData rail_construction_data[rail_construction_data_size];
} else {
RailConstructionData rail_construction_data[rail_construction_data_size];
}
u32 pillar_construction_data_size;
PillarConstructionData pillar_construction_data[pillar_construction_data_size];
if (header.version == CourseSaveDataVersion::ZiplineAdded2019) {
u32 rope_construction_data_size;
ZiplineAdded2019::RopeConstructionData rope_construction_data[rope_construction_data_size];
}
CourseElementGeneration generation;
u32 wall_construction_data_size;
WallConstructionData wall_construction_data[wall_construction_data_size];
};
Course course @ 0x00;