Trouble with the train path finding

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
neolithos
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Oct 25, 2016 3:42 pm
Contact:

Trouble with the train path finding

Post by neolithos »

Hello,

for every outpost I use a train stop (name is always "Support") for the daily needed stuff (Turrets, Repair Kits, ...). If a outpost runs short on some item, it sets the train signal of his station to green and sends a signal to the main station (A). The support train calculates a path to the open "Support" train stop and delivers his cargo. This works fine for all stations, except for B.

If B opens his station, the trains always calculates a route to C (that is closed!). Why?
When the trains waits before C, I always have to say to the train "go to main" after passing C "go to support". After this it finds his way.

I lost three trains, because they were waiting outsite of this outpost :(.
Map
Map
map1.png (373.19 KiB) Viewed 3797 times
kinnom
Filter Inserter
Filter Inserter
Posts: 706
Joined: Fri Dec 26, 2014 4:20 pm
Contact:

Re: Trouble with the train path finding

Post by kinnom »

put multiple circuit-based signals near c
no yes yes no yes no yes yes
neolithos
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Oct 25, 2016 3:42 pm
Contact:

Re: Trouble with the train path finding

Post by neolithos »

I tried this, but this results in an endless loop.

The train arrives at C, the ciruit switches the signal to green. The train stopps at the "Support" stop and goes back to the Base (A). Then it gets the command to go to a "Support" stop. It calc's the path to C, and so on.

Putting two times "Support" into the train schedule did also result in strange deadlocks.

I guess, there is a "stop" in the "find path" algorithm, if the path gets to long? Does any one else tried this setup?

If this is true, I need may be two or more "Support" trains, for each direction. But I did not find any evidence for my guess.
kinnom
Filter Inserter
Filter Inserter
Posts: 706
Joined: Fri Dec 26, 2014 4:20 pm
Contact:

Re: Trouble with the train path finding

Post by kinnom »

also add extra signals at a.
the signals only add a limited amount of 'length' to a track and your track to b is so long that a single signal can't make the paths to a and c seem longer
no yes yes no yes no yes yes
User avatar
ChurchOrganist
Filter Inserter
Filter Inserter
Posts: 256
Joined: Sun Apr 17, 2016 12:45 pm
Contact:

Re: Trouble with the train path finding

Post by ChurchOrganist »

Try removing the loops from your system and use double headed trains instead.

That way there will be no possible route to B via C so it won't be included in the pathing algorithm.
Want to know where the biters chewing your power plant have come from??
Wondering where your next iron is going to come from??
You need Long Range Radar
neolithos
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Oct 25, 2016 3:42 pm
Contact:

Re: Trouble with the train path finding

Post by neolithos »

I played arround with the train schedule. And it seems there is a bound in the algorithm.
Or it is a bug. Should I file it in a different board?

Rule: If the train is too far away, it always selects the nearest station.

Conclusion: My idea will not work :(
Tami
Fast Inserter
Fast Inserter
Posts: 157
Joined: Tue Nov 19, 2013 11:29 am
Contact:

Re: Trouble with the train path finding

Post by Tami »

I have tested something:

Following Case:

2 Routes: one Route is blocked by circuit, one Route is blocked by train.

In this case the route with blocked by circuit will be choosen by train. This end ups your train is running to wrong station if anyhwere in this network is another train blocking the route.

Case 2:
2 Routes, both are blocked by train, the shorter path will be choosen, even if additional blocked by Network.

Case 3:
2 Routes, one is blocked by Network, one Route is free, the free Route will be choosen.

The length of the route is used too for calculating the route. If one route is free, but significant longer than the blocked route, the blocked route will be choosen.
Attachments
Route.png
Route.png (2.7 MiB) Viewed 3670 times
Tami
Fast Inserter
Fast Inserter
Posts: 157
Joined: Tue Nov 19, 2013 11:29 am
Contact:

Re: Trouble with the train path finding

Post by Tami »

The path calculation is more complex than expected.


I did some tests now, also having a second train on shedule with different settings. If there a train is on Shedule, the route calculate depending of waiting duration, for example if a train is going to wait long time at station, an alternate route will be choosen, if the train is expected to short time, no alternate route will be choosen.


Case 1
Route 1: =====TRAIN waiting short duration in station (30s) =====
Route 2: ===== NETWORK Block =====
Route 1 will be choosen.

Case 2
Route 1: ===== TRAIN waiting long duration in station (200s) =====
Route 2: ===== NETWORK Block =====
Route 2 will be choosen.

Case 3
Route 1: ===== Free Path, unexceptional long Route =====
Route 2: ===== NETWORK Block =====
Route 2 will be choosen.

For Case 1 and 2, the REMAINING waiting time is taken for path choosing, in my map its around 95 Seconds remaining waiting time. The path changes after passing the Threshold.

Case 4
Route 1: ===== TRAIN waiting long duration in station (200s) =====
Route 2: ===== NETWORK Block ===== NETWORK Block =====
Route 1 will be choosen.

Case 4 can fix your issue because using 2 signals in a row extend the THRESHOLD for patch choosing.

Case 5
Route 1: ===== Free Path, unexceptional long Route =====
Route 2: ===== (4x) NETWORK Block =====
Route 1 will be choosen.

If you add additional Signals in your NETWORK, to block a route, the you can extend the range of an alternate path and can reach stations far away you wouldnt reach with lesser amount of Signals
neolithos
Burner Inserter
Burner Inserter
Posts: 18
Joined: Tue Oct 25, 2016 3:42 pm
Contact:

Re: Trouble with the train path finding

Post by neolithos »

If you add additional Signals in your NETWORK, to block a route, the you can extend the range of an alternate path and can reach stations far away you wouldnt reach with lesser amount of Signals
You are right. If I block the path with an ciruit signal, the correct path is choosen. But, that means that no other train can use this track, because I have to cut of a whole part of this small network.

Your tests are quiet interesting.

It seems that the devs had only one scenario in mind: A station with multiple tracks. But they did not have in mind, that someone distribute the same station name over the whole map :( .
Post Reply

Return to “Gameplay Help”