Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Fun facts about DF geology and biomes  (Read 2303 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Fun facts about DF geology and biomes
« on: March 10, 2014, 12:53:19 am »

I recently did some research and statistics-gathering (with DFHack) on what causes sedimentary layers in DF, and made some interesting discoveries:

world.world_data.geo_biomes[].unk1 is an "enum" for the type of layers as follows:
Code: [Select]
0 NORMAL
1 VOLCANIC
2 DEEP OCEAN
3 DEEP OCEAN VOLCANIC
4 SHALLOW OCEAN
5 SHALLOW OCEAN VOLCANIC
6 SAND DESERT
7 SAND DESERT VOLCANIC

- NORMAL geo-biomes are the default for land areas. You get several random soil layers. This is followed by a sedimentary (~80% chance), metamorphic (~10%), or intrusive (~10%) layer. The remaining layers below are metamorphic (~50%), or intrusive (~50%), except that the bottom-most layer above the magma sea is always intrusive.

- VOLCANIC geo-biomes are like normal, except that the first stone layer under the soil is always extrusive, and the random subsurface layers are ~33% each of extrusive, intrusive, and metamorphic. Volcanic geo-biomes occur when the volcanism of the biome is over 90 on a scale from 0-100.

- DEEP OCEAN geo-biomes have a few layers from the ocean soils subset, then a layer of a deep ocean sedimentary (or extrusive if volcanic), then random layers as per normal (or volcanic). Deep ocean geo-biomes occur in oceans of elevation 0-49.

- SHALLOW OCEAN geo-biomes have a single sand layer, then a layer of a shallow ocean sedimentary (or extrusive if volcanic), then random layers as per normal (or volcanic). Shallow ocean geo-biomes occur in oceans of elevation 50-99.

- SAND DESERT geo-biomes are rare, as they only occur in sand desert biomes. They are like normal (or volcanic) biomes, except that there is always a single layer of a sand instead of several soil layers.

As far as I can tell, the chance of getting a particular layer stone is otherwise purely random. There does not appear to be any evidence of other logic/code which determines the type of layer stone in a biome.

scamtank

  • Bay Watcher
    • View Profile
Re: Fun facts about DF geology and biomes
« Reply #1 on: March 10, 2014, 10:27:05 am »

80%? Are you positive that it's totally random? From my own experience, I could swear that sedimentary sites are as rare as rubies. Doesn't elevation affect this spread?
Logged

Bokaza

  • Bay Watcher
  • Forts lost: A lot
    • View Profile
Re: Fun facts about DF geology and biomes
« Reply #2 on: March 10, 2014, 10:46:40 am »

Well, the save I'm currently playing has around 20 layers of chalk. This is the first time in a while I got strictly sedimentary near the surface. It is, however, plains with a river. Maybe it does depend on the elevation, but the first layers seem to be sedimentary.
Logged
Ah, RL. The only true slayer of fortresses.
A vile force of Reality has arrived!

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Fun facts about DF geology and biomes
« Reply #3 on: March 10, 2014, 07:52:56 pm »

80%? Are you positive that it's totally random? From my own experience, I could swear that sedimentary sites are as rare as rubies. Doesn't elevation affect this spread?

I can look into elevation, but across an entire world (using the default create-a-world) and only considering unk1==0 (NORMAL) geo-biomes, the first stone layer is sedimentary in about 80% of the geo-biomes, and there is no pattern here with respect to volcanism.

mastahcheese

  • Bay Watcher
  • Now with 20% less sanity and trans fat!
    • View Profile
Re: Fun facts about DF geology and biomes
« Reply #4 on: March 10, 2014, 11:47:03 pm »

That's is some nice stuff to know for advanced world gen shenanigans.
Thank you, good sir.
Logged
Oh look, I have a steam account.
Might as well chalk it up to Pathos.
As this point we might as well invoke interpretive dance and call it a day.
The Derail Thread

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Fun facts about DF geology and biomes
« Reply #5 on: March 11, 2014, 02:49:55 am »

- Verified by checking code disassembly that the game appears to do a 20% probability random check, followed by a 50% probability random check when deciding what the first stone layer should be in a NORMAL geo-biome.
- Elevation is not used, except for determining the type of ocean (deep or shallow)
- The code doesn't appear to care about the presence or absence of features such as rivers.

Well, the save I'm currently playing has around 20 layers of chalk. This is the first time in a while I got strictly sedimentary near the surface. It is, however, plains with a river. Maybe it does depend on the elevation, but the first layers seem to be sedimentary.
By the way, a geo-layer can be several z-levels thick, or only 1 z-level thick, depending on local ground shapes. You may have 20 z-levels of chalk, but you only have one layer of chalk followed by perhaps a granite layer or a marble layer. Erosion effects may cause layers to be absent in practice, but the geo-layer data is still there. This may contribute to the dishonesty of the site finder.

There must also be some special code somewhere else that overwrites glacier soil with solid ice. This is why some construction activities on glaciers can leave behind sand or soil that mysteriously came from nowhere - the geo layer data is still present.