How is Dirt (and others) Stored?

As the title suggests, I want to know how are items like dirt, farm crops, stone, etc. stored in the game.

You don’t get a 1 for 1 on items when you’re mining/farming, so I want to know what is the ratio and a few other things said below.

  • What is the ratio? (how many dirt do I need to dig for 1 clay?)

  • What happens if that ratio # doesn’t get met

  • Is the system just rng?

  • Is it going to be changed in the future?

  • What’s the general idea on how the data is stored code wise? (I don’t know much about coding)

  • Is it like a countdown/count up to getting a block? (like mine 20 blocks for 1 dirt)

I was just curious after Alpha 18, and the Desktop Tuesday on dirt, so I want to know how it is to get a general idea on the system.

1 Like

It works on a weighted RNG system and the default info can be found in the stonehearth.smod at /services/server/mining/mining_loot_tables.json. The probability of any result is equal to the weight of that result divided by the sum of all the weights in that block type.

In that file:
Grass gives nothing, always.
Dirt has weightings of 100 = nothing, 1 = stone, 1 = clay.
Rock has weightings of 25 = nothing, 0.5 = stone, 0.1 = copper ore, 0.1 = tin ore, 0.07 = iron ore, 0.07 = lump of coal, 0.05 = silver ore, 0.01 = gold ore.

5 Likes

And on top of that, biomes can change those defaults, so in temperate where there is no changes, it is exactly like the values tuhalu posted, but in the desert which has custom table, the dirt for example has a higher chance for clay drops, bumped to 4.
These means that in temperate there is around 1% chance of a mined dirt drop a clay, while in desert it is around 4%

2 Likes