[solved] Minable results
Posted: Sun Feb 28, 2016 2:58 pm
I recently got bugged around this while balancing hardCrafting:
Basically I set the minable result of iron-ore as following:
Now when hand mining I always get one dirt item and the other items respective to their probability.
However when I use a electric mining drill these items are produced at different amounts than the probability and min/max amount would suggest:
E.g. when mining 1000 iron ore I get the following:
mining by hand: 761 iron-ore, 109 iron-nuggets, 591 gravel, 1'000 dirt
buner-mining-drill: 721 iron-ore, 70 iron-nuggets, 385 gravel, 446 dirt
electric-mining-drill: 763 iron-ore, 72 iron-nuggets, 362 gravel, 440 dirt
Let's look at the iron-nuggets: 1 item at 10% probability. This should give you an estimated 100 nuggets mined total.
For the automatic mining it seems like the probability of giving iron-ore will not result in a nugget, so 70% of all cases no iron-ore is mined and therefore we have 700 mining operations where a nugget can be mined at 10% probability giving 70 nuggets.
Now for dirt I really can't explain how it works.
Are there somehow different implementations how to get the product when mining? Can somebody explain how the min/max amount are connected and how the implementation works of factorio?
Thanks a lot!
Basically I set the minable result of iron-ore as following:
Code: Select all
data.raw["resource"]["iron-ore"].minable.results = {
ressourceItemMinMaxProb("iron-ore", 1, 5, 0.3),
ressourceItemMinMaxProb("iron-nugget",1, 1, 0.1),
ressourceItemMinMaxProb("gravel", 1, 4, 0.3),
ressourceItemMinMaxProb("dirt", 1, 1, 1)
}
function ressourceItemMinMaxProb(itemName, amountMin, amountMax, probability)
return {
type = "item",
name = itemName,
amount_min = amountMin,
amount_max = amountMax,
probability = probability
}
end
However when I use a electric mining drill these items are produced at different amounts than the probability and min/max amount would suggest:
E.g. when mining 1000 iron ore I get the following:
mining by hand: 761 iron-ore, 109 iron-nuggets, 591 gravel, 1'000 dirt
buner-mining-drill: 721 iron-ore, 70 iron-nuggets, 385 gravel, 446 dirt
electric-mining-drill: 763 iron-ore, 72 iron-nuggets, 362 gravel, 440 dirt
Let's look at the iron-nuggets: 1 item at 10% probability. This should give you an estimated 100 nuggets mined total.
For the automatic mining it seems like the probability of giving iron-ore will not result in a nugget, so 70% of all cases no iron-ore is mined and therefore we have 700 mining operations where a nugget can be mined at 10% probability giving 70 nuggets.
Now for dirt I really can't explain how it works.
Are there somehow different implementations how to get the product when mining? Can somebody explain how the min/max amount are connected and how the implementation works of factorio?
Thanks a lot!