[0.12.x][Pending][modding] Inconsistent boilers behaviour

Bugs that are actually features.
DevilXD
Fast Inserter
Fast Inserter
Posts: 213
Joined: Tue Aug 12, 2014 10:47 am
Contact:

[0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by DevilXD »

Hello, I'm making a mod that adds faster machines. I'm currently working on boilers and steam engines.

The "how it should work" idea:
My boilers should work twice as fast, thus consuming fuel twice as fast, producing two times more pollution and heat up twice as much water in the same amount of time.
My steam engines should consume water twice as fast, while producing twice as much electricity.

The whole mod works so that you can literally replace all your existing boiler and steam engines with the faster version, without moving stuff and changing the boiler:engine ratio.

Now, to the core of the problem:

For the steam engines, I just multiplied the fluid box size and fluid_usage_per_tick values by 2. It was as easy as that.

For the boilers however, multiplying the fluid box and power_consumption values by 2 gave me a very interesting results - in my testing facility, only half of my modded boilers worked on heating up the water and there was a massive pressure drop through the whole system, so only half of my modded steam engines worked.

I expected that the boilers would adapt to the new fluid box size and let me heat up twice as much water in the same amount of time, instead of heating up the same amount of water twice as fast.

(now that I think about it, they were heating up the doubled fluid box size of liquid, so I got twice as much heated water from the same amount of energy, so that's also a bug)

To understand correctly what I've just described here, I set up this Bug Testing Facility:
Image
Just put some wood into the boiler and the whole thing should start up =)

Here's a short explanation of the bug using the image from the testing facility:
Image

I'm attaching the Bug Testing Facility world and my mod, so you can test it yourself:
Bug Testing Facility.zip
(1.85 MiB) Downloaded 90 times
Compact_Factory_1.1.6.zip
(20.29 MiB) Downloaded 81 times
I hoped that this will get changed, so that I can continue my work on the mod =)
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.12.x][modding] Inconsistent boilers behaviour

Post by bobingabout »

what you're experiencing is the differences in the "Water transfer simulation", it's a very complex issue. to solve it, you would also need a fluid that moves twice as fast through pipes, the issue with that is, if you make any fluid faster than the base game's values, and put it in a size 10 pipe, quote dev, but forgot which one "The simulation becomes unstable".

There is no clean solution to the water flow issue. also, if you consume water twice as fast, you'd need to put in twice as much water in the start, but I'm fairly sure there's a limitation of how fast water can flow, which is why you get the limit of 10 steam engines from a single pump.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.12.x][modding] Inconsistent boilers behaviour

Post by orzelek »

Did you try to connect 2nd offshore pump?
I do recall that one of those makes only as much water as can flow through normal pipe - and yours is twice the size.
DevilXD
Fast Inserter
Fast Inserter
Posts: 213
Joined: Tue Aug 12, 2014 10:47 am
Contact:

Re: [0.12.x][modding] Inconsistent boilers behaviour

Post by DevilXD »

bobingabout wrote:what you're experiencing is the differences in the "Water transfer simulation", it's a very complex issue. to solve it, you would also need a fluid that moves twice as fast through pipes, the issue with that is, if you make any fluid faster than the base game's values, and put it in a size 10 pipe, quote dev, but forgot which one "The simulation becomes unstable".
I've tried to avoid the situation, where I increase the effectivity of the steam engines instead of fluid usage, because then you could power the engines with normal boilers, effectively getting 2x more energy from the fuel than with a normal steam engines. I increased fluid usage, so you HAD to use the better boilers to keep up with the steam demand.
bobingabout wrote: also, if you consume water twice as fast, you'd need to put in twice as much water in the start, but I'm fairly sure there's a limitation of how fast water can flow, which is why you get the limit of 10 steam engines from a single pump.
orzelek wrote:Did you try to connect 2nd offshore pump?
I do recall that one of those makes only as much water as can flow through normal pipe - and yours is twice the size.
There is a modded offshore pump at the input, with twice the fluidbox size and pumping speed - I just didn't have time to make a graphic for it so it looks the same :P

I've tried connecting many offshore pumps to the input, but the big difference in pressure was still a thing.

EDIT: I just did a test with the normal Steam Engines:
Image
The pressure drop is STILL a thing. The water flow is the same as with the normal boilers, the modded boilers are just working very funny when you set the fluidbox to anything higher than 1. That's why I made this bug report, because it definitely shouldn't work that way.

EDIT2: I just set the fluidbox size of the boilers back to 1:
Image
As you can see, they are all running and heating up water with the "normal speed", despite still having power_consumption value doubled. The pressure drop still exists, but that's because the steam engines are using twice as much steam.

Is it now clear that there's something wrong with the way the boilers are heating up the water ? There's a world and mod download in the original post, you can test yourself if you want. To change the values of boilers and steam engines, just comment/uncomment these values in "prototypes/boiler-engine.lua":

Code: Select all

-- For boiler:
fluid_box =
    {
        --base_area = boiler_base_capacity * mods.general_boiler_engine_mod,
    },
    energy_consumption = boiler_base_consumption * mods.general_boiler_engine_mod .. "kW",

-- For engines:
--effectivity = steam_engine_base_effectivity * mods.general_boiler_engine_mod,
fluid_usage_per_tick = steam_engine_base_fluid_usage * mods.general_boiler_engine_mod,
Uncommented values are doubled, comment them to revert back to the original value.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.12.x][modding] Inconsistent boilers behaviour

Post by Klonan »

Thanks for the report

Im not sure if this is a bug,

You are doubling all the value in the boilers and steam engines, and expecting them to work twice as well,
However you haven't changed the fluid fow values for the water

Can you try making a new fluid with your water pump "water-mk2" with different values of the fluid flow to see if you have the same issue?
DevilXD
Fast Inserter
Fast Inserter
Posts: 213
Joined: Tue Aug 12, 2014 10:47 am
Contact:

Re: [0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by DevilXD »

Klonan wrote:You are doubling all the value in the boilers and steam engines, and expecting them to work twice as well
I didn't expect them to work twice honestly, I expected that the water will not fill the pipes entirely. I didn't expect having 70% pressure drop between the first and last boiler.

Notice the test I made with normal Steam Engines - they use 0.1 water/tick and the pressure drop in the boilers still exists, because the boilers are set to twice the fluid box size.
When I did the opposite - changed the fluidbox of boilers back to 1, left the 0.2 water/tick engines - all boilers started to work and heat up water just like the original boilers, despite having power_consumption value doubled (I don't know

The issue here is boiler logic - I expected that setting the fluid box to twice the size would only make the boiler transfer more water per tick. Instead, half of them turned off, because they were suddenly heating up twice as much water using the same amount of fuel, which resulted in water being heated twice as fast.

The logical thing here would be they start heating up water 2x slower, because of higher quantity of water flowing through them (30 boilers needed to reach 100C instead of 15). Then, doubling the power_consumption value would make them heat up water faster, so you still need only 15 of them to reach 100C.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by Klonan »

DevilXD wrote:
Klonan wrote:You are doubling all the value in the boilers and steam engines, and expecting them to work twice as well
I didn't expect them to work twice honestly, I expected that the water will not fill the pipes entirely. I didn't expect having 70% pressure drop between the first and last boiler.

Notice the test I made with normal Steam Engines - they use 0.1 water/tick and the pressure drop in the boilers still exists, because the boilers are set to twice the fluid box size.
When I did the opposite - changed the fluidbox of boilers back to 1, left the 0.2 water/tick engines - all boilers started to work and heat up water just like the original boilers, despite having power_consumption value doubled (I don't know

The issue here is boiler logic - I expected that setting the fluid box to twice the size would only make the boiler transfer more water per tick. Instead, half of them turned off, because they were suddenly heating up twice as much water using the same amount of fuel, which resulted in water being heated twice as fast.

The logical thing here would be they start heating up water 2x slower, because of higher quantity of water flowing through them (30 boilers needed to reach 100C instead of 15). Then, doubling the power_consumption value would make them heat up water faster, so you still need only 15 of them to reach 100C.
The logic doesn't work this way, the heating of the fluidbox is independant from the amount in the fluidbox. This isn't really a bug more just the way it was implemented.
DevilXD
Fast Inserter
Fast Inserter
Posts: 213
Joined: Tue Aug 12, 2014 10:47 am
Contact:

Re: [0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by DevilXD »

Klonan wrote:The logic doesn't work this way, the heating of the fluidbox is independant from the amount in the fluidbox. This isn't really a bug more just the way it was implemented.
I didn't consider it straight away as a "bug", more as a logical inconsistency...

Will this implementation get changed ? The logic just have to take into account size (not amount inside) of the fluidbox.

Putting two times more cold water through the boiler that has the same heat output should heat the water two times slower, not faster :)
DevilXD
Fast Inserter
Fast Inserter
Posts: 213
Joined: Tue Aug 12, 2014 10:47 am
Contact:

Re: [0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by DevilXD »

Okay, so I finally figured it out - you have to make the fluidbox two times SMALLER, not bigger for the boiler/pipe to have twice the flow speed... That's kinda strange, because in real life, making the pipe smaller will make the flow slower, not faster...

I've tried making the "water-mk2" as you suggested, but I want the offshore pump able to be used in oil processing chain - but the recipes ask for "water", not "water-mk2", so it's not an ideal solution...

EDIT: Fun thing is that now the water flows through them so fast that they are not capable of detecting it and heating it up... Mousing over the boiler shows that it has no liquid, yet still I can see the water flow through the pipe's window =)
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by bobingabout »

Making the pipe smaller is a bad idea, it makes the water travel fast enough to cause "unstable simulation".
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
DevilXD
Fast Inserter
Fast Inserter
Posts: 213
Joined: Tue Aug 12, 2014 10:47 am
Contact:

Re: [0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by DevilXD »

bobingabout wrote:Making the pipe smaller is a bad idea, it makes the water travel fast enough to cause "unstable simulation".
DevilXD wrote:EDIT: Fun thing is that now the water flows through them so fast that they are not capable of detecting it and heating it up... Mousing over the boiler shows that it has no liquid, yet still I can see the water flow through the pipe's window =)
Is that what you mean ?

EDIT: I think I know what you were saying: http://imgur.com/XLyPl4e
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.12.x][Pending][modding] Inconsistent boilers behaviour

Post by bobingabout »

Yeah, I guess that's a good summery of what I mean.

The water seems to bounce back and forth along the pipe, the reason why I quote "unstable simulation", is because that's how one of the Devs described it to me once.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Post Reply

Return to “Not a bug”