Train station design questions: waiting bay

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
vanatteveldt
Filter Inserter
Filter Inserter
Posts: 946
Joined: Wed Nov 25, 2015 11:44 am
Contact:

Train station design questions: waiting bay

Post by vanatteveldt »

I am trying to improve throughput on my iron ore station, which has to process 40k ore per minute using 5 unloading stations, each unloading to 4 express belts.

All trains come from the bottom (driving on the left), pass a waiting bay area with chain signals at the end, turn around through a single 'bottleneck' at the top, and go down to the unloading stations. All unloading stations have the same name.

The tracks are long enough to put two (unidirectional LCCCL) trains on each side, i.e. double waiting bays and a dedicated waiting bay before each stop.

With a single unloading stop this went really well, but with 5 stops the trains choose a stop to unload too early, causing 6 trains to wait for stop 1 while the dedicated bays in front on stops 2-5 are all empty.

I thought I could resolve it by placing a 'transit' station in the bottleneck, but this doesn't solve the problem.
without station
with station
In the last screenshot I've placed dots on the signals, green=normal, red=chain. You can see the train that went to the transit has chosen bay 4 and is now blocking the bottleneck, even though the waiting bays before stops 2,3, and 5 are empty.

Is there a way to have multiple stations, dedicated waiting bays, and multiple double waiting bays work together?

User avatar
Sephrat
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Mar 16, 2016 2:39 pm
Contact:

Re: Train station design questions: waiting bay

Post by Sephrat »

I had a similar issue that I exposed in this topic.
I assume the initial problem is that all unloading stations were occupied at some point. Some emptied over time, but not the one this train had decided to go to. And it won't repath because trains only repath when passing a signal.
A slight enhancement you could do to your setup is to put a chain signal at the end of every waiting bay you have on the left, so that no trains may stop in the bottleneck you have at the top. It still won't solve 100% of your issue (if all trains have decided to go to the same station that is occupied, they won't try to go to the other ones that may not be occupied anymore), but at least no trains will be blocked by a stupid train blocked in the bottleneck.

My reply to another topic and the following discussion may also interest you.

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

Re: Train station design questions: waiting bay

Post by vanatteveldt »

Thanks for the links, I'll have a look :)

Without the station (so the top picture) the problem is not that stations are left empty, but that in most cases the waiting bays before the stations are not used. The trains do seem to repath when a station becomes empty, or maybe I just have enough trains to make the chance high that each station is picked at least once...

23johnw
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Oct 08, 2016 5:35 pm
Contact:

Re: Train station design questions: waiting bay

Post by 23johnw »

I think whats happening is You need chain signals from the waiting bay to just one normal signal behind the station (far enough away from the station to allow your train to sit with out blocking other paths), because of the 2 normal signal behind the station there acting like waiting bays, so your waiting bays are for waiting bays, it's my understanding that way when it stops at a chain signal it will then rescan for a free station, otherwise it will wait at a chain signal for the next light to go green which then only has one option of station to stop at.

c0bRa
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Sun Nov 13, 2016 8:33 pm
Contact:

Re: Train station design questions: waiting bay

Post by c0bRa »

Do the upper normal Signals to Chain signals and the normal Signals to the first free spot when a train is in and it should work, Maybe even without Pre-Station...

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1490
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Train station design questions: waiting bay

Post by MeduSalem »

I'd say that it might also be a problem trying to force 9 waiting bays to go through a one-track bottleneck to go to the 5 unloading bays.

Maybe the throughput could also be increased with some kind of 2-track crossbar instead of a single-track bottleneck, something like so:
train crossbar.jpg
train crossbar.jpg (177.76 KiB) Viewed 15980 times
That way 2 trains might enter the unloading area at the same time, with the worst case being that only one can do so. Might be a 3-tile gap necessary between the 2 tracks though to squeeze in the necessary signals in the crossing.

I'm sure the design can also be squeezed a little bit more together.

Thinking of it... someone should start a "train balancer" thread... analogous to the "belt balancer" threads.
Sephrat wrote:I assume the initial problem is that all unloading stations were occupied at some point. Some emptied over time, but not the one this train had decided to go to. And it won't repath because trains only repath when passing a signal.
I never got the entire re-pathing thing... So how does it work?

After every signal the trains look if the path they want to go down is still free and if not they try another one?

Does that include picking another train station too, given it has the same name and is free?

Mehve
Filter Inserter
Filter Inserter
Posts: 318
Joined: Sat Aug 06, 2016 9:12 pm
Contact:

Re: Train station design questions: waiting bay

Post by Mehve »

I'm pretty sure the "Create an artificial chain signal using the circuit network" method relies on that being true.

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

Re: Train station design questions: waiting bay

Post by vanatteveldt »

Mehve wrote:I'm pretty sure the "Create an artificial chain signal using the circuit network" method relies on that being true.
How does that work? Searching on artificial chain signal doesn't work, do you have a link?

Thanks!

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1490
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Train station design questions: waiting bay

Post by MeduSalem »

vanatteveldt wrote:
Mehve wrote:I'm pretty sure the "Create an artificial chain signal using the circuit network" method relies on that being true.
How does that work? Searching on artificial chain signal doesn't work, do you have a link?

Thanks!
... I thought changing signals artificially didn't work out too well? Has there been improvement on that part?

I would like to know as well then.

User avatar
Sephrat
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Mar 16, 2016 2:39 pm
Contact:

Re: Train station design questions: waiting bay

Post by Sephrat »

MeduSalem wrote:I never got the entire re-pathing thing... So how does it work?

After every signal the trains look if the path they want to go down is still free and if not they try another one?

Does that include picking another train station too, given it has the same name and is free?
I didn't do any thorough search so I cannot answer specific questions, but what I've learned here from Deadly Bagel helped me a lot in understanding the way trains work in this game.
Basically the pathing algorithm is triggered everytime a train passes a signal. Also, the "cost" of a path is determined by the number of signals on that path. After that, I'm a bit lost as to how trains behave when there are other trains on the path ; I don't know when a train will go through an alternative route if other trains are stuck on the main path.
vanatteveldt wrote:
Mehve wrote:I'm pretty sure the "Create an artificial chain signal using the circuit network" method relies on that being true.
How does that work? Searching on artificial chain signal doesn't work, do you have a link?

Thanks!
In the same topic I linked a few lines above, Deadly Bagel refers to them as "faux chain signal". The idea is to "code" your own chain signal with a regular signal:
Deadly-Bagel wrote:The solution is to link your signals with green wire and make a "faux chain signal". Have all the signals into the loading bays output their status, then have the "faux chain signal" (where your current chain signal is) read those signals and go red if ([Green] = 0). This way the faux-chain signal will ALWAYS go green when there is an available bay, the train is then allowed to pass it which triggers the recalculation and it slides into the open bay.
However I've found that this does not work in all setups (problem described here): in this case the train will still path to the occupied lane even if another one is empty. I advise you to thoroughly test your setup with faux chain signals before leaving it on its own. Train pathing works in mysterious ways. :-)

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Train station design questions: waiting bay

Post by Deadly-Bagel »

MeduSalem wrote:I never got the entire re-pathing thing... So how does it work?

After every signal the trains look if the path they want to go down is still free and if not they try another one?

Does that include picking another train station too, given it has the same name and is free?
Kind of, I think every time a train passes a signal it recalculates the optimal path to the closest station of that name. This is basically the shortest (passes the fewest number of signals, not actually done on distance) available path, though at extreme distances (something like 100 signals) I'm aware trains will path a shorter unavailable route.
Sephrat wrote:However I've found that this does not work in all setups (problem described here): in this case the train will still path to the occupied lane even if another one is empty. I advise you to thoroughly test your setup with faux chain signals before leaving it on its own. Train pathing works in mysterious ways. :-)
In your case you had signals between each of your exits, which messed with the trains pathing calculations. You want the train to pass the same number of signals regardless of which waiting bay it passes through. This is standard practice for waiting bays and should be followed regardless of what signal type you're using.
Money might be the root of all evil, but ignorance is the heart.

User avatar
Sephrat
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Mar 16, 2016 2:39 pm
Contact:

Re: Train station design questions: waiting bay

Post by Sephrat »

Deadly-Bagel wrote:In your case you had signals between each of your exits, which messed with the trains pathing calculations. You want the train to pass the same number of signals regardless of which waiting bay it passes through. This is standard practice for waiting bays and should be followed regardless of what signal type you're using.
I know this is a little off-topic but look at the "Edit 2" in the post I linked: there is exactly the same amount of signals in each branch. Maybe this doesn't work when several branches lead to different stations with the same name.

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Train station design questions: waiting bay

Post by Deadly-Bagel »

Does the save you uploaded to that topic have that setup in it? I'd be curious to have a look.
Money might be the root of all evil, but ignorance is the heart.

mergele
Fast Inserter
Fast Inserter
Posts: 158
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: Train station design questions: waiting bay

Post by mergele »

I've read a few times (Sadly don't remember where exactly) that trains choose which station they travel to only when they leave a station and then only recalculate the path to said fixed station and designed my railroads accordingly. Has this been debunked?

User avatar
Sephrat
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Wed Mar 16, 2016 2:39 pm
Contact:

Re: Train station design questions: waiting bay

Post by Sephrat »

mergele wrote:I've read a few times (Sadly don't remember where exactly) that trains choose which station they travel to only when they leave a station and then only recalculate the path to said fixed station and designed my railroads accordingly. Has this been debunked?
This is not true, I just had the case while replying to Deadly Bagel (note: I've PM'd you so we don't get off-topic :-) ). When passing a signal, the train picked another station of the same name (I don't know why it did though, but that's another question :-) ).

c0bRa
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Sun Nov 13, 2016 8:33 pm
Contact:

Re: Train station design questions: waiting bay

Post by c0bRa »

Here is my Waiting bay for my Main-train-station, and it's working fine. the next train waits in the diagonal until one of the 3 waiting bays is empty:
Picture

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Train station design questions: waiting bay

Post by Deadly-Bagel »

That station is a bit excessive and I doubt this particular issue would even affect it unless you (for some reason) need the parking space.

The three waiting bays before the station for example, yeah any train in those will path to the station just fine. The problem would be evident when all three to a station are full and a train queues up in the shared bays. It will path through one of the three intermediate waiting bays, however if a train from one of the other bays leaves it will not be replaced by the train waiting in the shared bay as its waiting for its specific station to become free.
Money might be the root of all evil, but ignorance is the heart.

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

Re: Train station design questions: waiting bay

Post by vanatteveldt »

Smart idea to have multiple 'dedicated' waiting bays, since the (un)loading is wider than the rails anyway (you can probably squeeze two spaces by making the waiting bays directly adjacent as signalling is on the diagonals anyway).

Do the trains always path to these waiting bays, or do you have trouble where if one bay is full they wait in the shared bays until the 'favourite' waiting bay is empty?

Note that this does not alter my original problem, namely that trains don't update which station to pick until one is actually empty. For the situation with multiple stations of the same name it even makes it worse since now 3 trains can choose to wait for station A while no train goes to station B.

c0bRa
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Sun Nov 13, 2016 8:33 pm
Contact:

Re: Train station design questions: waiting bay

Post by c0bRa »

So I observated my waiting bays on the unload stations. The trains seem to recalculate their route pretty frequently and I documentated it with 2 pictures:

First it waited on the chain signal even if there was a slot free...
Picture 1
But after 10-20 secs it decided to get in the free waiting bay by itself...
Picture 2
So that should work also for multiple unload stations as long as every unloadstation is reachable from the chain signal where the train is waiting...

And yes you could squeeze it by 2, but then you will have trouble to get 4 belts out when you do 2 outgoing tracks, like I did on my mainstation. So I left that space free ;)

Post Reply

Return to “Gameplay Help”