Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Telemetry Data output for Motion simulators #323

Open
sci666-2023 opened this issue Dec 27, 2023 · 34 comments
Open

Adding Telemetry Data output for Motion simulators #323

sci666-2023 opened this issue Dec 27, 2023 · 34 comments
Labels
enhancement New feature or request needs more info There is not enough information to reproduce the issue.

Comments

@sci666-2023
Copy link

That would be 1000000000% immersive !!!! game with VR in a motion rig !!!

maybe this helps:
https://www.xsimulator.net/community/faq/devs-how-to-add-telemetry-output-into-a-game-unity-and-ue4-code.287/

just an example how this would look like:
https://www.youtube.com/watch?v=DQ_bFsmPpHQ&pp=ygUTbW90aW9uIHJpZyA2ZG9mIGRpeQ%3D%3D

and no, it should not be complicated, the game does NOT control the rig !!! it just provide the data for, surge, yaw, heave, exelaration, etc. in some format.

so the rig software can pull these data out of the memory and translate it to movement data...

@roncli roncli added enhancement New feature or request needs more info There is not enough information to reproduce the issue. labels Jan 11, 2024
@sci666-2023
Copy link
Author

what informations do you need a good source is the first link and there are also Devs for the tool that controls the motion rig which can help you how to implement the telemetry data output.

@luponix
Copy link
Member

luponix commented May 14, 2024

i made a small version that should give the telemetry for everything but gforces.
i have no way of testing it though so let me know if it works.

to install it you need olmod:

  1. https://olmod.overloadmaps.com/

  2. go to the olmod folder and replace its GameMod.dll with this file
    https://uploadnow.io/f/tv1GGxS , if that upload platform is sketchy i can share it over discord

If it worked you should see TELEMETRY in the top right corner of the main menu
it sends to 127.0.0.1:4123

@sci666-2023
Copy link
Author

sci666-2023 commented May 14, 2024 via email

@sci666-2023
Copy link
Author

i put the informations into the xsimulator forum:
https://www.xsimulator.net/community/threads/help-plugin-for-overload-got-implementation-by-the-developers.18757/#post-248193
User Yobuddy will take care of it - i hope he has a bis spare time for this one :) . maybe you can get in touch with him directly or vice versa
Thanks you !

@sci666-2023
Copy link
Author

Hi Luponix, Yobuddy and i tested it and we followed your orders with olmod and stuff and the game shows "Telemetry" in the main menu but it seems that there is NO output because all Values stayed with value Zero. :(
For Testing Values are watched with a small Tool called "UDP Reciever" i will attach it here. please can you take a look again on the output ? Maybe you can use it to determine whats going wrong here ?
and theres an additional wish from our xsim Dev Yobuddy, can you change the delimiter to semicolon instead of Comma ? its more usable because of problems with decimal delimiters if you use commas.

no_output

UDPRecieve_v2.zip

@luponix
Copy link
Member

luponix commented May 22, 2024

ok. will check whats going on there this weekend. thx for including the program. that is going to be a huge help

@luponix
Copy link
Member

luponix commented May 25, 2024

turned out to be a simple fix. the object i attached the script to got destroyed when changing scenes.

there are a couple changes in this version:

  • output is seperated with ';'
  • gforces based on the acceleration work now
  • it outputs some extra events

Format:
"{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};{10};{11};{12};{13}"
0 = Roll (rotation.z), // angles in degrees (-180 to 180)
1 = Pitch (rotation.x), // angles in degrees (-180 to 180)
2 = Yaw (rotation.y), // angles in degrees (-180 to 180)
3 = angular velocity.z, // in (rad/sec)
4 = angular velocity.x, // in (rad/sec)
5 = angular velocity.y, // in (rad/sec)
6 = Gforce.x,
7 = G-force.y,
8 = Gforce.z
9 = EVENT: Is the player boosting ? : {0f, 1f}
10 = EVENT: Is the player firing the primary weapon ? : {0f, 1f}
11 = EVENT: Is the player firing missiles ? : {0f, 1f}
12 = EVENT: Did the player just pickup an item ? : {0f, 1f}
13 = EVENT: How much damage did the player receive since the last update (16.6666ms) ? : {0f, <...}

GameMod.zip

@sci666-2023
Copy link
Author

sci666-2023 commented May 26, 2024 via email

@phunkaeg
Copy link

Any progress on this @sci666-2023?

@phunkaeg
Copy link

@luponix - we've created a plugin to get the telemetry working and passed on to Yaw3 via the Yaw GameEngine software.

https://github.com/phunkaeg/OverloadPlugin_GameEngine_YAWVR

I'm running into an issue at the moment where the telemetry seems to be world-based instead of player-orientation based.

For example, if I interpret the gForceX > Chair Pitch. It will pitch backwards if I accelerate in one particular direction. Lets say "East". However, if I accelerate West the chair will pitch forward. And if I accelerate North or South, the chair doesn't pitch at all.

Would it be possible to modify this on the telemetry output side?

@phunkaeg
Copy link

@luponix - I have no idea how to do coding. But I tried decompiling the GameMod.dll file and seeing if I could find how the telemetry data was being sent, to see if there was an easy way to change it to Local-space.

I didn't know how to do it, so I asked ChatGPT (don't hate me please!)
Which said that it could add some Local-space conversions to the code.

Not sure if this is total rubbish or not, but it might save a bit of time.

https://pastebin.com/wQK2UkST

@drowhunter
Copy link

Heres how you convert a Vector from World to Local Space

public static Vector3 WorldtoLocal(Quaternion rotationQuaternion, Vector3 v_world)
{
    //normalize the quaternion
    var qN = Quaternion.Normalize(rotationQuaternion);

    // Convert world vector to local vector
    Quaternion l_world = Quaternion.Conjugate(qN) * new Quaternion(v_world, 0) * qN;

    //return it
    return new Vector3(l_world.X, l_world.Y, l_world.Z);
}

@sci666-2023
Copy link
Author

hello there, sorry for the laaaate reply ...i was the initiator of this :D i had some private issues and vacation and stuff so i do not have the time. as mentioned above the relation seems to be wrong implemented, world based and not "player" based ...

for example, i accelerate and then break the simulator moves back and forth ... but when i turn 90degree and accelerate and break the simulator moves left and right instead of back and forth ... you know what i mean

yobuddy from xsimulator forum tested it with same results for Simtools.

@luponix please take a look and the movement relations :)

@drowhunter
Copy link

I made a few videos demonstrating the issue.

https://www.youtube.com/watch?v=bpAHzVm1N9A&list=PLKAHjo-1AXAE-H0npI1Re4FS_BPd1xeL6&index=1

in this video i used the function above on my side to localize the vector using the rotation being passed but it doesnt have the correct effect. Likely because the vector in the telemetry needs to be localized before subtraction (delta)

Speaking of which, in the telemetry Velocity.x y z should be called Acceleration x, y, z since its actually the difference between the current Velocity Vector and the previous one.

@drowhunter
Copy link

heres the full playlist of tests i did , demonstrating various axes

https://www.youtube.com/playlist?list=PLKAHjo-1AXAE-H0npI1Re4FS_BPd1xeL6

@drowhunter
Copy link

Actually can you can include the Acceleration(x,y,z) - renamed from Velocity
And also pass the actual Velocity (x,y,z) named as Velocity
And the cherry on top would also be to pass back the rotation quaternion as rotation X,Y,Z,W ?

this way I can try to also figure it out some calculations on my side ?

@drowhunter
Copy link

Also if you look at that playlist at the 3 geforce videos. It seems that the Axes are strange. They work perfectly but the axis are not what you would expect.
geforceX seems to be forward and back (surge) and GerforceZ is Side to Side (sway)

i would expect that those would be the other way around as usually Z is forward and X is to the right.

maybe Unity is different.

@phunkaeg
Copy link

@luponix

If you were in the mood to experiment. You can download the Yaw Emulator + Game engine software from the Yaw website
https://www.yawvr.com/downloads

So you can see the reactions as shown in @drowhunter's videos.

@sci666-2023
Copy link
Author

hello there @drowhunter ,as i say i was the initiator of this to get overload work wit Simtools (xsimulator.com), the Format is conform to simtools, so please avoid to request any format change!
it will cause simtools not to work and our simtools dev has to redo his work !!!!
so for any other tools you are a free rider here - take the format as is and convert it within your development when desired.
the content of the values, we can talk about if its velocity or acceleration- i think this is similar in your tool and simtools.

@luponix please no format change, just edit the movement relations, please - this would be very nice ;)

@drowhunter
Copy link

drowhunter commented Jul 30, 2024

Makes sense let's not break anything.

Looking at the code I see that what I thought was acceleration is actually what the mod is calling g-force.

And that the Velocity is actually angular velocity.

So no biggie.

What's for sure is that it seems after my testing that all of the g-force values are world space as which axis is forward changes based on what direction I'm facing.

So if I'm facing yaw 0. Forward = z

If I face 90 deg to the right (yaw 90) , then, Forward = x

@drowhunter
Copy link

Ideally regardless of what direction your ship was facing forward would always move z+

@sci666-2023
Copy link
Author

its cool that more people are interested in those simrig things ;) its so awesome to sit in it with VR and everything moves, its so immersive. i asked the same thing the iron rebelion devs but unfortunately they decide after 8 weeks or so to abandon this request :((((

@drowhunter
Copy link

its cool that more people are interested in those simrig things ;) its so awesome to sit in it with VR and everything moves, its so immersive. i asked the same thing the iron rebelion devs but unfortunately they decide after 8 weeks or so to abandon this request :((((

Check this out .

https://youtube.com/watch?v=zx7GTKkWqYk&si=pLyjYtoQbBlwBtSk

@drowhunter
Copy link

@luponix I have submitted a PR for the telemetry, I have kept all the existing data points in altered for compatibility, and added the new ones , they work great.

#336

@luponix
Copy link
Member

luponix commented Aug 3, 2024

very cool, thanks for looking at this, i am currently buried in real life stuff.
i dont have the rights to merge it. that would be a @roncli thing

how hacky are simulator setups ? -> is it normal to enable telemetry output over a command line argument or would this require an ingame option or do games just constantly dump telemtry

@drowhunter
Copy link

Not hacky at all. Most racing sims like Project Cars, Assetto Corsa, Dirt Rally ...I could go on but the list would be to long, even Gran Turismo 7 has telemetry that outputs via UDP or Shared memory.

To connect you use software like the one you see in my video and you just hit the connect button.

Some game you just need to enable it in settings.

Obviously in games like overload it requires a mod to get at the telemetry but then connecting to it is very straight forward.

@sci666-2023
Copy link
Author

games just dump constantly these data (racing games moslty have an activation switch within their options.

in general somebody included this within the development of the game, i dont know it there are inofficial rules for the format of telemetry. Racing and Flight sim games mostly have some sort of telemetry output, racing games are most advanced there, they provide everything - not only the position of yaw, heave, pitch and the other dofs , also tire pressures, needle positions of the gauges, light bulb status, RPM, etc etc ..... so you can grab these Data and build a whole Gauge Cluster or something. BUT ... the theres no software out there that can use this data natively, somebody has to convert this data with some sort of plugin to adapt the informations to the Sim, like here for the YawVR thingi or like in our Case Simtools, Simtools is more diy and you can use every kind of simulator for it. simtools dev must programm a plugin that converts the game informations to the chanels, like yaw, heave, pitch, etc. and the user has to configure these channels to their own simulator.

some games which do not provide telemetry natively are able to produce telemetry via third party tools like "Space monkey" i dont know how but the space monkey devs where able to grap some of these data directly out of the engine ingame ... idk ... like mechwarrior5 or so. but some games cant output these data at all, for example ace combat 7 - theres no way to produce any telemetry which is crap for this kind of game.

@luponix , @roncli ...but back to topic, whats the next steps to fix the ralation issue wo switch from world to player related movement ?

@drowhunter
Copy link

In MW5 it's accomplished via mod, just like overload.

I don't use simtools but in their current plugin , is it working well with the world space data ?

If it is then I assume they were handling the conversion to local space on their side.

I think someone with permission to merge will need to merge the PR linked above.

@sci666-2023
Copy link
Author

No it does not work the output in the mod must be corrected by the devs. If you turn around everything messed up 😉

@drowhunter
Copy link

No it does not work the output in the mod must be corrected by the devs. If you turn around everything messed up 😉

Yeah , it has been fixed in this Pull request.

#336

@sci666-2023
Copy link
Author

Oh didnt noticed it. I have to Check it with our Tool. Iam not Sure. Where i can Download the new mod Version?

@drowhunter
Copy link

@drowhunter
Copy link

@sci666-2023 any luck ?

@CCraigen
Copy link
Collaborator

I commented on the PR as well - sorry for the delay on this, this will be in 0.5.14 release. We started release testing a week ago and we're on RC2 now. I'll pull this in shortly for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs more info There is not enough information to reproduce the issue.
Projects
None yet
Development

No branches or pull requests

6 participants