Author Topic: Bug: Platform signals effect all trains in same platform.  (Read 10437 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2186
  • Helpful: 108
  • Languages: EN
Bug: Platform signals effect all trains in same platform.
« on: April 02, 2018, 07:01:39 AM »
Stations are often various sizes for various reasons. For example one might have a long station to support a long train service line. This station, with its long platforms, might also be serviced by much smaller train service lines. If the size difference between the services is large enough it might even be possible for 2 or more entire trains to enter the same platform if operating in the drive by sight mode. When this happens the departing train (stopped at platform) should use the platform relevant signal to depart with while the train behind should continue in drive by sight mode until stopped at the platform, upon which it changes to the platform relevant signal.

What is currently happening is the train behind instantly inherits the platform relevant signal upon entering the platform area. This means that a drive by sight train stuck behind another train will suddenly change to being timed interval if the platform is serviced by a timed interval signal such as a station signal. Since both trains are then in timed interval mode they will perform an emergency stop. Once the emergency stop is complete, both trains revert back to drive by sight mode, however since both trains are still in the platform they then instantly revert back to timed interval. Since the train behind is trying to pull into the platform while the train in front has yet to depart they have to both perform an emergency stop again. This continues in an infinite emergency stop loop, a total deadlock of the entire line.

Now obviously trains should not be operating in drive by sight mode for common use and that trains should be spaced out to avoid emergency stops in platform areas the first place. However this sort of situation commonly occurs when one is clearing a line blockage so convoys end up spaced far too close together until they reach a stop with scheduling to spread them out. I am also aware this is likely not a problem with absolute block signalling since by definition no 2 trains will ever enter the same block so no need emergency breaks can occur.

I think the solution is that trains should only inherit the platform relevant signal reservation type upon departure from the stop and only upon departure. Trains passing through the platform or which have yet to stop at it keep their existing block reservation mode and treat platform signals like there was no platform as they pass. This might have other mechanical implications that are not obvious from a user point of view.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17067
  • Country: gb
  • Helpful: 187
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Platform signals effect all trains in same platform.
« Reply #1 on: April 11, 2018, 11:49:58 PM »
Thank you for the report. I think that I have now fixed this by changing the logic so that the front of the two trains does not go into emergency stop if the rear of the two trains is in a stop with a station signal. I should be grateful if you could re-test with to-morrow's nightly build.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2186
  • Helpful: 108
  • Languages: EN
Re: Bug: Platform signals effect all trains in same platform.
« Reply #2 on: April 12, 2018, 07:38:45 AM »
Work around seems to work in the case of 2 trains being in the platform. Have not tried if there are 3 or more trains in a long platform so more testing is likely needed.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2186
  • Helpful: 108
  • Languages: EN
Re: Bug: Platform signals effect all trains in same platform.
« Reply #3 on: April 14, 2018, 03:38:12 AM »
Update: Just seen this bug deadlock 2 convoys at a distant signal outside of a station. The convoys might have been occupying the same tile due to another bug (train leaving depot with messed up coach offset until first reverse, this exists in standard).

A quick and dirty work around might be to add an extra 2-3 minutes emergency stop time to the train located behind, if one can be identified by facing directions. This way the train in front has plenty of time to get moving and clear the area.
« Last Edit: April 14, 2018, 05:16:25 AM by DrSuperGood »

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17067
  • Country: gb
  • Helpful: 187
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Platform signals effect all trains in same platform.
« Reply #4 on: April 14, 2018, 11:05:11 AM »
Update: Just seen this bug deadlock 2 convoys at a distant signal outside of a station. The convoys might have been occupying the same tile due to another bug (train leaving depot with messed up coach offset until first reverse, this exists in standard).

A quick and dirty work around might be to add an extra 2-3 minutes emergency stop time to the train located behind, if one can be identified by facing directions. This way the train in front has plenty of time to get moving and clear the area.

The train behind already has a greater emergency stop time (it is identified, not by the facing direction, but by being the one that triggers the emergency stop). The difference is currently 500ms in real time. I have increased this to 2,000ms to see whether this assists. I should be grateful if you could let me know whether this has made a difference.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2186
  • Helpful: 108
  • Languages: EN
Re: Bug: Platform signals effect all trains in same platform.
« Reply #5 on: April 16, 2018, 07:10:56 AM »
Trains no longer deadlock entirely but they will repeatedly cycle emergency stop due to the train in-front being unable to clear the tile before the train behind starts to move and causes an emergency stop again when trying to reserve the still ocupied tile. This means that a single such collision can take 10-20 game minutes of emergancy stops before the convoys crawl away in drive by sight mode.

I would recommend raising the difference to 10,000-15,000ms. Trains accelerate very slowly, especially if early types or full, so they need a substantial lead time to clear away from an emergancy stop.

A better, but more complex, solution would be that a train switching to time interval block reservation mode while stationary starts off by using drive by sight to check if the tiles infront are free. Only if the tiles infront are free will it set off and start to move, acting as normal time interval would. If the tiles are not free the train blocks waiting for clearance without triggering an emergancy stop, only to start moving once the tiles are free. This would prevent trains repeatedly causing emergancy stops because the train stuck behind would wait for some nominal distance between them and the train in front before even trying to move.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 17067
  • Country: gb
  • Helpful: 187
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Platform signals effect all trains in same platform.
« Reply #6 on: April 16, 2018, 10:43:36 PM »
Can you upload a saved game in which this can reliably be reproduced? Adding 10-15 seconds to the rear train seems a little punitive - it would be useful to be able to test different values here.