1. Do you need support for Assetto Corsa Competizione? Please use the proper forum below and ALWAYS zip and attach the WHOLE "Logs" folder in your c:\users\*youruser*\AppData\Local\AC2\Saved. The "AppData" folder is hidden by default, check "Hidden items" in your Windows view properties. If you report a crash, ALWAYS zip and attach the WHOLE "Crashes" folder in the same directory. Do not post "I have the same issue" in an existing thread with a game crash, always open your own thread. Do not PM developers and staff members for personal troubleshooting and support.
  2. As part of our continuous maintenance and improvements to Assetto Corsa Competizione we will be releasing small updates on a regular basis during the esports season which might not go through the usual announcement process detailing the changes until a later version update where these changes will be listed retrospectively.
  3. If ACC doesn't start with an error or the executable is missing, please add your entire Steam directory to the exceptions in your antivirus software, run a Steam integrity check or reinstall the game altogether. Make sure you add the User/Documents/Assetto Corsa Competizione folder to your antivirus/Defender exceptions and exclude it from any file sharing app (GDrive, OneDrive or Dropbox)! The Corsair iCue software is also known to conflict with Input Device initialization, if the game does not start up and you have such devices, please try disabling the iCue software and try again. [file:unknown] [line: 95] secure crt: invalid error is a sign of antivirus interference, while [Pak chunk signing mismatch on chunk] indicates a corrupted installation that requires game file verification.
  4. When reporting an issue with saved games, please always zip and attach your entire User/Documents/Assetto Corsa Competizione/Savegame folder, along with the logs and the crash folder (when reporting related to a crash).

Generic UDP format

Discussion in 'Console Lounge' started by vthinsel, Mar 6, 2017.

  1. vthinsel

    vthinsel Gamer

    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. Similar Threads
    Forum Title Date
    ACC Troubleshooting RealtimeCarUpdate.Heading/Yaw removed from ACC Broadcast UDP in favor of WorldPosZ/Elevation? Apr 4, 2024
    ACC Multiplayer Communicating with accServer.exe (previously acRemoteServerUDP) Mar 14, 2024
    ACC Tools Read UDP Data Nov 26, 2022
    Console Lounge [PS5] UDP data for TM SF1000 Nov 15, 2022
    ACC Troubleshooting Game crashing with "Fatal error" only in multiplayer - UDP Paket not read to the end Nov 1, 2022
    Console Lounge Any chance of UDP on PS4/PS5? It was on AC original May 18, 2022
    ACC PS4/PS5/XB1/XBX/S General Discussions Keyboard support for console and UDP for telemetry Apps Jun 6, 2021
    ACC Multiplayer Error: AcMultiplayerClient disconnected due to UDP timeout Jul 15, 2020
    ACC PS4/PS5/XB1/XBX/S General Discussions Can we get UDP Telemetry on the Xbox One Jun 27, 2020
    ACC PS4/PS5/XB1/XBX/S General Discussions ACC UDP telemetry on consoles (PS4 at least) Jun 24, 2020
    ACC PS4/PS5/XB1/XBX/S General Discussions NO UDP/SHARED MEMORY output on console Jun 23, 2020
    Console Lounge We need UDP to run the dashes on our rigs. Jun 20, 2020
    Console Lounge will console version have UDP so we can use dash apps? Jun 19, 2020
    ACC Troubleshooting Connection Lost to Servers after Each Session Ends. UDP Timesout? Jun 9, 2020
    Multiplayer Bugs & Issues ERROR: Could not resolve UDP Plugin address Apr 21, 2020

  3. Kevin Kirk

    Kevin Kirk Simracer

    I didn't realize their was a way to use apps on the console version.
     
  4. boabmatic

    boabmatic Hardcore Simmer

    Davi2877, svenvangent and Kevin Kirk like this.
  5. Guillaume C

    Guillaume C Simracer

    You're saying you've implemented handshake successfully... Does it mean you're able to get track and car name ?
    If so, I'm very interested if you can try to get also the best time and then we can see how you can push me these 3 infos to my leadearboard https://www.ac-leaderboard.com ;)
    It would be awesome to have something similar as RSR for console.
     
    svenvangent likes this.
  6. vthinsel

    vthinsel Gamer

    Yes, I get succesfully the track name, car name, track config, etc... all those come from the handshake.
    What you are mentioning is the RTInfo structure, which I havent tried yet, but I'm confident it is feasible.
    The handshake is a bit painfull to integrate in XSim, so I was thinking of having my code acting as a proxy. This would make it possible to push info to your leaderboard easily. Feel free to PM me with details on how to push this info.
     
    svenvangent likes this.
  7. vthinsel

    vthinsel Gamer

    So I have almost finished the XSim plugin. the UDP payload provides the 3 G forces, which is great. It would be marvellous to get also the yaw / pitch /roll position of the car so the playseat could be moved accordingly, to feel the car position. G forces is essential for kicks, but position are also a must-have. I love to feel going up/down in Spa :p
    If a nice developper could add three floats at the end of the UDP frame, I would be more than happy to implement it.
     
  8. bradleyland

    bradleyland Hardcore Simmer

    @vthinsel I am using Ruby to read the UDP stream, and some of the datatypes are ambiguous. For example, char is supposed to be 1-byte according to the MS C++ documentation (link), but they're actually 2-byte (wchar_t). Also, the AC UDP doc does not specify text encoding. I think I've figured out that it's UTF-16LE, but the strings are odd. They appear to be terminated by a % character, but there is "junk" after the string. I was expecting some kind of padding. Can you tell me anything about the strings sent by AC?

    Also, can you confirm that column C is accurate (in your Google Sheet) for RTCarInfo? That's a very helpful document, btw :)

    My end goal is to write a command line data logger, that connects to AC, and writes JSON records to a file. The schema of the JSON will be defined by passing config files to the CLI tool. I will publish as a Ruby gem once it is complete.
     
    svenvangent likes this.
  9. vthinsel

    vthinsel Gamer

    Hi !

    Yes, strings are indeed a bit strange. I have the feeling the memory is not cleaned. Here is how I extract interesting data :

    trackname = System.Text.ASCIIEncoding.Unicode.GetString(UDPBytes.Skip(208).Take(50).ToArray())
    trackname = trackname.Substring(0, trackname.IndexOf("%"))

    I use '%' as the separator, as you also noticed. It works nicely this way

    Y'es, column C should be the one to use.
    Here is how I extract data in my code in VB:

    SpeedKMH = BitConverter.ToSingle(UDPBytes.Skip(8).Take(4).ToArray, 0)
    SpeedMPH = BitConverter.ToSingle(UDPBytes.Skip(12).Take(4).ToArray, 0)
    SpeedMS = BitConverter.ToSingle(UDPBytes.Skip(16).Take(4).ToArray, 0)
    RPM = BitConverter.ToSingle(UDPBytes.Skip(68).Take(4).ToArray, 0)
    Gear = BitConverter.ToInt32(UDPBytes.Skip(76).Take(4).ToArray, 0) - 1
    LapTime = BitConverter.ToUInt32(UDPBytes.Skip(40).Take(4).ToArray, 0)
    LastLap = BitConverter.ToUInt32(UDPBytes.Skip(44).Take(4).ToArray, 0)
    BestLap = BitConverter.ToUInt32(UDPBytes.Skip(48).Take(4).ToArray, 0)
    LapCount = BitConverter.ToUInt32(UDPBytes.Skip(52).Take(4).ToArray, 0)
    GForceVert = BitConverter.ToSingle(UDPBytes.Skip(28).Take(4).ToArray, 0)
    GForceLon = BitConverter.ToSingle(UDPBytes.Skip(36).Take(4).ToArray, 0)
    GForceLat = BitConverter.ToSingle(UDPBytes.Skip(32).Take(4).ToArray, 0)
    Gas = BitConverter.ToSingle(UDPBytes.Skip(56).Take(4).ToArray, 0)
    Brake = BitConverter.ToSingle(UDPBytes.Skip(60).Take(4).ToArray, 0)
    Clutch = BitConverter.ToSingle(UDPBytes.Skip(64).Take(4).ToArray, 0)
    Steer = BitConverter.ToSingle(UDPBytes.Skip(72).Take(4).ToArray, 0)
    PositionNormalized = BitConverter.ToSingle(UDPBytes.Skip(308).Take(4).ToArray, 0)
    CarPosition(0) = BitConverter.ToSingle(UDPBytes.Skip(316).Take(4).ToArray, 0)
    CarPosition(1) = BitConverter.ToSingle(UDPBytes.Skip(320).Take(4).ToArray, 0)
    CarPosition(2) = BitConverter.ToSingle(UDPBytes.Skip(324).Take(4).ToArray, 0)
    CarSLope = BitConverter.ToSingle(UDPBytes.Skip(312).Take(4).ToArray, 0)


    the char looks to be coded on 4 bytes as well.

    Hope it helps !
     
    OdeFinn and bradleyland like this.
  10. bradleyland

    bradleyland Hardcore Simmer

    Thank you so much for posting code! It's always helpful to see multiple implementations :)

    I think I'm really close. My Ruby script is able to handle HandshakerResponse and RTICarInfo. I have RTLap defined, but I haven't tested it. I'm not 100% certain it's interpreting the values correctly, but I'm confident my byte offsets are pretty close. I found a great Ruby library that provides a declarative model for binary formats. You can recognize them by the "BinData::Record" inheritance.

    I refactored quite a bit and put up a GitHub repo: https://github.com/bradland/ac_telemetry/

    - Refactored classes/modules out to /lib
    - Made sure output is thread-safe

    Right now, it just dumps the output of Ruby's inspect method to STDOUT for each record. Next up is to add an OutputFormatter class that accepts a configuration including field lists and output type (CSV, TSV, etc). I have to figure out how I'm going to merge HandshakerResponse, RTCarInfo, and RTLap to a single stream though. The column sets are very different. It might just be additive (combine fields in to a single set), and include a row type indicator, so I can easily filter/recognize each row when working with the data.
     
    OdeFinn likes this.
  11. svenvangent

    svenvangent Alien

    Ok this is all a bit of chinees food for me but never the less it would be great to have this tool for PS4/Xbox 1 thanks guy's .
    Keep the mustard going
     
  12. vthinsel

    vthinsel Gamer

    Hello ...
    It's been along time I didnt race on ACC. I switched to PS5 recently, and fired Xsim stuff.... but nothing came out of ACC.
    Is UDP still present in ACC, or is it just in AC ??
    Any updates on AC UDP behavior ?

    Thanks !
     
  13. vthinsel

    vthinsel Gamer

    Here is what I get when trying to establish the handshake:

    upload_2022-4-28_17-13-38.png
    firewall not opened on PS5 properly ? :p
     

Share This Page

  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