Stations, Junctions, and all things deadlock - 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.
garath
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 13, 2016 2:11 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by garath »

This weekend, I built my first rail section with more then one train. Initially, I tried two-headed trains. It was insanely complicated. I tried and tried and tried but could never figure it out. I only had two stops at my main base and two mining outposts with a bit of shared track. I kept running out of resources due to deadlock. I could never figure out how to do the rail signals, and I spent HOURS trying to make it work. Then, I threw in the towel and added a second track the entire distance, converted my trains to one-way only and made the whole thing a loop. Loops are EASY. It took me all of half a second to make the system work. Then, I added a second train to a couple of the outposts and a third and fourth train for one particular resource (oil) that was rich enough to support either multiple trains or a single very long train. I had been cautioned in advance about some of the problems associated with too long trains. Thus, I kept my longest train at only one locomotive and two cargo cars.

I cannot tell you how much more fun I'm having now that I've figured out trains. It is too awesome watching one or two trains waiting to leave from their unloading bays while another train is on its way out. It is also too cool to see 3-4 trains happily waiting to unload their resources (oil using the rail tanker).

I just cannot begin to imagine how you would do this with two headed trains. Adding a second or third or fourth or fifth (etc) train stop using a loop is trivially simple. I think if I tried to figure out the insanity that is dual headed that I would put the game down forever.
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

I assume by "dual-headed" you're talking about trains that can drive in both directions (that's actually not what "dual headed means", by the way).

I don't think it's harder to have two-way operation compared to one-way (with turn-arounds). Your problem was figuring out the basics (signals and stuff) which is not easy, but when you have that sorted out both approaches are of the same complexity.

Are you using one rail (for both directions) or two rails (one for each direction)? It sounds as if you started with a single railway layout, and that really doesn't work at all beyond anything but the simplest cases.

You need to lay rails in both directions (two tracks) everywhere, and build proper junctions (rotaries are easy). If you use rotaries you don't even have to do dedicated turnarounds, because your trains can always turn at a rotary junction if that's needed. Only the end points of a track need a rotary that is only used for turning. That also makes Ro-Ro stations (inline stations) very easy.

The FARL mod is pretty much mandatory or else laying the tracks gets too time consuming and tedious.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
garath
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 13, 2016 2:11 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by garath »

Hmm... LOL. I guess I assumed putting a locomotive on each end implied using mainly a single track everywhere. I started with just a single track going both ways but then tried to add a couple of areas off to the side every about every 100 track so a train would have someplace to go if the main track were blocked. I guess I didn't consider that a locomotive on each end setup would require dual rails the whole way. :-)

For me, I had thought the main reason to use two locomotives, one on each end, was so you only needed to lay a single track doing both directions. In other words, if you were planning to lay two parallel tracks, then I assumed that directly inferred a loop system. I never even considered you might use two tracks the whole way with both lanes allowing traffic in both directions.

Setting up the two parallel tracks, I drove on the right. For me, the signal setup was easy because I could test by putting a pair of trains on the track going just one way and see what happened. Looking ahead to trying to use again trains with locomotives on both ends, testing seems harder because you have to account for trains coming both directions.

Learning is fun. Thank you for the post and making me think!
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

Laying two tracks does not mean you run trains in both directions on both tracks!

The whole point of having two tracks is that one train can run in each direction on the same line. One track is for each direction; so you never have the situation that trains are running into eachother on the same rail (it can still happen on crossings, though, that's why proper signaling is very important at crossings).

If you allow both driving directions on a single rail, then you have severe capacity problems because only one train can be on a segment of rail at the same time. You "fixed" that problem by adding waiting bays to the side of the rails, so the trains would have a way to avoid eachother.

The real fix, however, is to have all rails go one way only. What you also need to do is put rail signals at intervals (along the road, so to speak), so that more than one train can be on that stretch of rail (you divide the line into several segments). For example, you want to allow several trains to be behind eachother on any longer stretch of railway.

Then again the question if you use trains that can go both ways (dual locomotives) or not: this mainly affects how you build your stations. If you want to have "terminus stations", you need to have trains that can drive in both directions. If you only have trains that go forward, then you can't have terminus stations at all.

This has nothing to do with "loops". Every non-trivial railroad has loops (those might be very big loops that are not obvious), it has nothing to do with how your trains are set up.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
garath
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 13, 2016 2:11 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by garath »

Thank you very much! I appreciate your patience in explaining this to me! Much appreciated!
Antaios
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sun Jun 14, 2015 5:18 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by Antaios »

Glad you sorted out your rail troubles garath, and thanks siggboy for explaining.

But there is one part of your advice where I'd advise caution:
siggboy wrote: If you use rotaries you don't even have to do dedicated turnarounds, because your trains can always turn at a rotary junction if that's needed. Only the end points of a track need a rotary that is only used for turning. That also makes Ro-Ro stations (inline stations) very easy.
I warn about this setup in the guide:
Antaios wrote: We could also look at it this way:
Because the siding makes trains want to turn around to exit and to enter the station, we can expand our view of the station to include the rotaries on either side:
Image
and we see the problem, trains entering the station can block trains that are exiting the station.
This full station view shows us that the station, as a bi-directional station, is not 'ideal'.
And so, a train entering the station stacks up with another train, and the train leaving can't exit.
just be careful and make sure there are more blocks between your rotaries than there are trains running on the rail lines where your stations are.

I recommend dedicated turn-arounds, they are much much safer because they can be signalled to prevent enter/exit lockup.
siggboy wrote: The FARL mod is pretty much mandatory or else laying the tracks gets too time consuming and tedious.
I've never used FARL and have had many large rail networks. personal roboport is your friend ;)
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

I've never used FARL and have had many large rail networks. personal roboport is your friend ;)
Yeah, that's what I file under "extremely tedious and unfun gameplay" :).
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
garath
Fast Inserter
Fast Inserter
Posts: 154
Joined: Wed Apr 13, 2016 2:11 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by garath »

Just started a new game using RSO and bumped all the biter settings up a notch from the default. The biter bases are bigger and more frequent. FARL will be quite quite helpful clearing the forest between my starting area iron deposit and the closest one I'll have to reach using trains.

Do you know if FARL can lay two parallel track at once?
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

garath wrote:Just started a new game using RSO and bumped all the biter settings up a notch from the default. The biter bases are bigger and more frequent. FARL will be quite quite helpful clearing the forest between my starting area iron deposit and the closest one I'll have to reach using trains.

Do you know if FARL can lay two parallel track at once?
Yes, you can lay any track layout with FARL. You have to provide a blueprint and have the mod read it. The mod can provide you with default blueprints that you then have to modify. It's probably best if you go to the forum section for the mod and read the documentation there; actually pretty easy after you've done it once.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
DraculBloodaxe
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Mar 24, 2015 10:48 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by DraculBloodaxe »

Great thread! And it is good that they wanted to make this more visible by making it a sticky. But wouldn't it be better to have a more general train thread in which we reference this thread and others?

If I wasn't on my phone right now I might have created it. For now, I'm hoping someone else will as it will be a while before I'm at my computer
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

DraculBloodaxe wrote:Great thread! And it is good that they wanted to make this more visible by making it a sticky. But wouldn't it be better to have a more general train thread in which we reference this thread and others?
There will probably be a dedicated forum soon for train discussions (and another forum for combinator related topics).

Trains are discussed a lot, just one thread would not be enough :).
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
aober93
Filter Inserter
Filter Inserter
Posts: 453
Joined: Tue Aug 30, 2016 9:07 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by aober93 »

What i just recently have overcome is the situation of too narrow junctions and rails. This is also seen on the first image of this thread. Signals cannot be placed between the 2 lanes in junctions and thus they become a single block, and a train on one lane blocks the train on the other lane. My dual lane rail is now 6 units or 3 rails apart, whereas before it was 4 units. This allows placing signals inbetween at junctions. Side effect is ,that junctions have a higher capacity because its less blocked.
User avatar
tzwaan
Inserter
Inserter
Posts: 42
Joined: Thu Jul 07, 2016 12:12 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by tzwaan »

I've always used 6 units between the rails, and never really understood why people used 4 for exactly the reasons you mentioned.
It's not like it really matters space-wise, since most rail is just in the middle of nowhere.

A nice added bonus is that you can actually easily place stuff around your powerpoles like turrets and lights, where before you were limited by space. (you are now limited by the range of your poles)
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

aober93 wrote:Signals cannot be placed between the 2 lanes in junctions and thus they become a single block
You can build all junctions just fine with 4 tiles in between lanes (with proper signaling, that is). It's not necessary to leave 6 tiles of space.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
wallE
Burner Inserter
Burner Inserter
Posts: 19
Joined: Fri Aug 12, 2016 3:15 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by wallE »

Funny thing i had the other day.
I use rotary junctions a lot - easy to build and allows trains to switch directions ( useful if you drive around manually!).
My normal train setup is 1 engine with 4 wagons.

What happend once and ONLY ONCE!: One train entered a roundabout coming from west with the intended direction south BUT did NOT leave immediately! Instead it wanted to go all round the rotary junction and DEADLOCKED itself.

I have no idea why this train did not just turn right (west to south) but wanted to follow the whole loop but it blocked my main supply lane and i was distracted killing biters for a long time. You can imagine what happend to my production ...
User avatar
Sephrat
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Mar 16, 2016 2:39 pm
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by Sephrat »

wallE wrote:Funny thing i had the other day.
I use rotary junctions a lot - easy to build and allows trains to switch directions ( useful if you drive around manually!).
My normal train setup is 1 engine with 4 wagons.

What happend once and ONLY ONCE!: One train entered a roundabout coming from west with the intended direction south BUT did NOT leave immediately! Instead it wanted to go all round the rotary junction and DEADLOCKED itself.

I have no idea why this train did not just turn right (west to south) but wanted to follow the whole loop but it blocked my main supply lane and i was distracted killing biters for a long time. You can imagine what happend to my production ...
This is a known issue that should be addressed in 0.15:
viewtopic.php?f=173&t=26409
viewtopic.php?f=173&t=19619

Long story short: your train changed direction (it initially hadn't planned to go south) and decided to go south while in the roundabout, causing the deadlock. Expected behavior: the train shouldn't repath in between chain signals.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by Optera »

Sephrat wrote: Long story short: your train changed direction (it initially hadn't planned to go south) and decided to go south while in the roundabout, causing the deadlock. Expected behavior: the train shouldn't repath in between chain signals.
trains have to repath waiting at chain signals otherwise having multiple track stations or stacker will not work.
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

Optera wrote:
Sephrat wrote: Long story short: your train changed direction (it initially hadn't planned to go south) and decided to go south while in the roundabout, causing the deadlock. Expected behavior: the train shouldn't repath in between chain signals.
trains have to repath waiting at chain signals otherwise having multiple track stations or stacker will not work.
I don't see how this relates to stackers, because in a stacker the train will always wait in front of the chain signal and then occasionally check if there is a new path behind the chain signal.

The train will never leave the stacker and then reconsider.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by Optera »

siggboy wrote:
Optera wrote:
Sephrat wrote: Long story short: your train changed direction (it initially hadn't planned to go south) and decided to go south while in the roundabout, causing the deadlock. Expected behavior: the train shouldn't repath in between chain signals.
trains have to repath waiting at chain signals otherwise having multiple track stations or stacker will not work.
I don't see how this relates to stackers, because in a stacker the train will always wait in front of the chain signal and then occasionally check if there is a new path behind the chain signal.

The train will never leave the stacker and then reconsider.
Chain signal should be used before switches of stackers or stations so trains don't block switches and in case of multi track stations/stacker can pick the next free track if all are currently taken.
User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Stations, Junctions, and all things deadlock - IMAGE HEAVY

Post by siggboy »

Optera wrote:Chain signal should be used before switches of stackers or stations so trains don't block switches and in case of multi track stations/stacker can pick the next free track if all are currently taken.
Yes, but I don't see how this is related to the case where the train recalculates its path AFTER it has passed the chain signal (that which is at the very front of the stacker in this case).
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick
Post Reply

Return to “Railway Setups”