4-way intersections: Throughput and deadlocks [image heavy]

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

vanatteveldt
I have some ideas of how to do it dynamically, but I won't try it today.

Regarding the intersection. While that would increase throughput, it would increase throughput at a point that isn't a bottleneck. The current bottleneck is the merger, not all the part intersections. It would also break the deadlock prevention I made=)
Zijkhal
Inserter
Inserter
Posts: 25
Joined: Thu Sep 07, 2017 4:32 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by Zijkhal »

The problem to overcome I think would be to make sure trains that started slowing down for the intersection, but the circuit controlled light turned back green would not break the intersection due to that train arriving earlier than expected.
mrvn
Smart Inserter
Smart Inserter
Posts: 5946
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by mrvn »

In 0.16 the fluid wagons where changed. I don't remember exactly but don't they now have the same weight as cargo wagons?

If so you could optimize for LLCCCC/LLFFFF for example. Otherwise you need to handle different speeds for cargo and fluid trains.

Also look at the previous posts about using a wait loop where the train never stops. You could keep all waiting trains at full speed.
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

I read it. The trains wont keep looping. Please show me how it can work?
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

Zijkhal wrote:The problem to overcome I think would be to make sure trains that started slowing down for the intersection, but the circuit controlled light turned back green would not break the intersection due to that train arriving earlier than expected.
Not sure I understand you correctly. The circuit network can't turn lights green. And the train do start to slow down if the light is red. If the light suddenly turn red they can instantly stop.
Zijkhal
Inserter
Inserter
Posts: 25
Joined: Thu Sep 07, 2017 4:32 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by Zijkhal »

hansjoachim wrote:
Zijkhal wrote:The problem to overcome I think would be to make sure trains that started slowing down for the intersection, but the circuit controlled light turned back green would not break the intersection due to that train arriving earlier than expected.
Not sure I understand you correctly. The circuit network can't turn lights green. And the train do start to slow down if the light is red. If the light suddenly turn red they can instantly stop.
When a train is crossing the intersection, the other lights it crosses are closed by circuit. Now, if a train starts slowing for that closed train signal, but just after it started slowing, the circuit controlled light was released, it would arrive to the intersection sooner than anticipated. Now, the trains would not collide, but this other train would stop where it was not supposed to be, thus it will take more time to clear the intersection, which could ripple through the entire intersection, drastically reducing throughput if not dealt with correctly. Ofc, I may be wrong, but I think it should be tested wether such a circuit-controlled intersection is susceptible to such mistiming, and wether it recovers from the mistiming.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by Mylon »

How does a very large 4x4 intersection consisting of 4 separate 2x2 intersections perform? That is, can I bypass the need for complex intersections by regularly crosslinking and making a grid-like structure for my rails?
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

Hey
I made an smaller combinator intersection with around 125 in set 1 and 115 in set 2.
tested with 6 cars, supports 14 cars not tested

RHD 4 way 2 lane
https://pastebin.com/gLxbV1GR

This time it is symmetrical and only with signals that are needed
Attachments
RHD 2 lane 4 way intersection.png
RHD 2 lane 4 way intersection.png (76.88 KiB) Viewed 8404 times
Last edited by hansjoachim on Sun Feb 04, 2018 10:58 pm, edited 8 times in total.
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

Zijkhal wrote:
hansjoachim wrote:
Zijkhal wrote:The problem to overcome I think would be to make sure trains that started slowing down for the intersection, but the circuit controlled light turned back green would not break the intersection due to that train arriving earlier than expected.
Not sure I understand you correctly. The circuit network can't turn lights green. And the train do start to slow down if the light is red. If the light suddenly turn red they can instantly stop.
When a train is crossing the intersection, the other lights it crosses are closed by circuit. Now, if a train starts slowing for that closed train signal, but just after it started slowing, the circuit controlled light was released, it would arrive to the intersection sooner than anticipated. Now, the trains would not collide, but this other train would stop where it was not supposed to be, thus it will take more time to clear the intersection, which could ripple through the entire intersection, drastically reducing throughput if not dealt with correctly. Ofc, I may be wrong, but I think it should be tested wether such a circuit-controlled intersection is susceptible to such mistiming, and wether it recovers from the mistiming.


Yeah, that is a big part of the challenge.
I am not sure such a merger will pay off in comparison to a merger that lets trains pass in batches. When the amount of trains per batch is very high the potential gains becomes quite low for a timing based merger.
User avatar
sapog
Burner Inserter
Burner Inserter
Posts: 14
Joined: Wed Mar 18, 2015 6:16 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by sapog »

these lights are superfluous, they complicate the ring, but they are useless
Attachments
2qVT0Qg.jpg
2qVT0Qg.jpg (252.83 KiB) Viewed 8155 times
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

sapog wrote:these lights are superfluous, they complicate the ring, but they are useless
I agree
A pretty useless intersection none the less.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2383
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by Jap2.0 »

hansjoachim wrote:
sapog wrote:these lights are superfluous, they complicate the ring, but they are useless
I agree
A pretty useless intersection none the less.
Are you sure? I haven't studied the intricacies of roundabouts, but it looks like it could increase throughput in cases such as where two trains come from the left, the first exiting down and the second exiting up. Would this allow the second to enter the roundabout before the first had fully exited?
There are 10 types of people: those who get this joke and those who don't.
Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by Aeternus »

I disagree. Roundabout intersections are useful in low to mid volume traffic with shorter trains (less then the length of the roundel - if the train length is greater then the roundels capacity you risk a pathing glitch causing the train to rearend itself). It allows trains to turn around, useful in dual-rail-as-bus setup. A roundabout is practically deadlock proof.

To improve throughput on this roundabout however I do recommend a corner bypass rail so traffic turning left doesn't even enter the roundel. In my base I use this configuration a lot, 'though for troughput purposes, I try to limit it to a threeway intersection instead of fourways.
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

Jap2.0 wrote:
hansjoachim wrote:
sapog wrote:these lights are superfluous, they complicate the ring, but they are useless
I agree
A pretty useless intersection none the less.
Are you sure? I haven't studied the intricacies of roundabouts, but it looks like it could increase throughput in cases such as where two trains come from the left, the first exiting down and the second exiting up. Would this allow the second to enter the roundabout before the first had fully exited?
No, the second train would still need to wait for the first train to exit the intersection.
Aeternus wrote:I disagree. Roundabout intersections are useful in low to mid volume traffic with shorter trains (less then the length of the roundel - if the train length is greater then the roundels capacity you risk a pathing glitch causing the train to rearend itself). It allows trains to turn around, useful in dual-rail-as-bus setup. A roundabout is practically deadlock proof.
In a game with unlimited resources there are so many way better intersections that I'd skip that intersection in every game.
Aeternus wrote: To improve throughput on this roundabout however I do recommend a corner bypass rail so traffic turning left doesn't even enter the roundel. In my base I use this configuration a lot, 'though for troughput purposes, I try to limit it to a threeway intersection instead of fourways.
Sure that makes it better
Last edited by hansjoachim on Mon Mar 19, 2018 8:48 pm, edited 1 time in total.
mrvn
Smart Inserter
Smart Inserter
Posts: 5946
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by mrvn »

The roundabout is the most simple intersection that allows a train coming from anywhere to go everywhere. Most other intersections don't allow turning back.

There are 2 problems with the roundabout (or anything that potentially has a 270° turn) though:

1) The game is buggy and will sometimes re-path trains inside the roundabout into a 270° turn. This crosses their own way so the chain signals inside the roundabout prevent the train from moving. The player has to go there and drive the train off the roundabout manually.

2) Without chain signals inside the roundabout (which avoids the bug in 1 at the cost of throughput) this limits the length of trains because they
simply drive into them self if a re-path to a 270° turn happens.
vanatteveldt
Filter Inserter
Filter Inserter
Posts: 947
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by vanatteveldt »

In my current game I have about 20 roundabouts, used by a single train of length 1 -- no way I'm going to hike all the way to the other end of monkey island my base, AGAIN. :-D
0mega
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Mar 21, 2018 5:24 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by 0mega »

How about a 4x4 with an outer roundabout and inner cross? I use something like this. Sometimes I see train going back and forth between two roundabouts though, not sure if it has to do with design or if trains in general have trouble to get a head in navigating?
outer_roundabout.png
outer_roundabout.png (1.89 MiB) Viewed 8141 times
User avatar
hansjoachim
Filter Inserter
Filter Inserter
Posts: 252
Joined: Wed Apr 26, 2017 7:03 pm
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by hansjoachim »

All these areas prevent trains from going in opposite directions. They need to be spaced out
Attachments
intersection2.png
intersection2.png (902.2 KiB) Viewed 7930 times
Last edited by hansjoachim on Thu Mar 22, 2018 5:25 pm, edited 1 time in total.
mrvn
Smart Inserter
Smart Inserter
Posts: 5946
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by mrvn »

hansjoachim wrote:All these areas prevent trains from going in opposite directions. They need to be spaced out
The chain signals on the diagonals of the circle are also pointless. The outer circle still suffers from the game in the bug of re-pathing sometimes making a 270° turn. The game really should never re-path inside a chain signal block but they only fixed that for some uncommon cases.


The reason why you see trains going between 2 roundabouts is due to the pathing algorithm. A red signal has a higher cost than a green one so while another train is on the track the train wants to take it is often cheaper to turn around and take the longer way around through the other roundabout. Of cause by the time the train has turned around and reached the other roundabout the whole situation has changed and it might even do the same again, turn around and use the first roundabout. Could repeat forever with a train never reaching it's destination.

After watching a lot of trains drive in a congested more-or-less grid layout I'm coming to the conclusion that less is more. Don't give the path finding too many options. You want a more of a tree structure with only one clear way from point A to point B. Make the loops in your rail networks so big that taking alternative paths that much more expensive that a single train in the way doesn't instantly add detours.
dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: 4-way intersections: Throughput and deadlocks [image heavy]

Post by dood »

mrvn wrote:1) The game is buggy and will sometimes re-path trains inside the roundabout into a 270° turn. This crosses their own way so the chain signals inside the roundabout prevent the train from moving. The player has to go there and drive the train off the roundabout manually.
Really?
I suppose this could happen with this one too?

Image

I've been running dozens of trains with lengths of 8-12 wagons through this for months now and not once have I seen one path into itself.
Locked

Return to “Railway Setups”