Train path finding problems

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Train path finding problems

Post by Hannu »

I have a large system with separate factories and complex train network connecting them. Not because it is the most effective way to play Factorio but because I like trains and have tried to make as prototypical train traffic as possible in Factorio. However, there seems to be some path finding errors. Most of my trains are relatively short and I have many short side tracks. They have separate block and train stop. I have understood that trains try to find shortest paths and there are always shorter straight track. However, sometimes longer trains try to go through side tracks and stuck because they are too long and block their route by themselves. It causes severe problems which are annoying and laborious to solve because I have more than 10000 units track in large area. Is there some known solutions to this problem? I do not want to make every small side track long enough for longest ore trains with 2 locomotives and 8 wagons.

Image
Example situation. 4 wagon iron train has gone through a short service side track and got stuck. This stop is not in train's schedule and I do not see any reason why it did not take straight route.

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: Train path finding problems

Post by Zeblote »

The real problem here is that the train got stuck, because you don't have enough signals. Place signals on the straight track aswell to seperate the entry/exit blocks of that station and it will leave :D

It probably chose to go that path because the straight rail was blocked by another train when the path was calculated (it's not updated until the train arrives at the destination or a red signal)

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: Train path finding problems

Post by Shokubai »

Hannu wrote:I have a large system with separate factories and complex train network connecting them. Not because it is the most effective way to play Factorio but because I like trains and have tried to make as prototypical train traffic as possible in Factorio. However, there seems to be some path finding errors. Most of my trains are relatively short and I have many short side tracks. They have separate block and train stop. I have understood that trains try to find shortest paths and there are always shorter straight track. However, sometimes longer trains try to go through side tracks and stuck because they are too long and block their route by themselves. It causes severe problems which are annoying and laborious to solve because I have more than 10000 units track in large area. Is there some known solutions to this problem? I do not want to make every small side track long enough for longest ore trains with 2 locomotives and 8 wagons.

Image
Example situation. 4 wagon iron train has gone through a short service side track and got stuck. This stop is not in train's schedule and I do not see any reason why it did not take straight route.
More signals on the whole will fix much of this but chain signals are the answer(or at least part of it). Unlike the standard signal which allows a train to stop at the next red signal, a chain signal requires the train to clear the next regular signal. This means you can set your signals such that your train MUST clear the intersection or path segment.

Here are some tips I dug up quickly.
https://www.factorio.com/blog/post/fff-81

https://www.youtube.com/watch?v=ps423d2WisY

Here is a good album on Imgur. Note the difference in graphic for the chain signal as it is a single light.
Last edited by Shokubai on Mon May 09, 2016 1:12 pm, edited 1 time in total.

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: Train path finding problems

Post by Shokubai »

I edited your graphic. Now, I don't know whats beyond this point so my example may be off but I hope it helps.

First, pretend your existing signals are gone.
Untitled-3.png
Untitled-3.png (1.14 MiB) Viewed 2949 times
Note the placement of the chain signal at the start. It will force the train to CLEAR the next signal or chain signal it encounters. At the first junction. The train cannot stop in the intersection, only before it. Where there are two chains in a row, the train will be forced to clear both chains and the next regular signal.
Also notice I have no signals in your station area. It's not long enough for multiple trains, I don't want a train to go here unless it's stopping at this station.

You may actually require another chain signal at the start of your station...I can't think that far ahead. Play with it though. I hope this helped.
Last edited by Shokubai on Mon May 09, 2016 8:22 pm, edited 1 time in total.

SyncViews
Filter Inserter
Filter Inserter
Posts: 295
Joined: Thu Apr 21, 2016 3:17 pm
Contact:

Re: Train path finding problems

Post by SyncViews »

Shokubai, that image is not displaying (error with http://gdurl.com). Can you just attach it to the forum directly ("Upload attachment" tab just below the save/preview/submit bar)?

Shokubai
Filter Inserter
Filter Inserter
Posts: 470
Joined: Mon May 02, 2016 3:17 pm
Contact:

Re: Train path finding problems

Post by Shokubai »

Try now

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: Train path finding problems

Post by Hannu »

Than you for the advice (and sorry about late response). I added more signals in my stations and railyards and now I have played over 10 hours without stucks. I think that there are couple of theoretical problem points in my rail system, which I have not fixed yet, but they seem to be very improbable to happen.

But I have another problem. As someone said, trains select another route if the shortest path is temporarily occupied. I have 22 trains in automatic traffic (and 1 service train which I use to move between factories) and my main routes are quite crowded. Sometimes trains select stupid paths. They may take a huge loop through 3000 unit long single track ore route with long distances between passing tracks instead of waiting 30 seconds that 1000 units of high throughput double track main line is released. Is there any mod which make it possible to define intermediate points without stop for trains between end points?

Is there mods or any other easy ways to increase freight capacity of wagons several times larger (and also maybe limit top speed of short trains to some sane value)? It seems to be impossible or at least very impractical to transport enough stuff (with my personal limitations, I want to keep certain feel of real traffic instead of optimizing traffic with optimal Factorio style which I feel somewhat artificial and unreal).

Image
This is my current rail network. Horizontal distance of extreme eastern and western tracks is about 3500 units.

Post Reply

Return to “Gameplay Help”