W.I.P. UDP format update ?

Discussion in 'Apps' started by vthinsel, Mar 6, 2017.

  1. vthinsel

    vthinsel New Member

    Joined:
    Mar 6, 2017
    Messages:
    4
    Likes Received:
    4
    Hello,

    I'm currently developing a plugin for SimTools (for motion and dashboard), using the UDP referece coming from this thread: http://assettocorsamods.net/threads/doc-ac-udp-remote-telemetry.60/
    I have implemented the handshake succesfully, but I'm now a bit stuck at decoding the UDP payload.
    From the above document, I calculated a packet size of 323 bytes. You can check it here, in case I made a mistake: https://docs.google.com/spreadsheets/d/1UTgeE7vbnGIzDz-URRk2eBIPc_LR1vWcZklp7xD9N0Y/edit?usp=sharing

    All packets I receive are 328 bytes large. (floats and ints are assumed to be 32 bits, little endian, what about bool ?)
    By changing offsets I managed to get a couple of values, but with high uncertainty.
    Has there been updates recently on the UDP structure ?
    I'm running on PS4.
    Thanks for your comments !
     
  2. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,491
    Maybe @ihlades has an idea.. hopefully.
     
  3. vthinsel

    vthinsel New Member

    Joined:
    Mar 6, 2017
    Messages:
    4
    Likes Received:
    4
    I have been able to sort out RPM, and went from that one up and down. The only strange thing is that I have extra bytes around the bool values. But I have all I need for motion, at least the G forces.
    What is terribly missing in the data is the yaw/pitch/roll values. Those one are a big lack for motion. Any chance we get them in a future update ?

    Thanks.
     
    luchian likes this.
  4. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,491
    I wish I knew..
    However, I tend to think that developers are listening, and should these values be available somewhere, they could be surfaced. Maybe try a suggestion on official forums.

    In the same time, isn't it possible to calculate them (approximately) based on G-forces ?
     
  5. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    199
    Likes Received:
    142
    Or start sniffing ram for the yaw, pitch and roll values/headers?
     
  6. vthinsel

    vthinsel New Member

    Joined:
    Mar 6, 2017
    Messages:
    4
    Likes Received:
    4
    On PS4, this is not an option unfortunately
     
    Mr Whippy likes this.
  7. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    199
    Likes Received:
    142
    Ah yes of course, sorry :(

    I hope you have some luck accessing these values if it's designed to be able to let you. If not, I hope you can get KS to add them in.

    Though I do wonder if they have commerical/sim lisences and the overlap/capabilities of AC would be too close to the sim users capabilities if they offered too much within AC.
    I know even in sim-land people might still use game versions of things to do pro-level work, even though in the T&Cs it says otherwise :)
     
  8. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,491
    I don't have a modern console, so may I ask: can you use mods on Consoles ?? (for Assetto Corsa in particular I mean)

    Sent from my phone using Tapatalk
     
  9. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,541
    Likes Received:
    1,050
    no modding. or an amazing world of getting paid privately for this stuff would have occurred.
     
  10. cercata

    cercata Member

    Joined:
    Jul 6, 2017
    Messages:
    76
    Likes Received:
    27
    Location:
    Bilbao
    Consoles are closed gardens, everything you run there must be cryptographically signed, and I think only Sony/Microsoft can sign content

    The program (Assetto for example) is already signed, and it can load "content/code" from the cloud for example, so mods that are not a separate process are technically posible.

    But they can add exploits, and if you do that on your Game, you'll have problems with Sony/Microsoft.

    As far as I know, Fallout 4 is the first console game to allow mods, but you need to submit them to Bethesda, and if they validate it, they publish it to the game.

    If kunos is really interested, they could do something similar with Assetto, that would be great.
     
    luchian likes this.
  11. cercata

    cercata Member

    Joined:
    Jul 6, 2017
    Messages:
    76
    Likes Received:
    27
    Location:
    Bilbao
    I've seen that the new version of the protocol (4), is quite different:

    https://github.com/joaoubaldo/acudpclient/tree/master/acudpclient
    https://github.com/mathiasuk/ac-pserver

    I hope they don't break compatibility with your plugin with future updates, but it seems the console version is based in some old code of version 1, very different

    Or maybe they have several servers in diferent ports ?
     
    Last edited: Aug 2, 2017
  12. Mr Whippy

    Mr Whippy Active Member

    Joined:
    Jan 18, 2016
    Messages:
    199
    Likes Received:
    142
    I know this isn't a helpful addition for vthinsel, but why exactly are you making this plugin for PS4 rather than just running a PC version?
    Don't you need a PC to run the software for telemetry readouts in the first place?


    Maybe there is a use case and I'm not familiar enough with the gear needed etc, but I'm interested in why you'd do this unless you 'just wanted to'

    Ie, I know teams who've gone with a PS4 and forgone all moddability and flexibility just to save a few hundred quid on setup... assuming they'll never need/want more.
    Is this a case of being stuck on PS4 for budget reasons, because it could easily be cheaper (depending on your time costs) to just go for a PC version and have huge flexibility/future proof etc etc?!
     
  13. cercata

    cercata Member

    Joined:
    Jul 6, 2017
    Messages:
    76
    Likes Received:
    27
    Location:
    Bilbao
    I guess you don't need a PC, the embedded hardware (arduino, etc) that makes the motion control of the RIG will read directly the UDP stream

    https://www.xsimulator.net/simtools-motion-simulator-software/
     
    Last edited: Aug 8, 2017
  14. vthinsel

    vthinsel New Member

    Joined:
    Mar 6, 2017
    Messages:
    4
    Likes Received:
    4
    Hello.
    Actually, this is wrong. I do not any money with my plugins or arduino dashboards. I'm not a simtools developper. The plugin also requires a PC.
    On the console question, well, I already spend 8 hours a day on a PC. When I get home and want to play for 30 minutes, I want to play without delay. No windows update, driver update,game update, crash update,... PC has advantages over consoles, for sure, but so far console is fine with me.
    More and more games support UDP on consoles, and some with handshakes like AC. UDP has strong advantages over memory dumping, so this is why my plugins are UDP based, for both consoles and PC. Trying to harmonize the two worlds... so they are on par regarding motion/dashboards.When I develop plugins I try to validate it on PC also using free/demo versions

    Cheers,
    Vincent
     
    bradleyland and luchian like this.
  15. cercata

    cercata Member

    Joined:
    Jul 6, 2017
    Messages:
    76
    Likes Received:
    27
    Location:
    Bilbao
    Sorry for the misunderstanding ...

    I totally understand you, I've been like that for the last 15 years !!!! :lol:
    Now I'm back to PC, I don't know until when ...
     
  16. bradleyland

    bradleyland New Member

    Joined:
    Sep 3, 2017
    Messages:
    3
    Likes Received:
    3
    @vthinsel it sounds like you figured out the UDP layout, but I wanted to post my solution here, so that anyone else looking might benefit from our exploration. I also noticed the extra bytes, which was extremely confusing for a couple of hours.

    I used a Ruby library called BinData to read the UDP stream into usable data structures within Ruby. This won't be of much use to you directly, but because I'm 100% certain that this is a working implementation, it should be much easier to port to other languages.

    My RTCarInfo payload reader is here:

    https://github.com/bradland/ac_tele...d/lib/ac_telemetry/bin_formats/rt_car_info.rb

    BinData records use a declarative format, so starting at the top, endian is just a global setting (which I've sloppily repeated elsewhere, whoops), and everything after that is part of the payload. The primitives (string, int8, int32le, etc) are all based on common C implementations of the same, but there are some inconsistencies between implementations, so the following reference will be helpful:

    https://github.com/dmendel/bindata/wiki/PrimitiveTypes

    I've tried to document as much as I could within the class definition. If you have discovered any additional information about the values output by AC, I'd love to incorporate it!
     
    Ricardo Rey and luchian like this.
: udp, telemetry
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice