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.
  2. FOR ASSETTO CORSA COMPETIZIONE: If you report issues with saved games, please always zip and attach your entire User/Documents/Assetto Corsa Competizione/Savegame folder!
  3. If your game executable is missing, please add your entire Steam directory to the exceptions in your antivirus software, then run a Steam integrity check or reinstall the game altogether.

DOCS ACC Shared Memory Documentation

Discussion in 'ACC Blog' started by Fernando Barbarossa, Aug 28, 2019.

  1. Iko Rein

    Iko Rein Rookie

    Hi Ensi,

    Great work on the documentation.

    I don't know, if you follow the broadcast developers thread. There was a question about the penalty enum, which relates to the Shared Memory documentation.

    Any change, you could get a updated list of the Penalty codes for Shared Memory? I assume they are the same as for Broadcasting API.

  2. DennisF89

    DennisF89 Rookie


    I'm currently working on a small app using the shared memory of ACC and I was wondering if there is a flag or something in there to detect wether a lap is valid or not?
    Basically I'd like to know when if the user cutted and the laptime is displayed red in game. I couldn't find anything yet, so any help is appreciated :)
  3. Ensi Ferrum

    Ensi Ferrum Racer

    What you're looking for is in SPageFileGraphic:
    int isValidLap
    - 0(zero) indicates Non Valid Lap (Red timing in the HUD);
    - 1 indicates Valid Lap
    ..LeRenard! likes this.
  4. DennisF89

    DennisF89 Rookie

    Thank you!:)
    I was only looking at the code sample, which apparently does not include some newer fields, so I never saw those new field.
  5. Tom Shane

    Tom Shane Racer

    Doesn't work for race and hot stint sessions. It always returns 1.
  6. Ensi Ferrum

    Ensi Ferrum Racer

    Really :eek:
    Will have a look at it over the weekend.
    Last edited: May 22, 2020
    Tom Shane likes this.
  7. ProBosch

    ProBosch Rookie

    Hey guys, I just noticed that fields like fuelXLap, ABS, TC, TCUT, usedFuel in graphics are always 0 for me. Do they work for you guys?
  8. Ensi Ferrum

    Ensi Ferrum Racer

    They work very well on my side.
  9. AL612

    AL612 Rookie

    It does stay as true, I think it was mentioned earlier in the thread. As you said it's tied to the current time going red, the superficial level rather than the ratings and lap record chart level.

    In c#? Check the string encoding, when I leave it default the result is as you get, but setting charset to unicode it reads fine.
    ..LeRenard! likes this.
  10. ProBosch

    ProBosch Rookie

    Thanks, I figured it out using a package meant for AC. Gonna fork it and prepare one for ACC in C# tomorrow.
  11. ProBosch

    ProBosch Rookie

  12. Doug Duthie

    Doug Duthie Racer

    I use shared memory, for among other things, to tell me when new sessions start and when I need to ask for a Broadcast connection to record the session. At the moment I determine a new session
    • If the session type (Race/qualifying etc) changes
    • If the lap number is less than the last
    • AND the status is ACC_LIVE (as i don't want to try to record when the user has exited a session and/or ACC)
    Someone has just reported an issue with multiplayer driver changes. This driver wasn't the first stint and I think what happened is that the status for him was ACC_OFF until his stint started. Therefore, I didn't record the first stint as it looked as though it wasn't in a session.

    Does this sound right? Is the status supposed to be ACC_OFF if a driver is just spectating the first stint? If so, how do I differentiate this from when a driver isn't in a session at all? Interestingly, it looks as though when his stint finished, and he went back to spectating, the status remained as ACC_LIVE

  13. AL612

    AL612 Rookie

    Not worked with those two elements, but I'll take a shot.
    My understanding of the driver swapping, is that non-driving team members are in a spectator condition - think iRacing - so telemetry doesn't exist.

    As such the broadcast api is geared around the spectate concept, and also provides session status beyond the graphic.status ACC_LIVE/ACC_OFF when I had a cursory look previously. I imagine it might work nicer for you to flip the concept and use the broadcast api as the outer control, given the increased states.
  14. AL612

    AL612 Rookie

    Brake Pressure, the constants given in appendix 3, do these get multiplied with the corner values to give a value in bar?

    Also it appears that 488 is FWD o_O
  15. Doug Duthie

    Doug Duthie Racer

    My problem with driving it around the broadcast api is while that is geared around the spectate concept, it appears to be designed around manual interaction (ie you know a session has started so you start spectating). There's nothing to tell you a new session is starting so you need to get a new connection. This is really why I was trying to drive it around shared memory, and when the status/session/track/laps changed it was an indication that a new session had started.

    I was working on the assumption that status of ACC_OFF always meant that ACC wasn't in a race (ie not between pressing Start Event and session ending/quitting). I'm just wondering if this is supposed to be like that. It would be nice if there were an extra state of Spectate.
  16. AL612

    AL612 Rookie

    I get that, it's actually the same for the shared memory. Whether you close the memory file is another matter.

    Just done some testing, whilst spectating, the graphic.status returns ACC_OFF. Which will be your problem right?

    I think many are doing something similar to below with the memory files, where catch filenotfound exceptions occur they return success = false. Here it's looking at the broadcast response instead.

    System.Timers.Timer broadcastControlTimer = new System.Timers.Timer(1500);
    int ConnectionId = 0;
    ACCUdpRemoteClient broadcast;
    public ctor()
        broadcast = new ACCUdpRemoteClient(ip, port, displayName, connectionPassword, commandPassword, msRealtimeUpdateInterval)
        broadcast.MessageHandler.OnConnectionStateChanged += ConnectionStateChanged;
        broadcastControlTimer += OnTimerElapsed_Waiting;
        broadcastControlTimer.AutoReset = true;
        broadcastControlTimer.Enabled = true;
    protected void OnTimerElapsed_Waiting(object sender, ElapsedEventArgs e)
    protected void ConnectionStateChanged(int connectionId, bool connectionSuccess, bool isReadonly, string error)
        if (connectionSuccess)
            broadcastControlTimer.Enabled = false;
            ConnectionId = connectionId;
            broadcastControlTimer.Enabled = true;
    edit: not even close to trying that code out

    For reference aswell, the game engine looks like;
    1. Menu - nothing exists,
    2. Session loaded - memory file created, broadcast accepting connections -> Spectate state
    3. Player car loaded - memory files being written to.
    Last edited: Jun 10, 2020
  17. Doug Duthie

    Doug Duthie Racer

    OK - thanks for your confirmation - I just need to still poll broadcast when ACC_OFF to see if we are spectating
  18. johmix

    johmix Rookie

    thanks man
  19. Doug Duthie

    Doug Duthie Racer

    Given all the GT4 cars coming in the DLC have now been teased in the preview video, is there any chance we can have a list of all the codes used for the new cars (shared memory car model code and the enums used for broadcast and results files). It would give me a chance to get my app ready

    Iko Rein, AL612 and Tom Shane like this.
  20. WallyM

    WallyM Alien

    Has anyone figured out if you can calculate some measure of understeer/oversteer from what's available in the shared memory? E.g. maybe using a combination of localAngularVel, tyreContactHeading, heading etc?
Similar Threads
Forum Title Date
ACC Troubleshooting ACC Shared Memory Example Apr 23, 2020
Programming Language - Apps - GUI Themes Shared Memory or UDP Reference for ACC ? Sep 13, 2018
ACC Troubleshooting ACC - TC Changes randomly with no button pressed Today at 3:59 AM
Console Lounge WHL 197 . AC: Dancing with the wallflower. ACC: Partick on tour. Yesterday at 2:10 PM
ACC PS4 - XB1 General Discussions What would make ACC be the best sim on console? Yesterday at 12:16 AM
ACC Troubleshooting ACC Freezes after race/stint .. and sometimes droppes me out of the server .. for half a year prob. Friday at 11:57 PM
ACC Troubleshooting ACC - Crash (GTX 1080/I5 8600K) Friday at 9:15 PM
ACC Virtual Reality Finally fixed ACC VR performance. . Friday at 6:54 PM
ACC Physics ACC Motec Wrong Data Thursday at 7:42 PM
ACC PS4 - XB1 General Discussions Console ACC Leagues Sep 12, 2020
ACC PS4 - XB1 General Discussions Fanatec Pedal Rumble function doesn't work after ACC resumed after PS4 waked up. Version 1.04(1.5.4) Sep 11, 2020
ACC Physics ACC Motec log file driver name Sep 9, 2020
ACC PS4 - XB1 General Discussions Start new race accidentally (design issue) and AI car stalls on grid Sep 8, 2020
ACC Hardware Discussions How much bandwidth does an ACC server use on average? Sep 7, 2020
ACC Troubleshooting Saving not possible since 1.5.5 [Win Defender blocking access to documents folder] Sep 5, 2020

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