Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How minerals are actually distributed (.31.19 - .31.21)  (Read 3462 times)

Khift

  • Bay Watcher
    • View Profile
How minerals are actually distributed (.31.19 - .31.21)
« on: March 08, 2011, 06:03:47 pm »

There's a lot of confusion over how the new system actually distributes minerals and I see a lot of posts on the various boards asking how the system works. I've been messing with minerals for quite a bit, mostly in .31.19 but also a bit in .31.21 and so let me try and spell out how I see the system working in an attempt to dispel some misconceptions that are floating around.

The first thing done in world gen is pretty simple -- it determines the layer-stones found in the various biomes. As far as I know this hasn't changed any since .31.01 and possibly even before then. It distributes the stones based on volcanism levels and other various factors probably leaving a lot up to chance. Others know better how this is done than I do and I'm sure it's been written about quite a bit so I'll leave it to them to describe it.

The second thing done in world gen is it takes each layer of stone -- not each z-level, but each distinct layer stone -- and determines which minerals and gems are present in those stones. This is where the mineral scarcity meter works in. I imagine it takes the full list of each mineral that can appear in that layer, rolls a number for each mineral and each mineral whose rolled number is larger than the mineral scarcity value is then present in that layer. Gems are also determined in this section but for one there are a lot, lot more gems so they average out easier and for two they don't appear to be affected by the mineral scarcity value.

The third thing done in world gen is actually distributing the minerals. Here's the part where I see the most misconceptions. The big thing is that mineral scarcity has no affect on this, in fact it often has the opposite effect. Think of it like this: there are only so many potential large clusters, veins, and small clusters that are allowed to exist within so much space per layer. If, for example, in the previous step only one vein was determined to be inside this layer of stone then ALL of the potential veins will be that one mineral. However if, say, five veins were picked then that same amount of space must be split between the five. As a result, greater mineral scarcity values makes it less common to see metal but when you see it you seen tons of it whereas lower mineral scarcity values makes it more common but also gives it more competition and variety. You still end up with more overall metals at lower scarcity but it is better spread out throughout the various layer stones (high scarcity often leaves layer stones completely barren of any minerals). Note that this actually means lower scarcity results in fewer gems as you roll more small cluster minerals to compete with the small cluster gems. Also, veins, large clusters and small clusters don't compete with each other for space; the distribution algorithm will distribute just as many veins whether there are large clusters present or not.

To sum things up: A higher mineral scarcity value will mean that more layers are devoid of minerals, but will usually mean that when a layer has a mineral it is completely saturated with that mineral because there is no competition. A lower mineral scarcity value will mean that fewer layers are devoid of minerals however the layers that do have minerals frequently have multiple types of minerals competing for the same area. Lower scarcity means more variety and more total minerals but typically smaller quantities of each type of mineral whereas higher scarcity means less variety, less total minerals but a greater quantity of the minerals that are present.

Hope this clears some things up for you guys.
Logged

Carnes

  • Bay Watcher
  • Near a good old-time canteen.
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #1 on: March 08, 2011, 06:16:59 pm »

Thanks, that was informative.  Seems like there is probably some good middle ground in there.
Logged
You call that breaking my spine?! You Forgotten Beast ladies wouldn't know how to break a spine if-
SNAP
AUGHHH! MY SPINE!

arkhometha

  • Bay Watcher
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #2 on: March 08, 2011, 06:30:52 pm »

To sum things up: A higher mineral scarcity value will mean that more layers are devoid of minerals, but will usually mean that when a layer has a mineral it is completely saturated with that mineral because there is no competition. A lower mineral scarcity value will mean that fewer layers are devoid of minerals however the layers that do have minerals frequently have multiple types of minerals competing for the same area. Lower scarcity means more variety and more total minerals but typically smaller quantities of each type of mineral whereas higher scarcity means less variety, less total minerals but a greater quantity of the minerals that are present.

Hope this clears some things up for you guys.

If this is the only thing, it was already figured out. Some tests showed that 10000 had variety, and the general topic about it lead to believe this was the case. And UristMcDaVinci put an hypothesis that the mineral scarcity feature might be bugged due to an 16bit limitation.

Also, there are some non-consistent things in your posts, being:
A. Some layers of stone are wrongly placed, as we see some sedimentary rock on extrusive layers and don't usually see extrusive layers typical rocks on their respective layers. The system isn't as realistic as one may assume. Is good, but not THAT good.
B. Also, iron ore availability, which is a common ore in nature, also is missing ins several layers.
C. Some strange behaviors like and almost omnipresent metal ore in a layer missing and replaced by a non typical ore of that layer just by changing the scarcity setting by a small amount, namely 500.
D. The system and you did not take account of metamorphism of the rocks, the law of superposition and rock strata.


To try clear things a bit,
Spoiler (click to show/hide)
this image should do it.

The tests I ran with temperature did show that temperature didn't mattered in the formation of rocks, pressure I still don't know.
The meaning of all this is that even an "simple thing" like "The first thing done in world gen is pretty simple -- it determines the layer-stones found in the various biomes." isn't as simple, and "The second thing done in world gen is it takes each layer of stone -- not each z-level, but each distinct layer stone -- and determines which minerals and gems are present in those stones."
Gems in particular have and other behavior not strictly linked to layer, but ambient. As you may know, a layer can contain carbon but the atoms may or not be arrange to form diamonds depending on the pressure. Since pressure isn't taken (I think) in the world gen, gems are more... random, maybe. Since I didn't constructed the system, we can only conjecture about it's standard operation routine.

And, as stated in http://www.bay12forums.com/smf/index.php?topic=79018.30, in a test embark made, you had 21 types of rocks/gems/metal with an 2000 scarcity, while in the same site, with more scarcity, namely 3500, you got only 5 variety.

An actual example is my fort, who has whole layers of Dacite, an igneous, volcanic rock and iron ores veins, limonite and magnetite, that are found in sedimentary layers. Didn't embark in two biomes, and even if I did, I could not find one standing side by side to another.

You did a god joob trying to explain things, but I think UristDaVince hypothesis make a lot more sense.
« Last Edit: March 08, 2011, 06:52:34 pm by arkhometha »
Logged

Khift

  • Bay Watcher
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #3 on: March 08, 2011, 06:57:25 pm »

If this is the only thing, it was already figured out. Some tests showed that 10000 had variety, and the general topic about it lead to believe this was the case. And UristMcDaVinci put an hypothesis that the mineral scarcity feature might be bugged due to an 16bit limitation.
It's very possible that there might be a bug with the system at high scarcity values. It's also possible that the scarcity value is logarithmic and a value of 100,000 doesn't actually mean minerals are 10x rarer than at a value of 10,000 and people are just getting lucky. I'm not really in a position to say what the deal is.

For the rest of your post: Uh, it's a game. It's pretty well accepted that the DF mineral system isn't entirely accurate; it's close to reality, but nowhere near perfect. In any case, NONE of my post is with regards to realistic accuracy; I'm looking at it entirely from a game mechanic perspective. So when I say "it determines the layer-stones found in the various biomes" I'm referring to the game going through whatever processes it goes through, realistic or not comprehensive or not, to determine which biomes get which layer stones. A purely mechanical perspective.

This wasn't an attempt to explain absolutely everything with regards to mineral distribution. I was just trying to lay down the basics for people to understand.

That said, couple things:
B. Also, iron ore availability, which is a common ore in nature, also is missing ins several layers.
I've seen iron ores in all the normal layers in .31.21. Unless you're talking about realistic accuracy again (in which case yes, iron should present in more layers) I don't see this as an issue. I find plenty of hematite, magnetite and limonite in sedimentary stone and plenty of hematite in igneous extrusive stone.

C. Some strange behaviors like and almost omnipresent metal ore in a layer missing and replaced by a non typical ore of that layer just by changing the scarcity setting by a small amount, namely 500.
Changing the mineral scarcity value is going to change which minerals appear. This is pretty common sense. And like I said above, there's no halfway between a mineral being present and being absent; either it's everywhere or it's nowhere.

Gems in particular have and other behavior not strictly linked to layer
Gems are absolutely linked to layers at the moment. Go do some test embarks on areas with no minerals detected and use DF reveal. Unless, again, you're referring to realism, in which case I'll defer to your knowledge of the situation.
Logged

Khift

  • Bay Watcher
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #4 on: March 08, 2011, 07:06:27 pm »

Also, looking at the pictures in the thread you linked for your test embarks 4a through 4e and I"ll tell you why you're seeing small quantities of stones: you're embarking across a break line in the layer stones; there's one biome in the SE that's not very large and it was getting galena and other stones as a metal consistently but with it being so small you didn't end up with very much of it. And when you got a large quantity of a stone it was because the large biome in the rest of the map was seeded with that stone.

I see nothing in your test embarks that in any way contradicts what I've said here.
Logged

arkhometha

  • Bay Watcher
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #5 on: March 08, 2011, 07:22:45 pm »

Also, looking at the pictures in the thread you linked for your test embarks 4a through 4e and I"ll tell you why you're seeing small quantities of stones: you're embarking across a break line in the layer stones; there's one biome in the SE that's not very large and it was getting galena and other stones as a metal consistently but with it being so small you didn't end up with very much of it. And when you got a large quantity of a stone it was because the large biome in the rest of the map was seeded with that stone.

I see nothing in your test embarks that in any way contradicts what I've said here.

makes a lot of sense. A now with your hypothesis more explained, I take you word for it. thanks!
Logged

Brandstone

  • Bay Watcher
  • Come hug me bro
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #6 on: March 08, 2011, 10:20:10 pm »

Gems in particular have and other behavior not strictly linked to layer
Gems are absolutely linked to layers at the moment. Go do some test embarks on areas with no minerals detected and use DF reveal. Unless, again, you're referring to realism, in which case I'll defer to your knowledge of the situation.

As a side note, if you look through the raws (specifically inorganic_stone_gem) you can see which layer(s) a gem should appear in. However, it should be noted that jade should only appear in alluvial layers, alluvial layers are not implemented, but jade has started appearing since 0.31.19. So gems at least and possibly all minerals could be bugged. Unless Toady implemented a band-aid fix so jade would start appearing in the interim before alluvial layers are implemented.

arkhometha

  • Bay Watcher
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #7 on: March 08, 2011, 10:22:22 pm »

Gems in particular have and other behavior not strictly linked to layer
Gems are absolutely linked to layers at the moment. Go do some test embarks on areas with no minerals detected and use DF reveal. Unless, again, you're referring to realism, in which case I'll defer to your knowledge of the situation.

As a side note, if you look through the raws (specifically inorganic_stone_gem) you can see which layer(s) a gem should appear in. However, it should be noted that jade should only appear in alluvial layers, alluvial layers are not implemented, but jade has started appearing since 0.31.19. So gems at least and possibly all minerals could be bugged. Unless Toady implemented a band-aid fix so jade would start appearing in the interim before alluvial layers are implemented.

Well noted.
Logged

Khift

  • Bay Watcher
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #8 on: March 08, 2011, 10:29:36 pm »

Gems in particular have and other behavior not strictly linked to layer
Gems are absolutely linked to layers at the moment. Go do some test embarks on areas with no minerals detected and use DF reveal. Unless, again, you're referring to realism, in which case I'll defer to your knowledge of the situation.

As a side note, if you look through the raws (specifically inorganic_stone_gem) you can see which layer(s) a gem should appear in. However, it should be noted that jade should only appear in alluvial layers, alluvial layers are not implemented, but jade has started appearing since 0.31.19. So gems at least and possibly all minerals could be bugged. Unless Toady implemented a band-aid fix so jade would start appearing in the interim before alluvial layers are implemented.
It does sound like there is a small chance of seeing a gem / mineral in an improper layer stone, yeah. There are quite a couple reports of that (although not the opposite, at least that I can find). Hard to say whether it's actually a bug or not, though -- I'd practically call that a feature, as long as it's decidedly uncommon and not screwing anything else up. Wouldn't it be nice to accidentally into coal down in an igneous intrusive layer? Or diamonds outside of kimberlite? Surprises like that are a good thing, IMO.
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: How minerals are actually distributed (.31.19 - .31.21)
« Reply #9 on: March 09, 2011, 08:17:38 am »

[...] jade has started appearing since 0.31.19. So gems at least and possibly all minerals could be bugged. Unless Toady implemented a band-aid fix so jade would start appearing in the interim before alluvial layers are implemented.

That's because 0.31.19 implemented clay layers... which are a type of alluvial deposit.  So they're implemented already, in a small way.  Thing is, they don't generally appear exclusively near rivers.

But it does explain why whenever I search for a site with clay and a river, all I ever get is freaking gold.
Logged
I like fortresses because they are still underground.