PDA

View Full Version : TNI Train Physics Interface: Status and Possible Use Case



agentmike
August 29th, 2020, 05:26 PM
Hello,

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.

pcas1986
August 29th, 2020, 06:10 PM
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.

robfletchs
October 13th, 2020, 06:06 AM
Can you share more information, please?

JAGG
October 13th, 2020, 08:04 AM
rileyzzz should be microlem trainz registered user....

Tony_Hilliam
October 13th, 2020, 05:58 PM
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 (http://online.ts2009.com/mediaWiki/index.php/TrainzNativeInterface).

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.

robfletchs
October 14th, 2020, 04:31 AM
Thanks for update