News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[Bug] Trains ignoring collision when near a distant signal

Started by guxx, November 03, 2019, 06:31:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

guxx

Hello!

While I was playing with trains and signals I stumbled upon a mysterious issue.
In a very particular situation, two colliding trains are not deadlocking when they should, but instead they ignore collision and drive through each other.
This seems to happen (only) near a distant signal. I managed to reproduce this in a quite small test, see the animation (made with current nightly build):



Save is here. After loading you just need to wait until both trains get near to the rightmost station. You can use fast-forward.
If you miss it, no worries, just wait until next opportunity because it loops infinitely.

Note 1: The signal on the right is a distant signal. This does not happen if it is replaced with a normal 2-aspect signal (haven't tried others yet).

Note 2: In the animation some details are missed in between frames. Depending on the particular timing, you can notice the right train "having doubts"
(says "waiting for clearance") for a fraction of second (single tick?) before moving on and ignoring collision.

Note 3: I'm not sure yet if reversing is essential for this to happen, or it is just enough to get two trains against each other on a bidirectional track.
I will try to reproduce a similar situation without reversing involved. I can also try to provide saves with slightly different timings which might give more insight.

Vladki

Distant signal is not supposed to prevent train from moving through. Its aspects are caution and clear, both allowing train to pass. The other train is in drive by sight, so it correctly stops one tile ahead of the occupied station. What did you tried to achieve? There is no main (stop) signal ahead of the distant signal, so it does not know what aspect to show? Even if it would be stop signal (instead of distant), it would deadlock.

So although this looks like a bug, it is on layout that is not expected to work anyway.

Mariculous

Trains passing through each other should never happen, no matter the falsy signal setup.

guxx

Quote from: Freahk on November 04, 2019, 09:42:26 PMTrains passing through each other should never happen, no matter the falsy signal setup.

I agree with this and this is what I'm reporting. I'm not claiming that this signal layout is valid or useful. It's only purpose is to demonstrate behaviour that I didn't expect to see, and which I discovered accidentally.

Vladki

I think that the collision detection is implemented only in time interval method, and collision avoidance in drive by sight. All others simply do not expect that collisions could happen - which you proved is wrong.