Sorry James, I forgot about this one, but I guess I have properly reported all known one_train_staff related bugs now.
Note that this bug is a of a little bit different nature, as it is not about signalling failing in a proper setup but about exploiting the signalling system to create some kind of new signalling system which qill be a lot les inexpensive than any other signalling system in a use case where it should not work at all.
Trains passing a one train staff cabinet will toggle to drive_by_sight, if they were in one_train_staff mode before, otherwise they will switch to one_train_staff, creating a reservation to the next cabinet, no matter if that exit cabinet is close to the cabinet where the train entered or not.
See the attached game for two example exploited layouts. I won't give a detailled descripütion on what's going on there.
What's the bug?
Hard to tell, as it seems like a general error in design rather than a little bug.
However, from the ingame description of this working method, I would not expect trains returning the staff to any non-adjacent cabinet.
This could be achieved by always reservating the whole track up to the next adjacent cabinet and ignoring any cabinet that is not at the last tile of trains reservation.
Discussion about the given exploited layouts:
The upper layout is a realistic layout. Assuming a player had some reading about one train staff (One-Train Working) in the real world, that player will expect the upper layout to work.
Thus, fixing the bug may be a good interims solution, but will definitely raise a feature request for allowing this usage, so maybe we should discuss this before fixing this bug, especially if the fix is not quite straight-forward, what I would expect tbh.
Further note, that the above layout would work in the real-world as it does in the save. A train can only enter a block if the token is available, will carry it to the other side allowing another train to usse the block in the opposite direction.
However, the layout is not guaranteed to work exactly like this ingame as delays could inbalance the layout.
The lower layout, for sure, is a pure exploit. It effectively creates something close to token block signalling whilst being much les expensive. It cannot work this way in the real-world as it would require some kind of communication in between the cabinets but the only way to communicate in between them is passing the token or additional information to the train. It can not immediately communicate block clearance back to the previous station.
An idea how to fix this properly, would be sticking reservations to cabinets, simulating the staff.
- A train attempting to enter a one train staff controlled section will check if the whole way to the next cabinet is clear. (as-is)
- A train entering a one train staff controlled section will create a reservation to the next cabinet. (as-is)
- When leaving one_train_staff working method, it will not clear the reservation, but instead stick it to the cabinet.
- Another train attempting to enter from the same side will now check if the whole way to the next cabinet is clear (as-is)
- This will fail, so it checks for adjacent cabinets that are in possession of that reservation, which will also fail, so the train has to wait.
- Yet another train attempting to enter from the other side will also check if the way is cleared.
- This will fail, so it checks for adjacent cabinets that are in possession of that reservation, which will succeed, so the reservation gets sticked to the train
- The train is now in obsession of the reservation, so it can proceed.
- On clear-reservation tool usage, the reservation is entirely removed, thus resetting the system.
- On vehicle deletion the reservation will also be cleared
- On cabinet deletion the reservation may get passed to an adjacent cabinet (if any) or get cleared.
Thank you for the report and reproduction case. I believe that I have now fixed this: I should be grateful if you could re-test with the next nightly build.
The question of using the one train staff cabinets as if they were part of a staff and ticket system has been discussed at very great length in the past. The summary is that there are only two ways of implementing the staff and ticket working method:
(1) in a way that is easy for players to deal with, but is functionally identical to token block; or
(2) in a way that is so fragile as to be virtually unusable, especially in online games (in reality, it was not uncommon for people on horseback to have to go and retrieve a staff to break deadlocks in this method).
The one train staff working method is intended to represent, not the staff and ticket working method, but the "one train in steam" working method. In modern times, this is shortened to the "one train" working method, as steam locomotives are no longer used. The tutorial video the circumstances in which these were designed to be used clear, so it should not be difficult for players to understand the intended limitations of this system.
The bug seems to be fixed.
Instead of simply waiting for clearance forever if the next cabinet in the route is not a cabinet, it should raise an error message, so any user expecting the "single line staff" to work will know the simutrans impementation is not meant for such usage.
As mentioned, when searching the web for one train staff, one will find information about One train working (with train staff), One Engine in Steam, One-Train Working, of which all mention usage for intermediate single tracked sections, so it is quite likely some players will expect it to work.
May I ask you to split the discussion from the bugreport? I did not expect it would be that easy to fix.
Yet, the discusion remains.
I do still think it would be an extremely useful and, once setup reliable signalling method. Especially before the introduction of time interval with telegraph (without intermediate stops on single tracked sections) and token block (with intermediate stops), being far more reliable than schedules without signalling and still just as reliable as token block.
I have split the posts discussing the proposed single line staff working method as requested.