Page 1 of 1

[1.1.59] Train pathfinder is slow

Posted: Mon May 09, 2022 1:09 am
by ctnightmare
Starting with version 1.1.59 the train path finder in my Py modded game has gone from taking less than 1 to taking over 1000's to complete. This save has about 2100 station with 300 trains.
I have loaded up an older save to version 1.1.57 and the train path finder wasn't an issue and I have updated the save to version 1.1.59 and the train path finder keeps hitting upwards of 40 - 60. This save has 1800 station with 1200 train.
Pics

Re: [1.1.59] Train Path Finder time

Posted: Mon May 09, 2022 1:23 am
by Loewchen
Post your log and a link to your save file please.

Re: [1.1.59] Train pathfinder is slow

Posted: Mon May 09, 2022 1:45 am
by ctnightmare

Re: [1.1.59] Train pathfinder is slow

Posted: Mon May 09, 2022 8:33 am
by boskid
And what are you expecting me to do? Make it fast? I was looking into the reasons why the trains pathfinder is slow, the most common reason is having trains in a NO_PATH state but i see that rails missing near [gps=2247,1614] are only causing NO_PATH state for 2 trains which are really close to the missing rails which means its a really fast failure of trains pathfinder. I also noticed trains pathfinder taking super long time (>10000 steps) when finding path to a train stop at [gps=1551,173] for a train near [gps=1661,81] due to a congestion which means the path penalty here is quite high and this causes trains pathfinder to visit a lot more segments than usually needed because it really tries to find a path that does not contain the train without locomotive at [gps=1552,183].

There were no trains pathfinder changes recently so the only reason here is most likely this one cargo wagon without locomotive caused by most likely some mod removal or mod changes.

Re: [1.1.59] Train pathfinder is slow

Posted: Tue May 10, 2022 2:14 am
by ctnightmare
Thanks, I'll dig into it and close this ticket.

Re: [1.1.59] Train pathfinder is slow

Posted: Wed May 11, 2022 12:19 am
by ctnightmare
Fixing the train stop at [gps=1551,173] did the trick. If I can ask how you were able to track this down or point me to material so I can learn I would love to learn how

A million thanks

Re: [1.1.59] Train pathfinder is slow

Posted: Wed May 11, 2022 5:00 am
by boskid
ctnightmare wrote:
Wed May 11, 2022 12:19 am
If I can ask how you were able to track this down or point me to material so I can learn I would love to learn how
I was running factorio under debugger, not something that you could do so there are no options for you to find the issue yourself in 1.1.59. Since those data were annoying to obtain even for me, i also implemented a debug setting "show-train-no-path-details" that will be available starting from version 1.1.60 when it will be released. This debug setting will be printing a lot of extra details of the trains pathfinder showing how many steps trains pathfinder took, what was the penalty of the path, which train was requesting the path and where it is trying to go. This will include all the trains pathfinder requests that ended in the NO_PATH state, but it will also report slow trains pathfinder searches (those which took >= 10000 steps by default, configurable through a threshold inside of "the rest" hidden settings).

Re: [1.1.59] Train pathfinder is slow

Posted: Sun Jan 08, 2023 5:08 pm
by DarkShadow44
Could a mod please move this to fixed / not a bug?