[solved] Minable results

Place to get help with not working mods / modding interface.
Post Reply
judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

[solved] Minable results

Post 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
Last edited by judos on Tue Mar 08, 2016 11:41 pm, edited 1 time in total.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Minable results

Post 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.

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Minable results

Post by Ranakastrasz »

I can confirm that. The mining drill needs to have one inventory slot per item type you want it to mine.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

Re: Minable results

Post 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.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: Minable results

Post by Arch666Angel »

Peeking into bobmods, what you want is probably

Code: Select all

storage_slots = x

judos
Filter Inserter
Filter Inserter
Posts: 266
Joined: Mon Dec 08, 2014 11:17 am
Contact:

Re: Minable results

Post by judos »

Nice! this absolutely works now :) So I no longer have to bother these differences.

thanks for your help

Post Reply

Return to “Modding help”