Something Wrong with Train Path Finding

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Something Wrong with Train Path Finding

Post by Jap2.0 »

Can you upload a save for us to look at?
There are 10 types of people: those who get this joke and those who don't.

Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Something Wrong with Train Path Finding

Post by Zanthra »

Trains do not constantly update their pathing. If the train finds a valid path through a series of chain signals to its destination, by the time it is partway through that path the other trains may have moved and left it a suboptimal path. If you use standard signals, then a train will be willing to create a path that already has another train in the way, and can wait at the preceding standard signal for that train (or proceeding chain signal after a standard signal). With all chain signals it cannot create a path with another train in the way, even if that train will later move out of the way, it is still stuck on it’s suboptimal path.

Consider putting chain signals opposite standard signals on some intersection exits. Consider alternating dominant northwards and southwards columns and eastward-westward rows.

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

Re: Something Wrong with Train Path Finding

Post by mrvn »

Zanthra wrote:Consider putting chain signals opposite standard signals on some intersection exits. Consider alternating dominant northwards and southwards columns and eastward-westward rows.
Impossible with this design. Would deadlock.

Zanthra
Fast Inserter
Fast Inserter
Posts: 207
Joined: Fri Mar 25, 2016 8:18 am
Contact:

Re: Something Wrong with Train Path Finding

Post by Zanthra »

mrvn wrote:
Zanthra wrote:Consider putting chain signals opposite standard signals on some intersection exits. Consider alternating dominant northwards and southwards columns and eastward-westward rows.
Impossible with this design. Would deadlock.
If the train passes a standard signal and stops at a chain signal at least one train length past, it only occupies one block. Why would that cause any deadlock? If a train takes a non dominant direction. Say they go south on the first column (north standard with south chain) it will have to reserve it's exit block from that column before it can enter the column, and all trains that want to go north on that column will have to wait for that train to pass the intersection they want to turn north at. A train can only be stopped waiting on column 1 if it's northbound, in which case a southbound train will have to take the next column which cannot have a northbound train stopped on it. Same is true for east and west. Naturally stations need to have enough waiting space (including the station itself for 0 additional if it only serves one train) for all the trains they serve.

Studying the OP's images a bit further, I believe you are right about the deadlock situation, but I think that it may be an increase of situations where the OP's system already would deadlock. The question is does the OP have a system to protect against 4 trains all stopping at stations, all facing towards the same intersection and deadlocking because none of them can leave due to all three paths at that intersection being blocked by the other three trains?

Another option is to have express lines without stations on them that can be signaled with standard signals in one direction, but that won't help trains taking suboptimal paths for the last few blocks, just reduce those problems over longer distances.

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

Re: Something Wrong with Train Path Finding

Post by mrvn »

Zanthra wrote:
mrvn wrote:
Zanthra wrote:Consider putting chain signals opposite standard signals on some intersection exits. Consider alternating dominant northwards and southwards columns and eastward-westward rows.
Impossible with this design. Would deadlock.
If the train passes a standard signal and stops at a chain signal at least one train length past, it only occupies one block. Why would that cause any deadlock? If a train takes a non dominant direction. Say they go south on the first column (north standard with south chain) it will have to reserve it's exit block from that column before it can enter the column, and all trains that want to go north on that column will have to wait for that train to pass the intersection they want to turn north at. A train can only be stopped waiting on column 1 if it's northbound, in which case a southbound train will have to take the next column which cannot have a northbound train stopped on it. Same is true for east and west. Naturally stations need to have enough waiting space (including the station itself for 0 additional if it only serves one train) for all the trains they serve.

Studying the OP's images a bit further, I believe you are right about the deadlock situation, but I think that it may be an increase of situations where the OP's system already would deadlock. The question is does the OP have a system to protect against 4 trains all stopping at stations, all facing towards the same intersection and deadlocking because none of them can leave due to all three paths at that intersection being blocked by the other three trains?

Another option is to have express lines without stations on them that can be signaled with standard signals in one direction, but that won't help trains taking suboptimal paths for the last few blocks, just reduce those problems over longer distances.
Not from the images. Or not everywhere. Some stations seem to be designed with trains coming from both directions. Others only with trains going one way.
Having 4 trains at stations all facing each other is a real possibility and will deadlock.

Post Reply

Return to “Gameplay Help”