Page 1 of 1

[0.17.50] Gate Read Sensor reacts multiple times to slow train

Posted: Wed Jun 19, 2019 1:35 pm
by Sircus
I have this train-counting configuration:
gate_config.png
gate_config.png (106.36 KiB) Viewed 1751 times
The gate is set to Read Sensor. The bottom arithmetic combinator receives this input and adds 0, producing a different output. The decider combinator checks whether the undelayed (gate) input is greater than the delayed (0-added) input and emits 1. The top arithmetic combinator adds the decider's output to a signal.

This all works beautifully if the train goes quickly through the gate. In some places, I have some routing logic just before the gate. Sometimes, trains stop at the routing signal. In these cases, when the train starts again and passes through the counter, multiple "open" events of the gate will occur.

I can reproduce this manually by putting a train some 20ish blocks away and driving through the gate, accelerating all the time. If I do that, the count is correct. If I instead start ~5 rail blocks away, where the gate has not been triggered to open yet, then multiple trains will be counted.

The effect is more pronounced if I drive backwards through the gate.

Note: this is not the "nothing happened for 5s, so the gate closed" effect. Visually, the gate remains completely open at all times. To trigger the bug, the train doesn't need to stop or decelerate. Continuous acceleration toward the gate will also trigger it, as long as the speed at which the train passes the gate is sufficiently slow.

Re: [0.17.50] Gate Read Sensor reacts multiple times to slow train

Posted: Fri Jun 21, 2019 11:35 am
by Sircus
I've attached a minimal test case. Three lines, three trains all in the same place. Counters placed somewhat differently. None of the trains has triggered any of the gates (if you switch them to manual mode and edge them back, then switch them to automatic, you'll see that the gate doesn't open as they approach the red signal).

Turn on the constant combinator to the right of the player - all three trains will depart. At least for me, A will count 4. B will count 5. C will (correctly) count 2.

(The test case was made using Creative Mode, but this is a vanilla save.)

Re: [0.17.50] Gate Read Sensor reacts multiple times to slow train

Posted: Mon Jun 24, 2019 3:07 pm
by kovarex
Hello, this is not a bug. The train repeatedly sends the signal to pen games in front of him so one gate can easily get more signals to open.

Re: [0.17.50] Gate Read Sensor reacts multiple times to slow train

Posted: Mon Jun 24, 2019 4:21 pm
by Sircus
But... the gate only actual opens once. I'm struggling to picture why a player would be more interested in the logic of how trains trigger gates than in when the gate actually opens?

Re: [0.17.50] Gate Read Sensor reacts multiple times to slow train

Posted: Wed Jan 29, 2020 2:07 am
by JasonC
Reported again: viewtopic.php?f=7&t=80584

Strongly disagree that this is not a bug, see description and points there.