There is a funny contradiction in your arguments. You want to implemented the "driving on sight" (call-on in English). MSTS never could handle this properly for AI trains - AI trains would ignore one another and often run straight through eachother, which usually ended in a crash. The signalling in OR is different and does properly handle this situation. Yet you complain that OR is different. If OR were a copy of MSTS, this function would never work.
Another important point is that OR is compatible - that is not the same as copy. A basic MSTS script will still work in OR, but there are detail differences. These are quite deliberate and for very good reasons.
As for the reasons : the first main reason is that
signalling in MSTS does not work properly. As mentioned, "call-on" for AI trains never worked in MSTS. And that is just one of the many problems with MSTS signalling. The second reason is that the exact logic of the MSTS signalling is not known. There are no documents or whatever which describe how signalling is implemented in MSTS.
All this means that signalling for OR had to be developped from scratch.
Two groundrules form the base of the OR signalling :
- OR has no dispatcher function. Each train functions as its own dispatcher and has to clear and set its own route.
- There is no distinction between types of train, so AI train and player train are processed in the same way.
Two other decisions were made wich had an impact on the logic. One was that call-on for AI trains should be made possible. The other was that the basic script functions would be maintained, making existing scripts compatible with regard to basic functions.
However, the groundrules as defined above made it necessary that some slight changes were made w.r.t. the definition of the blockstates and the 'enabled' variable.
The definitions are :
- BLOCK_JN_OBSTRUCTED
The section ahead is blocked for the approaching train. When this condition is returned, the signal should never be allowed to clear.
In principle, this state is returned under the following conditions :
- Another train has cleared or is occupying a path through the section such that it locks a switch in an unaligned position.
- Another train has cleared or is occupyinh a path through the section and is moving (or intending to move) in opposite direction.
Note that, in most cases, the second rule automatically implies the first rule - for if not, it would lead to a deadlock (trains facing eachother in opposite directions). The only situation where the second rule applies but the first does not, is if that particular train is to reverse in the section in question.
- BLOCK_OCCUPIED
The section ahead is occupied by another train but that train is stationary or is moving in the same direction. Any switches in the section up to the position of the train ahead are properly aligned as required.
Defining this state in this manner allows proper working of call-on functionality.
If BLOCK_OCCUPIED would be returned rather that BLOCK_JN_OBSTRUCTED in case of a train moving in opposite direction, implementation of call-on would not have been possible as no distinction could have been made for trains standing still or moving in same direction (when call-on would be allowed), or trains running in opposite direction (when call-on would never be allowed). So without this change in definition, call-on could never have been implemented.
- BLOCK_CLEAR
All other states, i.e. there is no other train which has cleared a path though the section or is occupying the section.
In this situation, the actual state of switches in this section is irrelevant. Remember that there is no dispatcher function and the train has to set its own path, so the train itself has to aling all switches ahead. A switch ahead could be misaligned as that is the state in which the previous train running over that switch may have left it. If, in this situation, BLOCK_JN_OCCUPIED would be returned, the train would never be able to continue - for without a dispatcher function, there is no function within the program which would align that switch. End of story. So if a switch is misaligned but is 'available', i.e. there is no route cleared over it by another train, the state BLOCK_CLEAR is returned thus allowing the signal to clear and in that process, to properly align the switch.
- enabled variable
Taking the definition literally : "if signal is enabled by dispatcher", the variable would always be 'false' as OR has no dispatcher function.
So the meaning behind this definition is used, and the variable is defined such that it allows definition of two types of signal control:
- controlled signal
Default position of such a signal is 'stop'. The signal is only cleared if a path is set from this signal. In real life, this is done by a dispatcher. In OR, this is done by the train itself.
- automatic signal
Default position of such a signal is 'clear'. The signal is in stop state only if the section ahead is blocked.
The enabled variable is defined in such a way that if this variable is tested, the signal operates as a 'controlled signal'; if not, the signal operates as an 'automatic signal'. The variable is 'true' when a path is requested from that signal. As there is no dispatcher, this implies it is the train itself which makes this request. When the train passes a signal, there is no longer a request for that signal to clear a path, so enabled drops back to false.
Since the basic implementation of signalling, many more functions have been added, including proper call-on functions. More detailed control of all trains including AI trains has been made available through these new functions, even more so in timetable mode as commands defining interaction between trains and signals as well as between two trains were defined for timetables, offering functionality that MSTS never provided.
OR offers far greater control over AI trains than MSTS ever could, for instance including coupling/uncoupling of AI trains. The price to pay was a slight difference in definition of the signal script variables. If these definitions had been maintained as an exact copy of what they were in MSTS, expanding the functionality beyond what MSTS could offer would not have been possible.
Regards,
Rob Roeterdink