The International Simutrans Forum

 

Author Topic: [Bug] one_train_staff on intermediate single tracked lines  (Read 449 times)

0 Members and 1 Guest are viewing this topic.

Offline Freahk

  • *
  • Posts: 133
  • Languages: DE, EN
[Bug] one_train_staff on intermediate single tracked lines
« on: August 22, 2019, 08:11:32 PM »
Hey there,

At first, sorry about yet another signalling bug report James :/

This is not a critical bug as it allows the one_train_staff to be used when it shouldn't, however it operates differently than it's description in the in-game help, which states that the token block signal can only be used for dead end tracks or very simple tracks with only one train operating on it.

I just used the one_train_staff on an intermediate single tracked section and it worked perfectly well.
This is not wrong so far since, for example (at least according to Wikipedia) the track between Exeter and Plymouth used one_train_staff for such an operation.
For sure, when a train passed a single tracked section from Exeter->Plymouth, another train could only enter the section from Plymouth->Exeter (fun fact: or had to get the staff from the other side by horse)
This is not the case for one_train_staff cabinets in Simutrans-ex. Whenever the track between the cabinets is free, a train can enter from whichever side.

You can see this behavior in layout 5 of this save: https://dome.xileks.de/simutrans/signal_bugs.sve

There is another useful bug which makes the one_train_staff working method much more useful than it should be (and token block, compared to it, nearly useless)
Quote
- When a train approaches the "one train staff"-cabinet, it will come to a halt to check whether the staff is available inside the cabinet
It simply doesn't!
See the save, it's the same when you use one_train_staff the way is is intended to use


There is an additional problem happening when you use the block reservation tool to clear the reservation of a one_train_staff reservation and there is another train waiting at the cabinet.
The train in the section will correctly fall back to drive_by_sight but the other train will immediately start reserving the section but won't start moving causing the train in drive_by_sight to stop due to reserved tracks.
You can also reproduce this in the save at layout 5:
1. stop the train in the single tracked section
2. wait until the other train is waiting at the cabinet
3. let the stopped train continue and clear its reservation


My suggestions about the one_train_staff working method:
Just as time interval signalling which, apart from the start does only create short reservations where the train actually is, just don't create a reservation for the whole one_train_staff-block.
- When a train enters a one_train_staff cabinet tile, it will come to a halt.
- When the staff is available (this means some staff_available flag is set to true), grab the staff (which means to set the staff_available flag to false and setting the trains working method to one_train_staff)
- Otherwise wait until it is available*
- When the train enters another one_train_staff cabinet tile, return the staff(which means setting the staff_available flag to true and setting trains working method to drive_by_sight
- When a train in one_train_staff collides with another train, which could happen when someone builds some crazy track layout, the train should come to an emergency halt, just as it currently does in time_interval_signalling
- Setting staff_available flag does always happen to all neighboring cabinets.

I want to mention that this would be perfectly compatible to the currently described use of one_train_staff in the in-game help, just adding some new functionality taken from the real-world.

*About the waiting: It would be nice to also simulate this "...because if the staff is not there, the train must stop while a man is sent on a horse to get it..." Which means, if the staff is not available, but is in the next cabinet on the trains route, after "distance/riding_speed time", the staff will be removed from that cabinet and after "2*distance/riding_speed" time, the train waiting for it will continue its journey.


Furthermore, I have read about "Staff and ticket" token system, which is actually exactly what I needed to run my second line on my first railway track.
I simulated some kind of "timetable and train order" operating method on this track, using schedules and drive_by_sight, later on using schedules and time_interval, but "Staff and ticket" would have been a much easier.

Assuming my suggested one_train_staff working method, this could be added the following way:
- When a train enters a staff_and_ticket cabinet tile, it will check for the staff just as the one_train_staff cabinet would.
- If the staff is available, it will continue in one_train_staff operating method.
- If the staff is not available, but the time_since_last_train is less than what I will call "max_following_time" AND the last train that entered the section did not already return the staff, that train will switch to ticket operating mode and our train will continue in one_train_staff working method.
- When a train in ticket operating method enters a staff_and_ticket- or one_train_staff cabinet, it will switch back to drive_by_sight, but won't stop, because it doesn't need to return a token.
- When a train in one_train_staff working method enters a staff_and_ticket- or one_train_staff cabinet, it will stop and return the staff.
« Last Edit: August 22, 2019, 08:48:29 PM by Freahk »

Offline Matthew gb

  • *
  • Posts: 220
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Re: [Bug] one_train_staff on intermediate single tracked lines
« Reply #1 on: August 23, 2019, 08:46:58 AM »
The first point here seems to me to be an exploit rather than a bug. It's not ideal that one_train_staff can be used in some unrealistic situations, and reporting this news is helpful to the project. But the fact that it does work in realistic situations is much more important IMHO!   :thumbsup:

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2700
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: [Bug] one_train_staff on intermediate single tracked lines
« Reply #2 on: September 01, 2019, 04:32:53 PM »
the time interval with telegraph has many similarities with staff and ticket. "Tickets" are issued in timely manner in both, just the staff transfer is replaced with telegraph communications. So in simplified simutrans operation they should be the same.

Also in real world, it works the other way than you said. Only if there IS a staff in the box (could be in the form of a key opening a box with tickets), the driver will be able to get a ticket. The if trains from the other direction are expected, then the staff must be given to the train driver to take it to the other box.

Offline Freahk

  • *
  • Posts: 133
  • Languages: DE, EN
Re: [Bug] one_train_staff on intermediate single tracked lines
« Reply #3 on: September 01, 2019, 05:56:28 PM »
I know how this works in real world.
However, I think we can simplyfiy things a bit without changing the principle of that working method.
To correctly simmulate staff and ticket, we would need to predict when the next train will arrive at that box to decide if the train will get the staff or a ticket.
However, we don't need such a prediction, when the first train always gets the staff and will magically change to ticket and pass the staff back to the cabinet, when a train wants to enter in the same direction within a given timeframe.
The resulting behavior would be the same. We just replace train prediction by the ability to magically teleport staff and tickets around, which for sure is not possible in reality but wizzards are real in Simutrans anyway.

Staff and ticket has some similarities with time interval and one train staff. You could call it a combination of both.
However, time interval requires telegraph to control single tracked sections, while staff and ticket doesn't, so it is available earlyer.
Also, time interval can't handle single tracked sections with multiple stops on it, while staff and ticket can.

However, staff and ticket is a bit off topic here. Should have created an own thread for it.