-
Notifications
You must be signed in to change notification settings - Fork 81
/
df.world-data.xml
1067 lines (925 loc) · 51.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='resource_allotmentst'>
<int32_t name="production_zone_index"/>
<enum name="allotment" type-name='resource_allotment_specifier_type'/>
<int32_t name="special_controlling_entity_id"/>
<stl-vector name="count" type-name='int32_t'/>
</struct-type>
<struct-type type-name='resource_pilest'>
<int32_t name="id"/>
<stl-vector name="allotment" pointer-type='resource_allotmentst'/>
<stl-vector name="allotment_stone" pointer-type='resource_allotmentst' comment='optional'/>
<stl-vector name="allotment_food" pointer-type='resource_allotmentst' comment='optional'/>
<stl-vector name="allotment_crop" pointer-type='resource_allotmentst' comment='optional'/>
</struct-type>
<enum-type type-name="world_population_type"> bay12: WilderPopTypes
<enum-item name='Animal' comment='ROAMING'/>
<enum-item name='Vermin'/>
<enum-item name='Unused3'/>
<enum-item name='VerminInnumerable' comment='SOIL'/>
<enum-item name='ColonyInsect' comment='SOIL_COLONY'/>
<enum-item name='Tree'/>
<enum-item name='Grass'/>
<enum-item name='Bush'/>
<enum-item name='Unused9'/>
</enum-type>
<struct-type type-name='embark_note' original-name='region_notest'>
<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' original-name='regionpopinfost'>
<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='site_id' ref-target='world_site'/>
<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' original-name='wilderpopst'>
<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="quantity_max" since='v0.40.01'/>
<bitfield name='flags' base-type='uint8_t'> bay12: WILDERPOPFLAG_*
<flag-bit name='discovered'/>
<flag-bit name='extinct'/>
<flag-bit name='already_removed' comment='no longer in world.populations'/>
<flag-bit name='need_offload'/>
</bitfield>
<compound name='population' type-name='world_population_ref'/>
<int32_t name="breed" ref-target='breed'/>
<int32_t name='interaction_idx' init-value='-1'/>
<int32_t name='interaction_instance' init-value='-1'/>
<int32_t name='interaction_effect' init-value='-1'/>
</struct-type>
<struct-type type-name='world_population' original-name='regionpopst'>
<enum base-type='int16_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='temp_num' init-value='0' since='v0.40.01'/>
<int32_t name="owner" ref-target='historical_entity'/>
<int32_t name="breed" ref-target='breed'/>
<int32_t name="production_zone" init-value='-1'/>
<int32_t name='interaction_idx' init-value='-1' since='v0.34.01'/>
<int32_t name='interaction_instance' init-value='-1' since='v0.34.01'/>
<int32_t name='interaction_effect' init-value='-1' since='v0.47.01'/>
</struct-type>
<struct-type type-name='world_landmass' original-name='landmassst'
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='temp_x' type-name='int16_t'/>
<stl-vector name='temp_y' type-name='int16_t'/>
</struct-type>
<enum-type type-name='world_region_type' base-type='int16_t'> bay12: RegionType
<enum-item name='Swamp'/>
<enum-item name='Desert'/>
<enum-item name='Forest'/>
<enum-item name='Mountains'/>
<enum-item name='Ocean'/>
<enum-item name='Lake'/>
<enum-item name='Glacier'/>
<enum-item name='Tundra'/>
<enum-item name='Grassland'/>
<enum-item name='Hills' comment='Grassland 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' original-name='subregionst'>
<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="savageboundnum"/>
<int32_t name="totalboundnum"/>
<int32_t name="origsavagenum"/>
<int32_t name="orig_savage_total_only_high"/>
<stl-vector name="population" pointer-type='world_population'/>
<static-array name="biome_tile_counts" count="51" type-name='int32_t' index-enum='biome_type'/>
<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="evilgood_pic" 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="has_bogeymen" comment="Probably optionally set only on neutral regions"/>
<bool name="reanimating" comment="Indicates that region interaction is reanimating"/>
<int32_t name="last_temp_evil_year" 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"/>
<int16_t name="civs_received" 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'
original-name='feature_layerst'>
<enum name="type" type-name='feature_layer_type'/>
<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="trees"/>
<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="associated_histfig" type-name='int32_t' ref-target='historical_figure'/>
<pointer name="feature_init" type-name='feature_init'/>
</struct-type>
<struct-type type-name='world_river' original-name='riverst'>
<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='RiverFlagType, none used yet'/>
<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'> bay12: GeologicalLayerType
<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' original-name='geological_layerst'>
<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_freq" type-name='int8_t' comment='ignored?'/>
<int16_t name="top_height" comment='negative'/>
<int16_t name="bottom_height"/>
</struct-type>
<enum-type type-name='geo_biome_type'> bay12: GeologicalRegionType
<enum-item name='NORMAL_STANDARD'/>
<enum-item name='NORMAL_VOLCANIC'/>
<enum-item name='OCEAN_DEEP_STANDARD'/>
<enum-item name='OCEAN_DEEP_VOLCANIC'/>
<enum-item name='OCEAN_SHALLOW_STANDARD'/>
<enum-item name='OCEAN_SHALLOW_VOLCANIC'/>
<enum-item name='DESERT_SAND_STANDARD'/>
<enum-item name='DESERT_SAND_VOLCANIC'/>
</enum-type>
<struct-type type-name='world_geo_biome' instance-vector='$global.world.world_data.geo_biomes' original-name='geological_regionst'>
<enum name='type' type-name='geo_biome_type' base-type='int16_t'/>
<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' original-name='feature_square_infost'>
<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'/>
<int16_t name='zup_x'/>
<int16_t name='zup_y'/>
<int16_t name='zdown_x'/>
<int16_t name='zdown_y'/>
<int16_t name='left_y1'/>
<int16_t name='left_y2'/>
<int16_t name='right_y1'/>
<int16_t name='right_y2'/>
<int16_t name='up_x1'/>
<int16_t name='up_x2'/>
<int16_t name='down_x1'/>
<int16_t name='down_x2'/>
<int8_t name='u_flow'/>
<int8_t name='d_flow'/>
<int8_t name='l_flow'/>
<int8_t name='r_flow'/>
<uint32_t name="seed"/>
<df-flagarray name="flag"/>
<int16_t name='left_z_min'/>
<int16_t name='left_z_max'/>
<int16_t name='right_z_min'/>
<int16_t name='right_z_max'/>
<int16_t name='up_z_min'/>
<int16_t name='up_z_max'/>
<int16_t name='down_z_min'/>
<int16_t name='down_z_max'/>
<enum type-name='tile_liquid' name='liquid_type'/>
<int16_t name='liquid_upper_filled_z'/>
<int16_t name='openness'/>
<int16_t name='passage_density'/>
<static-array count='2' type-name='int16_t' name='vertical_connection'/>
<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' original-name='region_midmapst'>
<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'/>
<compound name='ocean_beach_comp' comment='ocean_beach_compst'>
<int16_t name='soil_freq'/>
<int16_t name='pebble_freq'/>
<int16_t name='solid_rock_freq'/>
<int16_t name='boulder_freq'/>
<int16_t name='driftwood_freq'/>
</compound>
-- 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='48' name='site_map_travel_dir' since='v0.40.01'><static-array count='48' type-name='uint8_t'/></static-array>
<static-array count='16' name='temp_elevation'>
<static-array type-name='int16_t' count='16'/>
</static-array>
<static-array count='16' name='temp_path_map'>
<static-array type-name='int32_t' count='16'/>
</static-array>
<int16_t name='site_finder_x1'/>
<int16_t name='site_finder_x2'/>
<int16_t name='site_finder_y1'/>
<int16_t name='site_finder_y2'/>
</struct-type>
<enum-type type-name='region_map_entry_flags'> bay12: RegionSquareFlagType
<enum-item name='has_river'/>
<enum-item comment='unused_02'/>
<enum-item name='new_lake'/>
<enum-item name='has_site'/>
<enum-item name='temp_river'/>
<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 name='light'/>
<enum-item name='skylight'/>
<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' comment='any construction'/>
<enum-item name='orig_river_source'/>
</enum-type>
<enum-type type-name='front_type' base-type='uint16_t'> bay12: REGION_WEATHER_FRONT_*
<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'> bay12: REGION_WEATHER_CUMULUS_*
<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'> bay12: REGION_WEATHER_STRATUS_*
<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'> bay12: REGION_WEATHER_FOG_*
<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' original-name='region_squarest'>
<int32_t name="path_map" comment='unsaved'/>
<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'/>
bay12: actually an int16 array indexed by worldgen_range_type
<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'> bay12: REGION_WEATHER_*
<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'> bay12: REGION_DAILY_WINDS_*
<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'/>
<int16_t name="unused_16"/>
<int16_t name="unused_17"/>
<int16_t name="unused_18"/>
<int16_t name="unused_19"/>
<int16_t name="unused_20"/>
<int16_t name="unused_21"/>
<int16_t name="unused_22"/>
<int16_t name="unused_23"/>
<int16_t name="unused_24"/>
<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_influencest'>
<pointer name="map" is-array='true'>
<pointer is-array='true'> bay12: entity_influence_blockst
<stl-vector name='entities' type-name='int32_t' ref-target='historical_entity'/>
<stl-vector name='region_masks'>
<pointer> bay12: entity_influence_sheetst
<static-array count='16' name='influence'>
<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='entity_territoryst'>
<pointer name="map" is-array='true'>
<pointer is-array='true'> bay12: entity_territory_blockst
<stl-vector name='entities' type-name='int32_t' ref-target='historical_entity'/>
<stl-vector name='region_masks'>
<pointer> bay12: entity_territory_sheetst
<static-array count='16' name='territory'>
<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='world_object_data' original-name='creation_zonest'
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> bay12: creation_zone_itemst
<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'/>
<bitfield name='flags' base-type='uint32_t'> bay12: CREATION_ZONE_ITEM_FLAG_*
<flag-bit name='zone_assigned'/>
</bitfield>
</pointer>
</stl-vector>
<stl-vector name="detail_abs_x" type-name='int32_t'/>
<stl-vector name="detail_abs_y" type-name='int32_t'/>
<stl-vector name="detail_abs_z" type-name='int32_t'/>
<stl-vector name="detail_image_id" type-name='int32_t'/>
<stl-vector name="detail_image_member" type-name='int16_t'/>
<stl-vector name="altered_buildings" type-name='int32_t' comment='world_data_subid'/>
<stl-vector name="offloaded_buildings">
<pointer> bay12: creation_zone_buildingst
<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"/>
<uint32_t name="flags"/> none yet
</pointer>
</stl-vector>
<stl-vector name="campfire">
<pointer> bay12: creation_zone_campfirest
<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="stoked"/>
</pointer>
</stl-vector>
<stl-vector name='creation_zone_alterations' pointer-type='creation_zone_pwg_alterationst' since='v0.40.01'/>
<int32_t name='next_pwg_alteration_local_id' 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"> not a compound
<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='pulled_branches' since='v0.43.01' comment="probably used by Adventurer mode"> not a compound
<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='year' type-name='int32_t' comment="233/234 seen"/>
</compound>
</struct-type>
<enum-type type-name='mountain_peak_flags'> bay12: PeakFlagType
<enum-item name='is_volcano'/>
<enum-item name='climbed'/>
</enum-type>
<struct-type type-name='world_mountain_peak' original-name='peakst'
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='region_edge_datast'>
<int32_t name='s_dimx'/>
<int32_t name='s_dimy'/>
<pointer name='lr_edge_seed' type-name='uint32_t' is-array='true' comment='(region.dimx+1)*(region.dimy+1)'/>
<pointer name='ud_edge_seed' type-name='uint32_t' is-array='true' comment='(region.dimx+1)*(region.dimy+1)'/>
<pointer name='square_seed' type-name='uint32_t' is-array='true' comment='region.dimx*region.dimy'/>
<pointer name='edging_value' type-name='uint8_t' is-array='true' comment='(region.dimx+1)*(region.dimy+1) -- holds ul,u,l edge values for midmaps'/>
</struct-type>
<struct-type type-name='smm_pathing_datast'>
<static-array count='4' name='mm'><static-array count='4' pointer-type='world_region_details'/></static-array>
<static-array count='12' name='spb'><static-array count='12'> bay12: smm_pathing_blockst
<static-array count='16' name='pmap'><static-array count='16' type-name='int32_t'/></static-array>
<static-array count='16' name='dirmap'><static-array count='16' type-name='int32_t'/></static-array>
</static-array></static-array>
<int32_t name='spb_pmap_start'/>
<int32_t name='spb_pmap_end'/>
<bool name='spb_pmap_clear'/>
<bool name='spb_dirmap_clear'/>
</struct-type>
<struct-type type-name='world_data' original-name='regionst'>
<compound name='name' type-name='language_name' comment='name of the world'/>
<static-array name='permission' count='15' type-name='int8_t' index-enum='region_permission_type'/>
<int32_t name='next_site_id'/>
<int32_t name='next_resource_pile_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='next_region_weather_id' since='v0.34.01'/>
<int32_t name='world_width'/>
<int32_t name='world_height'/>
<int32_t name='moon_angle'/>
<int32_t name='moon_phase'/>
<enum name='flip_latitude' base-type='int16_t'> bay12: PoleType, base int32_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' comment='bay12: sunrise'/>
<static-array name='incoming_temp' count='3' type-name='int16_t'/>
<static-array name='front_count' count='3' type-name='int16_t'/>
<compound name='edge_data' type-name='region_edge_datast'/>
<compound name='midmap_data'> bay12: region_midmap_datast
<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="loadarea_sx"/>
<int16_t name="loadarea_sy"/>
<int16_t name="loadarea_ex"/>
<int16_t name="loadarea_ey"/>
<stl-map name="midmap_place" comment="std::map<std::pair<int16_t,int16_t>,VIndex>; not saved"/>
</compound>
<compound name='constructions'> bay12: world_construction_datast
<int16_t name="width"/>
<int16_t name="height"/>
<pointer name="map" is-array='true'>
<pointer is-array='true'> bay12: world_construction_data_blockst
<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_influence" type-name='entity_influencest'/>
<compound name="entity_territory" type-name='entity_territoryst'/>
<stl-vector name="sites" pointer-type='world_site'/>
<stl-vector name="resource_pile" pointer-type='resource_pilest'/>
<stl-vector name="resource_allotments" pointer-type='resource_allotment_data' comment='bay12: production_zone'/>
<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="variant_flag" type-name='uint16_t' is-array='true' comment='size: dimx*dimy'/>
<pointer name='corner_variant_flag' type-name='uint8_t' is-array='true' comment='size: (dimx+1)*(dimy+1)'/>
<pointer name='feature_map_seed' type-name='uint32_t' is-array='true' comment='size: ((dimx+15)>>4)*((dimy+15)>>4)'/>
<int16_t name="olookx"/>
<int16_t name="olooky"/>
<stl-vector name="embark_notes" pointer-type='embark_note'/>
<static-array name='region_block' count='6'>
<pointer is-array='true'>
<pointer is-array='true'> bay12: region_blockst
<stl-vector name='event' pointer-type='region_block_eventst'/>
<stl-vector name='army' pointer-type='army'/>
</pointer>
</pointer>
</static-array>
<compound name='smm_pathing_data' type-name='smm_pathing_datast'/>
<stl-vector name="active_site" pointer-type='world_site'/>
<pointer name="feature_map" is-array='true'>
<pointer is-array='true'> bay12: feature_map_shellst
<int16_t name='x'/>
<int16_t name='y'/>
<pointer name='features'> bay12: feature_mapst
<static-array name='feature_init' count='16'>
<static-array count='16'>
<stl-vector pointer-type='feature_init'/>
</static-array>
</static-array>
<static-array name='index_ul' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
<static-array name='index_u' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
<static-array name='index_l' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
</pointer>
<pointer name='river_info'> bay12: feature_river_informationst
<static-array name='map' count='16'>
<static-array count='16'>
<static-array count='2' type-name='int16_t'/>
</static-array>
</static-array>
</pointer>
<pointer name='layer_info'> bay12: feature_layer_informationst
<static-array name='map' count='16'>
<static-array count='16'>
<static-array count='5'><static-array count='2' type-name='int32_t'/></static-array>
</static-array>
</static-array>
</pointer>
</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>
<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' comment='bay12: migrant_entry'/>
<int32_t name="path_start"/>
<int8_t name="path_clear"/>
<int32_t name="temp_value_start"/>
<int8_t name="temp_value_clear"/>
<int32_t name="old_temp_value_advance"/>
exists during worldgen only, before it finishes
<stl-vector name="world_gen_wandering_group" pointer-type='world_gen_wandering_groupst'/>
<compound name='open_list' since='v0.40.01'> bay12: open_list_binary_heap_2Dst
<static-array name='node' count='80000'>
<int32_t name='fval'/>
<int32_t name='hval'/>
<int32_t name='x'/>
<int32_t name='y'/>
</static-array>
<int32_t name='size'/>
<int32_t name='x1'/>
<int32_t name='y1'/>
<int32_t name='x2'/>
<int32_t name='y2'/>
<int32_t name='nx'/>
<int32_t name='ny'/>
</compound>
</struct-type>
<struct-type type-name='gene_poolst'>
<stl-vector name="body_modifier">
<pointer> bay12: gene_pool_body_modifierst
<int32_t name='id'/>
<int32_t name="roll_min"/>
<int32_t name="roll_max"/>