The International Simutrans Forum

 

Author Topic: [Bug] Trains ignoring collision when near a distant signal  (Read 304 times)

0 Members and 1 Guest are viewing this topic.

Offline guxx

  • *
  • Posts: 2
[Bug] Trains ignoring collision when near a distant signal
« on: November 03, 2019, 06:31:15 PM »
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.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2735
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: [Bug] Trains ignoring collision when near a distant signal
« Reply #1 on: November 04, 2019, 08:54:52 PM »
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.

Offline Freahk

  • *
  • Posts: 228
  • Languages: DE, EN
Re: [Bug] Trains ignoring collision when near a distant signal
« Reply #2 on: November 04, 2019, 09:42:26 PM »
Trains passing through each other should never happen, no matter the falsy signal setup.

Offline guxx

  • *
  • Posts: 2
Re: [Bug] Trains ignoring collision when near a distant signal
« Reply #3 on: November 08, 2019, 02:32:14 AM »
Trains 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.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2735
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: [Bug] Trains ignoring collision when near a distant signal
« Reply #4 on: November 08, 2019, 02:20:41 PM »
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.