TNI Train Physics Interface: Status and Possible Use Case


New member

I was wondering if it is possible to have a discussion about Train Physics Interface. It is currently marked as not implemented on the wiki, but I wish to know what would be the scope of it, and the possibilities it provides and whether it fits my use case.

I think it would greatly improve the driving experience and make Trainz more competitive in that regard.

I have working prototype of a train physics model written completely in script from the ground up. It includes everything starting from setting tractive effort and resistance per-vehicle via a method call and configuring pneumatic brake schemes based on graphs, calculating idle, rolling, aerodynamic and track curvature resistances to calculating final velocity and applying it to the train and then offsetting the vehicle meshes to approximately simulate dynamic reactions in the consist.

I would like to try reimplementing it as a TNI library. I don't think current prototype is a workable solution, even though it worked surprisingly well for what it is. Firstly, because I don't think it should be done via scripts ideally and secondly because Train.SetVelocity does not work on owning clients in the multiplayer, which makes this prototype inherently unusable there.

With all that, I would like to know if it is possible to discuss TNI Physics with implementing such system in mind, and if there is chance to implement such system at all.
There is a TNI discussion channel in the Trainz Discord server. There is a user there (rileyzzz) who is doing some clever stuff with TNI.
Hi agentmike - you have a PM.

We're soon to release a full TNI Physics API where users will be able to hook into most of the train physics and create custom plugins. Plugins are written in C++ rather than script. You can see more about TNI here.

Also, robfletchs you'll need to sort out your Trainz registration. If you purchased on a different account please contact helpdesk to arrange to transfer or merge things.