This is going to be a fairly rare problem, but I hope you fix it regardless.
I was playing a multiplayer game the other night, riding a train out to the hinterlands to bring in some more ore. The game had several mods, including the FARL, but as mods cannot to my knowledge modify the train behavior, I don't think they are the cause. As I was riding the train, I adjusted the train's schedule. I don't recall the precise adjustments I made, but I believe I rearranged the stops by removing one and adding it in a different position. It seems that I happened to do this exactly while I was in the loop you see here. The train apparently decided to turn around and head east, then as I completed my adjustment it decided to head west afterall. The result is the stuck trains you see here.
Of course this is exacerbated by having such tight loops in the tracks, but I didn't design the track network. In any case, the train should have planned a longer route that didn't self-intersect; there are plenty of other loops about the place where it could have successfully turned around.
[0.14.x] [Hanziq] train plans a self-intersecting route
[0.14.x] [Hanziq] train plans a self-intersecting route
- Attachments
-
- screenshot showing the self-intersecting route
- factorio train routed in a loop.png (3.53 MiB) Viewed 6689 times
Re: train plans a self-intersecting route
There is a bug, that the train cannot reserve a block in which it is located, that should be fixed for 0.13. This will of course mean, that if the train is too long, it will hit itself, which we do not consider a bug. I'm not sure if I can get rid of the self-intersecting paths in the pathfinder.
Re: train plans a self-intersecting route
Hmm. You know the lengths of the blocks and the length of the train. If a block in the route is reserved twice, or is the block the train is currently in, then add up the lengths of the blocks between these two endpoints and compare it to the length of the train?
On the other hand, I just thought of a track design that would cause a false-positive: the block it enters twice might have two parallel tracks and the train would not actually self-intersect. Difficult indeed.
Perhaps your idea of having the train proceed but potentially crash into itself is a good one.
On the other hand, I just thought of a track design that would cause a false-positive: the block it enters twice might have two parallel tracks and the train would not actually self-intersect. Difficult indeed.
Perhaps your idea of having the train proceed but potentially crash into itself is a good one.
Re: [0.14.x] [Hanziq] train plans a self-intersecting route
I've had this twice in the current 0.15 experimental releases, and these were naturally occurring due to the periodic train reroute calculations - no manual timetable editing.
One possible (but hacky) workaround I can suggest - if a train is stopped at a chain signal AND the blocking train is itself,
then treat the chain signal as a regular signal temporarally.
This way, if the train is short enough to fit on the loop it should get unstuck. If it's long, it'll still get stuck, but it'll solve a lot of cases.
It doesn't even need to be immediate - start a timer when stopped at a chain signal, and if it fires before the train moves, perform this extra check.
Do you think this might help?
One possible (but hacky) workaround I can suggest - if a train is stopped at a chain signal AND the blocking train is itself,
then treat the chain signal as a regular signal temporarally.
This way, if the train is short enough to fit on the loop it should get unstuck. If it's long, it'll still get stuck, but it'll solve a lot of cases.
It doesn't even need to be immediate - start a timer when stopped at a chain signal, and if it fires before the train moves, perform this extra check.
Do you think this might help?
Re: [0.14.x] [Hanziq] train plans a self-intersecting route
https://www.dropbox.com/s/qh209mge6sa8q ... 7.png?dl=0
this seems like a really bad pathfinding bug. instead of doing a simple 90° turn, the train wants to go around the whole roundabout before going in the right direction.
this seems like a really bad pathfinding bug. instead of doing a simple 90° turn, the train wants to go around the whole roundabout before going in the right direction.
Last edited by ARC190 on Sat Jun 03, 2017 7:17 pm, edited 1 time in total.
Re: [0.14.x] [Hanziq] train plans a self-intersecting route
You will need to post a public link of your image instead of your private URL if you want us to be able to see it.ARC190 wrote:
this seems like a really bad pathfinding bug. instead of doing a simple 90° turn, the train wants to go around the whole roundabout before going in the right direction.
Re: [0.14.x] [Hanziq] train plans a self-intersecting route
Still not fixed as of 15.20. Can happen in vanilla game.
Issue is the train decides to change its path after it enters the roundabout, so it picks the exit it already passed.
Bug is: Train can change paths in middle of chain signal block... And furthermore when it does, it picks paths it can't reserve.
See: viewtopic.php?f=41&t=26409
And viewtopic.php?f=41&t=19619
Issue is the train decides to change its path after it enters the roundabout, so it picks the exit it already passed.
Bug is: Train can change paths in middle of chain signal block... And furthermore when it does, it picks paths it can't reserve.
See: viewtopic.php?f=41&t=26409
And viewtopic.php?f=41&t=19619
Re: [0.14.x] [Hanziq] train plans a self-intersecting route
When you fix this?
- Attachments
-
- 20171002225557_1.jpg (906.9 KiB) Viewed 5424 times
Re: [0.14.x] [Hanziq] train plans a self-intersecting route
Yura881 : this bug is about trains choosing a self-intersecting path instead of a shorter non-intersecting path. (And we think that they are choosing to repath inside an intersection). In your case you can probably greatly reduce the likelihood of your train having issues by adding a left turn at the northern entrance to the roundabout, and giving the train a shorter non-intersecting path.
Re: [0.14.x] [Hanziq] train plans a self-intersecting route
This was likely fixed