[Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
[Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
A train passed through a chain signal and suddenly stopped some chain signals later. It shouldn't have entered this section if the path wasn't free.
Here is my save just a couple of seconds before the train arrives (vanilla): https://www.dropbox.com/s/mwx0udn108k09 ... g.zip?dl=0
You can find a detailed explanation of my setup and what I'm trying to achieve here. As I've explained, I have a lot of trouble with the pathing algorithm on this setup. I don't believe it is directly linked to this bug but this setup has unexplained patterns regarding train pathing.
TL;DR: one entrance with a chain signal, multiple routes (waiting bays) splitting and merging progressively, leading to a station, all of them being of equal length but with entrances closer/farther from the station. Intermediate chain signals are there to make sections smaller so that multiple trains can enter the waiting bays at a time.
What seems to happen is that the train entered the chain signals section, planning to go through an available waiting bay. For some reason when passing one of the chain signals, it rerouted twice (!!) through another waiting bay, but the second rerouting lead to a used waiting bay* (next regular signal is red). Therefore the chain signal suddenly switches from yellow to red, and stucks my train in the middle of chain signals.
*Why it did that in the first place, I really wonder: I don't understand (broke? ) the pathing algorithm on my setup... However it seems somehow correlated to the trains positions on the merging part of the waiting bays: I noticed it in the other topic, and when this bug occurs a train is moving in the merging part, probably causing the multiple reroutings. I would love you guys if you gave an explanation of what really happens here. I would really love this kind of setup to work, which doesn't seem possible so far.
Additionally, the train doesn't reroute even though it has alternative available paths. If I switch the automatic mode off/on, it changes its path and goes through an alternative (available) route.Here is my save just a couple of seconds before the train arrives (vanilla): https://www.dropbox.com/s/mwx0udn108k09 ... g.zip?dl=0
You can find a detailed explanation of my setup and what I'm trying to achieve here. As I've explained, I have a lot of trouble with the pathing algorithm on this setup. I don't believe it is directly linked to this bug but this setup has unexplained patterns regarding train pathing.
TL;DR: one entrance with a chain signal, multiple routes (waiting bays) splitting and merging progressively, leading to a station, all of them being of equal length but with entrances closer/farther from the station. Intermediate chain signals are there to make sections smaller so that multiple trains can enter the waiting bays at a time.
What seems to happen is that the train entered the chain signals section, planning to go through an available waiting bay. For some reason when passing one of the chain signals, it rerouted twice (!!) through another waiting bay, but the second rerouting lead to a used waiting bay* (next regular signal is red). Therefore the chain signal suddenly switches from yellow to red, and stucks my train in the middle of chain signals.
*Why it did that in the first place, I really wonder: I don't understand (broke? ) the pathing algorithm on my setup... However it seems somehow correlated to the trains positions on the merging part of the waiting bays: I noticed it in the other topic, and when this bug occurs a train is moving in the merging part, probably causing the multiple reroutings. I would love you guys if you gave an explanation of what really happens here. I would really love this kind of setup to work, which doesn't seem possible so far.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
I'm pretty sure I have a fix for this. I mean.. it fixes this scenario and the one linked I just don't know fully what the ramifications of my fix might be. At this stage in 0.15 stabilization I think it's too risky. I'll put it in 0.16.
I understand now what's causing the train to do what it's doing and why it's doing it - it was simply flawed in the case of large chain signal blocks with multiple exits.
This is the scenario:
I understand now what's causing the train to do what it's doing and why it's doing it - it was simply flawed in the case of large chain signal blocks with multiple exits.
This is the scenario:
- 1. A train is driving on a path towards some point.
2. The path crosses a set of chain signals which is perfectly valid for the train to cross
3. While the train is driving over the chain signals it detects that at it's current speed accounting for its braking force the total rail distance in front of itself + 1 contains a rail signal that it can't reserve
4. In this state the train tries to see if there's a better path that might be able to go around the blocked chain signal instead of just "stop at signal and wait"
5. If a new path is found that doesn't block the train then it keeps driving as if nothing happened
6. If there's no new path or the new path is also blocked by a signal the train slows to arrive at the blocked signal
If you want to get ahold of me I'm almost always on Discord.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
Do I understand this right? The last chain signal of the 3 chain signals turns blue (because a rail signal at that end of the chained blocks becomes red?) while the train is inside of the chained blocks. Because the chain signal is blue and the route the trains wants to go to is blocked (aka the rail signal at that end of the chain signal block is red), the train has to stop at the chain signal.
If my above paragraph is right, how would you fix that? There will always be long enough chained blocks so that a rail signal in a trains path can turn red while it's inside the chained blocks.
If my above paragraph is right, how would you fix that? There will always be long enough chained blocks so that a rail signal in a trains path can turn red while it's inside the chained blocks.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
No, once a train enters any chain signal block (assuming the logic is correct) it will always take the pre-determined exit route - that's where it's currently broken. If when it reaches the exit route the normal signal is red it will wait at that non-chain signal.Bilka wrote:Do I understand this right? The last chain signal of the 3 chain signals turns blue (because a rail signal at that end of the chained blocks becomes red?) while the train is inside of the chained blocks. Because the chain signal is blue and the route the trains wants to go to is blocked (aka the rail signal at that end of the chain signal block is red), the train has to stop at the chain signal.
If my above paragraph is right, how would you fix that? There will always be long enough chained blocks so that a rail signal in a trains path can turn red while it's inside the chained blocks.
However, if you're signaled your rails correctly that never happens because in a proper signaled setup the "end" signal would be impossible to block except by the train coming from the chain signals: AKA: one-way rails.
If you want to get ahold of me I'm almost always on Discord.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
Does this fix roundabouts?
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
Probably. I don't have a save that shows a reproducible problem with them so I couldn't test them.steinio wrote:Does this fix roundabouts?
If you want to get ahold of me I'm almost always on Discord.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
There was mention above that this will be fixed for 0.16 - and it's in latest release notes.
Is factorio bot a bit to zealous or it was moved to 0.15?
Is factorio bot a bit to zealous or it was moved to 0.15?
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
YES!!
Thanks for the fix, I'm excited to build a mega-train network in my 0.15 game and see how it goes.
Thanks for the fix, I'm excited to build a mega-train network in my 0.15 game and see how it goes.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
I put it in 0.15. I figure if it's going to cause problems it's easy enough to revert but at most it would cause "a train isn't going where I want" kind of problems and not crashes.orzelek wrote:There was mention above that this will be fixed for 0.16 - and it's in latest release notes.
Is factorio bot a bit to zealous or it was moved to 0.15?
If you want to get ahold of me I'm almost always on Discord.
- SupplyDepoo
- Filter Inserter
- Posts: 305
- Joined: Sat Oct 29, 2016 8:42 pm
- Contact:
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
It should be impossible for that to happen. When a train passes a chain signal, it reserves the exit.Rseding91 wrote:If when it reaches the exit route the normal signal is red it will wait at that non-chain signal.
Even if you have two-way rail and a shared exit block, or an exit block that crosses another exit block, it shouldn't cause problems. There's no "correct way to signal the exit block" in that sense. No matter how it's signaled, trains should never stop in a chain-signaled block, because of the reservation mechanic.Rseding91 wrote:However, if you're signaled your rails correctly that never happens because in a proper signaled setup the "end" signal would be impossible to block except by the train coming from the chain signals: AKA: one-way rails.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
Stuff
The purpose of this topic is not to demonstrate proper signalling but to show of a bug, unless one has additional information on this particular bug I would ask to refrain from making comments here.-Loewchen
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
I use that many signals only for throughput reasons: it helps loosening the bottleneck. The many chain signals are only there to have shorter blocks. I know it could work with fewer signals, but the way I designed it make it so that several trains may enter the waiting bays. If one goes all the way to the end, the following one can enter the first waiting bay while the first train still is one its way to its assigned waiting bay.ykyjohn wrote:StuffThe purpose of this topic is not to demonstrate proper signalling but to show of a bug, unless one has additional information on this particular bug I would ask to refrain from making comments here.
-Loewchen
Anyway, we should discuss it on the original thread instead of the bug report one. let's continue there: viewtopic.php?f=18&t=34321&p=216771
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
No. If a station is being disabled and the train changes route while in a roundabout it can still get stuck. (0.15.27)Rseding91 wrote:Probably. I don't have a save that shows a reproducible problem with them so I couldn't test them.steinio wrote:Does this fix roundabouts?
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
That's a different thing. There was an issue with trains in roundabouts.Nexarius wrote:No. If a station is being disabled and the train changes route while in a roundabout it can still get stuck. (0.15.27)Rseding91 wrote:Probably. I don't have a save that shows a reproducible problem with them so I couldn't test them.steinio wrote:Does this fix roundabouts?
If you want to get ahold of me I'm almost always on Discord.
-
- Inserter
- Posts: 41
- Joined: Wed Dec 14, 2016 7:33 am
- Contact:
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
This is fixable and we'd love it to be fixed, but as a programmer I can see that it's really not easy.Rseding91 wrote:That's a different thing. There was an issue with trains in roundabouts.Nexarius wrote:No. If a station is being disabled and the train changes route while in a roundabout it can still get stuck. (0.15.27)Rseding91 wrote:Probably. I don't have a save that shows a reproducible problem with them so I couldn't test them.steinio wrote:Does this fix roundabouts?
Now that random rerouting after chain signal is fixed (0.15.27 changelog, haven't tried yet), we need to do something intelligent on /forced/ rerouting after chain (eg destination station becomes disabled, track tile gets removed, normal signal forced red by circuit, etc)
So, what should we do in this case? Continue on the planned path *anway* until we pass the chain exit (first normal signal)? That could break stackers and such, but is still worth exploring.
Evaluate all reachable chain exits and ignore chain signals? That could cause crashes when multiple trains are in the same chain block - unless the train internally converts chains to normal signals until it exits the chain block.. This could still deadlock if there's two trains in a roundabout, in which case they'd want to fall back on continuing on their original planned route which should still be reserved/clear.
Hm that might work quite well, but if there's another viable destination station it could try to reroute towards that..
Plenty of thinking to be done on this one, but what we specifically *don't* want is trains *parking* in a chained roundabout/intersection when they get confused - they should exit the chain block and intelligently go *somewhere* outside the chain block without crashing into anyone else, somehow..
PS: the stacker thing might be more easily solved if we could attach circuit wires to chain signals
glossary for this post:
"chain block" is the block that a train would be in if all chain signals were removed, and only normal signals remained. Chain signals (already) make it so a train won't enter a "chain block" until it can exit that chain block past a normal signal, and multiple trains can simultaneously occupy a chain block.
"chain exit" is all reachable normal signals from within the current "chain block" - ie places that the train can exit the current chain block
- SupplyDepoo
- Filter Inserter
- Posts: 305
- Joined: Sat Oct 29, 2016 8:42 pm
- Contact:
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
- Trains should never reroute inside of chain-signaled blocks.
- When a train reserves blocks, it should be guaranteed that it will use them.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
O, I didn't realize this was actually a bug, I'd always find a spot to place another chain signal to isolate so that a different train could travel through the same area... but I guess that once that other train has passed it prompts the stuck train to recalculate its path? Or I have not been victim to this particular problem... either way, yay fixes!
-
- Inserter
- Posts: 41
- Joined: Wed Dec 14, 2016 7:33 am
- Contact:
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
The bug happens when a train reroutes, passes a signal or three and then sees *itself* in the next block and refuses to budge until manually moved.Ripshaft wrote:O, I didn't realize this was actually a bug, I'd always find a spot to place another chain signal to isolate so that a different train could travel through the same area... but I guess that once that other train has passed it prompts the stuck train to recalculate its path? Or I have not been victim to this particular problem... either way, yay fixes!
(it can also happen with multiple trains in large junctions, but this is the easiest one to reliably trigger and visualise)
This is really easy to trigger with 6-long or longer trains in roundabouts with 4 to 8 chain signals on the ring. It'll plan to go through the roundabout then reroute after the first signal and decide to go the other way, but its own tail is in that block and trains will never move into an occupied block - boom, deadlock.
There was a note in a recent changelog that the devs have stopped trains randomly rerouting after passing a chain signal but you can still trigger the deadlock by disabling their destination station while they're in the roundabout.
Re: [Rseding91] [0.14.14] Train stuck in between chain signals (due to rerouting?)
Personally I consider disabling stations whilst trains are en-route to them to be a case of shooting yourself in the foot. If that is causing you problems then don't disable stations whilst trains are en-route.