Page 1 of 1

Train stacker not working

Posted: Tue Apr 23, 2019 9:01 am
by Nilixen
Hi. My trains keep getting blocked like this:
Image
The purple science train is waiting in the top part behind a chain signal and blocks the path. Later on a second train wants to go through this path, even though there is ample space to go around. What can I do to prevent this from happening?

Re: Train stacker not working

Posted: Tue Apr 23, 2019 9:05 am
by leadraven
Try to place chain signal on the entrance.
P.S. And let me know if it helps.

Re: Train stacker not working

Posted: Tue Apr 23, 2019 9:14 am
by Nilixen
I don't know if that would help. Putting chain signals at each entrance would break the stacker.
Usually the stacker works fine, but this problem occurs only occasionally.

Re: Train stacker not working

Posted: Tue Apr 23, 2019 9:18 am
by leadraven
Nilixen wrote:
Tue Apr 23, 2019 9:14 am
I don't know if that would help. Putting chain signals at each entrance would break the stacker.
Usually the stacker works fine, but this problem occurs only occasionally.
No-no-no, put 1 chain signal on overall entrance, before the fork. Where second loko of red-science train stands.

Re: Train stacker not working

Posted: Tue Apr 23, 2019 9:22 am
by Nilixen
Ah I see. I'll try that and hope it solves the issue. Thank you.

Re: Train stacker not working

Posted: Tue Apr 23, 2019 10:57 am
by Serenity
It works. The train will evaluate its path at the chain signal. The signal will be blue, meaning that at least one path is blocked, but the train can pick a free one

Re: Train stacker not working

Posted: Tue Apr 23, 2019 5:50 pm
by orzelek
Part of the reason why it behaves like that is that trains work by distance.
And in your stacker distance is different on various branches.

Thats why most of stackers you see in use look like yours but entry is from bottom so that all paths through stacker carry same path length.

Re: Train stacker not working

Posted: Tue Apr 23, 2019 8:16 pm
by Mr. Tact
What can happen is train A selects a spot prior to train B taking the spot, then train A arrives before a recalculation of its path has been forced. You can place two signals wired together just before the parking lot to force a pathing recalc, I have included a blueprint.


Re: Train stacker not working

Posted: Tue Apr 23, 2019 8:48 pm
by disentius
just make sure every train recalculates its path just before entering the stacker

Excerpt from the Wiki: https://wiki.factorio.com/Railway/Train_path_finding

The route of a train is revalidated (and recalculated if it was invalid) in the following scenarios:

A rail block changes and invalidates a signal along the train's path. The train is forced to recalculate its path.
The train's braking force gets changed and the train is currently driving normally, arriving at a signal (chain or regular) or arriving at a station.
The train is preparing to stop at a signal (chain or regular) that changes so that the train can now continue. The train is forced to recalculate its path.
The train encounters a signal (chain or regular) it cant reserve and the train is not inside a chain signal block. The train is forced to recalculate its path.
The train has waited at a chain signal for a multiple of 5 seconds.
If the trains has waited for a multiple of 30 seconds or if multiple train stops with the name of the destination exist, the train is forced to recalculate its path.
The train wants to depart from a signal (chain or regular) that it stopped at. The train is forced to recalculate its path.
The train enters a new non-chain-signal block and can't reserve the next needed signal (chain or regular). The train is forced to recalculate its path.
The train collides with something that is not a train (like a player). The train is forced to recalculate its path.
The train is pathing to a train stop that gets disabled. The train is forced to recalculate its pat


Mr. Tact's solution works because of number three, Serenity's triggers number five.