Single rail train network

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Selvek
Fast Inserter
Fast Inserter
Posts: 238
Joined: Fri May 06, 2016 4:04 am
Contact:

Re: Single rail train network

Post by Selvek »

Ripshaft wrote:for a simple example, if you have 4 ore trains and only 3 ore offloading stations, if 3 of them are at the offloading stations and the fourth tries to get there, it's an immediate permanent roadblock once it enters the section of track leading to those offload points.... unless you compromise on design and have one way entries and exits, as well as a looped or interwoven track
Do you mean it's an immediate deadlock that will not resolve itself without manual intervention?

I would expect the 4th train would just wait at the last open bypass before the (single) track that leads to the 3 stations, since the chain signal to enter the single track would block it. The situation should resolve itself as soon as a train leaves the unloading station.

I'm envisioning:
bidirectional track > bypass (w/ chain signals at exits) > bidirectional track > 3x unloading station.

As an aside... interwoven track sounds awesome! Can you post a screenshot?

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Single rail train network

Post by mrvn »

PacifyerGrey wrote:
mrvn wrote:
PacifyerGrey wrote:I did state that at every straight segment of your system you got to have N-1 bypasses where N is a number of trains passing through this segment.
This means that for 1 bypass you can only use 2 trains. For 4 trains you got to add 3 bypasses.

Or you can add a multistop station at every end with number of stops equal to the number of trains. In this case it won't deadlock ever but trains will be mostly waiting. Adding Optera's bypasses will increase throughput.
If you have too many trains for your stations then some will stay in bypasses and block the flow. It doesn't matter how many bypasses you have they will be stuck and prevent any train from passing them. With enough bypasses they will not deadlock but will slow down the throughput to be useless. On the other hand if you never have more trains going to a station than the station can hold (including stacks aka waiting bays) then you don't need as many bypassed between stations. For 4 trains 2 bypasses are enough to prevent deadlocks. Bu if no 2 trains have the same destination then 0 bypasses is deadlock free too.

The idea of the bypass is not to buffer trains waiting to enter a station but to let trains going in opposite direction pass each other. You don't even need one bypass per pair of stations. Every couple of stations is enough. Can limit the throughput though.
You are right about the purpose of the bypass.
But you are wrong about deadlocking.
Later in the evening when I'll get to my factorio I will post an image of what I mean and you will see it work without deadlocks.
The main concept here is that all single rail fragments should be a single block and should not contain any signals at all. This will prevent trains from entering them from opposite directions forming a deadlock
Say you have a rail system like this:

Code: Select all

    A        D
    |  _B_   |
___/\_/_C_\_/\___
You have stations A and D and a bypass (marked B and C). Now 4 trains enter from the left with stations A and D as destination. The first train goes to A, then to C, then to D then to B. The second train goes to A, then C and then D. The third train goes to A and then B. The fourth train goes to A and now all four trains are deadlocked.

The problem is the same as with a 2 track system. A-C-D-B-A forms a loop with 4 blocks and you have 4 trains. Any loop with n trains needs at least n+1 blocks or it deadlocks. Adding waiting bays to A or D will add blocks to the loop and resolve the deadlock. Adding more bypasses between A and D adds more blocks and resolved the deadlock. But bypasses would still block other traffic (and allow more trains to enter the loop quickly causing a deadlock again).

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Single rail train network

Post by mrvn »

Selvek wrote:
Ripshaft wrote:for a simple example, if you have 4 ore trains and only 3 ore offloading stations, if 3 of them are at the offloading stations and the fourth tries to get there, it's an immediate permanent roadblock once it enters the section of track leading to those offload points.... unless you compromise on design and have one way entries and exits, as well as a looped or interwoven track
Do you mean it's an immediate deadlock that will not resolve itself without manual intervention?

I would expect the 4th train would just wait at the last open bypass before the (single) track that leads to the 3 stations, since the chain signal to enter the single track would block it. The situation should resolve itself as soon as a train leaves the unloading station.

I'm envisioning:
bidirectional track > bypass (w/ chain signals at exits) > bidirectional track > 3x unloading station.

As an aside... interwoven track sounds awesome! Can you post a screenshot?
Yes, it is not (yet) a deadlock. As soon as one train is empty it will leave and the traffic jam will be cleared. But now all your traffic is blocked behind the ore train and moves at the speed you unload and consume ore.

This will be painfully slow but might work for a time. Then eventually you run into the problem that your copper ore train is stuck behind an iron ore train and you don't consume any iron ore because you are waiting for more copper. Or you need more coal or water or ... You do not ever want to have to wait for a train to be unloaded so that traffic can flow again.

Selvek
Fast Inserter
Fast Inserter
Posts: 238
Joined: Fri May 06, 2016 4:04 am
Contact:

Re: Single rail train network

Post by Selvek »

mrvn wrote:
Yes, it is not (yet) a deadlock. As soon as one train is empty it will leave and the traffic jam will be cleared. But now all your traffic is blocked behind the ore train and moves at the speed you unload and consume ore.

This will be painfully slow but might work for a time. Then eventually you run into the problem that your copper ore train is stuck behind an iron ore train and you don't consume any iron ore because you are waiting for more copper. Or you need more coal or water or ... You do not ever want to have to wait for a train to be unloaded so that traffic can flow again.
I think the takeaway is that this is a problem that will occur in any rail network - not a problem unique to the 1-rail design. A well-designed 1-rail design will have all the capabilities and disadvantages of a 2-rail design (except with way less throughput of course). In a typical 2-rail network you will have a waiting bay to prevent an idle iron train from sitting on the main tracks. The same thing has to be done in a 1-rail system.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Single rail train network

Post by mrvn »

Selvek wrote:
mrvn wrote:
Yes, it is not (yet) a deadlock. As soon as one train is empty it will leave and the traffic jam will be cleared. But now all your traffic is blocked behind the ore train and moves at the speed you unload and consume ore.

This will be painfully slow but might work for a time. Then eventually you run into the problem that your copper ore train is stuck behind an iron ore train and you don't consume any iron ore because you are waiting for more copper. Or you need more coal or water or ... You do not ever want to have to wait for a train to be unloaded so that traffic can flow again.
I think the takeaway is that this is a problem that will occur in any rail network - not a problem unique to the 1-rail design. A well-designed 1-rail design will have all the capabilities and disadvantages of a 2-rail design (except with way less throughput of course). In a typical 2-rail network you will have a waiting bay to prevent an idle iron train from sitting on the main tracks. The same thing has to be done in a 1-rail system.
You can have 1-rail going in a large loop. I think that design is actually much simpler and faster than a 2-rail because there are no intersections. On the other hand going back one station means going once around the loop. You want to design your factory to move items mostly one way.

So it might be better to talk about unidirectional and bidirectional rails.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: Single rail train network

Post by vanatteveldt »

mrvn wrote:
Selvek wrote:
mrvn wrote: You can have 1-rail going in a large loop. I think that design is actually much simpler and faster than a 2-rail because there are no intersections. On the other hand going back one station means going once around the loop. You want to design your factory to move items mostly one way.
This is a cool idea, but it also means that you 'recycle' trains, i.e. instead of separate trains for outpost -> smelter, smelter -> green circuit plant, green -> red circuit plant etc., a train would make a loop where after delivering e.g. copper to the green plant, it will pick up green circuits to deliver to the red plant, etc.

Actually, this is a really cool idea :). Not sure if it's practical since the resource amounts can differ dramatically (14 stacks of plates become one stack of green circuits) and many plants will have different #s of consumers and producers, but I like the principle. Have you ever designed something like that?

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Single rail train network

Post by mrvn »

vanatteveldt wrote:
mrvn wrote:
Selvek wrote:
mrvn wrote: You can have 1-rail going in a large loop. I think that design is actually much simpler and faster than a 2-rail because there are no intersections. On the other hand going back one station means going once around the loop. You want to design your factory to move items mostly one way.
This is a cool idea, but it also means that you 'recycle' trains, i.e. instead of separate trains for outpost -> smelter, smelter -> green circuit plant, green -> red circuit plant etc., a train would make a loop where after delivering e.g. copper to the green plant, it will pick up green circuits to deliver to the red plant, etc.

Actually, this is a really cool idea :). Not sure if it's practical since the resource amounts can differ dramatically (14 stacks of plates become one stack of green circuits) and many plants will have different #s of consumers and producers, but I like the principle. Have you ever designed something like that?
No. you can have many stops branching of the loop and many trains. It just means that the ore train comes from the mine, goes to the smelter and then it has to take the big loop once around the base before it can go back to the mine. Same with the copper plate train. It picks up copper plates at the smelter, delivers them to the green plant and then takes the rest of the loop back to the copper smelter.

Point was that it is 1-rail system but there are no bypasses, no traffic jams, no deadlocks. You can argue that it is a 2-rail system with the 2 rails spread apart so the whole thing forms a big circle and you are right. You can think of it that way. It is the same as a 2-rail system where you can only change direction at the two ends.

vanatteveldt
Filter Inserter
Filter Inserter
Posts: 945
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Re: Single rail train network

Post by vanatteveldt »

mrvn wrote: No. you can have many stops branching of the loop and many trains. It just means that the ore train comes from the mine, goes to the smelter and then it has to take the big loop once around the base before it can go back to the mine. Same with the copper plate train. It picks up copper plates at the smelter, delivers them to the green plant and then takes the rest of the loop back to the copper smelter.

Point was that it is 1-rail system but there are no bypasses, no traffic jams, no deadlocks. You can argue that it is a 2-rail system with the 2 rails spread apart so the whole thing forms a big circle and you are right. You can think of it that way. It is the same as a 2-rail system where you can only change direction at the two ends.
Which is way less cool :). Why not have the train do something useful if it is going around the loop anyway? You could put every station on the loop in each schedule, and disable/enable stations as resources are requested and available....

Greybeard_LXI
Fast Inserter
Fast Inserter
Posts: 122
Joined: Sun Feb 26, 2017 10:48 pm
Contact:

Re: Single rail train network

Post by Greybeard_LXI »

vanatteveldt wrote:
Which is way less cool :). Why not have the train do something useful if it is going around the loop anyway? You could put every station on the loop in each schedule, and disable/enable stations as resources are requested and available....
Wow. That sounds like lots of fun when you add a station.

Selvek
Fast Inserter
Fast Inserter
Posts: 238
Joined: Fri May 06, 2016 4:04 am
Contact:

Re: Single rail train network

Post by Selvek »

mrvn wrote:
Point was that it is 1-rail system but there are no bypasses, no traffic jams, no deadlocks. You can argue that it is a 2-rail system with the 2 rails spread apart so the whole thing forms a big circle and you are right. You can think of it that way. It is the same as a 2-rail system where you can only change direction at the two ends.
Ooh I actually like this idea a lot.

From a practical standpoint, congestion is never a problem in the outer reaches near the mines - the real question in any system is how efficiently you can get trains in and out of the dense stations around your main factory. With this system, trains will always enter (say, the ore dropoff station) from one direction and leave from the other, without crossing. Sure, many of them will take extreme detours, but transit time of the trains isn't really much of an issue since they are so fast compared to typical outpost distances, and you can just add more trains if it's an issue... I may have to give this a try!

You can also use "nested" loops so that most trains can get back to the station without going around the entire outermost loop - I expect a network like this would naturally grow in that way regardless. You still wouldn't have any crossings.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Single rail train network

Post by mrvn »

Selvek wrote:
mrvn wrote:
Point was that it is 1-rail system but there are no bypasses, no traffic jams, no deadlocks. You can argue that it is a 2-rail system with the 2 rails spread apart so the whole thing forms a big circle and you are right. You can think of it that way. It is the same as a 2-rail system where you can only change direction at the two ends.
Ooh I actually like this idea a lot.

From a practical standpoint, congestion is never a problem in the outer reaches near the mines - the real question in any system is how efficiently you can get trains in and out of the dense stations around your main factory. With this system, trains will always enter (say, the ore dropoff station) from one direction and leave from the other, without crossing. Sure, many of them will take extreme detours, but transit time of the trains isn't really much of an issue since they are so fast compared to typical outpost distances, and you can just add more trains if it's an issue... I may have to give this a try!

You can also use "nested" loops so that most trains can get back to the station without going around the entire outermost loop - I expect a network like this would naturally grow in that way regardless. You still wouldn't have any crossings.
Problem with grow is that you start putting down your first mine and smelter and basic assemblers. They will be in the center. Then outward you add more complex stuff. Later you add new mines much much farther away. Now the ore trains have to go from the far outside to the very center. BAD. So no, I don't think networks grow like this naturally. You have to purposefully design them that way and move e.g. the smelter to the outside as you grow.

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: Single rail train network

Post by Hannu »

I use often one track bidirectional routes and run hundreds of hours without deadlocks. I do not recommend it for maximum throughput megabases and there are no practical reasons to do it, because rails and laying them by bots are practically free, but it works well in normal bases and rail worlds and gives nice realistic like railway system instead of Factorio-optimal superfast cargo tram system which I think is too childish.

When your base expands so that you notice congestion you just build second rail to existing bidirectional routes and make new bidirectional single lines for new far outposts. Very much what have been the history of real train systems in many countries. You need just to know couple of things. You should signal every transition between single and double track line with normal and chain signal like it was in picture. And if you branch single line with a triangle you should put 6 chain signals like this:

Code: Select all

             c
 -----------------------------
        \    c   /
         \      /
         c\c  c/c
           \  /
            \/ 
             |
             |
             |
And of course you should not put too much trains. I prefer slow long trains, like 2-8. It gives more feeling of trains than fast very short trains. Mods which increases cargo wagon capacity are also practical.

Post Reply

Return to “Gameplay Help”