How to make trains NOT drive THROUGH a station?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

How to make trains NOT drive THROUGH a station?

Post by mrvn »

I have a part in a multiplayer game where trains keep getting stuck. The train system had to grow into the remaining space in part of the base so I didn't have much choice in the design. Here is the problem:

I have a main track going through the base. From that one track branches off and splits in 3 allowing for 2 trains to sit on each track (for a total of 6). Then it merges again and enters a copper plate unloading station. Last it merges the main track again at a point after the split. Now what sometimes happens is that a iron plate train takes a turn into the station and then has to sit behind all the copper plate trains until they have all be unloaded and left. Only then it can drive through the copper unload station and keep going.

What I think happens is that the iron plate train does a path finding when the main track is blocked by a passing train while the copper plates station is free with a fully empty waiting bay. So the main track has a red signal while the station is green all the way. Problem is that by the time the iron plate train arrives the copper plate station has filled up again causing the blockage.

Normally my fix is to have the station exit before the entry, thereby making any path through the station longer than any other. But I can't do that here. Is there any way to use signals to make trains not drive through the station? I can't use just chain signals due to the waiting bays.
twepy
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Tue Apr 28, 2015 6:19 pm
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by twepy »

My preferred solution is setting up the stations at my base in such way that trains that doesnt belong there cant path through other stations.

A possible solution is creating a waypoint station parallel to the copper ore waiting bays then iron ore trains no longer path through copper ore station. Its not ideal because the train will slow down to stop briefly at the station.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by mrvn »

Plus a lot of trains drive through there, potentially all of them. So lots of trains to alter for the extra station. And then they WILL drive through there even if they didn't before.

I think an extra way point is way out of the question. It would create a massive choke point. in an already congested area.
paouk
Inserter
Inserter
Posts: 25
Joined: Tue May 09, 2017 7:01 pm
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by paouk »

I think the best advice here is:
- you should always have one track to bypass the station.

This is obviusly not a real "solution" but, you know, a 5secs delayed train because of a usless loop around the station is better then one delayed due to 2min waiting other trains to be unloaded.
So, you can get your time thinking about a solution without killing your Iron Plate supply throughput.

In the rare case the Iron Plate train will find red on the mainline and chose to enter the station, it could transit on the bypass track.


Anyway, try to post a screenshot if you can, to have the particular case in exam.
Rome, Italy, Europe, Planet Earth, Solar System, Local Interstellar Cloud, Local Bubble, Orion–Cygnus Arm, Milky Way, Known Universe
(forgive me for eventually bad english, i'm trying my best)
Avezo
Filter Inserter
Filter Inserter
Posts: 454
Joined: Fri Apr 01, 2016 3:53 pm
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by Avezo »

To my knowledge, the way pathfinding works, trains calculate distance by amount of blocks between signals, if you just put more signals on certain route, trains will think it's longer and be less likely to take it.

The only other solution I can think of (other than totally rebuilding entire network) is using lots of circuitry with blocking signals, but that would break pathfinding for trains that are meant to go to that station, it would require really tons of circuitry to work properly.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by mrvn »

paouk wrote:I think the best advice here is:
- you should always have one track to bypass the station.

This is obviusly not a real "solution" but, you know, a 5secs delayed train because of a usless loop around the station is better then one delayed due to 2min waiting other trains to be unloaded.
So, you can get your time thinking about a solution without killing your Iron Plate supply throughput.

In the rare case the Iron Plate train will find red on the mainline and chose to enter the station, it could transit on the bypass track.


Anyway, try to post a screenshot if you can, to have the particular case in exam.
The trains is stuck behind the copper plate train in the waiting bay. The waiting bay is 2 trains deep and 3 tracks wide. So a bypass to the station would not fully work. It still has to wait to get to the start of the waiting bay.

(ignoring the fact that I have no space for the bypass there)
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by mrvn »

Avezo wrote:To my knowledge, the way pathfinding works, trains calculate distance by amount of blocks between signals, if you just put more signals on certain route, trains will think it's longer and be less likely to take it.

The only other solution I can think of (other than totally rebuilding entire network) is using lots of circuitry with blocking signals, but that would break pathfinding for trains that are meant to go to that station, it would require really tons of circuitry to work properly.
But they also count red signals to be more expensive than green ones. And I think the path finding will always use a green path no matter how expensive if the alternative is a red one.

As said I think the problem is that the path finding picks a path when it makes sense but when the train actually arrives things have changed. Some trick to make it repath at the right point would probably solve the issue.

Maybe a kind of air lock. Two signals where second is always red when the first is green.
twepy
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Tue Apr 28, 2015 6:19 pm
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by twepy »

Personally i think redesigning is the best way to solve your issue reliable without causing other issues or having downsides. The airlock idea doesnt prevent an iron ore train entering the airlock and thus the station. Another solution is setting the station entry signal to red when the main route is red so trains have no other option then to wait in front of the intersection. The downsides is that a copper ore train also has to wait until the main track has cleared and it still doenst guarantee that a iron ore train never enters the station, maybe in combination with a airlock makes the chance very small.
User avatar
Tev
Fast Inserter
Fast Inserter
Posts: 149
Joined: Sun Aug 02, 2015 7:42 pm
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by Tev »

Fix: place more stations on the branches you wish to be not pass-through. (I use "_" as name for such stations)
Watch changelogs, it was one of the better and more discussed changes in the 0.15 threads.

Rant: wonderfully wrong solutions ITT :D I mean - obviously, the design is just wrong, but OP has obviously already realized that, and is looking for hotfix. Because rebuilding major parts of train system is just not trivial or fast. And you all keep spamming the thread without a solution ... And even repeat same thing again and again. Please don't.

In general: for reasons above (poor post quality err I mean insane amounts of hardly filterable spam on these forums) I'd advise to ask questions on reddit weekly question thread in r/factorio.
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by mrvn »

twepy wrote:Personally i think redesigning is the best way to solve your issue reliable without causing other issues or having downsides. The airlock idea doesnt prevent an iron ore train entering the airlock and thus the station. Another solution is setting the station entry signal to red when the main route is red so trains have no other option then to wait in front of the intersection. The downsides is that a copper ore train also has to wait until the main track has cleared and it still doenst guarantee that a iron ore train never enters the station, maybe in combination with a airlock makes the chance very small.
The airlock would have to be on the main track just before the copper branch of. So the iron ore train enters the airlock, stops at the red signal, the signal goes green and it picks a path. If at that time the copper station is free it might still go through there but that would be OK since the stations would really be free.
aaargha
Filter Inserter
Filter Inserter
Posts: 333
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by aaargha »

There are a few things you can do to help the situation: One solution would be to place extra train stops on the copper unloading branch as Tev suggests, you may need to place a few for it to work though. Also, if possible, place them after the copper unloading station so that they don't affect the pathfinding of the copper trains heading to the unload station.

Another part of the problem is, as you've noted, that the iron train does not check its path again early enough. The airlock idea should make sure that the train updates its path but from your description it sounds a bit bulky and stopping the trains on the main line is not ideal either. You could try the simple circuit setup below, just place it on the main line and it will cause any train that reserves the blocks it makes to update their paths. It's been reliable so far, the only problem it might have is if the trains are moving really slowly, but then they've recently updated their paths anyway. The idea is that we show the train a red signal for one tick which is enough to make it update its path but not noticeably affect its speed.
Path changer
mrvn
Smart Inserter
Smart Inserter
Posts: 5848
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: How to make trains NOT drive THROUGH a station?

Post by mrvn »

aaargha wrote:There are a few things you can do to help the situation: One solution would be to place extra train stops on the copper unloading branch as Tev suggests, you may need to place a few for it to work though. Also, if possible, place them after the copper unloading station so that they don't affect the pathfinding of the copper trains heading to the unload station.

Another part of the problem is, as you've noted, that the iron train does not check its path again early enough. The airlock idea should make sure that the train updates its path but from your description it sounds a bit bulky and stopping the trains on the main line is not ideal either. You could try the simple circuit setup below, just place it on the main line and it will cause any train that reserves the blocks it makes to update their paths. It's been reliable so far, the only problem it might have is if the trains are moving really slowly, but then they've recently updated their paths anyway. The idea is that we show the train a red signal for one tick which is enough to make it update its path but not noticeably affect its speed.
I can't try that blueprint string now but it sounds like you reduced the airlock to a single signal and wired it up so when it turns yellow it goes red for a single tick. This will cause the train to break for one tick and then repath and continue. Which indeed should not be noticeable.

Meanwhile I placed a bunch of dummy train stops at the copper station and haven't seen a iron train stuck again. But I will try the signal thing too, probably tonight if everybody shows up to continue the game.
Post Reply

Return to “Gameplay Help”