ErlerPhilipp / dr2_logger

A logging and analysis tool for Dirt Rally 2.0
MIT License
21 stars 5 forks source link

Expand to .NET #20

Closed KubaKrychowski closed 5 months ago

KubaKrychowski commented 7 months ago

Hi I'd like to expand this idea for .NET framework may i ask u few questions about reading data?

ErlerPhilipp commented 7 months ago

Of course. Please ask. I haven't used .NET for several years, so I can't really tell you which functions or libraries would be good. But I can certainly explain my stuff.

KubaKrychowski commented 7 months ago

Oh that's great! Where i could contact you?

ErlerPhilipp commented 7 months ago

You can write it here. It might be interesting for others. If you want to keep it private, you can find my email here: https://www.cg.tuwien.ac.at/staff/PhilippErler (small indirection to avoid spam)

KubaKrychowski commented 7 months ago

Ok, so I'm already reading the byte array from telemetry UDP but I've got problem with encode it (or map idk) I've seen that somehow you know which bytes are for specified data ,like speed rpm etc - how did u know that? PS: i think i got some data like gear and RPM but speed is totally different than should be (I keep in mind that its in m/s)

ErlerPhilipp commented 7 months ago

my low-level stuff is here: https://github.com/ErlerPhilipp/dr2_logger/blob/master/source/dirt_rally/udp_data.py the most important source for UDP encoding is here: https://docs.google.com/spreadsheets/d/1UTgeE7vbnGIzDz-URRk2eBIPc_LR1vWcZklp7xD9N0Y/edit#gid=0 Dirt Rally 1 and 2 seem to be the same. I think they extracted the information from some Codemasters document for motion base systems.

you can also check this related project: https://github.com/soong-construction/dirt-rally-time-recorder

do you need anything else?

KubaKrychowski commented 7 months ago

Thank you, i guess i found same data but i've got problem with one parameter: the speed cause as i said its totally different than this one i see in game and in telemetry. Behaviour is strange too - when car is on handbrake the speed still changes, and f.g i put 1 and got max speed 79 km/h data shows only 43

ErlerPhilipp commented 7 months ago

Sounds strange indeed. Maybe they changed the telemetry in the meantime. I haven't used my logger in several years. Another guess: little endian vs big endian.

KubaKrychowski commented 7 months ago

I don't think so about endian cause everything works fine except speed

KubaKrychowski commented 7 months ago

image perfect example of this situation

ErlerPhilipp commented 7 months ago

assuming they didn't change the data, i suspect a mixup. these fields are all related to velocity: pos_x = 4 pos_y = 5 pos_z = 6 speed_ms = 7 vel_x = 8 vel_y = 9 vel_z = 10 ... wsp_rl = 25 wsp_rr = 26 wsp_fl = 27 wsp_fr = 28

you can calculate the world-space velocity from

  1. the change in pos_xyz
  2. just take speed_ms whatever that actually is. this is probably shown on the tachometer in-game. i think it's related to wheel speeds.
  3. take the sum of vel_xyz and then the vector length. maybe ignore the up-axis for this.
  4. do something with the wheel speeds wsp_rl etc. but it's probably unnecessarily complicated
  5. in theory, you could even take the g forces but it's probably very inaccurate

which one do you use? what exactly do you want to show?

KubaKrychowski commented 7 months ago

Thank you for that suggestions cause this is it! Its the "GPS" speed not the wheels, setting reading on left front wheel in FWD car finally im getting normal values :D