overload-development-community / olmod

A mod for the game Overload that enhances the multiplayer experience.
https://olmod.overloadmaps.com
MIT License
32 stars 15 forks source link

Adding Telemetry Data output for Motion simulators #323

Open sci666-2023 opened 8 months ago

sci666-2023 commented 8 months ago

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...

sci666-2023 commented 7 months ago

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 commented 3 months ago

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 commented 3 months ago

Hi Lukas, wow sounds good.I will share this Information with my xsimulator forum friends. They have to grab the telemetry Data from the memory to make a plugin. I will let you know. Very best! Ronny --Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 14.05.24, 19:19 schrieb Lukas Denda @.***>:

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:

https://olmod.overloadmaps.com/  
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 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

sci666-2023 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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

luponix commented 3 months ago

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:

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 commented 3 months ago

Hi. Wow. Thanks a lot. I will forward this to yobuddy. I will let you know what He say. Best regards--Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 25.05.24, 12:51 schrieb Lukas Denda @.***>:

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 works 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 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

phunkaeg commented 1 month ago

Any progress on this @sci666-2023?

phunkaeg commented 1 month ago

@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 commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

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

drowhunter commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

@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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

sci666-2023 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

@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.

https://github.com/overload-development-community/olmod/pull/336

luponix commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

drowhunter commented 1 month ago

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.

https://github.com/overload-development-community/olmod/pull/336

sci666-2023 commented 1 month ago

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

drowhunter commented 1 month ago

Here you go https://github.com/drowhunter/olmod/releases/download/1.1.1/GameMod_wTelemetry_v1.1.1.zip

drowhunter commented 3 weeks ago

@sci666-2023 any luck ?