SimHub icon indicating copy to clipboard operation
SimHub copied to clipboard

Missing telemetry for Train Simulator

Open OfficerFields opened this issue 3 years ago • 40 comments

Description: SimHub is missing multiple telemetry data, although it could be retrieved from the game.

Simhub version: Latest

To Reproduce:

  • Run Raildriver and Joystick Interface for TS: https://rail-sim.de/forum/filebase/entry/2898-ts2017-raildriver-and-joystick-interface/
  • Click "Start"
  • Get into a scenario and check "Data received from Railworks" in the Raildriver and Joystick Interface

Expected behavior: SimHub should make the same data available, but is missing the biggest part of it.

Additional context: I don't know how SimHub actually gets data from TS, but usually this is done through the raildriver64.dll, which has an API: https://rail-sim.de/forum/filebase/entry-download/2898-ts2017-raildriver-and-joystick-interface/?fileID=4287

OfficerFields avatar Oct 24 '22 08:10 OfficerFields

Having just discovered SimHub, what an amazing piece of software. I too can confirm the above as I discovered this myself while setting up gauges and would love to see it looked at if the author could spare some time towards it.

Bekns avatar Oct 25 '22 04:10 Bekns

Commenting to support Fields request. I like to make custom dashes for locos and having more data to add would be great.

Higgsee avatar Oct 31 '22 00:10 Higgsee

+1 on the above, I'd like to use a matrix for AWS warning but can't see the data being pulled by SimHub

Ben-H6021 avatar Jan 24 '24 17:01 Ben-H6021

Im currently working on a plugin to get all the TSC data across to Simhub, I have successfully managed to get the data into Simhub but am running into issues that I am working through. The challenge is that TSC is 64bit and the plugins for Simhub are 32bit so its just working out the best way to bridge the two together.

Just to manage expectation I do have a full time job and a family so I am working on this in my (sometimes minimal) spare time

Bekns avatar Jan 24 '24 21:01 Bekns

Thats great news Bekns, thank you for the update and for taking the time to create the plugin.

Ben-H6021 avatar Jan 25 '24 08:01 Ben-H6021

I just about have something ready to go in a beta kind of situation, would anybody be willing to have a crack and see how it works out for them?

Im doing some final testing tonight and will write up a quick read me if anyone is interested

Bekns avatar Jan 28 '24 10:01 Bekns

Happy to test and assist if possible, like you, I have full time job and a family but am happy to help with the time I have

Ben-H6021 avatar Jan 28 '24 14:01 Ben-H6021

Long time Simhub user been my wish for a long time to be able to have more TS data available to Simhub. I managed to make some dashboards for what does work.

Thanks a lot Bekns for having a go, saw you mentioned you were working on plugin over at the DTG forums an I thought legend! I didn't think it would be easy as there is no sdk for creating plugins.

If you want a hand testing I'm willing an able :)

Higgsee avatar Jan 28 '24 22:01 Higgsee

Thanks PPL, I hope to have something ready in the next day or two, I was all ready to go and I made some cosmetic changes last night and now it is causing issues. The joys of programming!

As for no SDK you are completely correct other than a few example plugins which dont show anything either, it wasnt until I came across a plugin for ETS made by SJDawson on Github that I thought I might be able to make something work. Shout out to them for answering questions when I needed assistance.

The plugin side of the equation is good to go but it is the bridge program that is not wanting to play the game so I will be trying to get that to play nicely today.

Bekns avatar Jan 28 '24 23:01 Bekns

Is the Raildriver and Joystick Interface program of any help to you? I think it can export the data? and may be easier for the bridging program to read? You may be already aware of it but just throwing it out there :-) no offence intended.

Nah all good, any help appreciated :)

I use Chris's program religiously as I have made my own mock up out of 2 Logitech Throttle Quadrants and an Arduino, he has also helped out when I needed it.

I did think to use his program but I didnt want to burden him with any issues should people be using it only for Simhub and get confused as to who they should be annoying if something isnt working right.

How would you go about exporting the data from it, Chris was nice enough to let me have the source code for it as I was going to make some changes for personal use for this very purpose but I decided to go down this route instead

Bekns avatar Jan 28 '24 23:01 Bekns

I deleted my comment as I completely forgot the program was referenced when the issue was opened, its been a long day lol.

I also use it with an Arduino to light leds and use it for mapping a logitech quadrant so similar thought process to yours.

My programming skills are somewhat limited I must admit!

Ben-H6021 avatar Jan 28 '24 23:01 Ben-H6021

I deleted my comment as I completely forgot the program was referenced when the issue was opened, its been a long day lol.

I also use it with an Arduino to light leds and use it for mapping a logitech quadrant so similar thought process to yours.

My programming skills are somewhat limited I must admit!

My programming skills wouldnt be any better, tbh ChatGPT has written most of my code for this project. You still have to have some understanding of how it all works to debug when it doesnt work but it has probably saved me months of learning which I have no desire or time to do it.

I left my quadrants as is but gutted the insides out and put them in a different enclosure, I use the Arduino for a button box that has different kinds of switches and buttons on it, including a key for the master key and a locking type plunger that lights up red for the DRA in UK trains.

Insert sad joke here ;)

Bekns avatar Jan 28 '24 23:01 Bekns

I started learning C# for writing GTAV plugins, then ChatGPT came along and saved my ass! As you say, some understanding for debugging and catching ChatGPT when it tries to take you around in circles is definitely needed!

Sounds similar to my set-up, I repurposed a yellow mushroom switch for the AWS reset, and have a switch enclosure with one of those red keys they use in racing cars as a battery kill switch as a master key.

No sad dad jokes here, as my wife likes to tell me, I'm still playing with toys, they just got more expensive!!

Ben-H6021 avatar Jan 28 '24 23:01 Ben-H6021

Oh man, does it like to take you round in circles indeed!

I hear you there about them getting more expensive but it keeps me out of the pub so thats a good thing

Bekns avatar Jan 29 '24 00:01 Bekns

I tried to use Chris's RD&JI interface to pass data to simhub, emulating 2 serial ports to pass data from RD&JI to simhubs serial interface. I got 'rpms' in simhub using ncalc but dash studio wouldn't see it, I have no doubt it was my lack of programing knowledge. It's way too clunky anyway.

I did think of approaching Chris to see if he could implement Simhub support as he is already halfway there, but he lost interest in TS and is working on TSW support, got busy with life and then UKTS died so I didn't bother.

Thought about asking Roland Beenhakker 'Beentrain' the developer of Third Rails as well, another talented developer as he has worked out how to pull data from Raildriver.dll as well.

I even looked at hiring a programmer on Fiverr but costs killed that idea real fast!

I've been dabbling in Python for few months now and recently found that python can read c++ libraries via modules. Got a few projects finished and I too used ChatGTP occasionally as Bekns mentioned need some understanding to know when ChatGTP gets it wrong! It's an avenue I intend to explore further.

Higgsee avatar Jan 30 '24 01:01 Higgsee

Could you explain actually an example of missing data ? Overall even if I'm keeping focused on racing games, a little quick fix on simhub side is not impossible , from memory originally I made it generic enough to read back all data from the ts sdk, but I might have missed something :)

SHWotever avatar Jan 30 '24 07:01 SHWotever

Could you explain actually an example of missing data ? Overall even if I'm keeping focused on racing games, a little quick fix on simhub side is not impossible , from memory originally I made it generic enough to read back all data from the ts sdk, but I might have missed something :)

Hello SHWotever

Thanks for stopping by and I love your program and appreciate the effort that has gone into it, an internal Simhub fix would be the best solution but I understand the focus is mainly Racing :)

With TSC each train driven will have its own controlID's and these will be different in each train even for the same function. In Simhub it appears that there is stuff in the rawData that is not used on some trains and then there is some that is, it seems like you might use a master list rather than getting the controlID's individually for each train but without seeing the inner workings I am guessing at best.

I presume you have a copy of TSC for testing purposes, it would help if we were able to test the same train / loco's and then we could show exactly where some data is missing.

Bekns avatar Jan 30 '24 09:01 Bekns

I checked ... and I think I see the struggle ... my bridge is indeed made to read absolutely everything it can finds ... but ... on simhub side it won't show new or unknown values (even if data is retrieved by the bridge), I'm really no expert in railsims, but if you could share some simhub records with the loco showing particularities all the data should be stored inside the simhub replay and I can make sure to make it visible.

Edit : the idea is to make simhub self adapt, but seeking at those "particularities" will help ;)

SHWotever avatar Jan 30 '24 10:01 SHWotever

This is great news, massive thanks to you SHWotever and to Bekns for taking the time to look at this. I'm happy to provide some replays if needed? Bekns i'll take direction from you on that mate.

Ben-H6021 avatar Jan 30 '24 10:01 Ben-H6021

Doesnt Simhub add new properties like you can in a plugin? It would be a mammoth task to get together properties from all different trains, some are even in different languages.

Im happy for you to do up replays Ben, I have to travel for work over the next week.

Bekns avatar Jan 30 '24 10:01 Bekns

@Bekns Actually I already have some dynamic process to keep and retrieve "discovered" properties (IRacing has this need too, each car being different and being a paywall for most of them I can't scan them all, so simhub has to "learn" all the possibilities) .

SHWotever avatar Jan 30 '24 10:01 SHWotever

Thanks for dropping in SHWotever

We can use a program called Raildriver and joystick interface by Chris Gamble his program shows in real time what is being out put by TS, great for comparing what Simhub can potentially display.

In Simhub I look under available properties while playing back a replay and see what is changing and only a few things are working occasionally none at all. Usually rpms, throttle position and brake position. GPS, gradient, date and time and loco name work. One that is there and rarely works is PSI for brakes I've only found it works with two US diesels. Some German trains show nothing at all. Steam locos have very little in properties there is no fire mass, water level, steam usage vs generation, injectors, valve cocks.

TS can out put a fair bit of data, slowly figuring out converting raw data for dash studio using ncalc

I have some replays I can post them tomorrow it's late here....

Higgsee avatar Jan 30 '24 10:01 Higgsee

@Bekns Actually I already have some dynamic process to keep and retrieve "discovered" properties (IRacing has this need too, each car being different and being a paywall for most of them I can scan them all, so simhub has to "learn" all the possibilities) .

Thats awesome news if it is not too much trouble to put together for our humble little sim. Hopefully Bens replays will give you what you need.

Bekns avatar Jan 30 '24 10:01 Bekns

What a great community to see everyone working so well together! @SHWotever I'll get these replays over to you this evening, I'm at work at the moment, between mine and @Higgsee hopefully you will have the required info. @Bekns huge thanks again for your work on this!

Ben-H6021 avatar Jan 30 '24 10:01 Ben-H6021

A little test beta (warning, since it's a beta so I'm not spamming microsoft defender to get it cleared, I'm keeping ammos for public releases ;) So there can be some random false positives, it's pretty typical ... thanks antiviruses ...)

https://simhubdash.com/unofficial/SimHub.9.01.29b1_DynamicTSValues.zip

Overall everything new will automatically enrich the simhub known list in rawdata (no not forget to refresh the search text after entering a train, the filter is applied once you type it won't show new dynamic values until it's refreshed) : image

Tilt for instance was something not existing when I did the original implementation, Values learnt but not fed at that time will show a null value.

After a little test on a random train i've got this list of properties as below image

Here is the complete list I get for this train :

"FrameTimeStamp", "Active", "Active_min", "Active_max", "TractiveEffort", "TractiveEffort_min", "TractiveEffort_max", "RPM", "RPM_min", "RPM_max", "RPMDelta", "RPMDelta_min", "RPMDelta_max", "CompressorState", "CompressorState_min", "CompressorState_max", "Wheelslip", "Wheelslip_min", "Wheelslip_max", "Headlights", "Headlights_min", "Headlights_max", "AuxReservoirPressure", "AuxReservoirPressure_min", "AuxReservoirPressure_max", "MainReservoirPressurePSIDisplayed", "MainReservoirPressurePSIDisplayed_min", "MainReservoirPressurePSIDisplayed_max", "EqReservoirPressurePSIAdvanced", "EqReservoirPressurePSIAdvanced_min", "EqReservoirPressurePSIAdvanced_max", "BrakePipePressureTailEnd", "BrakePipePressureTailEnd_min", "BrakePipePressureTailEnd_max", "AirBrakePipePressurePSIDisplayed", "AirBrakePipePressurePSIDisplayed_min", "AirBrakePipePressurePSIDisplayed_max", "TrainBrakeCylinderPressurePSI", "TrainBrakeCylinderPressurePSI_min", "TrainBrakeCylinderPressurePSI_max", "DisableBrakeNotches", "DisableBrakeNotches_min", "DisableBrakeNotches_max", "Ammeter", "Ammeter_min", "Ammeter_max", "EngineStop", "EngineStop_min", "EngineStop_max", "EngineStart", "EngineStart_min", "EngineStart_max", "AirBrakePipePressurePSI", "AirBrakePipePressurePSI_min", "AirBrakePipePressurePSI_max", "LocoBrakeCylinderPressurePSI", "LocoBrakeCylinderPressurePSI_min", "LocoBrakeCylinderPressurePSI_max", "LocoBrakeCylinderPressurePSIDisplayed", "LocoBrakeCylinderPressurePSIDisplayed_min", "LocoBrakeCylinderPressurePSIDisplayed_max", "LocoBrakeCylinderPressurePSIAdvanced", "LocoBrakeCylinderPressurePSIAdvanced_min", "LocoBrakeCylinderPressurePSIAdvanced_max", "Horn", "Horn_min", "Horn_max", "Regulator", "Regulator_min", "Regulator_max", "Reverser", "Reverser_min", "Reverser_max", "SimpleChangeDirection", "SimpleChangeDirection_min", "SimpleChangeDirection_max", "SimpleThrottle", "SimpleThrottle_min", "SimpleThrottle_max", "EngineBrakeControl", "EngineBrakeControl_min", "EngineBrakeControl_max", "EngineBrakeHandle", "EngineBrakeHandle_min", "EngineBrakeHandle_max", "EngineBrakeSound", "EngineBrakeSound_min", "EngineBrakeSound_max", "TrainBrakeControl", "TrainBrakeControl_min", "TrainBrakeControl_max", "VirtualBrake", "VirtualBrake_min", "VirtualBrake_max", "VirtualThrottle", "VirtualThrottle_min", "VirtualThrottle_max", "DynamicBrake", "DynamicBrake_min", "DynamicBrake_max", "SpeedometerKPH", "SpeedometerKPH_min", "SpeedometerKPH_max", "SpeedometerMPH", "SpeedometerMPH_min", "SpeedometerMPH_max", "Wipers", "Wipers_min", "Wipers_max", "EmergencyBrake", "EmergencyBrake_min", "EmergencyBrake_max", "Startup", "Startup_min", "Startup_max", "HandBrake", "HandBrake_min", "HandBrake_max", "Sander", "Sander_min", "Sander_max", "Bell", "Bell_min", "Bell_max", "CabLight", "CabLight_min", "CabLight_max", "DitchLights", "DitchLights_min", "DitchLights_max", "StepsLight", "StepsLight_min", "StepsLight_max", "NumberLights", "NumberLights_min", "NumberLights_max", "GaugeLights", "GaugeLights_min", "GaugeLights_max", "door_front", "door_front_min", "door_front_max", "door_back", "door_back_min", "door_back_max", "WindowLeft", "WindowLeft_min", "WindowLeft_max", "WindowRight", "WindowRight_min", "WindowRight_max", "WindowRightExt", "WindowRightExt_min", "WindowRightExt_max", "WindowLeftExt", "WindowLeftExt_min", "WindowLeftExt_max", "DoorFrontExt", "DoorFrontExt_min", "DoorFrontExt_max", "DoorRearExt", "DoorRearExt_min", "DoorRearExt_max", "PCSstate", "PCSstate_min", "PCSstate_max", "BrakeDifficulty", "BrakeDifficulty_min", "BrakeDifficulty_max", "DrivingMode", "DrivingMode_min", "DrivingMode_max", "TrainBrakeSound", "TrainBrakeSound_min", "TrainBrakeSound_max", "SunVisors", "SunVisors_min", "SunVisors_max", "ExteriorSounds", "ExteriorSounds_min", "ExteriorSounds_max", "TrainLatitude", "TrainLatitude_min", "TrainLatitude_max", "TrainLongitude", "TrainLongitude_min", "TrainLongitude_max", "FuelLevel", "FuelLevel_min", "FuelLevel_max", "IsInTunnel", "IsInTunnel_min", "IsInTunnel_max", "Gradient", "Gradient_min", "Gradient_max", "Heading", "Heading_min", "Heading_max", "Timeofdayhours", "Timeofdayhours_min", "Timeofdayhours_max", "Timeofdayminutes", "Timeofdayminutes_min", "Timeofdayminutes_max", "Timeofdaysecond", "Timeofdaysecond_min", "Timeofdaysecond_max", "LocoProvider", "LocoEngineName", "LocoProduct", "Tilt", "Tilt_min", "Tilt_max", "RawSpeedTarget", "RawSpeedTarget_min", "RawSpeedTarget_max", "RawTargetDistance", "RawTargetDistance_min", "RawTargetDistance_max", "TargetDistanceBar", "TargetDistanceBar_min", "TargetDistanceBar_max", "TargetDistanceDigits100", "TargetDistanceDigits100_min", "TargetDistanceDigits100_max", "TargetDistanceDigits1000", "TargetDistanceDigits1000_min", "TargetDistanceDigits1000_max", "Acceleration", "Acceleration_min", "Acceleration_max", "VSoll", "VSoll_min", "VSoll_max", "TargetSpeed100", "TargetSpeed100_min", "TargetSpeed100_max", "TargetSpeed10", "TargetSpeed10_min", "TargetSpeed10_max", "TargetSpeed1", "TargetSpeed1_min", "TargetSpeed1_max", "AFB", "AFB_min", "AFB_max", "AWSReset", "AWSReset_min", "AWSReset_max", "Cmd_Free", "Cmd_Free_min", "Cmd_Free_max", "Cmd_40", "Cmd_40_min", "Cmd_40_max", "PantographControl", "PantographControl_min", "PantographControl_max", "BrakePipePressureBAR", "BrakePipePressureBAR_min", "BrakePipePressureBAR_max", "MainReservoirPressureBAR", "MainReservoirPressureBAR_min", "MainReservoirPressureBAR_max", "TrainBrakeCylinderPressureBAR", "TrainBrakeCylinderPressureBAR_min", "TrainBrakeCylinderPressureBAR_max", "VigilEnable", "VigilEnable_min", "VigilEnable_max", "VigilReset", "VigilReset_min", "VigilReset_max", "VigilLight", "VigilLight_min", "VigilLight_max", "VigilAlarm", "VigilAlarm_min", "VigilAlarm_max", "LZBActive", "LZBActive_min", "LZBActive_max", "LZBEnding", "LZBEnding_min", "LZBEnding_max", "LZBEnable", "LZBEnable_min", "LZBEnable_max", "LZB_G", "LZB_G_min", "LZB_G_max", "LZB_End", "LZB_End_min", "LZB_End_max", "PZB_85", "PZB_85_min", "PZB_85_max", "PZB_70", "PZB_70_min", "PZB_70_max", "Dummy", "Dummy_min", "Dummy_max", "PZB_1000", "PZB_1000_min", "PZB_1000_max", "PZB_500", "PZB_500_min", "PZB_500_max", "PZB_40", "PZB_40_min", "PZB_40_max", "ServiceBrake", "ServiceBrake_min", "ServiceBrake_max", "PZBEnable", "PZBEnable_min", "PZBEnable_max", "PZB_1000hz_Control", "PZB_1000hz_Control_min", "PZB_1000hz_Control_max", "PZB_500hz_Control", "PZB_500hz_Control_min", "PZB_500hz_Control_max", "PZB_2000hz_Control", "PZB_2000hz_Control_min", "PZB_2000hz_Control_max", "PZB_Distant_Passed", "PZB_Distant_Passed_min", "PZB_Distant_Passed_max", "DeskLight", "DeskLight_min", "DeskLight_max", "DoorsOpenCloseLeft", "DoorsOpenCloseLeft_min", "DoorsOpenCloseLeft_max", "DoorsOpenCloseRight", "DoorsOpenCloseRight_min", "DoorsOpenCloseRight_max", "GlarePanels", "GlarePanels_min", "GlarePanels_max", "LZB_Buzzer", "LZB_Buzzer_min", "LZB_Buzzer_max"

SHWotever avatar Jan 30 '24 10:01 SHWotever

Thanks for dropping in SHWotever

We can use a program called Raildriver and joystick interface by Chris Gamble his program shows in real time what is being out put by TS, great for comparing what Simhub can potentially display.

In Simhub I look under available properties while playing back a replay and see what is changing and only a few things are working occasionally none at all. Usually rpms, throttle position and brake position. GPS, gradient, date and time and loco name work. One that is there and rarely works is PSI for brakes I've only found it works with two US diesels. Some German trains show nothing at all. Steam locos have very little in properties there is no fire mass, water level, steam usage vs generation, injectors, valve cocks.

TS can out put a fair bit of data, slowly figuring out converting raw data for dash studio using ncalc

I have some replays I can post them tomorrow it's late here....

TSC actually has this built in as well and it will show everything for the loco and each of the wagons you are pulling, just add '- ShowControlStateDialog' to the shortcut and it has a little window that shows all the controls.

Bekns avatar Jan 30 '24 10:01 Bekns

@SHWotever You are a machine, I could barely type a forum post in that time lol

Bekns avatar Jan 30 '24 10:01 Bekns

@SHWotever Amazing! I totally echo Bekns comments above! Look forward to trying this out later!

Ben-H6021 avatar Jan 30 '24 10:01 Ben-H6021

I forgot about that Bekns so used to RDJI.

The self-learning looks pretty awesome.

Thanks a ton SHWotever. Will test some more later..

Higgsee avatar Jan 30 '24 10:01 Higgsee

What a great community to see everyone working so well together! @SHWotever I'll get these replays over to you this evening, I'm at work at the moment, between mine and @Higgsee hopefully you will have the required info. @Bekns huge thanks again for your work on this!

Cheers for that, I am more than happy and grateful to see something implemented officially.

It is not in vain as my original goal was to get something that would be able to combine multiple properties and choose the correct one for display purposes, eg. use the value from VirtualReverser instead of Reverser but still be functional if the VirtualReverser doesnt exist.

This will be especially useful with controls like the brake cylinder PSI which sometimes has multiple controls so I could implement a list that works on a priority and would then use the highest priority control and could add a new property that is like BrakeCylinder.Combined and you would only have to use that property instead of accounting for all the different types and then the virtual ones on top of that.

Bekns avatar Jan 30 '24 10:01 Bekns