[Dominik][0.17.60] Fluid mixing by rotation

This subforum contains all the issues which we already resolved.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3319
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

[Dominik][0.17.60] Fluid mixing by rotation

Post by boskid »

  1. load "fluid-mixing-by-rotation"
    save
    fluid-mixing-by-rotation.png
    fluid-mixing-by-rotation.png (145.96 KiB) Viewed 5661 times
  2. Remove cutter underground pipe
    fluid-mixing-by-rotation-2.png
    fluid-mixing-by-rotation-2.png (127.21 KiB) Viewed 5661 times
  3. Try rotating right underground pipe (near acid output)
  4. Underground pipes connect:
    fluid-mixing-by-rotation-3.png
    fluid-mixing-by-rotation-3.png (127.82 KiB) Viewed 5661 times
Underlying issue is most likely same as in 73840 but reproduction does not require mods or console commands
Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by Dominik »

So all these three reports (this, viewtopic.php?f=182&t=73840, viewtopic.php?f=182&t=73890) were very similar in that the issue would require rewriting and complicating the current code beyond what is reasonable, considering how rare these issues actually are (from automatic reports I would guess that 1 in 100s of players ever encounters it.) So as a solution I have instead prevented the action that triggered the problem. In this case and the upgrade there is an error text imploring the player to fix the blocked connection, with teleport there is not as that would also be complicated and not that useful.
User avatar
Dev-iL
Filter Inserter
Filter Inserter
Posts: 304
Joined: Thu Jul 02, 2015 2:48 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by Dev-iL »

Dominik wrote: Thu Aug 01, 2019 4:32 pmSo as a solution I have instead prevented the action that triggered the problem. In this case and the upgrade there is an error text imploring the player to fix the blocked connection
I think this was fixed in a sub-optimal way, I'll explain why and suggest alternatives.
  • Here's how to make the new error message appear (movie credit to @Bilka):

    Evidently, the removal of the central pipe section creates fluid mixing (a situation that shouldn't ever be possible).
  • In following, upon attempting to resolve the problem (by rotating one of the problematic pipes), an error message appears, effectively preventing the player from fixing it.
Suggestion 1: Block the action that would cause fluid mixing in the first place (i.e. the removal of the central pipe), and associate the message with that. The current mechanism addresses a symptom of the problem, instead of its cause - by telling the user how to fix something that shouldn't happen in the first place.
Suggestion 2: Rephrase the message to better explain what needs to be done to fix it. For example: "Fluid mixing found. Please remove this pipe and try a different layout."
Leading Hebrew translator of Factorio.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3319
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by boskid »

Dev-iL wrote: Sun Aug 04, 2019 7:45 am Evidently, the removal of the central pipe section creates fluid mixing (a situation that shouldn't ever be possible).
No, underground pipes did not connect so there is no fluid mixing.

This is how underground pipe looks when not connected (to prevent fluid mixing) - there are red boxes on tiles where there are implicit buried pipe segments:
73884-undergrounds-not-connected.png
73884-undergrounds-not-connected.png (33.16 KiB) Viewed 5390 times
And this if they are connected - there are two dotted lines:
73884-undergrounds-are-connected.png
73884-undergrounds-are-connected.png (31.5 KiB) Viewed 5390 times
Fluid mixing is if you manage to connect two fluid boxes with different filters (like crude-oil and acid [i used them in almost all cases so they are good representative here :)])

Implemented solution is good enough with given fluid engine implementation limitations: Because it is not possible to decide if this pipe segment after rotation will indeed be allowed without removing it first (more on that in viewtopic.php?p=447186#p447186) and because if it would happen it should not be rotated, there would be no way to restore previous state, this action is prevented all the way from start. This is good solution.

-- edit:
It would be helpful if unconnected underground pipes would announce themselves with proper alert with map coordinates. This would help finding them.

paint crafted proposition:
73884-proposed-underground-alert.png
73884-proposed-underground-alert.png (51.42 KiB) Viewed 5382 times
User avatar
Dev-iL
Filter Inserter
Filter Inserter
Posts: 304
Joined: Thu Jul 02, 2015 2:48 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by Dev-iL »

boskid wrote: Sun Aug 04, 2019 8:10 am No, underground pipes did not connect so there is no fluid mixing. ... Fluid mixing is if you manage to connect two fluid boxes with different filters.
I see your point. What I meant was that the pipes appear connected when you glance at them (w/o mousing over). If they appear connected but are not actually connected - it's a point of confusion. There should be some way that differentiates this scenario from a "proper connection" (for example: a small ⚠️ next to the ug connection when it's not really connected, like the blue "missing modules" icon).
boskid wrote: Sun Aug 04, 2019 8:10 amImplemented solution is good enough
I have to disagree with your here - the current solution is simply confusing, and not as informative as it could be. My main argument is that that the current message doesn't indicate what the player action should be. I meant to add a 3rd possible solution to my previous post, which is a combination of 1+2 and that it: keep the current text but associate it with the action of removing the central pipe (that causes an apparent connection), and also keep the current warning logic, but write a different string for it (like the one I suggested above), in case it can be reached from by different path of actions.
Leading Hebrew translator of Factorio.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3319
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by boskid »

Preventing underground pipe removal because it would create unconnected underground pair? Tell this to biters: "please choose different path to destroy players base because this pipe is untouchable" or "hey biter, could you please fix underground pipe issue before going for this underground pipe?". I can imagine biters prevention setups that abuse undestructible entity.
73884-fluid-mixing-biter-prevention-system.png
73884-fluid-mixing-biter-prevention-system.png (1016.74 KiB) Viewed 5369 times

There is no blue "missing modules" icon, it is item-request-proxy and it shows that item is requested

Every solution to highlight that underground pipe is unconnected would however be better than no hint. Even reducing its health to not be higher that max-1 would be better (pros: would show on map that it needs repair. cons: 1/ would need roboport in range and 2/would deploy bots that cannot repair underground pipe issue)
User avatar
Dev-iL
Filter Inserter
Filter Inserter
Posts: 304
Joined: Thu Jul 02, 2015 2:48 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by Dev-iL »

boskid wrote: Sun Aug 04, 2019 8:59 am Preventing underground pipe removal because it would create unconnected underground pair? Tell this to biters: "please choose different path to destroy players base because this pipe is untouchable" or "hey biter, could you please fix underground pipe issue before going for this underground pipe?". I can imagine biters prevention setups that abuse undestructible entity.
I didn't say that the current logic should be removed. Think of my suggestion as another precaution - if the pipe was removed somehow (bots, biters, nukes), you would end up in the present situation, with the current solution being the fallback. That doesn't mean that the user should be allowed to do it deliberately (unless it greatly complicates the logic).
boskid wrote: Sun Aug 04, 2019 8:59 am There is no blue "missing modules" icon, it is item-request-proxy and it shows that item is requested
I'm well aware of this. I meant to demonstrate that a method of showing some icon on top of entities already exists, and that adapting it for pipes should probably not be too difficult.
boskid wrote: Sun Aug 04, 2019 8:59 am Every solution to highlight that underground pipe is unconnected would however be better than no hint.
Thank you :)

If you disagree with my claim that the popup message is confusing, please suggest something else.
Leading Hebrew translator of Factorio.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3319
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by boskid »

Dev-iL wrote: Sun Aug 04, 2019 9:22 am That doesn't mean that the user should be allowed to do it deliberately (unless it greatly complicates the logic).
It would greatly complicate logic. Lets see this case:
73884-cannot-test-for-mixing-by-removal-without-removal.png
73884-cannot-test-for-mixing-by-removal-without-removal.png (47.94 KiB) Viewed 5339 times
Here middle U.P. is disconnected from left U.P. to prevent fluid mixing. If you want to prevent removing it because if would create new disconnected U.P. pair, you first need to detect that removal is bad (would create this disconnected pair). For this you need to remove U.P. in question (engine limitation) to check if there are new disconnected underground pipes. If you find that removing it should be avoided, you need to restore original middle U.P. and it looks this action is hard in current code because this U.P. would now need to know to which fluid boxes nearby it should connect (restore lost state).
Preventing would also be extra irritating because without possibility of removal underground pipe, you would need to: 1/ guess which pipes nearby can be removed in a way that would prevent fluid mixing check, or 2/ find other action which is allowed and solves issue. This would work as rails with train on top - you cannot remove rails under train, but here it is obvious what prevents you from removing rails - it is exacly same entity that overlaps with most of rail collision box.
--
popup message is not confusing on its own because it is precise. Confusing is lack of extra details of where this issue is (like alert "some undergrounds are disconnected to prevent fluix mixing" with "click to show on map"). If would be better to rephrase it to "cannot do that yet. check alerts for fluid mixing disconnected underground pipes" but given occurence rate of this issue for standard player it is not likely it will be fixed other way because of poor gain to work ratio.
IMO this fix is more to prevent rouge players from connecting to multiplayer and creating this fluid mixing setup to prevent other players to join because of consistency errors and in that sense it works good - prevents you from creating fluid mixing with underground pipes.
User avatar
Dev-iL
Filter Inserter
Filter Inserter
Posts: 304
Joined: Thu Jul 02, 2015 2:48 pm
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by Dev-iL »

Ok, you win - it's not as simple as I thought.
Leading Hebrew translator of Factorio.
Dominik
Former Staff
Former Staff
Posts: 658
Joined: Sat Oct 12, 2013 9:08 am
Contact:

Re: [Dominik][0.17.60] Fluid mixing by rotation

Post by Dominik »

Yes, preventing the action in the first place would be nice, but it is not realistic.
"user can't fix the issue by rotation" - deleting the pipe is what I would think of to fix it, not rotating the pipe.
I left it only at the message as this issue is really rare - before it would cause mixing and we never got a report of it. I think it would be reasonable to always have these blocked connections highlighted, but I left it open to decide based on what people think.
Post Reply

Return to “Resolved Problems and Bugs”