forked from DFHack/df-structures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
df.world-data.xml
1057 lines (930 loc) · 48.4 KB
/
df.world-data.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<data-definition>
<struct-type type-name='world_site_unk130'>
<int32_t name="index"/>
<static-array name='unk_4' count='4'>
<stl-vector>
<pointer>
<int32_t name="unk_0"/>
<int32_t name="index"/>
<int32_t name="unk_8"/>
<stl-vector name="unk_c">
<int32_t/>
</stl-vector>
</pointer>
</stl-vector>
</static-array>
</struct-type>
<enum-type base-type='int8_t' type-name="world_population_type">
<enum-item name='Animal'/>
<enum-item name='Vermin'/>
<enum-item name='Unk2'/>
<enum-item name='VerminInnumerable'/>
<enum-item name='ColonyInsect'/>
<enum-item name='Tree'/>
<enum-item name='Grass'/>
<enum-item name='Bush'/>
</enum-type>
<struct-type type-name='embark_note'>
<int8_t name='tile'/>
<int16_t name='fg_color'/>
<int16_t name='bg_color'/>
<stl-string name='name'/>
<compound name='pos' type-name='coord2d'/>
<int16_t name='left'/>
<int16_t name='right'/>
<int16_t name='top'/>
<int16_t name='bottom'/>
</struct-type>
<struct-type type-name='world_population_ref'>
<int16_t name="region_x"/>
<int16_t name="region_y"/>
<int16_t name="feature_idx" init-value="-1"/>
<int32_t name='cave_id' ref-target='world_underground_region'/>
<int32_t name="unk_28" />
<int32_t name="population_idx">
<code-helper name='refers-to'>
(let* ((info $$._global)
(wdata $global.world.world_data)
(x $info.region_x)
(y $info.region_y)
(reg (or (when (/= $info.feature_idx -1)
(let* ((rip $wdata.feature_map[(floor x 16)][(floor y 16)])
(flst $rip.features.feature_init[(logand x 15)][(logand y 15)]))
$flst[$info.feature_idx].feature))
(awhen $info.cave_id.ref-target
$it.feature_init.feature)
(find-instance $world_region ;
$wdata.region_map[x][y].region_id))))
$reg.population[$])
</code-helper>
</int32_t>
<enum base-type='int16_t' name='depth' type-name='layer_type' comment="Doesn't look correct. See -1, 0, 41, 172, 508, and 686 with critters visible in all caverns. Some dead, but the dorf on the surface isn't"/>
</struct-type>
<struct-type type-name='local_population'>
<enum base-type='int8_t' name='type' type-name='world_population_type'/>
<compound is-union='true'>
<int16_t name="race" ref-target='creature_raw'/>
<int16_t name="plant" ref-target='plant_raw'/>
</compound>
<int32_t name="quantity"/>
<int32_t name="quantity2" since='v0.40.01'/>
<bitfield name='flags' base-type='uint8_t'>
<flag-bit name='discovered'/>
<flag-bit name='extinct' comment='guessed, based on 23a'/>
<flag-bit name='already_removed' comment='no longer in world.populations'/>
<flag-bit name='unk3' comment='prevents it from showing up, related to world.unk_59dc4 (now area_grasses?)'/>
</bitfield>
<compound name='population' type-name='world_population_ref'/>
<int32_t name='wp_unk_10' init-value='-1'/>
<int32_t name='wp_unk_18' init-value='-1'/>
<int32_t name='wp_unk_1c' init-value='-1' comment="only set on subset of animals (including vermin). None seen on fresh embark"/>
<int32_t name='unk_v47_1' init-value='-1' since='v0.47.01' comment="set on same animals as wp_unk_1c and only seen 0"/>
</struct-type>
<struct-type type-name='world_population'>
<enum base-type='int8_t' name='type' type-name='world_population_type'/>
<compound is-union='true'>
<int16_t name="race" ref-target='creature_raw'/>
<int16_t name="plant" ref-target='plant_raw'/>
</compound>
<int32_t name="count_min" init-value='10000001'/>
<int32_t name="count_max" init-value='10000001'/>
<int32_t name='unk_c' init-value='0' since='v0.40.01'/>
<int32_t name="owner" ref-target='historical_entity'/>
<int32_t name="unk_10" init-value='-1'/>
<int32_t name="unk_14" init-value='-1'/>
<int32_t name='unk_18' init-value='-1' since='v0.34.01'/>
<int32_t name='unk_1c' init-value='-1' since='v0.34.01'/>
<int32_t name='unk_20' init-value='-1' since='v0.47.01'/>
</struct-type>
<struct-type type-name='world_landmass'
instance-vector='$global.world.world_data.landmasses'>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>(describe-obj $.name)</code-helper>
<int32_t name="index"/>
<int32_t name="area"/>
<int32_t name='min_x' since='v0.40.01'/>
<int32_t name='max_x' since='v0.40.01'/>
<int32_t name='min_y' since='v0.40.01'/>
<int32_t name='max_y' since='v0.40.01'/>
<stl-vector name='unk_74' type-name='int16_t'/>
<stl-vector name='unk_84' type-name='int16_t'/>
</struct-type>
<enum-type type-name='world_region_type' base-type='int16_t'>
<enum-item name='Swamp'/>
<enum-item name='Desert'/>
<enum-item name='Jungle'/>
<enum-item name='Mountains'/>
<enum-item name='Ocean'/>
<enum-item name='Lake'/>
<enum-item name='Glacier'/>
<enum-item name='Tundra'/>
<enum-item name='Steppe'/>
<enum-item name='Hills' comment='Steppe and Hills share the same set of biomes, differing only in Drainage'/>
</enum-type>
<struct-type type-name='world_region' instance-vector='$global.world.world_data.regions'>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>(describe-obj $.name)</code-helper>
<int32_t name="index"/>
<enum base-type='int16_t' name="type" type-name='world_region_type'/>
<compound name='region_coords' type-name='coord2d_path'/>
<int32_t name="size" comment='Number of tiles in the region'/>
<int32_t name="unk_98"/>
<int32_t name="unk_9c"/>
<int32_t name="unk_a0"/>
<int32_t name="unk_a4"/>
<stl-vector name="population" pointer-type='world_population'/>
<static-array name="biome_tile_counts" count="51" index-enum='biome_type'>
<int32_t/>
</static-array>
<stl-vector name="tree_biomes">
<enum base-type='int16_t' type-name='biome_type'/>
</stl-vector>
<stl-vector name="tree_tiles_1" index-refers-to='$$._global.tree_biomes[$].refers-to'>
<int16_t ref-target='plant_raw' />
</stl-vector>
<stl-vector name="tree_tiles_2" index-refers-to='$$._global.tree_biomes[$].refers-to'>
<int16_t ref-target='plant_raw' />
</stl-vector>
<stl-vector name="tree_tiles_good" index-refers-to='$$._global.tree_biomes[$].refers-to'>
<int16_t ref-target='plant_raw' />
</stl-vector>
<stl-vector name="tree_tiles_evil" index-refers-to='$$._global.tree_biomes[$].refers-to'>
<int16_t ref-target='plant_raw' />
</stl-vector>
<stl-vector name="tree_tiles_savage" index-refers-to='$$._global.tree_biomes[$].refers-to'>
<int16_t ref-target='plant_raw' />
</stl-vector>
<int8_t name="dead_percentage" comment="% vegetation dead on embark. The number increases during world gen history, with the new ones always at 100%"/>
<bool name="unk_1e5" comment="Probably optionally set only on good and evil regions during world gen. Number set increases during world gen history and can affect neutral."/>
<bool name="unk_1e6" comment="Probably optionally set only on neutral regions"/>
<bool name="reanimating" comment="Indicates that region interaction is reanimating"/>
<int32_t name="unk_1e8" init-value='-1' since='v0.47.01' comment="Number set increases during world gen history"/>
<bool name='evil'/>
<bool name='good'/> -- At most one of 'evil' and 'good' is set at a time by DF.
<int16_t name='lake_surface' init-value='-30000'/>
<stl-vector name="forces" type-name='int32_t' ref-target='historical_figure' comment="historical figure IDs of force deities associated with the region. Number set increases during civ placement"/>
<int32_t name="unk_v47_2" init-value='0' comment="Number set increases during civ placement"/>
<int32_t name="mid_x"/>
<int32_t name="mid_y"/>
<int32_t name="min_x"/>
<int32_t name="max_x"/>
<int32_t name="min_y"/>
<int32_t name="max_y"/>
</struct-type>
<struct-type type-name='world_underground_region'
instance-vector='$global.world.world_data.underground_regions'>
<enum base-type='int16_t' name="type">
<enum-item name='Cavern'/>
<enum-item name='MagmaSea'/>
<enum-item name='Underworld'/>
</enum>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>(describe-obj $.name)</code-helper>
<int32_t name="index"/>
<int16_t name="layer_depth" comment='0-2 caves, 3 magma sea, 4 hell'/>
<int16_t name="layer_depth_p1a" comment='+1'/>
<int16_t name="layer_depth_p1b"/>
<int16_t name="water"/> -- Based on worldgen parameter pair.
<int16_t name="unk_7c"/>
<int16_t name="openness_min"/> -- These parameters correspond to
<int16_t name="openness_max"/> -- the similar world gen parameters.
<int16_t name="passage_density_min"/> --
<int16_t name="passage_density_max"/> --
<compound name='region_coords' type-name='coord2d_path'/>
<stl-vector name="region_min_z" type-name='int16_t'/>
<stl-vector name="region_max_z" type-name='int16_t'/>
<stl-vector name="unk_c8"/>
<pointer name="feature_init" type-name='feature_init'/>
</struct-type>
<struct-type type-name='world_river'>
<compound name='name' type-name='language_name'/>
<code-helper name='describe'>(describe-obj $.name)</code-helper>
<compound name='path' type-name='coord2d_path'/>
<stl-vector name="flow" type-name='int32_t'/>
<stl-vector name="exit_tile" type-name='int16_t'/> -- 0 - 15
<stl-vector name="elevation" type-name='int16_t'/>
<compound name='end_pos' type-name='coord2d'/>
<df-flagarray name='flags'/>
<comment>
Additional river information:
The flow element affects the width of the river and seems to follow the
formula width = (flow / 40000 * 46) + 1, with a minimum width of 4 and
a maximum width of 47. DF uses specific names for rivers with certain flows:
- Stream: less than 5000
- Minor River 5000 - 9999
- River 10000 - 19999
- Major River: greather than 20000
Brooks tend to have a flow of 0, but DF has divided the controlling information
between this structure, the region map entry (below), and the feature map.
Thus, the region map flag 'is_brook' controls whether a water course actually
is a (potentially broad) brook or an open water course. Likewise, the 'has_river'
flag is needed for DF to properly understand a water course should be present.
The exit tile holds the information on which mid level tile the river should
exit the region. Presumably the path controls which edge to apply this to.
Note that the river up/down/left/right flags of the region map entry should
align with the sides rivers enter/exit.
The feature map has to have a river entry for the corresponding world tile
for a river to be implemented properly. All this is done by DF, but needs
to be known if hacking.
The world region details (below) data on rivers are generated as the regions
are generated.
The elevation element affects the level of the river. If the river elevation
is lower than the surrounding area DF tends to generate a valley around the
river to allow it to reach the correct elevation.
</comment>
</struct-type>
<enum-type type-name='geo_layer_type' base-type='int16_t'>
<enum-attr name='flag' type-name='inorganic_flags' use-key-name='true'/>
<enum-item name='SOIL'/>
<enum-item name='SEDIMENTARY'/>
<enum-item name='METAMORPHIC'/>
<enum-item name='IGNEOUS_EXTRUSIVE'/>
<enum-item name='IGNEOUS_INTRUSIVE'/>
<enum-item name='SOIL_OCEAN'/>
<enum-item name='SOIL_SAND'/>
<enum-item name='SEDIMENTARY_OCEAN_SHALLOW'/>
<enum-item name='SEDIMENTARY_OCEAN_DEEP'/>
</enum-type>
<struct-type type-name='world_geo_layer'>
<enum base-type='int16_t' name="type" type-name='geo_layer_type'/>
<int32_t name="mat_index" ref-target='inorganic_raw'/>
<code-helper name='describe'>(describe-obj $.mat_index.ref-target)</code-helper>
<stl-vector name="vein_mat" type-name='int32_t' ref-target='inorganic_raw'/>
<stl-vector name="vein_nested_in" comment='Index of the other vein this one is nested in, or -1'>
<int16_t refers-to='$$._global.vein_mat[$].ref-target'/>
</stl-vector>
<stl-vector name="vein_type">
<enum base-type='int8_t' type-name='inclusion_type'/>
</stl-vector>
<stl-vector name="vein_unk_38" type-name='int8_t' comment='density??'/>
<int16_t name="top_height" comment='negative'/>
<int16_t name="bottom_height"/>
</struct-type>
<struct-type type-name='world_geo_biome' instance-vector='$global.world.world_data.geo_biomes'>
<int16_t name='unk1'/>
<int16_t name='index'/>
<code-helper name='describe'>(fmt "~A geo_layers" $.layers.count)</code-helper>
<stl-vector name="layers" pointer-type='world_geo_layer'/>
</struct-type>
<struct-type type-name='world_region_feature'>
<int16_t name='feature_idx'>
<code-helper name='refers-to'>
(let* ((info $$._parent._parent._global)
(wdata $global.world.world_data)
(x $info.pos.x)
(y $info.pos.y))
(when (/= $ -1)
(let* ((rip $wdata.feature_map[(floor x 16)][(floor y 16)])
(flst $rip.features.feature_init[(logand x 15)][(logand y 15)]))
$flst[$])))
</code-helper>
</int16_t>
<int32_t name="layer" ref-target='world_underground_region'/>
<int32_t name="region_tile_idx">
<code-helper name='describe'>
(let ((l $$._parent.layer.ref-target))
(when l
(list (fmt "(~A,~A)-(~A:~A)"
$l.region_coords.x[$] $l.region_coords.y[$]
$l.region_min_z[$] $l.region_max_z[$]))))
</code-helper>
</int32_t>
<int16_t name='min_z'/>
<int16_t name='max_z'/>
<static-array count='6' type-name='coord2d' name='unk_c'/>
<int32_t name="unk_28"/>
<uint32_t name="seed" comment='looks random'/>
<df-flagarray name="unk_30"/>
<static-array count='15' type-name='int16_t' name='unk_38'/>
<enum name="top_layer_idx" type-name='layer_type' base-type='int16_t'
comment='topmost cave layer the feature reaches'/>
</struct-type>
<struct-type type-name='world_region_details'>
<static-array count='17' name='biome'>
<static-array type-name='int8_t' count='17'
comment='lower 4 bits: biome 1..9; |=0x30 if fort'/>
<comment>biome field reference:
789
456
123
as directions, with 5 = own world tile, 1 = SW, 9 = NE, etc.</comment>
</static-array>
<static-array count='17' name='elevation'>
<static-array type-name='int16_t' count='17'/>
</static-array>
<static-array count='16' name='seed' comment='looks random'>
<static-array type-name='uint32_t' count='16'/>
</static-array>
<compound name='edges'>
<comment>
In order to determine how biomes cross embark tile edges,
the rectangle framing an embark tile is split into 4 corners,
and 4 straight edge segments, using ranges measured in tiles:
+-/----/+
| /
/ * |
/ /
+-/-/---+
After this, each corner and edge segment is assigned the biome
of one of the adjoining 4 or 2 embark tiles, based on the values
in these arrays. It may be necessary to access adjacent details
objects to collect the full outline:
c11 x11 | c21
y11 *** | y21
-------------
c12 x12 | c22
There are also certain rules forcing ocean/lake biomes to lose
edges to mountains, and both of them to anything else, no matter
what the original array value is. The actual biomes for tiles in
the frame are semi-randomly interpolated from this edge spec.
For some reason DF provides for all edges of all mid level tiles
in a world tile, but not for the corners on the south and east
edges: for these you have to go to the next world tile.
This has some effect on the corners on the south and east edges of
the world where there are no adjacent tiles to get the data from.
There the rules are static: the biomes of corners are taken from
the easternmost and southernmost of the two touching corners.
The rules for corner determination when the biome_corner field has
specified a biome that's specified to yield as per the above seems
to be to first take the NW corner (0), then the NE (1) one, and
then the SW (2) one. If the selected corner doesn't exist (because
it's outside of the world) the same fallback corner selection is
used, with the exception of a northern row selection of NW (0),
where the home corner (3) is selected.
</comment>
<static-array count='16' name='split_x'
comment='splits for horizontal edges, x=min y=max'>
<static-array type-name='coord2d' count='17'/>
</static-array>
<static-array count='17' name='split_y'
comment='splits for vertical edges, x=min y=max'>
<static-array type-name='coord2d' count='16'/>
</static-array>
<static-array name='biome_corner' count='16'
comment='0=Reference is NW, 1=Reference is N, 2=Reference is W, 3=Reference is current tile'>
<static-array type-name='int8_t' count='16'/>
<comment>
All 4 corners touching get the same reference (which determines the biome),
i.e. SE corner of the tile to the NW, SW corner of the tile to the
N, NE corner of the tile to the W, and the NW corner of the current
tile, as directed by the biome_corner value.
</comment>
</static-array>
<static-array name='biome_x' count='16' comment='0=Reference is N, 1=Reference is current tile (adopted by S edge to the N)'>
<static-array type-name='int8_t' count='16'/>
</static-array>
<static-array name='biome_y' count='16' comment='0=Reference is W, 1=Reference is current tile (Adopted by E edge to the W)'>
<static-array type-name='int8_t' count='16'/>
</static-array>
</compound>
<code-helper name='describe'> (describe-obj $.pos) </code-helper>
<compound name='pos' type-name='coord2d'/>
<int16_t name='unk12e8'/>
<int16_t name='unk_1'/>
<int16_t name='unk_2'/>
<int16_t name='unk_3'/>
<int16_t name='unk_4'/>
-- Rivers crossing embark tile edges
<compound name='rivers_vertical'>
<static-array name='x_min' count='16'>
<static-array type-name='int16_t' count='17'/>
</static-array>
<static-array name='x_max' count='16'>
<static-array type-name='int16_t' count='17'/>
</static-array>
<static-array name='active' count='16'>
<static-array type-name='int8_t' count='17'/>
</static-array>
<static-array name='elevation' count='16'>
<static-array type-name='int16_t' count='17'/>
</static-array>
</compound>
<compound name='rivers_horizontal'>
<static-array name='y_min' count='17'>
<static-array type-name='int16_t' count='16'/>
</static-array>
<static-array name='y_max' count='17'>
<static-array type-name='int16_t' count='16'/>
</static-array>
<static-array name='active' count='17'>
<static-array type-name='int8_t' count='16'/>
</static-array>
<static-array name='elevation' count='17'>
<static-array type-name='int16_t' count='16'/>
</static-array>
</compound>
<static-array name='other_features' count='16'>
<static-array count='16'>
<bitfield name='flags' base-type='uint8_t'>
<flag-bit name='construction' comment="the MLTs of world_data.constructions.all"/>
<flag-bit name='minor_site_footprint' comment="MLTs with sites other than MountainHall, DarkFortress, ForestRetreat, Town"/>
<flag-bit name='river' comment="Only a very small subset (selection criteria unknown), but the MLTs marked match up with Rivers* tiles plus implicit River tiles interpolated from that"/>
</bitfield>
</static-array>
</static-array>
<static-array count='16' name='features'>
<static-array count='16'>
<stl-vector pointer-type='world_region_feature'/>
</static-array>
</static-array>
<int16_t name='lava_stone' ref-target='inorganic_raw'/>
<static-array count='1152' name='unk_12' type-name='int16_t' since='v0.40.01' comment="Might it be 256 * 9 int8_t, i.e. 1 per 16*16 block?. Never seen other than -1, though"/>
<static-array count='16' name='elevation2'>
<static-array type-name='int16_t' count='16'/>
</static-array>
<static-array type-name='int32_t' count='256' name='undef13'/>
<int32_t/>
<int32_t/>
</struct-type>
<enum-type type-name='region_map_entry_flags'>
<enum-item name='has_river'/>
<enum-item name='tile_variant'/>
<enum-item/>
<enum-item name='has_site'/>
<enum-item/>
<enum-item name='river_up'/>
<enum-item name='river_down'/>
<enum-item name='river_right'/>
<enum-item name='river_left'/>
<enum-item name='discovered'/>
<enum-item/>
<enum-item/>
<enum-item name='has_army'/>
<enum-item name='is_peak'/>
<enum-item name='is_lake'/>
<enum-item name='is_brook'/>
<enum-item name='has_road'/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
<enum-item/>
</enum-type>
<enum-type type-name='front_type' base-type='uint16_t'>
<enum-item name='front_none'/>
<enum-item name='front_warm'/>
<enum-item name='front_cold'/>
<enum-item name='front_occluded'/>
</enum-type>
<enum-type type-name='cumulus_type' base-type='uint16_t'>
<enum-item name='cumulus_none'/>
<enum-item name='cumulus_medium'/>
<enum-item name='cumulus_multi'/>
<enum-item name='cumulus_nimbus'/>
</enum-type>
<enum-type type-name='stratus_type' base-type='uint16_t'>
<enum-item name='stratus_none'/>
<enum-item name='stratus_alto'/>
<enum-item name='stratus_proper'/>
<enum-item name='stratus_nimbus'/>
</enum-type>
<enum-type type-name='fog_type' base-type='uint16_t'>
<enum-item name='fog_none'/>
<enum-item name='fog_mist'/>
<enum-item name='fog_normal'/>
<enum-item name='fog_thick'/>
</enum-type>
<struct-type type-name='region_map_entry'>
<int32_t name="unk_0"/>
<int32_t name="finder_rank" init-value='-1'/>
<stl-vector name="sites" pointer-type='world_site'/>
<df-flagarray name='flags' index-enum='region_map_entry_flags'/>
<int16_t name="elevation" comment='0-99=Ocean, 150+=Mountains, 100-149: all other biomes. Note that PSV elevation uses 100-299 for normal biomes, with range later cut to 1/4, and Mountains shifted down'/>
<int16_t name="rainfall" comment='0-100'/>
<int16_t name="vegetation" comment='0-100'/>
<int16_t name="temperature" comment="Urists. 10000 Urists=0 Celsius. Urist steps equals Fahrenheit steps, which is equal to 5/9 Celsius steps"/>
<int16_t name="evilness" comment='0-32=Good, 33-65=Neutral, 66-100=Evil'/>
<int16_t name="drainage" comment='0-100'/>
<int16_t name="volcanism" comment='0-100'/>
<int16_t name="savagery" comment='0-32=Calm, 33-65=Neutral, 66-100=Savage'/>
<int16_t name="air_temp"/>
<int16_t name="air_x" comment='Toady: a velocity component? I dont remember'/>
<int16_t name="air_y" />
<bitfield name='clouds' base-type='uint16_t'>
<flag-bit name='front' count='2' type-name='front_type'/>
<flag-bit name='cumulus' count='2' type-name='cumulus_type'/>
<flag-bit name='cirrus' count='1'/>
<flag-bit name='stratus' count='2' type-name='stratus_type'/>
<flag-bit name='fog' count='2' type-name='fog_type'/>
<flag-bit name='countdown' count='4' comment='A counter for stratus clouds that randomly decreases by 1 or 0 each timer weather is checked there. it does various stratus/fog effects based on the humidity/breezes/etc.'/>
</bitfield>
<bitfield name='wind' base-type='uint16_t' comment='blows toward direction in morning'>
<flag-bit name='north_1'/>
<flag-bit name='south_1'/>
<flag-bit name='east_1'/>
<flag-bit name='west_1'/>
<flag-bit name='north_2'/>
<flag-bit name='south_2'/>
<flag-bit name='east_2'/>
<flag-bit name='west_2'/>
</bitfield>
<int16_t name="snowfall" comment='0-5000, humidity?'/>
<int16_t name="salinity" comment='0-100'/>
<compound name='unk_3e' type-name='coord'/>
<compound name='unk_44' type-name='coord'/>
<compound name='unk_4a' type-name='coord'/>
<int32_t name="region_id" ref-target='world_region'/>
<int32_t name="landmass_id" ref-target='world_landmass'/>
<int16_t name='geo_index' ref-target='world_geo_biome'/>
</struct-type>
<struct-type type-name='entity_claim_mask'>
<pointer name="map" is-array='true'>
<pointer is-array='true'>
<stl-vector name='entities' type-name='int32_t' ref-target='historical_entity'/>
<stl-vector name='region_masks'>
<pointer>
<static-array count='16'>
<static-array count='16' type-name='uint8_t'
comment='1 bit per entity'/>
</static-array>
</pointer>
</stl-vector>
</pointer>
</pointer>
<int16_t name="width"/>
<int16_t name="height"/>
</struct-type>
<struct-type type-name='moving_party'>
<compound name='pos' type-name='coord2d' comment='global block x/y'/>
<int16_t name="unk_4"/>
<int32_t name="unk_c"/>
<int32_t name="unk_10"/>
<stl-vector name="members">
<pointer>
<int32_t name="nemesis_id" ref-target='nemesis_record'/>
<int32_t name="hunger"/>
<int32_t name="thirst"/>
<int32_t name="sleepiness"/>
<int32_t name="stored_fat"/>
<int32_t name="unk_14"/>
<int32_t name="unk_18" init-value='1' comment='maybe type'/>
<int32_t name="unk_1c" init-value='-1000000'/>
<int32_t name="unk_20" init-value='-1000000'/>
<int32_t name="unk_24" init-value='-1000000'/>
</pointer>
</stl-vector>
<int32_t name="entity_id" ref-target='historical_entity'/>
<df-flagarray name='flags'/>
<stl-vector name="unk_30"/>
<stl-vector name="unk_40"/>
<int16_t name="unk_70"/>
<int16_t name="unk_72" init-value='-1'/>
<int16_t name="unk_74" init-value='-1'/>
<int32_t name="unk_7c" init-value='-1'/>
<int32_t name="region_id" ref-target='world_region'/>
<int32_t name="beast_id" init-value='-1' comment='for FB'/>
</struct-type>
<struct-type type-name='world_object_data'
instance-vector='$global.world.world_data.object_data' key-field='id'>
<int32_t name='id' comment="World MLT of the data according to: i + x * 16 + k * 16 * world_width + y * 256 * world_width, where (x, y) is the world tile and (i, k) the MLT within it"/>
<stl-vector name="altered_items" type-name='int32_t' comment='world_data_subid'/>
<stl-vector name="offloaded_items">
<pointer>
<pointer name="item" type-name="item"/>
<int32_t name="global_x" comment='in tiles it seems'/>
<int32_t name="global_y"/>
<int32_t name="global_z"/>
<int32_t name="container" ref-target='item'/>
<int32_t name="building" ref-target='building'/>
<int32_t name="unk_18"/>
</pointer>
</stl-vector>
<stl-vector name="unk_24" type-name='int32_t'/>
<stl-vector name="unk_34" type-name='int32_t'/>
<stl-vector name="unk_44" type-name='int32_t'/>
<stl-vector name="unk_54" type-name='int32_t'/>
<stl-vector name="unk_64" type-name='int16_t'/>
<stl-vector name="altered_buildings" type-name='int32_t' comment='world_data_subid'/>
<stl-vector name="offloaded_buildings">
<pointer>
<pointer name="building" type-name="building"/>
<int32_t name="global_x" comment='in tiles it seems'/>
<int32_t name="global_y"/>
<int32_t name="global_z"/>
<int32_t name="unk_10"/>
</pointer>
</stl-vector>
<stl-vector name="unk_94">
<pointer>
<int32_t name="global_x" comment='in in-game tiles it seems'/>
<int32_t name="global_y"/>
<int32_t name="global_z"/>
<int32_t name="unk_c"/>
</pointer>
</stl-vector>
<stl-vector name='creation_zone_alterations' pointer-type='creation_zone_pwg_alterationst' since='v0.40.01'/>
<int32_t name='unk_v40_1' since='v0.40.01'/>
<int32_t name="year"/>
<int32_t name="year_tick"/>
<compound name='picked_growths' since='v0.40.14' comment="also includes 'automatically picked' i.e. fallen fruit that becomes item_spatter. Doesn not seem to be used by Adventurer mode">
<stl-vector name='x' type-name='int16_t' comment="0 - 47, within the MLT"/>
<stl-vector name='y' type-name='int16_t' comment="0 - 47, within the MLT"/>
<stl-vector name='z' type-name='int16_t' comment="z coordinate using the elevation coordinate system"/>
<stl-vector name='subtype' type-name='int32_t' comment="subtype of the growth picked within the raws of the implicit plant"/>
<stl-vector name='density' type-name='int32_t' comment="copy of the density field of the growth raws"/>
<stl-vector name='year' type-name='int32_t' comment="presumably to know whether it's the current year's harvest or the previous one's"/>
</compound>
<compound name='unk_v43' since='v0.43.01' comment="probably used by Adventurer mode">
<stl-vector name='x' type-name='int16_t' comment="probably MLT relative x coordinate"/>
<stl-vector name='y' type-name='int16_t' comment="probably MLT relative y coordinate"/>
<stl-vector name='z' type-name='int16_t' comment="probably z coordinate using the elevation coordinate system"/>
<stl-vector name='unk_4' type-name='int32_t' comment="233/234 seen"/>
</compound>
</struct-type>
<enum-type type-name='mountain_peak_flags'>
<enum-item name='is_volcano'/>
</enum-type>
<struct-type type-name='world_mountain_peak'
instance-vector='$global.world.world_data.mountain_peaks'>
<compound name='name' type-name='language_name'/>
<compound name='pos' type-name='coord2d'/>
<df-flagarray name='flags' index-enum='mountain_peak_flags'/>
<int16_t name="height"/>
</struct-type>
<struct-type type-name='world_data'>
<compound name='name' type-name='language_name' comment='name of the world'/>
<static-array name='unk1' count='15' type-name='int8_t'/>
<int32_t name='next_site_id'/>
<int32_t name='next_site_unk130_id'/>
<int32_t name='next_resource_allotment_id'/>
<int32_t name='next_breed_id'/>
<int32_t name='next_battlefield_id' since='v0.34.01'/>
<int32_t name='unk_v34_1' since='v0.34.01'/>
<int32_t name='world_width'/>
<int32_t name='world_height'/>
<!--
<stl-vector name='travel' pointer-type='moving_party'/>
-->
<int32_t name='unk_78'/>
<int32_t name='moon_phase'/>
<enum name='flip_latitude' base-type='int16_t'>
<enum-item name='None' value='-1'/>
<enum-item name='North'/>
<enum-item name='South'/>
<enum-item name='Both'/>
</enum>
<int16_t name='flip_longitude'/>
<int16_t name='unk_84'/>
<int16_t name='unk_86'/>
<int16_t name='unk_88'/>
<int16_t name='unk_8a'/>
<int16_t name='unk_v34_2' since='v0.34.01'/>
<int16_t name='unk_v34_3' since='v0.34.01'/>
<compound name='unk_b4'>
<int32_t name='world_width2'/>
<int32_t name='world_height2'/>
<pointer name='unk_1' type-name='uint32_t' is-array='true' comment='align(width,4)*height'/>
<pointer name='unk_2' type-name='uint32_t' is-array='true' comment='align(width,4)*height'/>
<pointer name='unk_3' type-name='uint32_t' is-array='true' comment='width*height'/>
<pointer name='unk_4' type-name='uint8_t' is-array='true' comment='align(width,4)*height'/>
</compound>
<stl-vector name='region_details' pointer-type='world_region_details'/>
<int32_t name="adv_region_x"/>
<int32_t name="adv_region_y"/>
<int32_t name="adv_emb_x"/>
<int32_t name="adv_emb_y"/>
<int16_t name="unk_x1"/>
<int16_t name="unk_y1"/>
<int16_t name="unk_x2"/>
<int16_t name="unk_y2"/>
<compound name='constructions'>
<int16_t name="width"/>
<int16_t name="height"/>
<pointer name="map" is-array='true'>
<pointer is-array='true'>
<stl-vector pointer-type='world_construction_square'/>
</pointer>
</pointer>
<stl-vector name="list" pointer-type='world_construction'/>
<int32_t name="next_id"/>
</compound>
<compound name="entity_claims1" type-name='entity_claim_mask'/>
<compound name="entity_claims2" type-name='entity_claim_mask'/>
<stl-vector name="sites" pointer-type='world_site'/>
<stl-vector name="site_unk130" pointer-type='world_site_unk130'/>
<stl-vector name="resource_allotments" pointer-type='resource_allotment_data'/>
<stl-vector name='breeds' pointer-type='breed' />
<stl-vector name='battlefields' pointer-type='battlefield' since='v0.34.01' />
<stl-vector name='region_weather' pointer-type='region_weather' since='v0.34.01'/>
<stl-vector name='object_data' pointer-type='world_object_data' since='v0.34.01'/>
<stl-vector name="landmasses" pointer-type='world_landmass'/>
<stl-vector name="regions" pointer-type='world_region'/>
<stl-vector name="underground_regions" pointer-type='world_underground_region'/>
<stl-vector name="geo_biomes" pointer-type='world_geo_biome'/>
<stl-vector name="mountain_peaks" pointer-type='world_mountain_peak'/>
<stl-vector name="rivers" pointer-type='world_river'/>
<pointer name="region_map" is-array='true'>
<pointer is-array='true' type-name='region_map_entry'/>
</pointer>
<pointer name="unk_1c4" type-name='int8_t' is-array='true'/> 2d byte array with size based on map size
<pointer/>
<pointer/>
<padding name="unk_1c8" size="4"/>
<stl-vector name="embark_notes" pointer-type='embark_note'/>
<pointer name="unk_1dc" is-array='true'>
<pointer is-array='true'>
<stl-vector pointer-type='army'/>
</pointer>
</pointer>
<pointer name="unk_1e0" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1e4" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1e8" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1ec" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<pointer name="unk_1f0" is-array='true'>
<pointer is-array='true'>
<stl-vector/>
</pointer>
</pointer>
<int32_t name='unk_1' since='v0.40.01'/>
<pointer name='unk_2' since='v0.40.01'/>
<pointer name='unk_3' since='v0.40.01'/>
<pointer name='unk_4' since='v0.40.01'/>
<pointer name='unk_5' since='v0.40.01'/>
<pointer name='unk_6' since='v0.40.01'/>
<pointer name='unk_7' since='v0.40.01'/>
<pointer name='unk_8' since='v0.40.01'/>
<pointer name='unk_9' since='v0.40.01'/>
<pointer name='unk_10' since='v0.40.01'/>
<pointer name='unk_11' since='v0.40.01'/>
<pointer name='unk_12' since='v0.40.01'/>
<pointer name='unk_13' since='v0.40.01'/>
<pointer name='unk_14' since='v0.40.01'/>
<pointer name='unk_15' since='v0.40.01'/>
<pointer name='unk_16' since='v0.40.01'/>
<padding name='pad_1' size='294920'/>
<int8_t name='unk_17' since='v0.40.01'/>
<int8_t name='unk_18' since='v0.40.01'/>
<stl-vector name="active_site" pointer-type='world_site'/>
<pointer name="feature_map" is-array='true'>
<pointer is-array='true'>
<int16_t name='x'/>
<int16_t name='y'/>
<pointer name='features'>
<static-array name='feature_init' count='16'>
<static-array count='16'>
<stl-vector pointer-type='feature_init'/>
</static-array>
</static-array>
<static-array name='unk' count='16'>
<static-array count='16'>
<static-array count='30' type-name='int32_t' comment='it might actually be [30][16][16] rather than [16][16][30]'/>
</static-array>
</static-array>
</pointer>
<pointer name='unk_8' type-name='int16_t' is-array='true'/>
<pointer name='unk_c' type-name='int32_t' is-array='true'/>
</pointer>
<comment>
Additional feature_map information:
The feature_map is a two dimensional structure dividing the world into 16 * 16
world tile "feature shells" (and remember that there's a single tile wide shell
at the end of each dimension, so a pocket world has a shell dimension of 2 * 2).
These shells are loaded and unloaded dynamically, which means trying to access a
shell that isn't the one in DF's focus (where the fortress/adventurer/pre embark
cursor is) is invalid and can lead to DF crashing.
The "features.feature_init" 16 * 16 structure contains the features of each of
the corresponding world tiles within the shell. However, DF only loads the
feature vectors for the world tiles in focus, although they seem to remain
loaded until the shell is unloaded. Until loaded the vectors have a size of 0.
Manipulation of the features is usually preserved as feature vectors are
unloaded/reloaded, so spires can be elongated and rivers added, but some
details, such as river fauna, seem to be generated on loading. Added features
may not necessarily be reloaded at the vector index they were created at.
</comment>
</pointer>
<!--
<df-flagarray name='flags'/>
-->
<stl-vector name="old_sites" type-name='int32_t' ref-target='world_site'/>
<stl-vector name="old_site_x" type-name='int32_t'/>
<stl-vector name="old_site_y" type-name='int32_t'/>
<compound name='land_rgns' type-name='coord2d_path'/>
<int32_t name="unk_260"/>
<int8_t name="unk_264"/>
<int32_t name="unk_268"/>
<int8_t name="unk_26c"/>
<int32_t name="unk_270"/>
exists during worldgen only, before it finishes
some sort of wandering groups (entity types NomadicGroup, PerformanceTroupe)
unk_10, unk_24 and unk_region_name are either all initialised or all empty/uninitialised
<stl-vector name="unk_274">
<pointer>
<stl-vector name="members" pointer-type="historical_figure"/>
<stl-vector name="unk_10">
<pointer>
<int32_t name="unk_0"/> a type, maybe
<int32_t name='race' ref-target='creature_raw'/>
<int32_t name="unk_8"/> some flags I think
</pointer>
</stl-vector>
<pointer name="entity" type-name="historical_entity"/>
<int32_t name="unk_24"/>
<pointer name="unk_region_name" type-name="language_name"/>
<int32_t name="unk_2c"/>
<int32_t name="unk_30"/>
</pointer>
</stl-vector>
<compound name='unk_482f8' since='v0.40.01'>
<static-array name='unk_1' type-name='int32_t' count='320000'/>
<int32_t name='unk_2'/>
<int32_t name='unk_3'/>
<int32_t name='unk_4'/>
<int32_t name='unk_5'/>
<int32_t name='unk_6'/>
<int32_t name='unk_7'/>
<int32_t name='unk_8'/>
</compound>
</struct-type>
<struct-type type-name='breed' key-field='id' instance-vector='$global.world.world_data.breeds'>
<int32_t name='id'/>
<int32_t name="unk_4"/>
<stl-vector name="unk_8">
<pointer>
<int32_t name='id'/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_18">
<pointer>
<int32_t name='id'/>
<int32_t name="unk_4"/>
<int32_t name="unk_8"/>
</pointer>
</stl-vector>
<stl-vector name="unk_28">
<pointer>
<int32_t name="unk_0"/>
<int32_t name="unk_4"/>
</pointer>