Page 1 of 1

Pathfinding Train

Posted: Fri Jan 05, 2018 2:37 am
by rih0815
I play version 0.16.14.
I uploaded 2 pictures from a Train he blocks the entrance of the trainstation.
As you can see there is a free line, this happens ~every 10 minutes.
Do you know the problem?

Re: Pathfinding Train

Posted: Fri Jan 05, 2018 2:50 am
by Loewchen
Since you place entrance and exit of your holding bay in the south there is a path length increases the further you go north, you now reached the point where waiting in the south is more attractive for the PF than the free lot. NaB.

Re: Pathfinding Train

Posted: Fri Jan 05, 2018 3:10 am
by Xeteth
This is due to the nature of the train pathfinding in Factorio. Train paths are essentially assigned a 'cost' and the cheapest one is taken. In this case, even though there is a free station the 'cost' of the train moving there is above the upper limit for a train to move there - this is done so that trains don't end up taking ridiculously large routes to get to stations if loops are in the system.

There is a workaround however - it involves a bit of trickery to adjust the train pathfinding:

Note that signals which are closed via the circuit network add a 1000 unit penalty to the train pathfinding, we can exploit this to make already occupied stations 'cost' much higher than they really are. Here's how -

Copy the setup below whereby two signals are connected via the circuit network. The rightmost signal is set to "read Red as a '0' signal" and the leftmost is set to "Close when '0' > 0". What this does is add a circuit controlled signal to each path (ie adding 1000 units to the pathfinder when that station is occupied), as such it makes the 'free' stations seem much, much cheaper. By following this setup you should find that all your trains will path into your stacker correctly.
Setup
Blueprint String for Setup

Re: Pathfinding Train

Posted: Fri Jan 05, 2018 3:26 am
by rih0815
Thx, i think its works now!!
So the path finding from a train ignores the red sign on a train signal, good to know.
--> solved

Re: Pathfinding Train

Posted: Fri Jan 05, 2018 3:51 am
by Jap2.0
No, signals set red by the circuit network givee a significantly larger penalty. Normally the penalty is the block length*2, signals that are set red by the circuit network are a set penalty of 2000.

Re: Pathfinding Train

Posted: Fri Jan 05, 2018 7:42 am
by Aprillion
could you enter from south and exit to north to make all lenghts the same?

Re: Pathfinding Train

Posted: Sat Jan 06, 2018 5:10 am
by Jap2.0
Aprillion wrote:could you enter from south and exit to north to make all lenghts the same?
Yeah, that'd probably work as well.