[0.17.79] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network conditio
[0.17.79] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network conditio
What did you do?
Set up some entry/exit conditions with the intent that trains should go to a station that they are able to enter.
What happened?
Trains deadlocked when they didn't have to.
Here's the setup:
The green train sits at Station B. It wants to go to Station A; there are two of them (eastern and western).
The white train sits at Station A. It wants to go to Station B, which is occupied by the green train.
At the eastern station A, the Rail Signal has been set to Closed using a circuit network condition.
Currently, this is a deadlock. The green train and white train wait forever for each to leave their station.
This should not be a deadlock, because the green train has a legal place to go, and waiting for the white train to clear the area *will not allow it to go there anyway*
In fact, if we remove the white train, the green train *does proceed* to the western copy of Station A:
It seems like the pathfinding logic applies the "train waiting here" penalty *instead of* the much higher "closed by circuit condition" penalty. This doesn't really make sense, since the circuit condition is very likely not going to change based on a train leaving the guarded block.
What did you expect to happen instead? It might be obvious to you, but do it anyway!
The train should have pathed to the western station, since it's able to do this when there isn't a train behind the signal. In either case the signal is closed.
Set up some entry/exit conditions with the intent that trains should go to a station that they are able to enter.
What happened?
Trains deadlocked when they didn't have to.
Here's the setup:
The green train sits at Station B. It wants to go to Station A; there are two of them (eastern and western).
The white train sits at Station A. It wants to go to Station B, which is occupied by the green train.
At the eastern station A, the Rail Signal has been set to Closed using a circuit network condition.
Currently, this is a deadlock. The green train and white train wait forever for each to leave their station.
This should not be a deadlock, because the green train has a legal place to go, and waiting for the white train to clear the area *will not allow it to go there anyway*
In fact, if we remove the white train, the green train *does proceed* to the western copy of Station A:
It seems like the pathfinding logic applies the "train waiting here" penalty *instead of* the much higher "closed by circuit condition" penalty. This doesn't really make sense, since the circuit condition is very likely not going to change based on a train leaving the guarded block.
What did you expect to happen instead? It might be obvious to you, but do it anyway!
The train should have pathed to the western station, since it's able to do this when there isn't a train behind the signal. In either case the signal is closed.
- Attachments
-
- Train Bug.zip
- (463.49 KiB) Downloaded 180 times
-
- factorio-current.log
- (5.56 KiB) Downloaded 193 times
Re: [0.17.19] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network cond
Technicaly signal that you refer as closed by CN, is in state CLOSED because of white train and not reserved_by_the_circuit_network, so penalty for signal closed by CN does not apply. I could easily fix this so signals that are closed and at same time, scheduled to close by CN (but not yet reserved_by_the_circuit_network) to also apply this penalty but i am not sure how much it will break.
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.79] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network cond
See also 79545 outside the bug forum.
Re: [0.17.19] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network cond
(a) I'd like that, it's always seemed unreasonable to me that a train in a rail block disables the circuit-controlled penalty, particularly because that's often the point, discouraging further pathing to/through a block.boskid wrote: ↑Sat Jan 04, 2020 9:06 am Technicaly signal that you refer as closed by CN, is in state CLOSED because of white train and not reserved_by_the_circuit_network, so penalty for signal closed by CN does not apply. I could easily fix this so signals that are closed and at same time, scheduled to close by CN (but not yet reserved_by_the_circuit_network) to also apply this penalty but i am not sure how much it will break.
(b) Shouldn't the train _eventually_ discover the other path? It looks 6m farther per second, 30m per 5s repath interval, right? So a few minutes tops here?
- When the path includes a train currently waiting at a rail signal -> Add a penalty of 100 + 0.1 for every tick the train has already waited.
(c) I can't load the supplied map, and when I try to recreate it I don't get a deadlock, the train repaths properly. I have seen trains refuse to repath at chain signals, it happens, it's just hard to reproduce.
... hunh. I built it, the trains repathed. I took the blueprint, pasted it in here, built the blueprint, now both the blueprinted and the original are deadlocked.
Re: [0.17.79] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network cond
I made test case and fixed penalty so it will be applied when rail signal is scheduled to be reserved for circuit network. It felt counter intuitive that adding train (and so changing signal state to CLOSED) was decreasing total penalty.
Re: [0.17.79] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network cond
Do note that that bp I posted deadlocked without circuit closure.
Re: [0.17.79] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network cond
Here's a save of the trains not repathing
- Attachments
-
- deadlocked trains.zip
- (1.72 MiB) Downloaded 162 times
Re: [0.17.79] Train incorrectly deadlocks in presence of occupied block guarded by signal closed by circuit network cond
Sigh. I'm actually getting weary of saying "you guys rock". Is there some less-boring way to phrase that?