[0.17.32] Coal liquefaction underproduces heavy oil

Bugs that are actually features.
Post Reply
ThoughtCrime
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 24, 2019 11:31 am
Contact:

[0.17.32] Coal liquefaction underproduces heavy oil

Post by ThoughtCrime »

Description:

When using productivity modules, coal liquefaction produces less heavy oil than documented.

Steps to Reproduce:
1. Start Factorio
2. Enable Creative mod 1.0.4
3. Start A new game
4. Enable Cheats when prompted
5. Create the factory in the blueprint below
6. Add 10x heavy oil barrels into the assembling machine
7. Wait 70 seconds
8. Look at the 1m fluid production statistics

Blueprint:

Code: Select all

0eNqdl91yqyAQx9+Fa+kofiTNRV/kTCeDukmYKnoAM8fp+O5niY1JG6zEm0SE/S2w+1/wk+RVB60S0pDdJxFFIzXZ/fkkWhwlr+w707dAdkQYqElAJK9tKweOQ8kQECFL+Ed20fAeEJBGGAEj4dLo97Krc1A44KdtQNpG43B8RC+IoGlAevzLLBW9aftetwAlrZuyq4DGZMeGIXhgs2U2W8uOF9nRWnSyiE7WotNF9GYtOpvQXGuo80rII615cRLSGj1u/Xb0FKOnUigoxj7E4LO45BbUrenpCfi5p42oaM6Vgoo4nG8m5y2aUtPQo2o6WTrcZm63DujWH5o6ocwBffWHxiM0WZ5pFH6jOljJleWyvmlQm0bxI06Ly4/5GeG6CCaPHKd0SZHI/hwVgLwXuSiRvh3eB6fbmzwLBdyIM9gc24MEdeypbjpVuJYSvlx3+yVd3u/oJlTd5drwy9BHsd5DXZjEO27usDnnli6ELbmmlcs48zN2h/wmGCssBQdUqernilj4Yy13Gi0aXtFK/O3gwIuvvZ0KR6uwZuDbM/q+qx/u9dzJravbx6mk1xCxh9lgMhrVVPscTvwsGmUtCqGKTpg99pUT5iCUNvuHQ+xQdaK8nWJTxSFjomPW2HOQhaFt1i1X3Fgn5I0MT0khmpPCq18s3adc6NbRZVH03Ihytsqz5Rxl0W/0WZGO52r0S958g+Fu0S+iAV67Sjxj3gpMXEnrqpss9mZmTiG4mMnacPjAUzd8ahQn0Ga2crvzJ7sr/7z4oEJqUAa75sLKPHZ282S0fJjbJ6Plk96va6PlAY9D38tt+vz9M/K93K5gM8/L7Qp07Hm5XYFOPC+3S+j3sdtypo+ggJxB6QtpE4dRliZRtMWbwn9i/1s4
Bug.png
Bug.png (2.12 MiB) Viewed 3113 times

Expected Outcome:

Heavy oil production is: 7.8k/min
Heavy oil consumption is: 1.7 k/min

Actual outcome:

Heavy oil production is: 5.6k/min
Heavy oil consumption is: 0

Comments:

1. The net heavy oil production is too low by 500 heavy oil / minute.
2. The creative mod is not necessary to reproduce this bug. It is just is a convenient way to show it.

Math:

Refinery cycles / minute = 60s / 5s * 5.55 = 66.6 cycles / minute

Expected heavy oil production:
66.6 (cycles / minute) * 90 (heavy oil / cycle) * 1.3 (productivity) = 7792.2 heavy oil / min

Expected heavy oil consumption
66.6 (cycles / minute) * 25 (heavy oil / cycle) = 1665 heavy oil / min

Personal Comment:

This bug is causing my 200spm factory to run at 188spm, an unspeakable tragedy.
Attachments
factorio-current.log
(20.72 KiB) Downloaded 78 times
Creative Bug Report.zip
(4.1 MiB) Downloaded 78 times
Last edited by ThoughtCrime on Wed Apr 24, 2019 10:45 pm, edited 1 time in total.

User avatar
leadraven
Filter Inserter
Filter Inserter
Posts: 354
Joined: Fri Jan 18, 2019 7:23 pm
Contact:

Re: Coal liquefaction underproduces heavy oil

Post by leadraven »

66.6 * (90-25) * 1.3 = 5627.7 ~ 5.6k
I assume 25 of 90 resulting heavy oil is treated as catalyst and isn't affected by productivity bonus.

ThoughtCrime
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 24, 2019 11:31 am
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by ThoughtCrime »

@leadraven - yes I assume this is how it is being calculated in game, but it is clearly a bug. No other building in factorio has input cost increase with productivity as it defeats the purpose of the module.

User avatar
mrudat
Fast Inserter
Fast Inserter
Posts: 222
Joined: Fri Feb 16, 2018 5:21 am
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by mrudat »

As far as I understand it, this is working as intended.

Coal liquefaction, using 25 heavy oil as a catalyst (which isn't consumed, but also isn't subject to productivity),
consumes:
  • 10 coal
  • 50 steam
to produce:
  • 65 (90-25) heavy oil
  • 20 light oil
  • 10 petroleum gas
Similarly the kovarex process, using 40 u-235 and 2 u-238 as a catalyst (which isn't consumed, but also isn't subject to productivity)
consumes:
  • 3 u-238
to produce:
  • 1 u-235

Merssedes
Fast Inserter
Fast Inserter
Posts: 117
Joined: Sun Oct 29, 2017 7:05 pm
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by Merssedes »

In one of the versions they make that if recipe have same item for input and output, productivity module will increase only positive delta output value.
Therefore, output not 90 * 1.3 = 117 per cycle, but 25 + (90 - 25) * 1.3 = 109.5 per cycle.
Same math apply to kovarex process: 40 input, 41 output, output for 2x prod 3 modules is 40 + (41 - 40) * 1.2 = 1.2 U-235 per cycle.
Not showing consumption in statistics may be bug or intended behaviour.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2227
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by boskid »

Not a bug

Merssedes is right
ThoughtCrime wrote:
Wed Apr 24, 2019 10:35 pm
Expected heavy oil production:
66.6 (cycles / minute) * 90 (heavy oil / cycle) * 1.3 (productivity) = 7792.2 heavy oil / min
Your math is wrong. You assume that productivity is simple +30% for production, but it is not. Here due to "catalyst" rule, +30% affects only "65" excess:
Expected heavy oil production:
66.6 (cycles / minute) * 90 (heavy oil / cycle) = 5994 heavy oil / min (base yield)
66.6 (cycles / minute) * (90-25) * 0.3 (prod) = 1298,8 heavy oil / min (productivity)
total: 7292,8 production
and 7292,8 (production) - 1665 (consumption) = 5627,8 so there is no bug here.

Same result can be achived when counting productivity only to (production - consumption):
Expected heavy oil production:
66.6 (cycles / minute) * (90-25) (heavy oil gain / cycle) * 1.3 (base+prod) = 5627,7 heavy oil / min (effective production)

ThoughtCrime
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 24, 2019 11:31 am
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by ThoughtCrime »

So it's the intended behavior, fair enough. I will try to get this documented on the wiki.


I would like to comment that I dislike the asymmetry. To me it is surprising and works differently than the rest of the game--the opposite of how game mechanics should be. There are 2 different rules. The normal which works for both inputs and outputs is:

Outputs * Productivity - Inputs = Net Production / Cycle

But if an input and an output happen to be the same there is a different rule:

(Outputs - Inputs) * Productivity = Net Production / Cycle (And don't list consumption in the productivity statistics)

I assume the devs implemented this to make Kovorex Enrichment less OP, which I understand, but I still feel that this is wrong.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2227
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by boskid »

ThoughtCrime wrote:
Thu Apr 25, 2019 10:15 am
[...]
There are 2 different rules. The normal which works for both inputs and outputs is:

Outputs * Productivity - Inputs = Net Production / Cycle

But if an input and an output happen to be the same there is a different rule:

(Outputs - Inputs) * Productivity = Net Production / Cycle (And don't list consumption in the productivity statistics)
There is no such thing as first formula. If you set recipe "gear wheel", output="gear" and input="2*iron plate". There is no substitution here (what unit would it have?).

If you have recipe like "gear wheel", you have input="0 gear wheels", and output="1 gear wheel" so second formula holds for gear wheels: every craft gives 1 more gear wheel, and this "1 more" is what is increased by productivity modules.


Other example: lets create artificial recipe that requires "2 iron plates + 1 000 000 gear wheels" and produces "1 000 001 gear wheels" so each craft you get 1 gear more. With 1xProd1 (+4%) with your rule, assembler would produce 1 040 001 gear wheels (on average per craft) but would require only 1 000 000 gears per craft. This would be OP as you would get 40000 gears per 2 iron plates with only 1xProd1. In this case Prod1 should be called +4% or +4000000%?

Merssedes
Fast Inserter
Fast Inserter
Posts: 117
Joined: Sun Oct 29, 2017 7:05 pm
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by Merssedes »

IMHO, it'll be better to store catalists internally and not output/input back for every cycle.

For example, coal liquification will look like this:
Input: 50 steam, 10 coal
Catalyst: 25 Heavy oil
Output: 65 Heavy oil, 20 Light oil, 10 Petroleum gas
Input and output pipes does not change.
At 1st refinery stores 25 Heavy oil internally through 1st pipe (preparation stage).
After that, it works as usual (production stage).

In case of recipe change it can either drop all stored catalyst, or deal with it the same way as it's currently doing: put it into player's inventory (for items)/push into corresponding input pipe (for fluids).

ThoughtCrime
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 24, 2019 11:31 am
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by ThoughtCrime »

Thanks for the feedback everyone!

@biskid "There is no such thing as first formula...what unit would it have?". Inputs, outputs and net production are vectors with one element for each item in the game. Sorry for the confusion. Using this conception it should be clear why I consider this a special case.


"…This would be OP as you would get 40000 gears per 2 iron plates". Yes I agree that this is problematic as I mentioned before with Kovorex Enrichment.

@Merssedes "IMHO, it'll be better to store catalists internally and not output/input back for every cycle.". I actually like cycling back the inputs every cycle as it requires implementation of a priority system where catalysts get higher priority than other consumers. It's a fun little design challenge in the game.

IMHO the solution is to just document the edge case behavior, which I will do if/when my wiki account gets approved.
Last edited by ThoughtCrime on Thu Apr 25, 2019 10:06 pm, edited 2 times in total.

ThoughtCrime
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Apr 24, 2019 11:31 am
Contact:

Re: [0.17.32] Coal liquefaction underproduces heavy oil

Post by ThoughtCrime »

Also, someone with privliges should probably move this to the "not a bug" sub.

I don't see a way to do this.

Post Reply

Return to “Not a bug”