Scripting capabilities query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lts
    New Member
    • Jun 2020
    • 2

    #1

    Scripting capabilities query

    Hello,

    I am a software developer but new to OpenRails and wanted to ask briefly:

    For the purpose of creating a station view for a museum signalling control panel demonstration, can I send both manual signal aspects and train location and speed commands into the sim? If spawning new trains is not an option, I could have a stock of trains that I just bring into view when required..

    For comparison, MS Flight Sim has SimConnect.dll which lets you do all sorts, and I can connect the VATSim online air traffic network to the simulator and it does a super job of moving all the planes about in real time, with position interpolation etc. I'd like to do a similar thing with OpenRails, but also with signal control. From messing with the dispatcher in multiplayer it looks as though remote signal control in manual is possible and internal aspect control or routesetting won't interfere.

    Many thanks!
  • csantucci
    Senior Member
    • Nov 1999
    • 856
    • Torino, Italy.

    #2
    To answer you more precisely, I first need to understand better what system structure you have in mind: a block diagram of the elements involved would be very helpful.
    What I can say now is how OR Multiplayer is structured: between the master computer and the slave computers there is a message exchange, and among the messages available there are those about train position, train speed and signal and switch states. Slave sends Every slave in principle sends data about his player train to the player, and the master broadcasts back to slaves the data of all trains, switches and signals; the master computer player can manually set switches and signals using the Dispatcher window. Such player can also appoint any slave computer player as an aider, which means that such aider can set switches and signals too, even I'd say that it is not the most tested multiplayer feature.
    sigpic

    Comment

    • lts
      New Member
      • Jun 2020
      • 2

      #3
      Thanks for your fast reply!

      I think this sounds like it has everything I need. I have taken a look at the code on github and I'll see if I can put something together.

      What I would like to do is interface an external simulator and use OR as a visualiser. So, our software would provide train entries, positions and speeds, as well as all signal aspects and route information. It could either provide route requests or signal and point states to control them completely (in fact preferably the latter as our simulator uses correct delays for the routesetting steps for the area we are simulating).

      I have included a layout diagram below. I'd like to run OR on a separate machine, so presumably our script, acting as a MP client, would need to instantiate one client per train? Or can a client create multiple trains on the server?

      Annotation 2020-06-18 000623.jpg

      Comment

      • csantucci
        Senior Member
        • Nov 1999
        • 856
        • Torino, Italy.

        #4
        In principle it is one client, one train. In reality if you split the client train by uncoupling a part, both are updated at the client side. But I believe this has big limits. So, yes, I think you should instantiate one client per train.
        Take into account that OR needs a route and the rolling stock to be simulated. So you should first create them and make them available to OR. If you will use e.g. the MSGTrain to describe the train and MSGMove to update its position and speed, what you send should be coherent with the route and rolling stock description OR has.
        A point where I'm not able to provide a definite reply is signalling: it is true that you can manuallz force signal and switch statuses, however OR has an internal intelligence that manages signals and switches. I'm not sure that such intelligence will always obey to the external override commands. This must be practically verified.
        sigpic

        Comment

        Working...