[kovarex] [0.17.16] Doubleheaded Train does not choose shortest track

This subforum contains all the issues which we already resolved.
Post Reply
burninghey
Fast Inserter
Fast Inserter
Posts: 114
Joined: Fri Sep 14, 2018 2:06 am
Contact:

[kovarex] [0.17.16] Doubleheaded Train does not choose shortest track

Post by burninghey »

I have built a personal train with a very long round track. It sometimes does not choose the shortest track to the right side or even worse, it goes all the way around if it only have to drive 3 meters in the other direction.

No signals at all, yet.

Reproduce: enter the train, hold ctrl and choose various locations near you
Streifenwelt 09.zip
(2.86 MiB) Downloaded 129 times
trainbug.png
trainbug.png (139.47 KiB) Viewed 3940 times

User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: [0.17.16]Doubleheaded Train does not choose shortest track

Post by TruePikachu »

Are there regular train stops in place?

burninghey
Fast Inserter
Fast Inserter
Posts: 114
Joined: Fri Sep 14, 2018 2:06 am
Contact:

Re: [0.17.16]Doubleheaded Train does not choose shortest track

Post by burninghey »

No

ruy16109
Burner Inserter
Burner Inserter
Posts: 16
Joined: Mon Mar 11, 2019 7:05 pm
Contact:

Re: [0.17.16]Doubleheaded Train does not choose shortest track

Post by ruy16109 »

So I noticed something on your picture: you were inside the right-headed locomotive, and you ctrl-selected somewhere to the left of your train. I think because you are on the right-headed locomotive, the game sees that and decides to default the starting direction rightward. I suspect if you were on the other locomotive the train would start as you have wanted it to.

Zaflis
Filter Inserter
Filter Inserter
Posts: 414
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: [0.17.16]Doubleheaded Train does not choose shortest track

Post by Zaflis »

Is the path 2-ways or not using signal pairs? Trains will never drive against the allowed direction. edit: Found in the post you don't have any.

I was using a signaled stacker as a test with 2-headed train, it always went the shortest path. I actually thought for a moment that the bug was real until i realized my home station had no entrance from both lanes.

Engimage
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: [0.17.16]Doubleheaded Train does not choose shortest track

Post by Engimage »

The issue here is obviously about station direction. Every station has its direction on track so the train will not "reverse" to it no matter if it has backwards facing locomotive or not.
So I suppose the "temporary station" which is added to the train schedule also does have the direction which is set incorrectly in this case forcing train to follow longer route to approach the station from another side. I am also not sure if current movement direction of the train also effects the choice .

Zaflis
Filter Inserter
Filter Inserter
Posts: 414
Joined: Sun Apr 24, 2016 12:51 am
Contact:

Re: [0.17.16]Doubleheaded Train does not choose shortest track

Post by Zaflis »

PacifyerGrey wrote:
Fri Mar 22, 2019 8:48 am
The issue here is obviously about station direction. Every station has its direction on track so the train will not "reverse" to it no matter if it has backwards facing locomotive or not.
burninghey wrote:
Thu Mar 21, 2019 3:58 pm
hold ctrl and choose various locations near you
That will only be true if the train's schedule is not empty, but in the screenshot it is. So it's not trying to go to a station, just any plain location on tracks.

But if there is 1 station on the tracks it might already determine which direction the rail goes, same as signals.

Engimage
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: [0.17.16]Doubleheaded Train does not choose shortest track

Post by Engimage »

Zaflis wrote:
Fri Mar 22, 2019 8:58 am
But if there is 1 station on the tracks it might already determine which direction the rail goes, same as signals.
Stations do not effect rail direction. You can have any amount of differently oriented stations between destinations.

The only issue is that every station adds 2000 tiles penalty to a path going through it so visually longer path may be considered actually shorter from a pathfinder standpoint.
Actually this penalty might be the real issue in the OP situation.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [kovarex] [0.17.16] Doubleheaded Train does not choose shortest track

Post by kovarex »

Thanks for the report, it is now fixed for 0.17.22

This is kind of a special case (also treated by special logic), when the search is within a single segment. And since all the rail loop has no signal or junction, it is a single rail segment.
The logic now basically selects the shorter path within the segment instead of choosing whatever comes first.

Post Reply

Return to “Resolved Problems and Bugs”