.
Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: Trainz Native Interface

  1. #1
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    7,062
     

    Default Trainz Native Interface

    Hi all,

    We're currently reviewing opening up a limited number of our game systems to native plugin DLLs. The intention here is to twofold:
    1. To allow certain operations which would be far too resource-intensive to run as script, such as custom physics or sound generation.
    2. To allow interfacing with third-party hardware and software, such as mapping and routing software, physical controllers, model railroads, simulator cabs, etc.

    I'd like to speak with people who would actually use such an interface. I know we can all think of cool uses for it, and that's not what I'm asking for here- instead, I want to speak with people who actually have both the idea AND ALSO the time and knowledge to write a plugin. In practice, this likely means that you're a C/C++ programmer. I don't mind whether your idea is personal, for a small group, for commercial use, or for free distribution. The exact details of the SDK are to be determined and will depend to an extent on your feedback, but to avoid compatibility issues and malware concerns we will require source code access to any DLLs which are produced using the SDK (ie. we would need to review and perform the final builds of any DLLs to be distributed beyond your test environments.)

    If you fall into this category, please either post here (if you're a TrainzDev member and willing to speak publicly about your idea) or PM me. Start by letting me know a very small amount about your idea, how you plan to achieve it, what your timeframe would be, and what level of assistance you would need from us.

    chris

  2. #2
    Join Date
    Nov 2006
    Location
    Canberra, Australia
    Posts
    8,099
    Blog Entries
    30
     

    Default

    Sounds interesting. The only idea I can think of immediately, is the ability to export-import a model directly into a "Preview Asset" window without the need to go through a committal process. In practice, this might be exporting from the 3D editor, such as Blender, to the XML format and then using a TMI like DLL into a Preview Asset window.

    That, I suspect, falls into the "cool usage" category. But for me it would be a huge time saver for testing materials, LODs, etc.

    Paul


  3. #3
    Join Date
    Nov 2006
    Location
    Germany, SAL, Merzig
    Posts
    1,859
     

    Default

    i'm not a programmer but i've ideas

    1) What about also allowing plugins for CM (at least like the "OpenWith" ability in former versions)
    2) Ingame i wish features like Joystick-support to control trains for example. I guess this could be done via a plugin?

  4. #4

    Default

    Basti pointed me to this thread, thanks.

    Yes, I'm interested. My area of interest would be the obvious, streamlining the data exchange process between TransDEM and Trainz.

  5. #5
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    7,062
     

    Default

    Quote Originally Posted by geophil View Post
    My area of interest would be the obvious, streamlining the data exchange process between TransDEM and Trainz.
    Thanks. What kind of things did you have in mind here?

    chris

  6. #6
    Join Date
    Nov 2006
    Location
    United Kingdom, Cambridgeshire
    Posts
    3,669
     

    Default

    My long standing wish has been an interface between an external timing (time table planning) system and Trainz adding another level of game play - the running of trains to the timetable imported, marking down late starts etc.

    This is not focused on the driving from the cab aspect but rather on the signalman\controller\shed foreman point of view. A simple example (an ancient UK simulation) can be found here:

    http://www.siam.co.uk/html/samples.html (Hunstanton 1952).

    Data passed in would be something like:

    Unique Identifier (as used on real systems e.g. '2B23' or '4352'.
    Calling points (Location - e.g. named Trackmark).
    Time of departure at origin and calling points.
    Time of arrival at calling points and destination

    I could never get on with C programming syntax but I believe DLLs can be made in VB.NET which I am familiar with.

    I could provide the timing system, but the first thing would be to establish what data will be passed.

    Complex subject so the above is just a brief outline.

    Chris M

  7. #7

    Default

    Quote Originally Posted by WindWalkr View Post
    Thanks. What kind of things did you have in mind here?
    It's particularly the rather complex workflow to modify an existing route with TransDEM. (Route must have been created with TransDEM in the first place, but may have been edited in Surveyor in the meantime.)

    It's currently as follows:
    1. User opens the route for editing in CM.
    2. In TransDEM users selects the route and applies the modifications, often adding those large hi-res texture carrier objects called UTM tiles, with aerial images. Pitfall here: The route folder name as assigned by CM may not be the one the user expects. It may even be cryptic in case the designated folder name already exists. Hence, the user may pick the wrong route.
    3. Once the changes have been made by TransDEM, the users commits the changes in CM. If he added UTM tiles, these must then also be imported to the local Trainz asset data base, again involving CM.


    What I can imagine to simplify the workflow is some sort of interprocess communication. The TransDEM process could register itself with a running instance of T:ANE. T:ANE would send a message to TransDEM to notify TransDEM of a route being opened for edit and forward the actual folder name in a message. TransDEM would pre-select the route when receiving this message. Once the route has been modified, TransDEM would notify T:ANE to commit the changes and also import additional objects, if any.

    This would still retain independent processes and keep the interface between the processes very slim. Open/Commit/Import exchange messages would not be limited to TransDEM but could also be used by other 3rd party software that deals with asset modification or import.

    Data exchange itself would still be by file, and not in a serialized form through interprocess communication. Synchronization of file read/write, however, would be implemented by messages.

    We created such a message exchange system in Zusi when a tool of mine applied track geometry math. For the user it was a one click data exchange. (The essentials of that tool later became embedded in a DLL which is now linked statically to the respective Zusi editor.)

  8. #8
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    7,062
     

    Default

    That makes sense. We've also previously mooted the ability to have a direct interface into Surveyor, so that plugins could manipulate a route while it's open, but obviously there's more complexity involved there.

    thx,

    chris

  9. #9
    Join Date
    Oct 2009
    Location
    United States of America, Floatin' Along the Delaware River
    Posts
    7,377
    Blog Entries
    3
     

    Default

    While I don't want to commit myself just yet - mostly because of time - I would be interested in external access to game objects, specifically, switches and signals, so that they can be controlled by an external dispatching application. I've tested some methods of controlling signals in-game, i.e. as a dispatch system, but feel an external dispatch system would be a better addition to the sim.
    Eat More Popsicles.

  10. #10
    Join Date
    May 2008
    Location
    Russian Federation
    Posts
    892
     

    Default

    And that means that all signals & junctions has to be loaded all over the route, not as in new concept of TANE...

    Built-in dispatch system in TANE called "interlocking towers".

  11. #11
    Join Date
    Oct 2009
    Location
    United States of America, Floatin' Along the Delaware River
    Posts
    7,377
    Blog Entries
    3
     

    Default

    I'm well aware of Interlocking Towers.

    I have in mind more of an entire dispatch system, not a dinky little tower, along with a more-realistic UI.
    Eat More Popsicles.

  12. #12
    Join Date
    May 2008
    Location
    Germany, Nordrhein Westfalen, Moenchengladbach
    Posts
    126
     

    Default

    I've tryed to understand the usage of TrainzNativeInterface.dll for a long time.
    I'm waiting for a feature that allows Library-Assets the implementation of new native Script-Functions.

    My idea:
    Virtual Railway companies may need a small software that sends information about users driving experiences and/or some analysis to it's server.
    In Game-Script, I'd fetch all nessacary information and analyse them. Then I'd call a Library funtion, a custom native function, which
    would call a function stored in a plugin DLL, that sends the information to the server (E.g. Player-ID, Route-KUID, Session-KUID, time started, ending time, etc).

    Best regards
    Pascal

  13. #13
    Join Date
    Nov 2006
    Location
    Australia, QLD, Brisbane
    Posts
    7,062
     

    Default

    Hi all,

    Just an update on this.

    The documentation for TNI is starting to go online here: http://online.ts2009.com/mediaWiki/i...ativeInterface

    Please keep in mind that this is forward-looking documentation and doesn't reflect the state of the game that is in your hands currently.

    Feel free to reply back on this thread with any comments.

    chris

  14. #14

    Default

    Quote Originally Posted by WindWalkr View Post
    Feel free to reply back on this thread with any comments.
    It looks promising.

    In the introduction it states "Importing from third-party data sources into Surveyor." I guess this will also include something like "Surveyor/Content Manager data export notification" to facilitate the workflow I have sketched earlier, with a message exchange system.

    My plugin could
    • receive such external messages to trigger initial import or re-import of a route via TNI
    • and fire external messages when a route has been exported by Surveyor/Content Manager and the plugin has learned about it via some TNI notification mechanism.

    An obstacle I see is that you don't want the Windows platform API to be used. However, the Windows platform API springs to mind when one thinks about a possible inter-process message-passing mechanism. Such a mechanism would then be platform dependent, of course. Since I have no plans to port TransDEM to a different platform, a plugin to facilitate data exchange with TransDEM may well be Windows-specific.

    About the safety measures you plan: I fully understand why you are imposing these and I fully support them. As a consequence, of course, it will limit the number of applicants and applications.

  15. #15
    Join Date
    Nov 2006
    Location
    New Zealand
    Posts
    2,345
    Blog Entries
    7
     

    Default

    For over a decade I have cherished the thought that I could integrate Real World Rail experience with my HO model railroad and with Trainz and now TANE.

    I have a two room model railroad layout that uses many European building and object kitsets that I have completed. Bench, track, scenery and internal wiring of building lights is complete. End of Track lights and station lighting incorporated.

    I am now at the stage where I want to get power onto track, lighting and special effects/animation.

    I will also interface my model railroad to my computer LAN and my Samsung Galaxy S4 mobile and a Beam pico projector.

    The intent is to use JMRI software

    http://jmri.sourceforge.net/

    With an Android app on my mobile called DigiTrains.

    https://play.google.com/store/apps/d...ols.digitrains

    and documentation

    https://drive.google.com/file/d/0By2...RWTDJqX1E/view

    My turnouts, loco control, signalling, track power management etc will use Digitrax digital command and control system (DCC) that is already capable of interfacing with JMRI and Digitrains.

    Thus my mobile becomes a remote WIFI throttle for multiple consists, ambient colour light control via WIFI, audio, video and special effects remote, and turnout control. I can also access files on my WIN 10 computers and OneDrive so all my planning and project data concerning the model railroad and associated projects are available to me on my mobile but updated on LAN computers.

    In addition, through the Internet, it can pull up information and history on a location, images of local scenery and buildings; access current weather reports; Google Maps and Streetview, as well as local and rail webcams, EURail Map and train schedules.

    The Beam pico projector is in fact an Android computer accessed via WIFI. It will project a large image onto any surface. Other people might use a tablet. In this scenario it could be any of the Internet images or information; streetcams; traincams; or model railroad layout and signalling so in essence a CTC or interlocking tower; and something like DAPs CMTS for freight operations.

    Tomorrow, after a very long wait, I finally will have 200Mbps DOWN and 20Mbps UP Fibre Broadband to my house, 801.11ac WIFI internally, along with 4G mobile coverage elsewhere. This makes access to OneDrive, OneNote and other Cloud services viable.

    And in not too distant future it could be interfaced to an AR/VR headset, and controlled by voice.

    The missing link is the TANE to JMRI interface.
    JMRI is OPEN SOURCE. The API is not something I can develop as I'm not a programmer, but I think the above is achievable.
    Last edited by ianwoodmore; May 11th, 2016 at 07:28 PM. Reason: Ultra Fibre Broadband instal
    N3V Beta Tester. Trainz Pioneer Council. TrainzDev Team.
    Asset X, PEVTools and TARDIS Beta Tester
    http://online.ts2009.com/mediaWiki/i...AssetX_Scripts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •