Allow recipes to output secured fractions of products without the randomness of probabilities.
Posted: Fri Jan 28, 2022 1:15 pm
As proposed in a different thread (viewtopic.php?p=560573#p560573), I would like to have to possibility to remove the randomness of probabilities for fractional outputs.
For example:
Seablock has a recipe, which takes 200 fluid input and outputs 2x0.55 product1 and 1x0.7 product2
If you let this recipe run 100 times, you usually don't end up with exactly 110 p1 and 70 p1 of each product, but sometimes significant difference like 118p1 and 65p2 or 100p1 and 76p2.
If you'd run it 1000 or 10000 times, it gets closer to that desired ratio, but in seablock the first cycles matters most in overall progression.
You could scale up that recipe to the lowest common denominator:
input 2000 -> output 11 p1 and 7 p2 (if i'm not mistaken)
this is very different, because you end up waiting 10 regular cycles to get the products all at once.
or you take a approximation, with slightly different ratio. f.e.:
input 560 -> 3.08p1 and 1.96p2 simplified to
input 560 -> 3 p1 and 2 p2
this could be done, but its just a different ratio.
This is not very satisfying and it's at least a real life example, and I imagine there would be other use cases.
RNG can be nice component, but it can be disturbing, if you are forced to use it. I'm not a big fan of randomness in factorio.
My proposal is the following:
The recipe virtually outputs the given fractions of each product each cycle, which is getting summed up.
Once it reaches 1 or higher, it outputs it:
50% would mean, that it outputs 1 every 2 cycles.
1: 0.5
2: 0.5 + 0.5 = 0 + 1 (yield)
3: 0 + 0.5 = 0.5
4: 0.5 + 0.5 = 0 + 1 (yield)
etc.
70% would mean, that it outputs as soon, as it reaches at least 1 and the remainder is taken over:
1: 0.7 = 0.7
2: 0.7 + 0.7 = 0.4 + 1 (yield)
3: 0.4 + 0.7 = 0.1 + 1 (yield)
4: 0.1 + 0.7 = 0.8
5: 0.8 + 0.7 = 0.5 + 1 (yield)
6: 0.5 + 0.7 = 0.2 + 1 (yield)
etc.
160%
1: 1.6 = 0.6 + 1 (yield)
2: 0.6 + 1.6 = 0.2 + 2 (yield)
3: 0.2 + 1.6 = 0.8 + 1 (yield)
etc.
EDIT:
In order to reduce memory consumption and also increase usefulness I would propose, that the fractions of each recipe are shared with all machines executing this recipe. This also would help to don't loose cycles, if you change the machine's recipe.
For example:
Seablock has a recipe, which takes 200 fluid input and outputs 2x0.55 product1 and 1x0.7 product2
If you let this recipe run 100 times, you usually don't end up with exactly 110 p1 and 70 p1 of each product, but sometimes significant difference like 118p1 and 65p2 or 100p1 and 76p2.
If you'd run it 1000 or 10000 times, it gets closer to that desired ratio, but in seablock the first cycles matters most in overall progression.
You could scale up that recipe to the lowest common denominator:
input 2000 -> output 11 p1 and 7 p2 (if i'm not mistaken)
this is very different, because you end up waiting 10 regular cycles to get the products all at once.
or you take a approximation, with slightly different ratio. f.e.:
input 560 -> 3.08p1 and 1.96p2 simplified to
input 560 -> 3 p1 and 2 p2
this could be done, but its just a different ratio.
This is not very satisfying and it's at least a real life example, and I imagine there would be other use cases.
RNG can be nice component, but it can be disturbing, if you are forced to use it. I'm not a big fan of randomness in factorio.
My proposal is the following:
The recipe virtually outputs the given fractions of each product each cycle, which is getting summed up.
Once it reaches 1 or higher, it outputs it:
50% would mean, that it outputs 1 every 2 cycles.
1: 0.5
2: 0.5 + 0.5 = 0 + 1 (yield)
3: 0 + 0.5 = 0.5
4: 0.5 + 0.5 = 0 + 1 (yield)
etc.
70% would mean, that it outputs as soon, as it reaches at least 1 and the remainder is taken over:
1: 0.7 = 0.7
2: 0.7 + 0.7 = 0.4 + 1 (yield)
3: 0.4 + 0.7 = 0.1 + 1 (yield)
4: 0.1 + 0.7 = 0.8
5: 0.8 + 0.7 = 0.5 + 1 (yield)
6: 0.5 + 0.7 = 0.2 + 1 (yield)
etc.
160%
1: 1.6 = 0.6 + 1 (yield)
2: 0.6 + 1.6 = 0.2 + 2 (yield)
3: 0.2 + 1.6 = 0.8 + 1 (yield)
etc.
EDIT:
In order to reduce memory consumption and also increase usefulness I would propose, that the fractions of each recipe are shared with all machines executing this recipe. This also would help to don't loose cycles, if you change the machine's recipe.