Page 1 of 1

[solved] Minable results

Posted: Sun Feb 28, 2016 2:58 pm
by judos
I recently got bugged around this while balancing hardCrafting:

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
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! :D

Re: Minable results

Posted: Sun Feb 28, 2016 5:15 pm
by DaveMcW
I think the mining drill has a small inventory size, if it gets full of iron-ore it can't generate anything else.

Re: Minable results

Posted: Sun Feb 28, 2016 5:37 pm
by Ranakastrasz
I can confirm that. The mining drill needs to have one inventory slot per item type you want it to mine.

Re: Minable results

Posted: Sun Mar 06, 2016 9:49 pm
by judos
So is there a possible way to increase that private inventory size of the mining drill?

I tried to change the following for all mining-drills:

Code: Select all

for name,table in pairs(data.raw["mining-drill"]) do
	print("checking "..name)
	table.inventory_size = 5
	table.ingredient_count = 5
	table.result_inventory_size = 5
	table.source_inventory_size = 5
end
But this didn't help at all. Maybe I should move this thread into the bug forum because there is a different result between mining manual and automatic when multiple ressources are defined.

Re: Minable results

Posted: Mon Mar 07, 2016 12:36 am
by Arch666Angel
Peeking into bobmods, what you want is probably

Code: Select all

storage_slots = x

Re: Minable results

Posted: Tue Mar 08, 2016 11:40 pm
by judos
Nice! this absolutely works now :) So I no longer have to bother these differences.

thanks for your help