How can you avoid gridlocks at a train circle?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Glyph
Inserter
Inserter
Posts: 34
Joined: Sat Jul 26, 2014 5:40 pm
Contact:

How can you avoid gridlocks at a train circle?

Post by Glyph »

Or, more correctly, how can you avoid gridlocks at a train circle and allow more than one train to use the circle at a time?

See this image for my train circle:
Image

If the circle only has signals at the inputs/outputs, then there wouldn't be a problem: trains would queue up to use the circle and no more than one train would ever enter the circle. Restricting it that way doesn't allow two trains to pass each other at the same time, however, and will limit throughput in other ways. Adding four additional signals, as in the image, splits the circle into four semi-circles. Unfortunately, if four trains enter the circle near the same time, they can cause a gridlock situation. In fact, allowing any more than one train into the circle seems to allow a gridlock situation as far as I can tell.

Is there something that can be done to fix the gridlock scenario? Maybe different signal placements, or maybe adding some extra tracks? I'd prefer the circle to not get larger than it already is.

User avatar
-root
Filter Inserter
Filter Inserter
Posts: 651
Joined: Tue Jul 01, 2014 11:24 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by -root »

Speaking from experience in Transport Tycoon (and zero in Factorio with trains), nope no way of avoiding it. Can only have one train in the loop at a time...

The only other way to do it would be to route individual lines to each direction and then signal them up.

That is, don't send the trains to the one point to switch their track. Break it up. Give the train an earlier option to go left, a middle option to go right and a late option to go straight.

User avatar
Calico
Fast Inserter
Fast Inserter
Posts: 130
Joined: Sat Feb 08, 2014 6:23 am
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by Calico »

ah, the good ol' classic Roundabout. Works for loads of Trains... unfortunatly only in OTTD where we have pathsignals (and likely better code for the pathfinding).

I was thinking about enlarging it, but after some thought i dont see a way to do it without pre-signals or pathsignals.

jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by jeroon »

Last thing I tried were 3 way junctions instead of 4 way, where the right-hand-turn gets an extra 'lane', so they skip the junction altoghether. I haven't really tested it, because the jams just moved further down the line, but it might be worth a try :)

(I will post a screenshot of it later.)

User avatar
micomico
Long Handed Inserter
Long Handed Inserter
Posts: 94
Joined: Thu Jul 24, 2014 10:55 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by micomico »

Having played a lot of OTTD, when I found Factorio and with its trains and signals, I tried doing a lot of "standard builds" from OTTD. I quickly found that the train path-finding in Factorio is very limited compared to OTTD.

The path-finding from Factorio seems to me just a "find me a clear route between A and B". "A bazillion signals in that path? Three stations to go through and a 30min estimated time to destination? Seems like a wonderful route." - says the train - "Give me anything that doesn't involve waiting 5 seconds at the current red signal in the shortest, fastest (some would call it correct) route."

I've simply given up and started building the most possible independent, non-crossing rails ever. Junctions are made only when there's little to no chance the trains will jam up, because they will if they can.

At this point, I would just like to able to set some waypoints that would force the train to go through a certain track.

I'm aware that Factorio is not OTTD. OTTD must spend its sweet time calculating paths, because it's what it does, not minding several thousand items and bots running around in your factory. I would like at least some sense in the path-finding and not having trains go around the world to go to the station next door.

User avatar
DerivePi
Filter Inserter
Filter Inserter
Posts: 505
Joined: Thu May 29, 2014 4:51 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by DerivePi »

if you make the circle big enough for a full train between signals at each intersection, then there shouldn't be any jambs. Could also consider using 2 circles (shown).
Attachments
RRJUNCTION.jpg
RRJUNCTION.jpg (57.63 KiB) Viewed 9704 times

Mangledpork
Fast Inserter
Fast Inserter
Posts: 129
Joined: Fri Jul 25, 2014 7:03 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by Mangledpork »

Maybe just put bypasses on the most used part(s) of the circle?

Glyph
Inserter
Inserter
Posts: 34
Joined: Sat Jul 26, 2014 5:40 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by Glyph »

-root wrote:Speaking from experience in Transport Tycoon (and zero in Factorio with trains), nope no way of avoiding it. Can only have one train in the loop at a time...

The only other way to do it would be to route individual lines to each direction and then signal them up.

That is, don't send the trains to the one point to switch their track. Break it up. Give the train an earlier option to go left, a middle option to go right and a late option to go straight.
Because this introduces so many intersections at a 4-way junction, I can't wrap my mind around how to avoid gridlocks even with individual routes. Maybe I'm overthinking.
Calico wrote:I was thinking about enlarging it, but after some thought i dont see a way to do it without pre-signals or pathsignals.
micomico wrote:I've simply given up and started building the most possible independent, non-crossing rails ever. Junctions are made only when there's little to no chance the trains will jam up, because they will if they can.
I looked up OTTD pathsignals, seems pretty neat. I wouldn't expect something like that for Factorio, though. I think we'll have to wade through the mess and find solutions that work with the limited tools we have. I agree with making independent and non-crossing rails. I've also found another rule: if a track can be used in both directions, it will jam unless only one train could ever use it by having a turnaround without rail signals, and at least one entrance and at least one exit that goes to a dedicated one-way rail track.
DerivePi wrote:if you make the circle big enough for a full train between signals at each intersection, then there shouldn't be any jambs. Could also consider using 2 circles (shown).
That is pretty awesome. I gave up on keeping the circle small, so maybe this will be a solution. I tried to figure out a situation in which this junction could be jammed, but I wasn't able to. You introduce another good rule for preventing jams, too: never let a train be larger than any block it enters.

Inspired by your responses, I'm going to try some more designs now.

jeroon
Filter Inserter
Filter Inserter
Posts: 351
Joined: Sun Jan 26, 2014 10:18 am
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by jeroon »

my 3 way setup with express-right-hand-turn-lanes, trying to minimize rails crossing.
A bit further down the line I've made the same, but mirrored, for the rails coming in from the south.

Image

starxplor
Fast Inserter
Fast Inserter
Posts: 164
Joined: Sun May 18, 2014 11:25 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by starxplor »

I have been wondering, in that center criss-cross section, does the signal on the horizontal line block trains from entering the criss-cross if a train is on one of the turning tracks? Since it is not a connected segment, is there any way the signal would know about trains in the criss-cross?

Glyph
Inserter
Inserter
Posts: 34
Joined: Sat Jul 26, 2014 5:40 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by Glyph »

starxplor wrote:I have been wondering, in that center criss-cross section, does the signal on the horizontal line block trains from entering the criss-cross if a train is on one of the turning tracks? Since it is not a connected segment, is there any way the signal would know about trains in the criss-cross?
The train blocks connect everything that touches, I think. So crossings are all part of the same block.

User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

Re: How can you avoid gridlocks at a train circle?

Post by SHiRKiT »

Thanks for the designs and ideas, they've helped me out on my game!

Post Reply

Return to “Gameplay Help”