Modern Industrialization

Modern Industrialization

4M Downloads

fluid and item pipes have deranged pathing when multiple pipes are in one block

ryleu opened this issue ยท 4 comments

commented

image

kinda silly

i'd imagine you could run some sort of algorithm to generate a bunch of sane patterns and then cache those and apply them in-game, but i'm not an expert on that field of mathematics. this is likely a giant undertaking for such a small visual issue

commented

I might look into finding such algorithm, this annoys me surprisingly much when looking at my pipe spaghetti in-game :D.

If I understand right, what this current pipe shape enables is that when new pipes are added it is not necessary to re-route pipes, since they are in a shape where they can connect to all 6 directions.

Prettier shapes would presumably be conditional, and look different depending on number of connected pipes to the block and require re-renders / re-shapings when new pipes connect.

commented

The main property of the current algorithm is that it only depends on a single pipe's state...

If you look at the code you will see that it's not easy to change...

Personally I like the current sillyness ;)

commented

If anyone looks into changing the logic I repeat what I said a while ago, at a higher level of abstraction than code:

divide the minecraft "cube" into nodes. When you create a path through it, you have a face in, and a face out. The overall deal with pipes is that three can share the same cube, and they can move through different nodes and cross each other.

I thought of the logic, at the time, to avoid overlaps. I think Tech ran a custom algorithm to simply detect those overlaps and solve them, but my goal was to have an algorithm whose logic would just avoid entirely the possibility.

So, every time a pipe is placed, it paths itself from the entry point to the exit point, and also flags the nodes it goes through as occupied. When a second and then a third pipe is added, it will simply run its pathing through the available nodes.

The pathing itself should be enough to produce saner layouts, since it simply takes the shortest route available without "biases".

I guess the problem is connecting pipes in more than in/out, but I don't see this changing things meaningfully. There are cases where some "exits" may end up blocked, but it should be enough rerunning the algorithm of the first pipe and blocking some of the positions to guarantee those exits.

commented

Prettier shapes would presumably be conditional, and look different depending on number of connected pipes to the block and require re-renders / re-shapings when new pipes connect.

i had the same thought, but i wasn't sure how to word it. is it better to have the spaghetti without needing to re-route a bunch of pipes, or to have reduced spaghetti with more frequent re-routing?

it's such a minor thing that i don't think a config option would be worthwhile, because then you'd have to maintain two algos

maybe something along the lines of AE's bundled cables system could work? just a thought, not sure how that'd be in-game