[2.0.11] Train pathfinding takes much longer path
[2.0.11] Train pathfinding takes much longer path
I wanted to add temporary train stop using Ctrl+LeftClick
Train took much longer path, seemingly unable to path through certain spot.
It happens on both sides of incriminated spot. Train can pass through it when driven manually.
I copied incriminated rail spot into map editor to create small save file. Bug happened again, but in slightly different spot.
Edit: Adding some rail signals (on both sides of the rail) moves the incriminated spot and might create new ones.
Train took much longer path, seemingly unable to path through certain spot.
It happens on both sides of incriminated spot. Train can pass through it when driven manually.
I copied incriminated rail spot into map editor to create small save file. Bug happened again, but in slightly different spot.
Edit: Adding some rail signals (on both sides of the rail) moves the incriminated spot and might create new ones.
- Attachments
-
- Edit: Adding signals moves incriminated spot.
- 20241029013420_1.jpg (261.31 KiB) Viewed 696 times
-
- 20241029013415_1.jpg (253.39 KiB) Viewed 696 times
-
- Edit: Or creates additional one.
- 20241029013404_1.jpg (261.24 KiB) Viewed 696 times
-
- Rails are connected, train can get through.
- 20241029011558_1.jpg (600.99 KiB) Viewed 704 times
-
- 20241029011550_1.jpg (210.99 KiB) Viewed 704 times
-
- 20241029011548_1.jpg (219.95 KiB) Viewed 704 times
-
- 20241029011521_1.jpg (218.96 KiB) Viewed 704 times
-
- 20241029011517_1.jpg (212.55 KiB) Viewed 704 times
-
- This is where I discovered the bug in my gameplay. I used same rail layout in the editor (middle bottom section).
- 20241029005516_1.jpg (379.96 KiB) Viewed 704 times
-
- PathingBug.zip
- (2.02 MiB) Downloaded 10 times
-
- Long Handed Inserter
- Posts: 50
- Joined: Thu Sep 11, 2014 12:14 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
Just to add, I have encountered this situation too, while using elevated rails and double headed trains on Fulgora. The rail is a single unsignalled loop of elevated rail with a single double headed train. This is on the latest experimental 2.0.16.
When I drive manually there is no problem getting round the corner.
Attached screenshots show the path chosen being short just before the top of the bend, then going the wrong way to get slightly further, then showing chunk boundaries (if relevant) and finally showing that manually driving round the corner is fine. Save file attached.
When I drive manually there is no problem getting round the corner.
Attached screenshots show the path chosen being short just before the top of the bend, then going the wrong way to get slightly further, then showing chunk boundaries (if relevant) and finally showing that manually driving round the corner is fine. Save file attached.
- Attachments
-
- SASP.zip
- (19.72 MiB) Downloaded 16 times
-
- TrainPathShort.png (142.22 KiB) Viewed 600 times
-
- TrainPathManual.png (2.4 MiB) Viewed 600 times
-
- TrainPathLong.png (147.38 KiB) Viewed 600 times
-
- TrainPathChunks.png (2.89 MiB) Viewed 600 times
- BraveCaperCat
- Filter Inserter
- Posts: 303
- Joined: Mon Jan 15, 2024 10:10 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
A temporary solution for now, is not using double-headed trains on loops of track. Or not using double-headed trains at all.
Creator of multiple mods, including Quality Assurance - My most popular one. Expect multiple modding-related questions, answers and other posts.
-
- Long Handed Inserter
- Posts: 50
- Joined: Thu Sep 11, 2014 12:14 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
And one follow up test: if I remove the rear train then the train happily paths forward in the expected way. Re-adding the rear facing train and the oddity reappears. I presume this is something to do with the internal representation of loops of rail.
-
- Long Handed Inserter
- Posts: 50
- Joined: Thu Sep 11, 2014 12:14 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
I don't think anyone is suggesting that they can't play the game because of this, but this is a rather obviously strange situation that should not be occurring.BraveCaperCat wrote: ↑Mon Nov 11, 2024 10:13 am A temporary solution for now, is not using double-headed trains on loops of track. Or not using double-headed trains at all.
I haven't used double headed trains in the past, but was just thinking about experimenting with them on Fulgora, due to the difficulty of getting two parallel rails placed on the islands and shallow oil oceans. This pathing issue makes this solution less attractive, and I don't think that the devs want to force a particular style of railways because of pathing oddities.
Re: [2.0.11] Train pathfinding takes much longer path
This usually indicates a break in the rail or (what I think is happening here) an unpaired signal somewhere, making a section of the rail one-way only. I can't tell that this isn't a bug, but also I don't see all signals in the screenshots to definitely prove one way or the other.
Re: [2.0.11] Train pathfinding takes much longer path
I think what might be going on here is that double headed trains on bidirectional or unsignalled track pick a direction arbitrarily, and if they find any path then just go. I don't think they check both directions unless the first one fails.
You normally don't notice this because they are starting from one-way-signalled or dead-end station tracks.
You normally don't notice this because they are starting from one-way-signalled or dead-end station tracks.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
- BraveCaperCat
- Filter Inserter
- Posts: 303
- Joined: Mon Jan 15, 2024 10:10 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
You can use single-headed trains on "non-loops", by adding a mini-loop on each end of the track (which would be on land anyway) for the train(s) to turn around. Of course, if you want to run multiple trains you will need some extra bits of track in between to allow trains to pass by each other when travelling in opposite directions.SteelGiant wrote: ↑Mon Nov 11, 2024 12:32 pmI don't think anyone is suggesting that they can't play the game because of this, but this is a rather obviously strange situation that should not be occurring.BraveCaperCat wrote: ↑Mon Nov 11, 2024 10:13 am A temporary solution for now, is not using double-headed trains on loops of track. Or not using double-headed trains at all.
I haven't used double headed trains in the past, but was just thinking about experimenting with them on Fulgora, due to the difficulty of getting two parallel rails placed on the islands and shallow oil oceans. This pathing issue makes this solution less attractive, and I don't think that the devs want to force a particular style of railways because of pathing oddities.
Creator of multiple mods, including Quality Assurance - My most popular one. Expect multiple modding-related questions, answers and other posts.
-
- Long Handed Inserter
- Posts: 50
- Joined: Thu Sep 11, 2014 12:14 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
From my example, neither of these options are possible. The rail has no signals at all anywhere, and there is no break in the rail as shown in the last screenshot with the train manually driving round the bend without issue. Further, taking off the back engine allows the train to path correctly (round that corner and everywhere else), while adding on the second engine again makes it take the long way at the exact same point again. See save if you want to test more hypotheses.jagholin wrote: ↑Mon Nov 11, 2024 12:41 pm This usually indicates a break in the rail or (what I think is happening here) an unpaired signal somewhere, making a section of the rail one-way only. I can't tell that this isn't a bug, but also I don't see all signals in the screenshots to definitely prove one way or the other.
-
- Long Handed Inserter
- Posts: 50
- Joined: Thu Sep 11, 2014 12:14 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
Hmmm... Is this documented anywhere, and is this intended behaviour by the devs?robot256 wrote: ↑Mon Nov 11, 2024 12:59 pm I think what might be going on here is that double headed trains on bidirectional or unsignalled track pick a direction arbitrarily, and if they find any path then just go. I don't think they check both directions unless the first one fails.
You normally don't notice this because they are starting from one-way-signalled or dead-end station tracks.
Re: [2.0.11] Train pathfinding takes much longer path
I looked and couldn't find anything direct. I do know that trains won't change direction at all when they are waiting at a signal, even if that would get them there faster.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: [2.0.11] Train pathfinding takes much longer path
Thanks for the report. This is an edge case in the path-finding logic that has no nice solution.
If you want to get ahold of me I'm almost always on Discord.
- BlueTemplar
- Smart Inserter
- Posts: 3160
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
I have a 'worse' example :
The pathfinder is thinking that there's no path from Taw to the northern bridge.
Of course, as you can easily see, you can get there by going to Phyire first and then reverse course.
Two-headed trains are pretty much «second-class citizens» in Factorio, for better (general train performance, especially single-headed) or worse (these kinds of issues, which are sadly more common for new players, and also in Space Age in general (even on Nauvis, without cliff explosives ??), see also (though I haven't tried this one in 2.0 again yet)).
The pathfinder is thinking that there's no path from Taw to the northern bridge.
Of course, as you can easily see, you can get there by going to Phyire first and then reverse course.
Two-headed trains are pretty much «second-class citizens» in Factorio, for better (general train performance, especially single-headed) or worse (these kinds of issues, which are sadly more common for new players, and also in Space Age in general (even on Nauvis, without cliff explosives ??), see also (though I haven't tried this one in 2.0 again yet)).
BobDiggity (mod-scenario-pack)
Re: [2.0.11] Train pathfinding takes much longer path
That's a completely different issue and easily solved if you add a station and schedule entry where it can reverse directions. It's not reasonable to expect the pathfinder to figure out where to change directions mid path on its own.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
- BlueTemplar
- Smart Inserter
- Posts: 3160
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
Why not ?
And what schedule entry, we're (mostly) not talking about automated schedules here, but about temporary train stops.
And what schedule entry, we're (mostly) not talking about automated schedules here, but about temporary train stops.
BobDiggity (mod-scenario-pack)
Re: [2.0.11] Train pathfinding takes much longer path
Trains in Factorio have never worked this way. They don't add stations themselves as waypoints, and they don't spontaneously reverse direction.BlueTemplar wrote: ↑Mon Nov 11, 2024 6:27 pm Why not ?
And what schedule entry, we're (mostly) not talking about automated schedules here, but about temporary train stops.
However, you can add the station to the train schedule yourself with no leaving conditions, and then I think it should work.
- BlueTemplar
- Smart Inserter
- Posts: 3160
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
A new player isn't going to know that. They will think there is really an issue with the train/track, or that there's a bug with the pathfinder.Trains in Factorio have never worked this way.
seems to be the issue with the original post, that's why I posted mine here.they don't spontaneously reverse direction
BobDiggity (mod-scenario-pack)
Re: [2.0.11] Train pathfinding takes much longer path
Yeah, like a third of the bug reports lately have been first-time posters who don't know how things are supposed to work yet and just assume it's a bug. For some things maybe the tutorials would help if they did them. For others, not much we can do besides increase the volume of posts and videos in the hopes they find them before getting too confused.BlueTemplar wrote: ↑Mon Nov 11, 2024 6:43 pmA new player isn't going to know that. They will think there is really an issue with the train/track, or that there's a bug with the pathfinder.Trains in Factorio have never worked this way.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: [2.0.11] Train pathfinding takes much longer path
That may be the case, but so what?BlueTemplar wrote: ↑Mon Nov 11, 2024 6:43 pmA new player isn't going to know that. They will think there is really an issue with the train/track, or that there's a bug with the pathfinder.Trains in Factorio have never worked this way.
A new player plays the game, experiments, finds out what works and what doesn't. Spontaneous train reversal doesn't work.
- BlueTemplar
- Smart Inserter
- Posts: 3160
- Joined: Fri Jun 08, 2018 2:16 pm
- Contact:
Re: [2.0.11] Train pathfinding takes much longer path
My point is that there is a bug : there is a possible path, and the pathfinder can't find it (or finds the wrong one in OP's case).
It's just (probably) not one that is worth fixing. (But why needs to be explained to new players.)
(This is probably also why this has been classified in «Minor issues», rather than «Not a bug» ?)
It's just (probably) not one that is worth fixing. (But why needs to be explained to new players.)
(This is probably also why this has been classified in «Minor issues», rather than «Not a bug» ?)
BobDiggity (mod-scenario-pack)