[FFF 260] Pipe junctions should merge, for reduced calculations

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Hexicube
Fast Inserter
Fast Inserter
Posts: 216
Joined: Wed Feb 24, 2016 9:50 pm
Contact:

[FFF 260] Pipe junctions should merge, for reduced calculations

Post by Hexicube »

In the most recent FFF the new proposed system is effectively turning the entire pipe network into single pipe segments connected with junctions. This is an improvement in theory, but it mentions junctions would be a little more CPU intensive...and then it shows the last image:

Image

This reminds me of what I see as a typical oil refinery layout:

Image

Assuming that underground pipes are considered to be a single segment, that layout boils down to 5 sets of this:

Image

One thing becomes immediately apparent, which is that there's going to be tons of junctions in extremely close proximity. Since junctions are going to be the intensive part of the new pipe system, I see a (relatively) simple solution to the problem: Combine junctions.

For the last image, instead of having eight 3-way junctions, what if it was two 6-way junctions? All of a sudden, 75% of the junctions are gone, and it's went from 24 connections to 12. Assuming this merging only happens on pipe additions/removals to that pipe network, it should in theory massively improve the performance of the system that is being proposed, at the cost of a CPU hit when modifying pipe networks as it tries to work out how to merge junctions nicely.

For the image at the end of FFF 260, it would go from three junctions (3+3+4 way) to one 6-way, going from 10 connections to 6. Not as much of an improvement, but that's a theoretical scenario when my realistic example has a far bigger benefit. One way to look at it, is that every merger removes one junction and two connections.

The problem I foresee is save-load stability, since it would be horribly inefficient to break apart all junctions and remake them on a single pipe addition. Other than that, I can't see this addition performing worse than the current proposition in FFF 260, since pipe networks are typically left alone.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [FFF 260] Pipe junctions should merge, for reduced calculations

Post by darkfrei »

It looks like a logically optimization, only one junction instead of three.
Junction_01.png
Junction_01.png (123.22 KiB) Viewed 3062 times

McDuff
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Jan 11, 2015 11:09 am
Contact:

Re: [FFF 260] Pipe junctions should merge, for reduced calculations

Post by McDuff »

This makes sense.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [FFF 260] Pipe junctions should merge, for reduced calculations

Post by bobingabout »

you say it makes sense, and that it is logical, but then you have to think about... what constitutes a junction merge? 1 pipe section between 2 junctions? Those Underground junctions would count as 2 pipes between them, so do you limit it to 2 pipes between junctions to merge them?
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Hexicube
Fast Inserter
Fast Inserter
Posts: 216
Joined: Wed Feb 24, 2016 9:50 pm
Contact:

Re: [FFF 260] Pipe junctions should merge, for reduced calculations

Post by Hexicube »

bobingabout wrote:
Wed Sep 19, 2018 11:26 am
you say it makes sense, and that it is logical, but then you have to think about... what constitutes a junction merge? 1 pipe section between 2 junctions? Those Underground junctions would count as 2 pipes between them, so do you limit it to 2 pipes between junctions to merge them?
Maximum 2 non-junction pipes between merged junctions, maximum 8 connectors per merged junction, junctions do not automatically un-merge.

It doesn't need to be the best it can possibly be, it just needs to reduce how bad the worst-case is for the FFF proposal.

ondrii
Inserter
Inserter
Posts: 22
Joined: Sun Aug 27, 2017 8:01 am
Contact:

Re: [FFF 260] Pipe junctions should merge, for reduced calculations

Post by ondrii »

I see the trick users will use :D
All pipe long they will use single pipe junction without any pipes after them. So very long pipe will be a single one and tansfering fluids will be very fast.

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2368
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: [FFF 260] Pipe junctions should merge, for reduced calculations

Post by Jap2.0 »

ondrii wrote:
Wed Sep 19, 2018 6:03 pm
I see the trick users will use :D
All pipe long they will use single pipe junction without any pipes after them. So very long pipe will be a single one and tansfering fluids will be very fast.
He said max. 8 connections per merged junction, so that wouldn't be an issue.



Note that adding this would change the ratio of fluids coming out of the junction from 1/6 + 1/6 + 2/6 + 1/6 + 1/6 to 5x1/5.
There are 10 types of people: those who get this joke and those who don't.

ondrii
Inserter
Inserter
Posts: 22
Joined: Sun Aug 27, 2017 8:01 am
Contact:

Re: [FFF 260] Pipe junctions should merge, for reduced calculations

Post by ondrii »

Oh, sorry. You are right. I overlooked it.

Post Reply

Return to “Ideas and Suggestions”