The International Simutrans Forum

 

Author Topic: Bug: Connected one train staff signals using staff in both directions.  (Read 7678 times)

0 Members and 1 Guest are viewing this topic.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Sigh another day another bug...

Tried my hand at a terminal station using one train staff signal to force only 1 train into the terminal's junction at any given time. The idea being that only 1 train will enter the platform at any given time (the one with the staff) and on its way out it will return the staff for use by the next train.

James demonstrated this here under the part showing off a single track branch line from a double track mainline.
https://www.youtube.com/watch?v=iqmP8ju9YYE?t=3m10s

This is effectively what I am doing as the terminal and its junction is the branch line and the double track I use is the main line. I have made sure that the one train staff cabinets are placed on the correct side of the track, meaning that on my UK standard double track line the one for entry is on the left of the left track and the one for exit is on the right of the right track (if viewed as going towards the terminal).

Set this up. Started 6 trains on the double track before the one train staff cabinets. Went AFK a bit to watch other signalling vidoes. When I returned I was surprised to see 3 trains being in the junction (in the branch line) with one of the exiting trains using the one train staff on the double track main line rather than returning it and using the time interval signal for the mine line. Both one train staff cabinets are in adjacent tiles, connected by an edge, this is a parallel double track after all. Needless to say this line is not operating very well as a result...

What causes this and when does it happen I currently do not know. It will need further investigation. However this certainly is a huge bug with one train staff boxes, to the point they can be considered unusable in their current form.
« Last Edit: April 16, 2018, 07:02:21 AM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: One train staff signal allowing multiple trains into same block.
« Reply #1 on: March 21, 2018, 10:01:12 PM »
Thank you for the report. Can you upload a saved game in which this issue can reliably be reproduced in a specific place at a specific time?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: One train staff signal allowing multiple trains into same block.
« Reply #2 on: March 22, 2018, 07:01:31 AM »
Attached is a very simple map that demonstrates the problem. It is being recreated constantly (ever 1/32 of a month so a few seconds of fast forward), just enable block view to see that the double track main line is getting reserved by the one train staff, which it should not be acording to your video. You can withdraw all the convoys and then replace the one train staff boxes and restart 4 convoys and it will always recreate that state. The direction of the one train staff boxes does not matter, it always recreates this state.

It seems that boxes adjacent to each other are not sharing the same staff. The entry staff gets returned but a new staff is given out in the leaving direction, which is the main line. As such I have renamed this thread to more accurately reflect the bug. In any case it clearly is not working as intended.

Also note how the trains are stacking on top of each other in front of the entrance. This might be related to the bug.

This save is being used for another bug report (linked from the appropiate thread). Pressing the detail button on one of the trains will crash the game.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Thank you for the saved game. I think that the difficulty is that the one train staff cabinets are intended to be used with some other sort of signal or sign immediately after them at the exit point, or else the train on leaving the one train staff working method is not switched to any other working method and continues to behave partly as if it is in the one train staff working method). If you place end of signalling signs immediately beyond the one train staff cabinets on the double track section of main line, the trains revert to the drive by sight working method and do not display the behaviour that you report.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
However placing a time interval signal immediately after the exit point does not work and continues with the buggy behaviour seen in the demo map. This is how I encountered it on the server first, since I wanted the trains to run by time interval on the main line but use one train staff for the terminals.

As such the current work around would be (not tested, just theorizing)...
One train staff cabinet -> end of signalling signal -> time interval signal

Needless to say the train will pass this very slowly as it is having to change reservation modes 3 times.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Can you upload a saved game in which this issue can reliably be reproduced with a time interval signal?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Attached is a new demo map showing that the one train staff cabinet still breaks when timed interval signals are present after it is returned.

If the timed interval signals are placed directly after the one train staff cabinet it works correctly in 1 direction, but still breaks like the demo map in the other.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Thank you for that. I think that i have now fixed this (after a considerable amount of work: this was a difficult issue to track down properly).

I should be grateful if you could re-test with to-morrow's nightly build.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Not at all fixed...

The following have been observed to still happen in a clean line setup (all signals rebuilt).
  • Trains started near the entrance to a protected one staff cabinet block (not the main line) will show buggy reservation behaviour on exit unless they pass another signal before the one train staff cabinet. They will bug so much that multiple trains can be waiting on the same tile at the same time at the one train staff block entrance.
  • Trains started from behind a timed interval might not correctly obey the one train staff cabinet. The result is that 2 trains enter the same protected block at the same time (something that should be impossible). I am guessing this might have to do with a waiting train reverting to drive by sight due to being hit from behind by a timed interval train causing both to emergency stop.


Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Thank you for the further report. I am having considerable difficulties with this, so it might be a while before the fix is finalised. I note that, with the current version, the erroneous behaviour appears to occur only with every other train passing through the relevant sections. I will post again when I have managed to fix this.

Edit: Incidentally, for the arrangement that you have shown, you can simply use time interval signals - there is no particular need to use the one train staff working method in this situation. I suspect that this is why this particular combination had not been tested when the one train staff method was initially developed.
« Last Edit: March 28, 2018, 11:47:12 PM by jamespetts »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #10 on: March 29, 2018, 06:39:05 AM »
Quote
Edit: Incidentally, for the arrangement that you have shown, you can simply use time interval signals - there is no particular need to use the one train staff working method in this situation. I suspect that this is why this particular combination had not been tested when the one train staff method was initially developed.
Please explain how? How would timed interval signals stop 2 trains entering the terminal platform section at once and causing a deadlock?

Obviously later on there are station and station choose timed interval signals. But at the start there are only flag signal timed interval signals.

While you are at it, how am I meant to replace trains since in drive by sight mode replacement is prone to deadlock because one train tries to enter the depot as another exits. Currently I am using withdrawal all followed by starting new trains from a depot for the line so no train ever returns to depot.
« Last Edit: March 29, 2018, 06:58:28 AM by DrSuperGood »

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #11 on: March 29, 2018, 10:02:09 AM »
The signal before the crossover acts as a junction signal, so as long as the station is within sighting distance it will not let a train into an occupied platform.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #12 on: March 29, 2018, 10:22:51 AM »
As Rollmaterial states (and as is explained in the time interval signalling video tutorial), a time interval signal protecting a junction acts differently to a time interval signal protecting a plain track section, just as in real life.

A time interval signal protecting a junction will only clear when the route ahead can be reserved. A time interval signal without telegraph will only check the route ahead for 7 tiles, however. A time interval signal protecting a junction will only ever show a "danger" or "caution" aspect, and trains will need to pass a time interval signal protecting a section of clear track before being allowed to proceed at full speed.

Offline Ves

  • Devotee
  • *
  • Posts: 1677
  • Languages: EN, SV, DK
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #13 on: March 29, 2018, 01:12:39 PM »
That’s amazing, I also didn’t know or forgot about this feature.

This would be so helpful to be shown in the info window somehow. Are there any parameters that can be used in the signal logic to gather this information? I remember finding the flag that determines if the signal protects a junction, however, that flag was turning on and off a bit “random” and you told me that the flag was only ever intended to work internally and would turn on and of dependent on other things too. Would big modifications be required to make it reliable? Can you think of other checks that could be made to gather useful information?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #14 on: March 29, 2018, 10:56:47 PM »
Quote
The signal before the crossover acts as a junction signal, so as long as the station is within sighting distance it will not let a train into an occupied platform.
No obvious example of this was shown in the video.

Also if it does this why can it not act as a platform choose signal as well? Especially if multiple platforms are within 7 tiles.
Quote
This would be so helpful to be shown in the info window somehow. Are there any parameters that can be used in the signal logic to gather this information? I remember finding the flag that determines if the signal protects a junction, however, that flag was turning on and off a bit “random” and you told me that the flag was only ever intended to work internally and would turn on and of dependent on other things too. Would big modifications be required to make it reliable? Can you think of other checks that could be made to gather useful information?
There is currently an unsolved bug with timed interval signals. As the last signal before a stop they are meant to treat stops further than 7 tiles away with their normal behaviour but currently they treat them as junctions so apply limited half speed even after 10 minutes. The only solution is to use either an end of signalling signal, timed interval signal or any other block behaviour signal before the stop otherwise the train will not be able to reach max speed most of the journey.

One must also not place timed interval signals close together as otherwise an emergency stop occurring between trains, due to the front signal blocking, will cause an infinite emergency block loop that requires manual intervention of the front train to fix.

None of this explains how one is meant to use a depot to replace convoys...

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #15 on: March 30, 2018, 01:03:30 AM »
Ves - whether a given signal protects a junction is not a datum that is stored in the signal: it is rather calculated afresh  in rail_vehicle_t::block_reserver() every time that the block reservation is called. Whilst the last state of this could in principle be saved in the signal's data structure and displayed, this would potentially be very misleading, as it would be wrong when the signal be first placed, and wrong again whenever the layout of the track and signals ahead changed until the next train reserve a route through it. It is better to have no data at all than wrong data.

Dr. Supergood - junctions are dealt with in detail in the tutorial video from 5:10 onwards. You will see that what you describe as a bug is intended behaviour. To quote from the tutorial video,

Quote
A time interval signal protecting a junction will remain at danger until a train approaches. If the route that the approaching train is to take is clear, the signal will change to show caution. A junction signal never shows all clear.

With the block reservation display enabled, we will see that, at a junction, a time interval signal will only reserve up to 875 meters ahead – that is 7 tiles at 125 meters per tile. This is because this is as far ahead as the railway policeman can see.

Because of this, trains must travel slowly in the vicinity of junctions, and continue at that speed until they reach the next signal not protecting a junction.

Quote from:
Dr. Supergood[/url
None of this explains how one is meant to use a depot to replace convoys...
[/url]

Quote
One must also not place timed interval signals close together as otherwise an emergency stop occurring between trains, due to the front signal blocking, will cause an infinite emergency block loop that requires manual intervention of the front train to fix.

This does not apply to signals protecting junctions because they work in an entirely different way to ordinary time interval signals, as explained.

That would be because this thread concerns a bug report relating to one train staff cabinets rather than a query about how to use depots to replace convoys.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #16 on: March 30, 2018, 04:31:28 AM »
Quote
You will see that what you describe as a bug is intended behaviour.
No we ruled it was a bug in the other thread. It is not meant to be treating stop locations as junctions when there is no junction involved, especially one that the policeman cannot see because it is >>7 tiles away.

For example say you have your current stop, the platform is terminated with a timed interval signal, the line is completely straight until the next stop, the line is single direction only, the next stop is >>7 tiles away, eg 20km and is also terminated with a timed interval signal. This is your typical drive through station on a double track (probably called something else but I do not know such terms), fairly common throughout the UK. The timed interval signal should be allowing the train to run at full speed to the next stop as long as 10 minutes have passed since the last train. However currently it treats the entire circuit as a junction, unless one places either another timed interval signal or a end of signalling signal closer to the station in which case it will run at full speed up until that.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 572
  • Languages: EN, FR, DE, FI, SE
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #17 on: March 30, 2018, 09:33:22 AM »
One could argue that the railway policeman knows there is a station or a junction ahead regardless of whether he sees it (after all, the game assumes perfect route knowledge), and that the sighting distance limit only applies to what varies over time, i. E. track occupation.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #18 on: March 30, 2018, 10:16:17 PM »
Having a look at Dr. Supergood's network on the server, he appears to be running lines with very long distances between stations without any time interval signals. This is not intended - there should be periodic time interval signals along the line, just as there were in reality.

There is much to be said for the view that retaining the behaviour described (viz. that time interval signals treat the next block as containing a junction if the train is due to stop in the next block) is worthwhile to prevent the exploit placing no time interval signals at all between stops no matter the distance between them.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #19 on: March 31, 2018, 01:31:24 AM »
Quote
Having a look at Dr. Supergood's network on the server, he appears to be running lines with very long distances between stations without any time interval signals.
The longest is only 57km... Your video did not give any recommended distances so generally longer means better. Especially until one has access to pre signals, one needs such huge distances or else the trains constantly slow down due to a lack of pre-signals. To prevent accidents I have the trains scheduled to wait at the stations before entering the very long sections.

Mechanically I see no need for a lot of timed interval signals between stops, especially since they slow down the line a lot until access to vane signals and their pre-signal.

EDIT: Even with "Vane auxiliary signals" it is impossible for trains to pass them currently at 80km/h due to breaking distance. One cannot space out the vane signal and auxiliary signal far enough for the ~2.5km breaking distance the trains require. This is because vane signals have a small placement radius.
« Last Edit: March 31, 2018, 01:58:25 AM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #20 on: March 31, 2018, 11:40:27 AM »
57km is an extremely long distance between signals in real life. In reality, trains would not be guaranteed all to be travelling at a constant speed, so much more frequent time interval signals would be necessary. Setting up a network that relies on the constancy of the speed in the game in order to reduce signalling infrastructure is something of an exploit, as it allows infrastructure to be installed at much lower cost than would be the case in reality.

Incidentally, it is entirely realistic that, in the very early era, the main limit on the speed of trains was not the power of the locomotive but the braking distance: this is well documented. Therefore, what you describe in your final paragraph is entirely accurate to reality.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #21 on: March 31, 2018, 11:13:48 PM »
Quote
57km is an extremely long distance between signals in real life. In reality, trains would not be guaranteed all to be travelling at a constant speed, so much more frequent time interval signals would be necessary. Setting up a network that relies on the constancy of the speed in the game in order to reduce signalling infrastructure is something of an exploit, as it allows infrastructure to be installed at much lower cost than would be the case in reality.
I have no problem with the infrastructure cost. I would happily place 10 times more signals. The problem I have is that if I do then my trains are slower.

When block signals come, especially modern types, I will be using a lot more.
Quote
Incidentally, it is entirely realistic that, in the very early era, the main limit on the speed of trains was not the power of the locomotive but the braking distance: this is well documented. Therefore, what you describe in your final paragraph is entirely accurate to reality.
Except are you sure the physics are right? It takes a very long time for my trains to reach 80km/h (top speed) when not going down hill.

Also in reality there was fuel economy which was often far more important than speed. This is not simulated at all. Modern container ships can go pretty fast but seldom do because slower speeds mean better fuel economy. Trains were the same where one might choose to go slower due to less coal/water consumption per km.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #22 on: March 31, 2018, 11:23:44 PM »
I have no problem with the infrastructure cost. I would happily place 10 times more signals. The problem I have is that if I do then my trains are slower. When block signals come, especially modern types, I will be using a lot more.

That trains would have to slow down in this way is also, so far as I can discern from what limited records of these details that there are from early railways, also realistic: as stated above, the main constraint on speed on early railways was the ability to stop, as is well documented.

Quote
Except are you sure the physics are right? It takes a very long time for my trains to reach 80km/h (top speed) when not going down hill.

I cannot be completely sure that the physics are correct - they were written by Bernd Gabriel, who knows more about these things than I do. They have, however, been tested quite extensively and appear to be at least more or less correct within the parameters of the tests so far conducted. Do you have any data to suggest that the physics are inaccurate in some specific way(s)? It is realistic that steam hauled trains would take a long time (i.e., many, many kilometers) to reach top speed. This is the reason that, in the days of steam, it was far more common to have limited stop expresses, as the stops would have a far greater effect on average speed with steam locomotives than with more modern forms of traction. In modern times, express trains tend usually to stop at all or most of the major towns along their route.

Quote
Also in reality there was fuel economy which was often far more important than speed. This is not simulated at all. Modern container ships can go pretty fast but seldom do because slower speeds mean better fuel economy. Trains were the same where one might choose to go slower due to less coal/water consumption per km.

Simulating fuel economy linked to speed would be another massive 6-12 month project. Would you like to code this?

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2714
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #23 on: April 01, 2018, 10:59:00 AM »
Regarding the one train staff. I have noticed that it works much better if both the entry and exit staff boxes are heading towards the dead end. I hope I have put the so in the pak128-britain-ex demo game (havenpool dock branch). Like in this screenshot.


Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2727
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #24 on: April 16, 2018, 07:02:09 AM »
I think this can be marked as solved. I will not be using one train staff for station junctions anymore.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bug: Connected one train staff signals using staff in both directions.
« Reply #25 on: April 16, 2018, 10:42:10 PM »
Splendid, thank you for confirming.