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

DOCS ACC Shared Memory Documentation

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

  1. Malc2169

    Malc2169 Gamer

    Yes, JoyToKey is one such option, but I'd prefer native support - the less background stuff running the better. IMHO.
     
  2. expor

    expor Gamer

    Does anyone know how
    PHP:
    float surfaceGrip
    works? I created a lot of different scenarios but the value is always between 0.9 and 1.0 and without logic (to me). E.g. if I put the track at 4 degrees with Green condition I get 0.97, while adding 100% standing water and thunderstorm still gives me 0.97. I though this number would reflect the grip % (multiplied by 100) but so far I found no relation between track conditions and the surface grip variable. Anyone?
     
  3. Cirith Ungol

    Cirith Ungol Simracer

    I think it mostly works for dry scenarios, the more rubbered the track is, the more grip you have which it's what's reflected by this variable. When it start raining, you should probably look at the wetness (ksBroadcastingNetwork.Structs.RealtimeUpdate.Wetness in the broadcast interface) to determine the speed of the track.

    Edit : To be more clear, if the track is dry (wetness == 0.0) then the surfaceGrip is useful and tells you how fast the track is, in each other scenarios (damp track, wet etc) the surfaceGrip doesn't get updated and doesn't reflect how fast you can go.
     
    Last edited: Feb 15, 2021
  4. expor

    expor Gamer

    I see, if that's the case it makes more sense I suppose. Although I still expected the grip level to drop even on a dry track when setting a low ambient temperature. However that also didn't seem to affect it.
     
  5. XIV-V

    XIV-V Gamer

    With medium rain surfaceGrip returns 91% -> so it seems to work. I used race preset (and not hotlap).
     
  6. Cirith Ungol

    Cirith Ungol Simracer

    I don't think that's simulated (from experience, not a proof) however with a cold track the temperature at the surface of the tyre is too low compared to the optimum operating window and thus you loose grip.

    Edit : XIV btw are you the guy that made the the Simhub dashboard with the wetness + surface grip ? It's super useful I use it all the time it's f*cking great !
     
    Last edited: Feb 16, 2021
  7. XIV-V

    XIV-V Gamer

    Yes it's me. I released today an update to include wind force and rain intensity. Go update and enjoy it :)
     
    Cirith Ungol likes this.
  8. Bazofius

    Bazofius Rookie

    It's interesting to see how you manage to handle RAM usage
     
  9. Doug Duthie

    Doug Duthie Hardcore Simmer

    Tracks and tyres - I'm well confused...

    Now that shared memory has the tyre name, I thought I'd backtrack to see if it is possible to determine which year of track a session was run on

    For GT3/Zandvoort 2019 - Tyre is DH-D 680
    For GT3/Zandvoort 2020 - Tyre is DH-D2 680
    For GT3/Donington 2019 - Tyre is DH-D 680
    For GT3/Donington 2020 - Tyre is DH-D 680
    For GT3/Donington British GT- Tyre is DH-D 680


    No mention of DHE - is this a typo - should DH-D2 680 really be DHE?

    Also, I was under the impression (probably mistakenly) that if you chose 2020 season, you would get the DHE tyres on British GT/ICGT tracks with GT3. Is this not the case?

    Finally, in the graphic memory structure, all the MFD fields are always zero - is this intentional? I'm particularly interested in the tyre set. Is this supposed to reflect the tyre set in use, or the tyre set selected for the next pit stop?
     
  10. Doug Duthie

    Doug Duthie Hardcore Simmer

    I've just re-read Aris' release notes on the tyres and indeed only the GTWC tracks will have the DHE tyres.

    So is it just that DH-D 680 are in fact DHD2 tyres, and DH-D2 680 are in fact DHE tyres?
     
  11. Malc2169

    Malc2169 Gamer

    Doug, I’ve noticed the Graphic stuff reads zeroes all the time there is any menu displayed - could this be the cause of the issue?
     
  12. Jslabz

    Jslabz Rookie

    I'm trying to read the shared memory data with C#. A lot of fields seem to have unexpected values, which leads me to believe my code isn't reading the data in a correct way.
    For example, surfacegrip would read as a high number (132, 234..) instead of the expected 0.xx . TrackStatus is somehow unreadable as well: "烬䉶✅쏁鵠䌝ᦦ䉷࡜쏆␰䌣䩘䉷騿쏈⿒䌨侠䉷ሟ쏋⋯䌭鱱䉷纈쏍ꍣ䌲䉷㣄" which leads me to believe its an encoding issue, but all other text fields (like CurrentTime, LastTime,..) are read perfectly.
    Would anyone be able to point me in the right direction? Surely i'm missing something.

    Some other fields that are wrong:
    - MandatoryPitDone: 1115024617 (different value each time it's read)
    - ABS: 1125353932
    - Flag: 1123957147

    EDIT:
    I have downloaded the code sample, which works fine. When i add trackStatus (which seem to be missing from the example), the value comes out wrong and other values get corrupted in the process. Anyone else experiencing this?
     
    Last edited: Feb 21, 2021
  13. Doug Duthie

    Doug Duthie Hardcore Simmer

    Remember shared memory is a physical representation of data whereas C# abstracts some data types (strings, arrays) so you need to marshall them as un-managed types. See attached for the way I handled them
     

    Attached Files:

    neophyte likes this.
  14. Doug Duthie

    Doug Duthie Hardcore Simmer

    No - I don't think so. All the new MFD fields appear to be zero whether a menu is displayed or not
     
  15. Jslabz

    Jslabz Rookie

    Yeah ofcourse. I've compared your file with mine and could only determine that the length for TrackStatus is 15 instead of 33. As a test, i've copied your configured values, but now almost all integer values are 0 (zero). I have attached the code i use which reads the memorymap and converts it into my data class. (code is based on a same found on GitHub). I'm quite the rookie when it comes to pointers/shared memory stuff.
     

    Attached Files:

  16. Doug Duthie

    Doug Duthie Hardcore Simmer

    Ok...here's a few more code snippets

    Class to handle the memory mapped file...

    Code:
    namespace ACCResults.SharedMemory
    {
        class ACCSharedMemory<T> where T : struct
        {
            public static Boolean shutdown = false;
            private Logger logger = new Logger("ACCSharedMemory");
    
            private string memRegionName;
            private int memRegionSize;
    
            private MemoryMappedViewAccessor accessor = null;
            private MemoryMappedFile mmf = null;
    
            public ACCSharedMemory(string name, int size)
            {
                this.memRegionName = name;
                this.memRegionSize = size;
            }
    
    
            public bool Open()
            {
                bool opened = false;
    
                try
                {
                    mmf = MemoryMappedFile.OpenExisting(memRegionName, MemoryMappedFileRights.Read);
                    logger.info("Opened memory mapped file to region " + memRegionName);
                    CreateAccessor(mmf);
                    opened = true;
                }
                catch (FileNotFoundException)
                {
                    //Not an error - won't be there until ACC starts session
                    //logger.warning(string.Format("Shared memory region {0} not available - {1} ", memRegionName, ex.Message));
    
                }
                catch (Exception ex)
                {
                    logger.error(string.Format("Exception opening shared memory region {0}  - {1} ", memRegionName, ex.Message));
                    throw ex;
                }    
                return opened;
            }
    
            private void CreateAccessor(MemoryMappedFile mmf)
            {
                try
                {
                    accessor = mmf.CreateViewAccessor(0, 0, MemoryMappedFileAccess.Read);
                    logger.info("Created accessor to memory mapped region " + memRegionName);
                }
                catch (Exception ex)
                {
                    logger.error(string.Format("Exception creating shared memory accessor on region {0}  - {1} ", memRegionName, ex.Message));
                    throw ex;
                }
            }
    
            public void Close()
            {
                if (accessor != null)
                {
                    accessor.Dispose();
                }
                if (mmf != null)
                {
                    mmf.Dispose();
                }
            }
    
            public T Data
            {
                get
                {
                    T dataStruct;
                    try
                    {
                         var bytes = new byte[memRegionSize];
                        accessor.ReadArray<byte>(0, bytes, 0, memRegionSize);
                        var handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
    
                        try
                        {
                            dataStruct = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));
                        }
                        finally
                        {
                            handle.Free();
                        }
    
                    }
                    catch (Exception ex)
                    {
                        logger.error(string.Format("Exception reading data from region {0}  - {1} ", memRegionName, ex.Message));
                        throw ex;
                    }
    
                    return dataStruct;
                }
            }
        }
    }
    
    Handles for the shared memory regions
    Code:
            ACCSharedMemory<ACCsPageFileStatic> staticMemory = new ACCSharedMemory<ACCsPageFileStatic>(Constants.ACC_SHARED_MEMORY_STATIC, Marshal.SizeOf(typeof(ACCsPageFileStatic)));
            ACCSharedMemory<ACCsPageFileGraphic> graphicMemory = new ACCSharedMemory<ACCsPageFileGraphic>(Constants.ACC_SHARED_MEMORY_GRAPHICS, Marshal.SizeOf(typeof(ACCsPageFileGraphic)));
            ACCSharedMemory<ACCsPageFilePhysics> physicsMemory = new ACCSharedMemory<ACCsPageFilePhysics>(Constants.ACC_SHARED_MEMORY_PHYSICS, Marshal.SizeOf(typeof(ACCsPageFilePhysics)));
    
    Then to read
    Code:
    if (!physicsMemoryOpen)
    {
         physicsMemoryOpen = physicsMemory.Open();
    }
    
    ACCsPageFilePhysics accPhysics = physicsMemory.Data;
    Hope that makes sense

    EDIT: BTW, yes, I had track status at the wrong length
     
    Last edited: Feb 21, 2021
    Cirith Ungol and Jslabz like this.
  17. Iko Rein

    Iko Rein Racer

    Just checking, did you also update the struct for the Graphics?

    I get all the new V1.07 Graphics packet fields when MFD is visible or not.

    Cheers.
     
    Last edited: Feb 21, 2021
  18. Doug Duthie

    Doug Duthie Hardcore Simmer

    Doh...copy/paste error - I had the track status set to 15, not 33 bytes

    Thanks
     
  19. pankykapus

    pankykapus KS Dev Team Staff Member KS Dev Team

    I wasn't aware this was shared.

    Anyway, the naming convention is different internally because when development started on them, Pirelli were initially calling the DHE tyres DHD v2, so internally we have DHD and DHD2, instead of DHD2 vs DHE. It might get changed later for clarity now that it's in shared mem too.

    Unfortunately Pirelli naming conventions are not great, they called the 2nd revision of the DHD tyre DHD2 and with v2 they eventually changed the designation to DHE.
     
    Last edited: Feb 22, 2021
    Cirith Ungol likes this.
  20. Doug Duthie

    Doug Duthie Hardcore Simmer

    Ah I see. Thanks for the clarification. I'm just trying to use the tyre types to classify best laps for a track (ie a GT3 time on DH-E tyres on a 2020 track wouldn't be expected to be comparable to a time with DHD2 on a 2019/2018 track).

    It would be nice if there was some way of identifying the track year too (where the surface differs between 2018/2019)
     
Similar Threads
Forum Title Date
ACC Physics Differentiate AC and ACC Shared Memory With Different Naming. Jan 3, 2024
ACC Troubleshooting ACC Shared Memory: AC version still reports 1.7 Apr 19, 2023
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 Multiplayer ACC dedicated server race start hangs, but only on Nordshleife Apr 13, 2024
ACC Troubleshooting Access violation on game startup . The UE4-AC2 game has crashed Apr 11, 2024
ACC Multiplayer ACC Server Setting Apr 7, 2024
ACC Troubleshooting RealtimeCarUpdate.Heading/Yaw removed from ACC Broadcast UDP in favor of WorldPosZ/Elevation? Apr 4, 2024
ACC Multiplayer Missing information in ACC Server Admin Handbook Version 1.10.0 Apr 3, 2024
ACC Physics ACC inconsistensies should be addressed for the future of the game. (Ex: Braking mechanics & tracks) Apr 3, 2024
ACC PS4/PS5/XB1/XBX/S General Discussions ACC chrashed started Race in carriere modus Apr 2, 2024
Bug reports acc fov bug Apr 2, 2024
ACC Troubleshooting ACC 1.10.0 crash Nurb Nordschleife Apr 1, 2024
ACC PS4/PS5/XB1/XBX/S General Discussions ACC Will it get cross party not just cross play on consoles? Mar 23, 2024
ACC Physics Does ACC not implement real life braking mechanics?(Need some insights on this recent youtube video) Mar 16, 2024

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