Page 1 of 1

[kovarex] [0.17.64] Circuit controlled train signal "opens" by itself although set to "closed"

Posted: Tue Aug 13, 2019 9:46 pm
by Impatient
The case I found, while experimenting with circuit controlled train signals, shows a train signal, that is set to "closed" via the circuit network, but for no obvious reason sets itself to "reserved" and lets a train pass.

Steps:
1. Load attached save. (Load without mods, none are required to reproduce).
2. Use the constant combinator. Increase the value for signal G to anything above 10 to open the train signal and dispatch the train.
3. Decrease the value for signal G below 10 to close the train signal again.

Observed behavior:
The train loops around once and stops at the station. When it then approaches the circuit controlled train signal, the train signal sets itself to "reserved" and lets the train pass. The train loops around a 2nd time and after another stop at the station finally comes to a permanent halt at the train signal.

Expected behavior:
The circuit controlled train signal follows its set closed condition and does not open. The train comes to a permanent halt at the train signal after one loop.

Edit: Further observations
The behavior changes to the expected one, when the 2nd train signal (to the right of the station) is moved further to the right, in a way that the train, stopping at the station, is in one track section, not in both.

Re: [0.17.64] Circuit controlled train signal "opens" by itself although set to "closed"

Posted: Wed Aug 14, 2019 12:09 am
by ATAD
I think this bug may be related to (or possibly a duplicate of) the bug which I reported earlier: viewtopic.php?f=7&t=74390

Re: [0.17.64] Circuit controlled train signal "opens" by itself although set to "closed"

Posted: Wed Aug 14, 2019 1:12 am
by Impatient
In terms of the train signal not following its set closed condition definitely.

Re: [0.17.64] Circuit controlled train signal "opens" by itself although set to "closed"

Posted: Wed Aug 14, 2019 2:14 am
by mmmPI
If we load the save without mods, there is no way to make wire at all ? ( can't even make them appear in infinity chest ).

I tried a few things, it is odd that it ALWAYS takes the train 2 turns to realise the signal is supposed to be close. If you turn it off, the first turn it always bypass the signal when starting from TSN2. And the 2nd turn, it stops in front of it.

Edit: my guess is that is has to do with where the train is when you turn off the signal. The fact that there is only 2 blocks in your setup may introduce weird behavior i would try with more signal in the loop.

Re: [0.17.64] Circuit controlled train signal "opens" by itself although set to "closed"

Posted: Wed Aug 14, 2019 2:54 am
by Impatient
mmmPI wrote:
Wed Aug 14, 2019 2:14 am
If we load the save without mods, there is no way to make wire at all ? ( can't even make them appear in infinity chest ).
Hm, maybe the mod "Wire Shortcuts" deleted the recipes. I don't know. Load it with the mods. They don't change anything. They are just there to support blueprinting and experimentation.
mmmPI wrote:
Wed Aug 14, 2019 2:14 am
I tried a few things, it is odd that it ALWAYS takes the train 2 turns to realise the signal is supposed to be close. If you turn it off, the first turn it always bypass the signal when starting from TSN2. And the 2nd turn, it stops in front of it.
That is the weird thing for the devs to shed some light on. Why is the train signal behaving that way? And while doing so: Why is the train signal not switching to "reserved" consistently? Why only after the first loop?
mmmPI wrote:
Wed Aug 14, 2019 2:14 am
Edit: my guess is that is has to do with where the train is when you turn off the signal. The fact that there is only 2 blocks in your setup may introduce weird behavior i would try with more signal in the loop.
I agree with you there. It can be handled that way. But the baseline is, that the train signal is not following its set closed condition. It seems that something, under certain conditions (the pathing algo?) can override it. That feels like a bug, certainly is unexpected.

Re: [0.17.64] Circuit controlled train signal "opens" by itself although set to "closed"

Posted: Thu Aug 15, 2019 12:12 am
by mmmPI
Using the mods is annoying if you are not used to press alt F or alt G to get wire, they disappear when you try to have some in your inventory or toolbar!
in those cases i just place wire in slot for shortcut 1 and 2 i had to do differently :) !

it's ok though, i was thinking about this and realise that if you place a lamp like this you see something interesting:
wihtlamp.jpg
wihtlamp.jpg (235.58 KiB) Viewed 2988 times
The first turn the lamp is red, this means the first turn the signal is closed because the train was already in the block when the pathfinding was done. So the signal let the train through.

The second time, the lamp turns off, this means the block is now shut down by signal, the train had left it for a while. Which means it is prevented from entering again.

This looks similar to
mmmPI wrote:
Sat Aug 10, 2019 10:16 pm
if you click the little V you should get the pictures
Except the train in your case only cross the signal once due to it being shut down for other reasons the second turn. That would also explain why with more signal in the loop it doesn't happen. not 100% sure though :D

Re: [kovarex] [0.17.64] Circuit controlled train signal "opens" by itself although set to "closed"

Posted: Mon Sep 02, 2019 11:30 am
by kovarex
The problem was, that the block was already occupied by the same train, and the circuit network didn't have time to "tap" the signal.
But since it might be useful, I added a condition, that train signal can't be re-reserved by train when the circuit network wants to tap it, even if the block it guards is already occupied by the same train.