Mekanism

Mekanism

111M Downloads

Mechanical Pipes auto-connect in inactive area

CMrcm opened this issue ยท 10 comments

commented

Thank you for your hard work on this mod. I found an issue (*feature?) which has caused a lot of headaches for myself and others on my server that I wanted to bring to your attention.

When placing Mechanical pipes, the entire connected chain of pipes updates with every one placed. This causes any pipes adjacent to the chain to check for a connection. Seems they use [IF empty AND IF adjacent NOT empty: connect]. This has become an issue in our more compact builds that require multiple liquids (eg Brine and Water) piped close together in which: laying a pipe down in an empty chain intending to connect to a water line updates the chain somewhere to connect to a nearby brine line, instantly filling the pipe with brine (instead of water).

To recreate the issue:

  1. pipe brine to machine A
  2. connect empty mechanical pipe to machine B (we'll call this the "pigtail")
  3. chain mechanical pipe from water source next to brine pipe (they won't connect with separate substance contained)
  4. connect water pipe to machine B's pigtail

This will cause all pipes in the brine/water adjacency to connect spontaneously, filling the entire complex fully with one of the substances.

commented

What version of Mekanism are you using?

When placing Mechanical pipes, the entire connected chain of pipes updates with every one placed.

Not sure what you mean by that, but based on the the rest of your description I presume you are setting the connection between to lines to "none" with a configurator, if this is not the case I would highly recommend doing so to ensure they don't end up merging when one becomes empty, and if it is the case it might help to know that you can (or at least should be able to, not sure if it is broken as I haven't tested recently) be able to set the connection to none of the pipe that is already placed so that when you place another one it doesn't auto connect to that as the connection type is none.

commented

Wow, thanks for the quick response!

Version is 10.0.9.432 for 1.16.1

We've found a way around it which is close to what you described. Just thought it would be good to have it on the books in case it wasn't intended as it's not very intuitive (no one connects a pipeline IRL and expects a disconnected pipe down the line to suddenly form a connection).

I'll try to get some pics to better illustrate the behavior.

commented

The disconnected pipe down the line is because they become the same network at the pipe you place connecting there and reconnects any valid connections that were forced different because of contents down the line as they are the same network and a block update would cause them to reconnect so they get auto reconnected for you. It was actually a decent pain to get them connecting back together properly like that when the networks become valid for each other again, and it is because the networks aren't actually "disconnected" unless you manually set the connection to "none", they are just "disconnected" so that the contents don't end up getting voided (like they did at one point in 1.12 and earlier versions of MC) due to the pipes only having one buffer.

commented

01

Here's the setup with the odd piping. All of the circled pipes have been set to Connect: None.

01 2

Next, we've knocked out the terminal pipes and replaced all but one with empty pipe.

03 2

When we attempt to connect the water network on the left, it updates and pulls in the brine network (that was set to Connect: None) on the right.

04

This can be avoided by not connecting an existing network to a separate, empty network, ensuring to only add to the existing network or connect to a terminal.

commented

If you right click both networks with a network reader does it show that either of them are empty or does it show they have contents in them. Our pipes sometimes when they are transporting things show they have the contents of the thing being transported to show it is "moving" but doesn't actually have any of the contents actively stored in it for any length of time.

commented

All pipes (but the empty one) read as full of water and brine respectively before the connection. After connection it resulted in the following:

Full of water:
2020-09-30_14 04 19

Full of Brine:
2020-09-30_14 04 24

Note the different configuration of network joining this time around with that isolated water pipe still hanging out in the back:
Inked2020-09-30_14 04 44_LI

commented

I finally had a bit of time to start looking into this (and will try to fix it for 10.0.12), and I have been able to reproduce it though I am not quite sure why it is happening.
2020-10-14_13 21 55

commented

In my head it's a function that recurses down the chain and asks "is this connected?". If that's what's happening you might just turn that off and make people connect manually with a widget since it's acting uncontrollably (hopefully that's uncoupled from passing content information between blocks). Or delve into the depths to discover how it's making the connection decision and use content criteria in there (IF neighboring pipe contains same content as me then join, ELSE naw).

I dunno, just spitballing. Good luck and AGAIN thanks for all your hard work. It's a stellar mod even with pipe weirdness.

commented

That sort of what happens currently (or is supposed to be). I tracked it down partially to the fact it was rechecking connections before updating the stored contents, so I have fixed that locally, but I now have to track down a different bug where the contents don't properly update/render and some connections don't visually show on the client (though they are correct on the server).

commented

Took a lot longer to figure out than I wish it did, but it seems to be working properly again (and a lot better at that). So this will be fixed when we end up releasing 10.0.12 (which I hope will be sometimes in the next couple days)