Trains with multiple stations

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
BBTuna
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Apr 25, 2018 9:36 pm
Contact:

Trains with multiple stations

Post by BBTuna »

I have a train setup with 1 ore drop off and 3-4 Mining outposts all with the same name. They are all in a line and I thought it used to be that if the closest one was occupied then it would go to the next one..etc They now sit at the first one indefinitely until that one opens up. Did they change the logic in alpha 16 or am I doing something wrong. Only the furthest outpost has a buffer for trains to sit in while waiting the others are smaller and its just 1 train at a time.
I dont use any mods.

Main line --->
===========
RC---
I
I
RS I RC
Station

That is my attempt at a crude setup of what Im using RC=rail chain RS=rail signal

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Trains with multiple stations

Post by Koub »

Hi,

You should really post a screenshot :).
Koub - Please consider English is not my native language.

gsezz
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Thu Jan 04, 2018 8:23 pm
Contact:

Re: Trains with multiple stations

Post by gsezz »

If the route to the second station is too long, your trains will prefer to wait for the signal. Otherwise trains would constantly reroute everytime they reach a junction with a red signal.

You could disable the first station with a circuit, when there is a train at the station. But this brings a whole lot of other problems.
I don't think there is a good solution to handle outposts with same names at the moment. It always has one of two outcomes:
1. Trains waiting at one station, while other stations are free.
2. trains getting rejected from a station, turning around, going back and forth, eventually running out of fuel before they get to load any cargo.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Trains with multiple stations

Post by zOldBulldog »

I think this could be considered a minor design flaw in the pathfinding although some will argue that it is not. Either way, it is the current design choice so we must work through it.

The simplest solution for making trains go to the next stop by the same name is:

- Run a circuit wire from the stop to a pole, so that it enables the circuit logic.
- In the train stop (which outputs T=trainID) you want to set the stop to be enabled when T ≤ 0. In other words enable the stop when there is no train at it. If the stop is disabled the train goes to the next one.

You might need to read a little or watch some tutorials about circuit networks and train stops if you experience difficulties... But this is a simple scenario and the perfect one to introduce you to circuitry.

Also -VERY IMPORTANT- make sure you have fewer trains than stops by that name, or you will encounter troubles. Those troubles can be overcome but it is a more complex prroblem with a more complex solution.

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

Re: Trains with multiple stations

Post by mrvn »

gsezz wrote:If the route to the second station is too long, your trains will prefer to wait for the signal. Otherwise trains would constantly reroute everytime they reach a junction with a red signal.

You could disable the first station with a circuit, when there is a train at the station. But this brings a whole lot of other problems.
I don't think there is a good solution to handle outposts with same names at the moment. It always has one of two outcomes:
1. Trains waiting at one station, while other stations are free.
2. trains getting rejected from a station, turning around, going back and forth, eventually running out of fuel before they get to load any cargo.
I never had 2 happen. Do you have more trains than stations?

Also always leave one station in the schedule permanently enabled or you can end up with trains with "no path" in the middle of your train network. Refuel trains at the always enabled station and you can never run into problem 2.

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

Re: Trains with multiple stations

Post by mergele »

As far as I know the train destination is decided upon the train leaving it's previous station and not updated while on route. So if the first train is on the way to the mining outpost while the second train already leaves they both would head to the same station (as that one is at that time unoccupied).

User avatar
Lubricus
Filter Inserter
Filter Inserter
Posts: 294
Joined: Sun Jun 04, 2017 12:13 pm
Contact:

Re: Trains with multiple stations

Post by Lubricus »

mrvn wrote:
gsezz wrote:If the route to the second station is too long, your trains will prefer to wait for the signal. Otherwise trains would constantly reroute everytime they reach a junction with a red signal.

You could disable the first station with a circuit, when there is a train at the station. But this brings a whole lot of other problems.
I don't think there is a good solution to handle outposts with same names at the moment. It always has one of two outcomes:
1. Trains waiting at one station, while other stations are free.
2. trains getting rejected from a station, turning around, going back and forth, eventually running out of fuel before they get to load any cargo.
I never had 2 happen. Do you have more trains than stations?

Also always leave one station in the schedule permanently enabled or you can end up with trains with "no path" in the middle of your train network. Refuel trains at the always enabled station and you can never run into problem 2.
2. Is a mayor pain for me. It don't go that far so the trains run out of fuel but there is loots of trains going to the wrong places and clogging up the railway while there are empty stations...
It's because what mergele wrote that trains are on the way to the stations when they are turned off. With a big factory you need several trains on the way to the stations. To send the right amount of trains that are on the way to stations is a very complex task with no to very bad mechanics in the game that can help with that. How can we send a train to a specific station without manually setting specific trains schedule? How can we keep track on how many trains currently is on the way to a station?
I have an 1K science/m factory with 1:2 trains that I tried to get running with the same name/turning on/off stations strategy, and I had to cheat and put in some specific Iron plate trains to blue/purple science to get it to work. To give some idea where the limit is (depending on lots of things).

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

Re: Trains with multiple stations

Post by mrvn »

Maybe switch to 1:4 or 2:8 trains. With longer trains the smelter take longer to empty the buffer chests. Where you had 4 trains leaving at the same time now you only need one. Gives the train more time to reach a mine and close the station before the next train is unloaded.

You can also ship ore in two stages. Have small stations at each mine. Then in a ring around your base have a few collection depots. There the 1:1 or 1:2 ore trains arrive and the ore gets repackaged into 2:8 trains for delivery to the smelter. You can split your mines e.g. 4 ways with a collection depot in the north, south, east and west. That would give you 4 separate mining networks, which is still easy to manage, and keeps your trains from crossing back and forth uselessly.

User avatar
Hyenna
Inserter
Inserter
Posts: 41
Joined: Mon May 14, 2018 6:49 am
Contact:

Re: Trains with multiple stations

Post by Hyenna »

Hi,
about the problem explained with trains moving to a station and turn around to go back when another train already got to the station is a problem i have too so i will explain my situation here.

I have 2 iron mining stations and 1 ore offload station.
Once the mining place has a train load ready the station will be enabled.
I have multiple trains waiting to get the iron load.
The problem with this is once the mining station got enabled it has the load for 1 train to fill but 3-4 trains are trying to move there and one train arrives all other will turn around or if the cant turn will block the rails.

This may culd be solved by letting us set a number for each station can handle - how many trains can be on the way to it including the one already at the station.
Like station a can handle 4 trains at the same time because waiting lines are there and station b may can handle only 1 train because it doesnt have extra lines to wait on.

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

Re: Trains with multiple stations

Post by mrvn »

But that simply means one thing:

You don't have enough mines.

You are consuming iron ore faster than you produce it or the trains would be waiting to unload. Having the trains drive to the mine and then turn around waste a bit of fuel but is otherwise harmless. Just open up some more mines and the problem goes away.

Hedning1390
Fast Inserter
Fast Inserter
Posts: 231
Joined: Fri Jan 05, 2018 8:47 pm
Contact:

Re: Trains with multiple stations

Post by Hedning1390 »

I think ore fields are too spread apart to use the same name trick. Even if you didn't have empty trains going round in circles you'd still have trains preferring the nearest station with no good way to control that. Better to just give the station at the ore field a unique name and create unique trains for that ore field. That way you won't have pathing issues, can always have a train ready at the station, and you know the maximum amount of trains that could stack up there. Many mining fields are expansions rather than relocations, so then you are creating new trains anyway.

If you really want to keep using the same name you can control how many trains are active by setting circuit conditions on the release lights at your stacker. Like: If +1 ore loads available then current # of trains waiting -1 lights are not forced red.

zOldBulldog
Smart Inserter
Smart Inserter
Posts: 1161
Joined: Sat Mar 17, 2018 1:20 pm
Contact:

Re: Trains with multiple stations

Post by zOldBulldog »

Hedning1390 wrote:I think ore fields are too spread apart to use the same name trick. Even if you didn't have empty trains going round in circles you'd still have trains preferring the nearest station with no good way to control that. Better to just give the station at the ore field a unique name and create unique trains for that ore field. That way you won't have pathing issues, can always have a train ready at the station, and you know the maximum amount of trains that could stack up there. Many mining fields are expansions rather than relocations, so then you are creating new trains anyway.

If you really want to keep using the same name you can control how many trains are active by setting circuit conditions on the release lights at your stacker. Like: If +1 ore loads available then current # of trains waiting -1 lights are not forced red.
It is a very tough problem to crack, as you have to account for several scenarios:
- When ore usage is low and your trains pile up at the unload station.
- When ore usage is high and - assuming it is possible - trains pile up (if the station design allows it) at the load stations.
- When ore deposits dry up and you end up with every capable loading station full and still have trains that need a place to go load.

I have been working on a design for a while and have something that "seems to work" but I need to finish stress testing it and compensate for whatever additional issues I discover.

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

Re: Trains with multiple stations

Post by mrvn »

Hedning1390 wrote:I think ore fields are too spread apart to use the same name trick. Even if you didn't have empty trains going round in circles you'd still have trains preferring the nearest station with no good way to control that. Better to just give the station at the ore field a unique name and create unique trains for that ore field. That way you won't have pathing issues, can always have a train ready at the station, and you know the maximum amount of trains that could stack up there. Many mining fields are expansions rather than relocations, so then you are creating new trains anyway.

If you really want to keep using the same name you can control how many trains are active by setting circuit conditions on the release lights at your stacker. Like: If +1 ore loads available then current # of trains waiting -1 lights are not forced red.
Having the same name is fine if you disable stations with not enough ore or a train present. That closer mines will be preferred is actually useful because that way you exhaust the older mines first and then have room to expand. What you should avoid is having a high frequency of trains. If the mine is big don't fill up a LC train every 20s. Fill up a LLCCCCCCCC train instead. That allows trains to reach other mines before the first mine is ready for the next train again.

You can also make trains turn around earlier by having only a single track going out to distant mines. The first train will go there but the second train will halt at the point where you switch to single track. Make sure you have a waiting bay there. The second train will also reconsider costs there and often other mines become cheaper to reach when current path becomes blocked by the first train.

Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Trains with multiple stations

Post by Aeternus »

Simple solution.

The signal leading towards the stations (before it branches out to the various stations with the same name) should be a Chain Signal. Trains passing a chain signal are denied to go to a path leading to a red signal, so that basically auto-sorts your trains and stations. It'll also block trains from trying to go to a station if all stations are full. You can put a train stacker in front of the unloading stations to stack up trains if more are arriving then your stations can handle.

I've played with using generic names for mines but gave up on the idea. Mines are too far apart and too varied to be able to support this at megabase level. Right now I usually have one or two ore trains dedicated to each mine, moving to a smelter. I then set an alert at the -smelter- when the ore reserves run dry, signalling it's time to deploy or activate another mine. I use stackers at the entrances to the smelters to ensure the trains have waiting areas if needed. A 10 train stacker isn't that big of a deal, just costs some rails and signals. And the trains themselves can be reused once the mines run dry.

User avatar
Hyenna
Inserter
Inserter
Posts: 41
Joined: Mon May 14, 2018 6:49 am
Contact:

Re: Trains with multiple stations

Post by Hyenna »

Just noticed it seems i used the train signals wrong.
Now i have in and outgoing waiting lines at the offload stations with regular signals and chain to the out going and all the pathes with chain signals too. Only stations and waiting lines should have regular signals and the mine works even without extra waiting path when it cannot fill a train turns traffic light red in front of it (before i tried switching off the station when it doesnt have the load ready) so the trains arent going to it before the load is ready in the station boxes and the trains dont have to wait for the mine to bring the load so they can focus more on transport and less time spent in waiting to be filled.

Post Reply

Return to “Gameplay Help”