[2.0.14] Train Path finding fault.

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
KiiWiiWii
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Nov 02, 2024 5:29 pm
Contact:

[2.0.14] Train Path finding fault.

Post by KiiWiiWii »

Trains leaving the IRON stop will path find with a much longer path inexplicably when a 180 turn is placed seeminlgy irrelevantly further away. Found by KiiWii and kmui.

Attachments
space age.zip
Bug occurs at the top left iron in stop
(40.14 MiB) Downloaded 12 times
trtain.mp4
(6.89 MiB) Downloaded 18 times
Factorio_2024.11.02_-_17.16.04.04.mp4
(6.4 MiB) Downloaded 16 times
Last edited by KiiWiiWii on Sun Nov 03, 2024 7:07 pm, edited 2 times in total.
Loewchen
Global Moderator
Global Moderator
Posts: 9674
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [2.0.13] Train Path finding fault.

Post by Loewchen »

Post the save please, see 3638.
KiiWiiWii
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Nov 02, 2024 5:29 pm
Contact:

Re: [2.0.13] Train Path finding fault.

Post by KiiWiiWii »

Save is now in the original post
Muche
Filter Inserter
Filter Inserter
Posts: 585
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: [2.0.14] Train Path finding fault.

Post by Muche »

The issue seems to be that the train stop is in the rail split/intersection. Moving it a step back fixes it.
A minimal blueprint to reproduce it might be:
robot256
Smart Inserter
Smart Inserter
Posts: 1041
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.14] Train Path finding fault.

Post by robot256 »

Confirmed with the minimal reproduction blueprint in 2.0.15. Here's a video:
Untitled video - Made with Clipchamp.mp4
(7.67 MiB) Downloaded 12 times
The train is leaving the station and departing on a curved rail that actually starts before the rail the train stop is on:
Screenshot 2024-11-05 202533.png
Screenshot 2024-11-05 202533.png (1.18 MiB) Viewed 253 times
Placing a train stop on the long path causes the train to pick the shorter path again. I suspect that because of the train stop's position, it is counting as a penalty on the straight route but not the curved route.

There are two possible fixes for this behavior:
1. Make sure the path penalty is not affected by the stop you are in the process of leaving.
2. Make sure the train cannot take a curved path that starts before the rail its station is on.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3399
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.14] Train Path finding fault.

Post by boskid »

Hm... in general the trains pathfinder is correct given the existing rules as it selects a path with lower penalty and in this case since split of rails happens exactly 1 rail before the train stop, the train stop only binds to the rail segment that goes straight. When trains pathfinder turns left it simply does not see the train stop, and when trains pathfinder goes straight it is out of initial rail segment (in which case the train stop would be ignored) so the train stop is not ignored.

I have some ideas how i could change the trains penalty rules to account for this case slightly more nicely (by ignoring all train stops that are in the same rail block as the train) but that would create some additional corner cases i am not sure i want to handle (train could be in multiple rail blocks at the same time if its parked at train stop and there are multiple rail signals on sides). Core of this penalty rule is for trains to not go through train stops that are unrelated as this would make them occupied possibly blocking slots for legit trains, however since the train is in the same rail block as the train stop, it is already kind of occupied by the train so there is no value in avoiding that train stop.

For now i will move this to minor issues but i will keep this in mind that it may need to be handled if i see more people struggling about this. In general this train stop is in a place that it would not be buildable when rails are already placed but the train stop does not block placement of rails turning left.
Post Reply

Return to “Minor issues”