Page 1 of 1

[kovarex] [0.17.47] train still ignoring red signal by circuit in special case

Posted: Sun Jun 09, 2019 8:07 pm
by Zanostra
viewtopic.php?f=11&t=71409

in this topic in announced a bug where trains are able to pass a red light when it is kept red by circuit logic.
at the very moment it had completely left the specific block briefly, another train was able to enter that block.
so a collision was possible.
the bug is resolved, partially.
the bug that I reported was not.
the trains are still able to enter that block because they reserved it the first time, and are granted access even though the second signal is kept red by circuit design.
knightelite wrote:
Sat Jun 01, 2019 4:52 am

Here's a fixed blueprint that does cause the trains to collide:
in this example it it still visible.
the trains do not collide anymore, so that part is fixed, but when the lights next to the signals are red, the trains were not even allowed at all to enter the problem block for the second time.

( the use of the blueprint: print, provide uranium fuel, start both trains shedule, put 1 thing on both entry belts, it doesn't matter what )

the post has been moved to resolved bugs,
is it something that you guys think will be fixable? or will it stay this way?
I still think that a train should wait at a red signal no matter what, because I put that signal red on purpose.
but I also can live with how it is now.

Re: [0.17.47] train still ignoring red signal by circuit in special case

Posted: Tue Jun 11, 2019 3:11 pm
by knightelite
I checked it, and I think you're right. It still does ignore the circuit controlled red signal in this demo even though it is held red prior to the train's braking distance arriving at it.

Video demonstrating the problem.

Re: [0.17.47] train still ignoring red signal by circuit in special case

Posted: Tue Jun 11, 2019 3:57 pm
by knightelite
Thinking about this some more (I can't test now because I'm at work) what is happening is that because the block with the circuit controlled signal on its output is so short, the train still hasn't cleared the original block yet therefore still reserving it. That's why it doesn't stop. I'm willing to bet that if you add about 150 tiles (75 rail segments) of straight rail between the start and end of the rail block (and all other rail blocks) with the circuit controlled signal that it will work as you expect. Definitely unintuitive, but it does make sense given the rules trains use for reserving blocks.

Re: [0.17.47] train still ignoring red signal by circuit in special case

Posted: Tue Jun 11, 2019 6:48 pm
by Zanostra
If you have really slow trains it will do, but if you use mods with really fast trains for example, it becomes another story.
I think that a train should always check if it even may pass a signal before it reserves the block it wants to enter,
even if it already has reserved it before.
If the second signal is red, that means that it may not enter that same block a second time.
I don't know how it works codewise, but i think that it reserves a block if its breaking-distance-point passes a green signal.
the signal becomes yellow/red and then the block is reserved.
if the breaking-distance-point leaves that block and enters that block again via a second signal,
now it thinks it has still access because it is himself who is occupying that block.
but when that second signal is red, it should not be able to pass.
it is allowed to pass because it only checks if the upcoming block is free or only reserved by himself,
but it should check if the signal can change collor before it checks that reservation.

( my god, my english is not good enough to express myself well :? )

Re: [0.17.47] train still ignoring red signal by circuit in special case

Posted: Tue Jun 11, 2019 8:25 pm
by knightelite
You got your point across effectively :) .

I agree with you, and I think (I'll try it tonight if you haven't done it yet) that if the train was out of the shared block this would work in the expected way. So perhaps this is working as expected now, but it's definitely not the intuitive behavior for this configuration.

Re: [kovarex] [0.17.47] train still ignoring red signal by circuit in special case

Posted: Thu Jun 13, 2019 12:29 pm
by kovarex
Thanks for the report, it is fixed for the next version now. (I wrote quite a lot of train related tests in the past 2 days, so things should start to stabilize for real now ^^)