Train Signals - Correct Way to Set Bi-directional Bypasses

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
msgerard
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Mar 06, 2021 6:50 pm
Contact:

Train Signals - Correct Way to Set Bi-directional Bypasses

Post by msgerard »

I have created a rail track with multiple load and unload stops, and placed the train signals correctly so they will go to open/unoccupied load and unload destinations. However, trains will occasionally collide. The load stops have the same names, i.e. 'Oil Source' and the unload stops have the same name, i.e. 'Oil Home'. The track is bi-directional, not looped.

The collision happens at a fork between two load stops. I have placed two signals (bi-directional) after the fork for both paths - so a total of 4 signals. I have observed the trains running correctly for a while, heading to the open load stop where it is not currently occupied. However, for some reason, after a while a train will enter a occupied forked path although the signal heading into that stop is red and the signal for the other path is green.

I believe that this a bug and makes it difficult for me to utilize having a main track branching into multiple loads/stops. This setup is intended to maximize my oil production by having multiple trains going to unoccupied stops.
Last edited by msgerard on Sun Mar 07, 2021 6:05 pm, edited 1 time in total.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2240
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Train Signal Bug

Post by boskid »

You need to provide more details: at least game version, save file with your rails setup or screenshots. Save file with description is the preferred way.

MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 260
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Train Signal Bug

Post by MassiveDynamic »

99.9999999999999999999% chance that you’re doing something wrong. Post a screenshot if you dare.

msgerard
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Mar 06, 2021 6:50 pm
Contact:

Re: Train Signal Bug

Post by msgerard »

This was my first time using this forum and I did not know sending my save file was possible. I have attached the file I've been trying to test in getting multiple trains to work bi-directionally with a forked path but have not been successful with not having them collide or deadlocking.

In the save file, you'll see I've set up a track with stops named 'Test1' and 'Test2'. What do I need to do set up train signals to have it work every time? I've played around with different placements of the signals and tried the setup from the basic rail signal tutorial with signals on the other-side as well for trains to go bi-directionally. At first, I thought it may be a timing issue with two trains approaching the signal, but once a signal turns yellow shouldn't that halt the other train from occupying the section? My attempts with using the '(recipe)' signal type to look at the next signal(s) was also unsuccessful.

I've also attached a screenshot - the top train is heading down and did not take the turnout although the signal there is green. Placing signals in the turnout was not shown in the basic tutorial, but without signals there, the train does not stop when there is another train heading in the opposite direction along the main track.

If this is not a bug issue and due my error, then I apologize in advance for my erroneous assumption. I followed signal placement from the basic tutorial and it was causing collisions - leading me to think it is a bug issue.

Thanks! I immensely enjoy this game and would love to get the trains to work as intended so I can expand my resource gathering - which I never seem to have enough of!
Attachments
TrainIssue.JPG
TrainIssue.JPG (135.93 KiB) Viewed 5822 times
TrainTest.zip
(14.89 MiB) Downloaded 91 times

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Train Signal Bug

Post by disentius »

One track two-way signaling is tricky :)
you have to keep the shared portions of the track free at all times. one way to do this is using bypasses, like you did, and make each branch one-way, by dsetting a chain signal at the exit, and a normal signal at the entrance.
This is exactly the opposite to the normal rule of thumb of "Chain in, Normal out"

I have signaled the test track in your zip to (what I believe) is a correct way of signalling this.
2021-03-07 12_33_28-Window.png
2021-03-07 12_33_28-Window.png (473.6 KiB) Viewed 5805 times
Attachments
TrainTest.zip
(15.17 MiB) Downloaded 89 times

MassiveDynamic
Filter Inserter
Filter Inserter
Posts: 260
Joined: Sun Sep 16, 2018 10:44 pm
Contact:

Re: Train Signal Bug

Post by MassiveDynamic »

Try this short tutorial

https://youtu.be/ASES70Zlivw

msgerard
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sat Mar 06, 2021 6:50 pm
Contact:

Re: Train Signal Bug

Post by msgerard »

Thank you both for your help! I thought I could make my bypasses bi-directional. So, for every bypass I need to set them on both sides heading in a single direction. This solution works and it looks like I have to shoot down some more trees :D

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by disentius »

You're welcome :D
You can make your bypasses bidirectional, but that doesn't increase troughput, so it's a waste of signals.
This is how:
2021-03-08 13_28_36-Factorio 1.1.26.png
2021-03-08 13_28_36-Factorio 1.1.26.png (915.28 KiB) Viewed 5683 times

User avatar
bormand
Fast Inserter
Fast Inserter
Posts: 201
Joined: Fri Jun 05, 2020 9:59 am
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by bormand »

disentius wrote:
Mon Mar 08, 2021 12:31 pm
You can make your bypasses bidirectional, but that doesn't increase troughput, so it's a waste of signals.
Not only a waste of signals, but a potential cause for (rare) deadlocks.

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by disentius »

bormand wrote:
Mon Mar 08, 2021 12:44 pm
Not only a waste of signals, but a potential cause for (rare) deadlocks.
Intertesting!
In which situation would it deadlock? Aside from having to many trains on the line for them to have a free spot to move to.

User avatar
bormand
Fast Inserter
Fast Inserter
Posts: 201
Joined: Fri Jun 05, 2020 9:59 am
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by bormand »

disentius wrote:
Tue Mar 09, 2021 9:51 am
In which situation would it deadlock?
Something like that:
Screenshot from 2021-03-09 17-35-31.png
Screenshot from 2021-03-09 17-35-31.png (4.27 KiB) Viewed 5610 times
Your previous design is immune to such deadlocks: it never allows two trains to occupy both bypass lanes in the same direction.

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by disentius »

yes, offcourse. Thanks!

SoShootMe
Filter Inserter
Filter Inserter
Posts: 475
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by SoShootMe »

bormand wrote:
Mon Mar 08, 2021 12:44 pm
disentius wrote:
Mon Mar 08, 2021 12:31 pm
You can make your bypasses bidirectional, but that doesn't increase troughput, so it's a waste of signals.
Not only a waste of signals, but a potential cause for (rare) deadlocks.
Yes, and ironically, I think it potentially does increase throughput for the same reason as it can cause deadlock, ie allowing two trains heading the same way to wait at the bypass while they cannot proceed due to train(s) on the other side, instead of forcing one to wait further away until the other clears the bypass.

You can get the best of both worlds by making a unidirectional bypass long enough to allow two trains to wait in each side and adding a rail signal to each side.

Mind you, if throughput is a concern it is probably time to keep extending that bypass until you have something more like a twin track network :).

User avatar
bormand
Fast Inserter
Fast Inserter
Posts: 201
Joined: Fri Jun 05, 2020 9:59 am
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by bormand »

SoShootMe wrote:
Tue Mar 09, 2021 7:38 pm
making a unidirectional bypass long enough to allow two trains to wait in each side
It's better to add another bypass in the middle of bidirectional track than gathering trains at the ends, I think. You may get almost 2x throughput from that.

SoShootMe
Filter Inserter
Filter Inserter
Posts: 475
Joined: Mon Aug 03, 2020 4:16 pm
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by SoShootMe »

bormand wrote:
Tue Mar 09, 2021 8:12 pm
SoShootMe wrote:
Tue Mar 09, 2021 7:38 pm
making a unidirectional bypass long enough to allow two trains to wait in each side
It's better to add another bypass in the middle of bidirectional track than gathering trains at the ends, I think. You may get almost 2x throughput from that.
For a stretch of single track (assume many train lengths), I think adding "short" (one train length) passing places evenly distributed along its length is optimal for throughput, with more places directly increasing the capacity as well as improving throughput. If you start with one in the middle, replacing it with one at 1/3 and another 2/3 would give the same capacity but better throughput than the single "long" (two train lengths) loop I suggested.

What I suggested is like two "short" loops next to each other, except without any bidirectional track between them. It's also like two loops that are not evenly distributed, which is obviously not optimal per what I wrote above, but it still increases capacity and I think therefore achievable throughput compared to a single "short" loop.

However, I think this is all academic, as per the final point in my previous post: if throughput is a concern, it is probably time to build a twin track network.

gGeorg
Filter Inserter
Filter Inserter
Posts: 392
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Train Signals - Correct Way to Set Bi-directional Bypasses

Post by gGeorg »

bormand wrote:
Tue Mar 09, 2021 10:41 am
disentius wrote:
Tue Mar 09, 2021 9:51 am
In which situation would it deadlock?
Something like that:

Screenshot from 2021-03-09 17-35-31.png

Your previous design is immune to such deadlocks: it never allows two trains to occupy both bypass lanes in the same direction.
as OP requests, bi-directional is side tracks. It means, make the main track one way only and side track plus single track in between two way. No deadlock, and potentialy higher throughput.

Anyway iidea of 3 tracks will be fun to watch. Especially when use different lenght of trains so they tend to use middle track to overcome the slower trains. :P

Post Reply

Return to “Gameplay Help”