Pathfinding Train

Bugs that are actually features.
Post Reply
rih0815
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Feb 21, 2017 6:13 pm
Contact:

Pathfinding Train

Post 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?
Attachments
Trainstation_Bug2.jpg
Trainstation_Bug2.jpg (884.82 KiB) Viewed 2441 times
Trainstation_Bug.jpg
Trainstation_Bug.jpg (960.41 KiB) Viewed 2441 times

Loewchen
Global Moderator
Global Moderator
Posts: 8347
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Pathfinding Train

Post 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.

Xeteth
Fast Inserter
Fast Inserter
Posts: 158
Joined: Tue Feb 17, 2015 6:06 am
Contact:

Re: Pathfinding Train

Post 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

rih0815
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Feb 21, 2017 6:13 pm
Contact:

Re: Pathfinding Train

Post 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

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Pathfinding Train

Post 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.
There are 10 types of people: those who get this joke and those who don't.

User avatar
Aprillion
Inserter
Inserter
Posts: 34
Joined: Sun Apr 16, 2017 10:43 am
Contact:

Re: Pathfinding Train

Post by Aprillion »

could you enter from south and exit to north to make all lenghts the same?

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Pathfinding Train

Post 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.
There are 10 types of people: those who get this joke and those who don't.

Post Reply

Return to “Not a bug”