Schall Recipe Scaling


Adds scaled up version of recipes, in order to get around the game limitation (60 crafting per second) faced by very high speed machines. This allows for true mass production under healthy UPS. Designed for supporting scaled up machines from “Schall Machine Scaling” mod. (Locale: English, Deutsch, 正體中文, Português Brasileiro)

Content
3 years ago
0.17 - 1.1
10.1K
Manufacturing

g [Responded] Weird behaviour, possible bug? (Game limitation)

3 years ago
(updated 3 years ago)

I've noticed some weird behaviour with the scaled recipes involving chemical plants and oil refineries. Using a chem plant +6 to make plastic bar (3x prod 3 modules inside, beacons with speed 3s, crafting speed 1400%), regardless of whether I use the vanilla recipe or the scaled recipe the plastic output is limited by the number of inserters I can fit on the perimeter of the chem plant. 60 vanilla stack inserters (capacity 212) outputting plastic bar to provider chests, 6 inputting coal from requester chests gives a production of plastic at about 1.6M per minute from one chem plant +6.

However, if I look at the usage of petroleum and coal, it increases massively (like more than 10x) when using the scaled recipe. This quickly depletes the petrol and then production slows limited by petrol production. Why is the vanilla recipe outputting plastic at the same rate while consuming vastly less resources?

The same happens in the oil-refinery+6, output of heavy/light/petrol is about the same but consumption of crude increases by many times when using the scaled recipe.

I have the recipe multiplier at 100, but I checked and it happens at the default 50 too. All my stack sizes are x100 from vanilla, could that be causing it?

Do you have a forum thread for your mods? So I could share screenshots and blueprints.

EDIT: It seems have something to do with production modules in the refinery or chemical plant. When I take the production modules out the scaled recipe production decreases and consumption stays the same. When I take out production modules the vanilla recipe consumption increases hugely and production decreases slightly.

3 years ago

There is a lot of details here.
I will investigate and try to reproduce the bugs when I have time (probably on weekend, but cannot promise.)

I do not have a forum thread. But you could upload your screenshots to ImgBB or Imgur, then post the links here (whether plain text, or check the Markdown syntax on posting image links).
For blueprints, you can use text paste bins like Text Uploader.

If the bug has something to do with modules, then I guess it maybe related to possible value overflow on the game engine side...
So want to ask which overtiers do you have such problems kicked in?
Do you still have such problem with lower tiers like +3 or +4?

3 years ago
(updated 3 years ago)

Ok I did some more testing, I narrowed the issue down a bit. It's nothing to do with the recipe scaling itself. Weirdness is happening whenever a machine tries to exceed 60 crafts per second.

Quoted from the info on the machine scaling mod:
"This is due to limitation by game engine, only 1 crafting per tick for each machine, or equivalently 60 crafting per second."
"Any high tiers would still have the same output rate, but wasting unneeded power."

This may have been true when you first made the machine scaling mod but it doesn't seem to be true in my testing.

Procedure to reproduce (issue 1):
1. Go to creative/sandbox mode, put down an AM3+2, set the recipe to copper wire. Add 4 stack inserters on one side inputting copper plate from 4 chests (fill them with plate yourself or use bots or infinite chests). Add 9 stack inserters on another side outputting copper wire to 9 more chests.
2. Game reports crafting speed of 20, as per your formulas (c/s = CS / RT), 20/0.5 = 40 crafts/sec. Each craft produces 2 copper wires, 40 x 2 x 60 = 4.8k per minute. Verify the ingame production graph shows 4.8k/min production rate.
3. Add 4x speed module 3 to the machine. Craft speed now 60, crafts/sec should be 120 but game is limited to 60c/s. 60 x 2 x 60 = 7.2k/min which should be the maximum possible with one machine no matter what tier. Observe that the production is indeed 7.2k/min.
4. Now remove the speed 3 modules. Observe that the production does not fall back to 4.8k/min, it stays at 7.2k/min.
5. To return the machine to correct operation set the machine to 'no recipe' and then back to copper wire.
6. The above behaviour occurs if 2 or 3 speed module 3s are added in step 3, but not if only 1 is added. 1 modules brings c/s exactly to the limit, more than one pushes it beyond the limit and triggers this odd behaviour.

With production modules it gets weirder (issue 2).
1. Repeat steps 1 and 2 from above.
2. Put 4x production module 3s in the assembling machine.
3. Place 6 beacons adjacent to the assembling machine, fill all 12 slots with speed module 3s. Crafting speed reported as 68.
4. As before, the limit on production should still be 7.2k/min. I am seeing 14k/min
5. c/s = 68/0.5 = 136. 136 x 2 x 1.4 x 60 = 22848. So less than theoretical output ignoring the crafting limit, but still higher than the limit says it should be.
6. Stranger still, copper plate consumption is at 3.6k/min. With that consumption, maximum copper wire production should be 3600 x 2 x 1.4 = 10080 copper wire per min.

Using an AM3+6 with a large number of stack inserters with 200 capacity I have seen over 1million copper wire per min from a single machine while it consumes only a few thousand copper plate per min. While this is great for UPS, it does feel a bit too cheaty. I've noticed the same with other recipes too, including those in electric furnaces and chemical plants.

The behaviour of issue 2 changes when using scaled recipes. The consumption of recipe ingredients is closer to what it should be (calculated from measured production) depending on the value of the recipe multiplier setting. This is the cause of the discrepancy first noticed with the chemical plants in my opening post.

This whole thing may be a 'bug' in factorio itself (rather than your mods) that has not been noticed because it is impossible for it to manifest with vanilla machines?

3 years ago

Thanks for the detailed experiments. These will help me and others (trying to) understand the issue.
I do not have time yet to reproduce your results. I will post if I have the same or different results.

Just from what you described, I have the same conclusion as you.
Especially with "Issue/Experiment 1" is quite clear. If removing speed modules do not resume back the original speed, then something must be wrong.

However, copper wire output at 7.2k/min is suggesting exactly at c/s = 60 crafts/sec... So I have a hypothesis about the stay at 7.2k/min after removal (step 4) though. Maybe there is some kind of "buffer" in the output, so any excess product (more than the output capacity) are stored in the buffer, which piles up to some high level if you are in step 3 for a long time.
When you remove the speed modules (step 4), maybe the game still tries to give you back what was piled up earlier in the buffer, giving you an "illusion" that the speed does not goes down.
To prove if this hypothesis is right (or wrong), can you try staying in step 4 longer? (At least longer than time spent on step 3.) If the above hypothesis holds, then the machine output should fall back to 4.8k/min AFTER sufficient time (the time length of time just depends on how many have been piled up in step 3...)

If this hypothesis holds, then it prove the existence of buffer.
(Yet, if the machine output is "over-full" but not stopped taking input, it would still be considered a (minor) bug on the game side.)

If the above "over-full" buffer hypothesis holds, then your "Issue/Experiment 2" is not mysterious (to me) at all.
In Schall Machine Scaling FAQ, it has already been stated that:

Q: Are effects of Productivity Modules also included in this 60 c/s speed cap as well?
A: This question has to be split into two parts. For the -15% speed malus from Productivity Module 3, it is already included in the CS calculation. See the above FAQ.
For the productivity bonus (+10%) form Productivity Module 3, it counts to a separate crafting progress bar (purple bar), but is still limited to a maximum of 1 finish every tick. Combining the two bars, you can get a maximum of 60+60 = 120 product sets per second.

So for the copper wire (original) recipe with productivity modules, 120 product sets per second = 14.4k/min copper wires.
Hence, your output rates are still within the restriction of 60 c/s.

So all these mysterious results only point to one thing: the machines do NOT stop consuming ingredients when output is full. This would be considered a bug on the game side, like what you have also concluded.

3 years ago
(updated 3 years ago)

I forgot to mention, I disabled the majority of installed mods to do these tests. The only mods enabled are:
- Advanced Infinity Chest
- Advanced Solar High Resolution
- Schall Machine Scaling
- Schall Recipe Scaling

I conducted the steps in 'issue 1' again while timing the wait at certain steps. After completing step 2 I waited 1 minute at 4.8k/min. After adding speed modules in step 3 I waited 1 minute at 7.2k/min. I removed the speed modules as per step 4, and after approx 3 minutes the production reduced back to 4.8k/min. I also noticed that while the production was at 7.2k/min the sound from the AM stopped, and returned at the exact moment the production return to 4.8k/min.

I did another experiment to further illustrate how this issue is affecting my main save.
1. Place an AM3+6 set to copper wire (vanilla recipe), no modules yet. 84 stack inserters will fit on the perimeter. Place 2 stack inserters inputting copper plate from a chest as before and 82 outputting copper wire (inserter stack size is at 12).
2. Observe that the production of copper wire is 7.2k/min and consumption of copper plate is 3.6k/min.
3. Place 4x production module 3 in the AM3+6. Production of wire increases to ~135k/min while consumption of plate falls to ~2.5k/min, machine is limited by item production overload.
4. Place 32x beacon around the AM3+6 and fill all slots with speed module 3s. Production of wire falls very slightly to 130k/min, consumption drops massively to only 61/min.

I repeated the above steps, except in step 1 I used the scaled recipe and used 26 inserters inputting plate and 58 removing wire.
At step 2 the production of wire was 72k/min, consumption of plate was 36k/min.
After step 3 production was ~96k/min and consumption was ~13k/min limited by item production overload.
After step 4 production remained at ~96k/min and consumption fell to ~420/min limited by item production overload.

3 years ago

Your results can confirm some logic flaws (on game side) regarding ingredients intake with production overload.
So I think you should file a bug report on Factorio forum, to let the devs know and solve this. Attaching save file will be useful too.
And please read this before reporting.

3 years ago

it's going to be marked "Not a Bug" because the factorio devs have decided not to fix the 'productivity bug' when more than 1 craft per tick is happening with productivity modules.

2 years ago

Thanks for notice.
I will mark this as "game limitation", where nothing I can do about it.

2 years ago

i agree it is not a major issue.

the machines still chew through different quantities of inputs to produce different quantities of outputs.

it's not like you get endless free items.

New response