[Dominik][0.17.59] Fluid mixing by game.merge_forces

Things that we don't consider worth fixing at this moment.
Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Dominik »

I am quite familiar with it as this "clamping" is internally quite sick and created some difficult bug.
Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Staplergun »

It's just pipe prototype manipulating to have less ports than before. It locks it down to very specific connection positions to deny connection in specific directions.

It was my other mod that caused all the bugs lol.
Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Dominik »

I remember that I spent long time fixing this one with pipes connecting wrong during the hidden prototype replacement.
Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Staplergun »

Ohhh damn that's right.
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 884
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Oktokolo »

Nice. So devs already have experience with the mod. Then it should be obvious that adopting it into vanilla is the perfect solution.
Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Staplergun »

Lol.
Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Dominik »

Oktokolo solving problems by just splitting the pipes usually does not solve the actual problem. While having the better pipe building would be nice, it is not good a solution to mixing problems. (not like my solution is good, but it does not take two weeks to make)
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3290
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by boskid »

I think there is a solution: turn this bug into feature. Every time two underground pipes may connect but contain different fluids, just remove them and spawn explosion and show alert "underground pipe was destroyed by mixing fluids".
Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Dominik »

Yeah I would really love that, get rid of this whole blocked pipe thing. But that is the last resort and I don't want to do that when I have already sunk so much work into it :D
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3234
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by BlueTemplar »

BobDiggity (mod-scenario-pack)
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 884
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Oktokolo »

Dominik wrote: Thu Aug 01, 2019 1:27 pm Oktokolo solving problems by just splitting the pipes usually does not solve the actual problem.
The actual problem is, that you can build things with multiple factions that are forbidden to have with only one faction. The root cause is that adjacent pipes have to connect and underground pipes have to connect to the nearest opposite-facing endpoint while connecting two differently-fluid-locked FSs is forbidden.
Fix the build restriction in the general case so we can have adjacent unconnected pipes and connect undergrounds to any opposite-facing and free endpoint in range as we wish. Then the game state created by naively merging factions is not invalid anymore and a whole class of fluid-system-related bugs is not a bug anymore.

But having huge explosions destroying a multiple-tile radius of piping and machinery when trying to connect FSs holding different fluids would make me happy too. So i am fine with "fixing" the bug class that way. I am mostly playing modded (mostly QoL and some "Cheats" like Nanobots, warehouses, crating) anyway. The mod works fine as it is and would probably still continue to work after the high explosive fluids "fix".

I don't know how hard copying a mod into the core mod and implementing the layer-copy-testing method is, but triggering explosions on no-fluid-mixing-rule violation should be rather easy to add to the existing automatism.
It would certainly look much better in streams than just having boring pipes next to each other that just work and do nothing fancy at all too.
Dominik wrote: Thu Aug 01, 2019 1:27 pm While having the better pipe building would be nice, it is not good a solution to mixing problems. (not like my solution is good, but it does not take two weeks to make)
Except, that it would just solve the entire class of fluid mixing problems for pipes and underground pipes. Add a solution for machinery like pumps and refineries/assemblers/tanks too and you have the entire bug class gone extinct as fluid mixing violations would literally become impossible to exist.

By the way: It does not have to be done with "special" prototypes and replacing them when clamping/unclamping. That just was the only sensible way for a mod author without direct access to the engine code to use. With access to engine code, you could have a bit-flag per possible connection-point indicating whether there might be a connection established or not. That would imply one byte extra state per fluid-related entity per eight fluid connection points though (not sure whether that is worth it or not for pipes and undergrounds as they work just fine with the "special" prototypes hack).
The automatism code would have to set the corresponding flags for both items' affected connection points whenever a non-fluid-mixing-rule violation is detected.
Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Dominik »

For this one, I have to unfortunately do won't fix. It is not really something people would realistically encounter and rewriting several places in the code, force change logic, is just not worth it.
User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 884
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: [Dominik][0.17.59] Fluid mixing by game.merge_forces

Post by Oktokolo »

Dominik wrote: Thu Aug 01, 2019 4:33 pm For this one, I have to unfortunately do won't fix. It is not really something people would realistically encounter and rewriting several places in the code, force change logic, is just not worth it.
Sad but understandable. We might still get lucky and have the root cause resurface as a less easy ignorable bug.
Also i am pretty sure that it is possible to fix this bug in a mod doing the layer-copy-merge-compare i suggested in an on_forces_merging event handler.
Post Reply

Return to “Won't fix.”