The International Simutrans Forum

 

Author Topic: Bug: Trains ignore timed interval choose signal.  (Read 53496 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2732
  • Languages: EN
Bug: Trains ignore timed interval choose signal.
« on: April 03, 2018, 06:52:17 AM »
Under some very common conditions trains will completely ignore timed interval choose signals, trying to go the scheduled platform even if it is currently occupied. They will reserve junction tiles, completely deadlocking the terminal. Also applies to standard time interval signals which will fail to perform their junction check behaviour and permit the train to enter and block the junction for a station even if the junction+platform is only 500m in total. Basically one cannot set up terminals using timed interval signals currently as they will break badly.

So far the only thing in common with terminals effected by this problem is that reasonably close to the terminal junction the main line undergoes an elevation change. Attempts to recreate this in a test map have failed.
« Last Edit: April 16, 2018, 07:00:24 AM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #1 on: April 03, 2018, 09:20:33 AM »
Thank you for the report. Are you able to upload a saved game in which this can reliably be reproduced at a specific time and place?
« Last Edit: April 03, 2018, 09:51:48 AM by jamespetts »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2732
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #2 on: April 03, 2018, 08:33:48 PM »
Quote
Are you able to upload a saved game in which this can reliably be reproduced at a specific time and place?
No I cannot. All attempts to recreate this in a simple save have failed with the system working as expected.

It seems to always occur on the server. To the point I have had to revert some of my terminal stations back to drive through loops because they were always deadlocked by platform choose signals.

The only common factor I have between these stops is that there is an elevation change on the main line within breaking distance of the stop. Something my simple test maps did not have.

Offline Ves

  • Devotee
  • *
  • Posts: 1677
  • Languages: EN, SV, DK
Re: Bug: Trains ignore timed interval choose signal.
« Reply #3 on: April 03, 2018, 10:45:06 PM »
Ive captured this bug, I believe. I managed to provoke it on a small test map, and it is repeatable on my computer. Just load the save and fast forward, and the trains will all exit the depot, bump into each other (as they should) kind of space them self appart, but end up piling on one track at the terminus.
The trains also drive utterly slow, making me believe this bug is connected with the other bug DrSupergood mentioned.

https://simutrans-germany.com/files/upload/bug_-_time_interval_choose_signal_bug_state_before_bug_B.sve

I dont know wether the bug has already happened on this map, since I played around with the signals first, and then they worked fine. I was playing around with editing the route by laying out new tracks while the trains where driving, as well as modifying signalboxes.
I will see if I can produce a consistent way to "create" the bug in the first place.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #4 on: April 11, 2018, 10:49:55 PM »
Thank you for the report and the detailed reproduction instructions. I have tracked this down to an earlier attempt to fix this issue, which was apparently not successful in any event.

I should be grateful if you could confirm whether this is fixed with to-morrow's nightly build.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2732
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #5 on: April 12, 2018, 06:52:38 AM »
Not fixed. Still see trains ignoring a choose signal and then driving straight into the train occupying the platform.

On the server game I seem to have got this continuously and reliably recreated. @6138,1992 going into Evening Parock Vilage Railway Station. The line is serviced very frequently so should be fesible to debug. The station has 2 platforms but the second platform makes part of a loop back and is blocked off by end of choose signal so the choose signal has only 1 platform to select from. I have observed this cycle over 3 times so hopefully it will persist until tomorrow.

It starts with 2 trains queueing behind the choose signal in drive by sight mode. Then when the platform is free the train waiting at the signal goes into the platform and waits for schedule. The train behind that then goes to stop at the choose signal. Upon stopping at the choose signal it then immediatly drives off in timed interval mode towards the ocupied platform. It will reach the ocupied platform and have to perform an emergancy stop. Another train arives at the choose signal and then correctly waits behind it for a free platform. Then the first train departs the platform, with the second train now using drive by sight to enter the platform. Another train queues up behind the train waiting at the choose signal. The second train then departs the platform. The cycle repeats.

The correct behaviour is that trains should be waiting at the choose signal until the platform is clear. There should never be an emergancy stop near the station area.

Possibly the timed interval mechanics are to blame? Timed interval choose signals should be limiting train entry to once every 5 minutes I would imagine, otherwise they would be another kind of choose signal. It seems reasonable that the line the train is comming from will have a convoy spacing of at least 5 minutes if operating correctly, so even if it enforced timed interval 5 minute mechanics it will still work well. The second train in the example cycle arrives at the signal long before 5 minutes have passed since the last train, so I imagine should be getting blocked by the timed interval mechanics, but instead is allowed through.

EDIT: Attached is a map demonstrating the problem. The choose signals are being completely ignored at one of the terminal stations. This map also shows the station signal slow stop approach bug.
« Last Edit: April 12, 2018, 08:03:45 AM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #6 on: April 14, 2018, 08:21:05 PM »
Thank you for uploading the saved game. The problem in that saved game is that the (non-telegraph) choose signal is more than 7 tiles from the location of the train stopped in the platform. Because the railway policemen can only see 7 tiles ahead, they cannot tell that a train is waiting >7 tiles ahead in the platform and so send the next train on. The solution is to put the signals as close as possible to the stations, which is a realistic way of signalling in any event.

Time interval signals protecting a junction (which all choose signals are deemed to be), incidentally, cannot sensibly make trains wait for 5 minutes before allowing the next to pass because the following train might be taking a completely different route, meaning that it would make no sense for the following train nonetheless to have to wait 5 minutes. Instead, the following train should be allowed to proceed as soon as its route up to 7 tiles ahead is clear, but be restricted to proceeding at caution speed (as was the case in real life). Good signalling design would then necessitate placing a further time interval signal after the junction but not more than 7 tiles away from the signal protecting the junction.

I will look into the slow approach issue presently.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2732
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #7 on: April 14, 2018, 10:36:21 PM »
Quote
Thank you for uploading the saved game. The problem in that saved game is that the (non-telegraph) choose signal is more than 7 tiles from the location of the train stopped in the platform. Because the railway policemen can only see 7 tiles ahead, they cannot tell that a train is waiting >7 tiles ahead in the platform and so send the next train on. The solution is to put the signals as close as possible to the stations, which is a realistic way of signalling in any event.
Why do you think I placed them so far away in the first place??? They do not work when placed close by. They do not work when placed far away. They never work reliably at all.

If all platforms are occupied the stupid railway policeman mostly sends the train to the default platform instead of getting it to wait at the choose signal. If there is even 1 platform free they work perfectly, just if all are occupied they do not. I guess they are wanting a collision to happen, with all the explosions, just fortunately Simutrans prevents that.

Also 7 tiles is not much. In fact your example video (@7:50) shows a terminal station where the train stops more than 7 tiles from the choose signals...
https://youtu.be/nZ07UmsVqVg?t=455
From choose signal to where train stops is ~10-11 tiles. This configuration does not work. Trains will ignore the choose signal if all platforms are full and drive to their default platform. 100% reproducable on server so far as I can tell. This happens with terminals where the choose signal is under 7 tiles away from the stopping tile.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #8 on: April 15, 2018, 01:26:36 AM »
This is not a very helpful manner of response. The specific thing that you described in this thread as a bug is in fact correct behaviour. If you placed the signals further from the station than they are designed to be placed (as clearly set out in the video tutorial) as a result of another bug, then you will need to post a separate report with that other bug and a saved game in which it can reliably be reproduced at a specific time and place (although I think that I have now managed to fix this - I should be grateful if you could re-test, and, if the problem has not been solved, post a new bug report with a full reproduction case rather than replying here). The behaviour described here is not a bug: it is not only intended, but explicitly explained in the tutorial video to which you link.

As to the separate problem relating to trains approaching stations with station signals very slowly, this is proving extremely difficult to track down. However, it appears to be related at least in part to the very odd arrangement of having a station with a reversing loop immediately beyond it instead of the more ordinary arrangement of having the trains reverse in the stations and also having a station signal. When I modify the track layout in the saved game that you provided either to replace the reversing loop with a normal set of crossovers in front of the station, or when I replace the station signal in the station with an ordinary stop signal at the end of the platform, the problem abates for all trains that depart the terminus station after the new arrangement was put in place. I suspect that the problem is related to the very obscure situation with which the signalling code was not designed to cope, viz. a train departing a station controlled by a station signal, leaving the platform, then, on the same route, returning to the station with the station signal in it before continuing on its way. If you avoid situations in which this occurs, you should be able to avoid the second of the two issues reported here.

Because (1) this issue has proven extremely difficult to resolve; and (2) it only occurs in track configurations that were never intended to be installed and are not realistic, I am considering this a low priority bug at present.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2732
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #9 on: April 15, 2018, 02:32:17 AM »
Sorry about the previous post but those timed interval choose signals have really been frustrating me recently. Once the server is playable again I will move around the entry signals to minimize distance. Previously I was required to place them at some distance to avoid another bug which might have been fixed.

Could we clarify what this 7 tile range is measured from and to? Is the tile immediately following the signal tile a distance of 1 with 6 tiles later being the final serviced tile?

Must the 7 tile range cover the far end of all platforms at the station? Or is a platform fully checked as long as any tile of it is within the 7 tile range? Or is the signal only aware a platform is occupied if the 7 tile range covers reserved or train occupied tiles? Or does it only work properly if the line scheduled stop tile is within the 7 tile range?

Is the 7 tile distance Manhattan or Euclidian measured?

Could one extend this distance by using telegraphed policeman cottages in any way? Or is this a hard limit to early station junction size? Or is it even a hard limit to early platform length?

Currently I am using a platform length of 3-4 with number of platforms being 2, 4 or 6. This results in a junction length of 1, 2 or 3 tiles before the station after the choose signal. This seems pretty reasonable and realistic so I would expect them to work well in this situation.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #10 on: April 15, 2018, 04:16:45 PM »
I have been investigating further this issue, as further testing has shown problems even where the track is signalled normally, albeit this has still been difficult to track down. However, I have pushed a fix for a related problem, which is that time interval station signals were not behaving correctly when those signals were not protecting any junctions: in those cases, where the signal was at danger, the train would start, but would travel at 1km/h for one tile, then revert to the drive by sight working method. They now correctly wait behind the signal until the requisite time has passed. However, I can no longer reproduce this with the corrected track layout and the latest fix.

For reference, here is the corrected track layout for the saved game that you supplied above.



To answer your questions: the 7 tiles is counted from the signal, and is the number of tiles along the route (i.e., route distance in tiles). The route will be reserved to the nearer of (1) the next signal after the time interval signal protecting a junction; or (2) the 7th tile of track beyond the signal on the train's route. If the route to that point is not clear, the signal will remain at danger and the train will not be able to pass. If the route to that point is clear, the signal will be at caution and the train will be permitted to pass at half line speed.

There is no mechanism for extending this distance other than by using time interval with telegraph signals. In reality, time interval with telegraph was used for all of the more complex junctions from the early days of railways. The time interval with telegraph (albeit the more expensive Cooke & Whetstone type) is now available from quite an early period, so this should be viable.

The time interval with telegraph working method is in reality a half-way house between pure time interval and pure absolute block signalling, and represents (realistically, in so far as I can reproduce this in Simutrans-Extended) the period of transition between time interval and absolute block signalling. Thus, in the time interval with telegraph working method, a signal protecting a junction will always reserve all the way to the next signal along the train's route and will not allow the train to pass unless this entire section is clear. On plain track, however, these signals operate like ordinary time interval signals (save that station signals will make a directional reservation).



Edit: A little more detail on this (and a bug fix report): if any part of the station platform is within 7 tiles of the time interval signal protecting a junction (or any choose signal), the whole station platform will be reserved and must be free for the signal to clear. In the saved game that you had uploaded, the station platform was 8 tiles away from the time interval signal, thus the reservation never reached the station platform.

Further, there was a bug causing the time interval reservation to extend to 1 tile less than the sighting distance, meaning that it would reserve only 6 tiles ahead: I have now fixed this on the master branch.
« Last Edit: April 15, 2018, 04:31:25 PM by jamespetts »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2732
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #11 on: April 16, 2018, 07:00:11 AM »
So far things are looking good. Have not seen trains entering station junctions when they should not. I am marking this as solved.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #12 on: April 16, 2018, 10:40:08 PM »
Splendid, thank you for confirming.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 576
  • Languages: EN, FR, DE, FI, SE
Re: Bug: Trains ignore timed interval choose signal.
« Reply #13 on: April 16, 2018, 11:38:13 PM »
Elsfont station on the server still regularly deadlocks.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2732
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #14 on: April 16, 2018, 11:51:42 PM »
Elsfont station seems to be on the boarder of choose signal range, with the end of platforms being over 7 tiles away if Euclidian distance is used. However it is using telegraph policeman cottage so that should not be a problem?

Offline Ves

  • Devotee
  • *
  • Posts: 1677
  • Languages: EN, SV, DK
Re: Bug: Trains ignore timed interval choose signal.
« Reply #15 on: April 17, 2018, 12:02:51 AM »
What I have found help sometime is to completely redo the schedule and signals. Can be a hassle though if you have alot of convoys

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #16 on: April 17, 2018, 11:06:30 PM »
It is not clear from the above description whether the deadlocks reported are as a result of a bug or not, as deadlocks can arise as a result either from a bug or from the design of the track layout/signalling/scheduling.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 576
  • Languages: EN, FR, DE, FI, SE
Re: Bug: Trains ignore timed interval choose signal.
« Reply #17 on: April 18, 2018, 12:20:23 AM »
The layout should be correct. It seems like it is always a train that is sent into the second platform from the east when it is occupied that causes the deadlock.

Update: Netstoke Southern Harbour is deadlocked at the moment.
« Last Edit: April 18, 2018, 02:22:58 PM by Rollmaterial »

Offline Ves

  • Devotee
  • *
  • Posts: 1677
  • Languages: EN, SV, DK
Re: Bug: Trains ignore timed interval choose signal.
« Reply #18 on: April 18, 2018, 08:51:41 PM »
Yes, This bug has occured at Netstoke Southern Harbour, messing around with our joint connection. I will rebuild the signals to see if it persists.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 576
  • Languages: EN, FR, DE, FI, SE
Re: Bug: Trains ignore timed interval choose signal.
« Reply #19 on: April 19, 2018, 05:57:39 PM »
It now also occurs at Okeinglow Heath, which was built from scratch under the current version.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #20 on: April 20, 2018, 07:31:48 PM »
I am still not clear on the nature of this issue - can I ask for more details of precisely where and when this issue can be seen to occur in the server game?

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 576
  • Languages: EN, FR, DE, FI, SE
Re: Bug: Trains ignore timed interval choose signal.
« Reply #21 on: April 20, 2018, 07:53:57 PM »
I believe that I have caught it in laboratory conditions. It seems to occur when a train already proceeding over an alternative route (in this save convoy No. 10) is caught up. It will lose its reservation and the train behind it will reserve a route and proceed to the same platform, creating the deadlock.
.sve: https://simutrans-germany.com/files/upload/Broken_time_interval.sve

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Trains ignore timed interval choose signal.
« Reply #22 on: April 21, 2018, 07:48:35 PM »
I think that I have now pushed a change which fixes this: emergency stops no longer clear a reservation. I should be grateful if you could confirm whether this assists the problem with the next nightly build.