Shared Memory API

Discussion in 'Community Workshop' started by Mikael Hermansson, Jun 7, 2015.

  1. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    I do regret not including the player's current sector, as it would probably have made things a bit easier for you guys. I tried to do as little manipulation on the data as possible before copying it into shared memory, to avoid a potential maintenance nightmare. What you're seeing is pretty much coming straight from our various subsystems, but that makes it easy to miss various surrounding state needed to make sense of it. I did seem to make some sense out of the sector stuff in my testing though. I'll try and document it as clearly as possible.

    Also, I can confirm that it's not properly recording invalid lap times in race sessions, @Craig. Seems like this is a bug that's slipped through somehow, and not something we intended to change.
     
  2. Craig

    Craig Member

    Joined:
    Jul 2, 2015
    Ratings:
    +12 / 0 / -0
    Sorry i was wrong about the cur lap time, it does become -1 when the lap gets invalidated, it was something in the way i was displaying it that was tricking me into thinking it was pausing. The previous lap however is not -1 at the end of an invalidated lap, it becomes the complete lap time of the invalidated lap, which is not necessarily a bad thing as it means we can detect the overall lap time as invalid, but still display the actual lap time for that invalid lap.
     
  3. Craig

    Craig Member

    Joined:
    Jul 2, 2015
    Ratings:
    +12 / 0 / -0
    Are you just referring to the previous lap time thing here?

    Sector number would have also been nice, along with the actual full sector times.
     
  4. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    Yes, previous lap time in race sessions should get updated with -1 after passing the finish line with an invalid lap, according to one of our developers. Not sure if this better matches what you'd expect from it.
     
  5. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Thanks craig, I'll add some checking to my app - if current lap is -1, don't report the laptime in previous lap when you cross the line
     
  6. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    Can confirm that sector times are unfortunately wonky at best at the moment, especially with the last sector. I'll probably end up documenting those fields as reserved at the moment, and include/fix them in the next update.

    Apologies for the various hiccups in this update. It was admittedly a fairly rushed update on my part, as the patch date sort of snuck up on me, so I ended up not doing as much testing as I would've liked to.

    And of course thank you for sort of involuntarily beta testing the new additions. Hopefully you'll be able to hit the ground running next time instead. :)
     
  7. Craig

    Craig Member

    Joined:
    Jul 2, 2015
    Ratings:
    +12 / 0 / -0
    no worries, these things happen. I've still managed to add some nice new stuff based on this new api :) Just putting together an updated build for Kjell to test now
     
    • Winner Winner x 2
    • Like Like x 1
  8. MrLu

    MrLu New Member

    Joined:
    Apr 24, 2015
    Ratings:
    +4 / 0 / -0
    @Craig will your App be IOs compatible? If yes I would love to test it aswell ;)
     
  9. Craig

    Craig Member

    Joined:
    Jul 2, 2015
    Ratings:
    +12 / 0 / -0
    Yep the app will be available on both iOS and Android.
     
    • Like Like x 2
  10. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    I just pushed the new entries to the GitHub repo.

    There are a couple of changes in there that weren't in the gist's I posted earlier. The most important ones being that I've marked LapTimeDeltaSelf, SectorTimeDeltaSelf, SectorTimeDeltaLeader and SectorTimeDeltaLeaderClass as "reserved" pending future fixes.

    For you early adopters who grabbed the new layouts from the gists (@mr_belowski, @Craig, @pixeljetstream, @Stefan Mizzi) you might find some issues compiling the new changes. We'll still be populating those fields with the less-than-ideal behavior, so feel free to keep using them, but know that they might change at a later date (late August, possibly). I'll of course let you know beforehand though.
     
    • Like Like x 4
  11. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Thanks fella, that's very helpful. All this new stuff is going to keep me busy for a while longer :)
     
  12. pixeljetstream

    pixeljetstream Well-Known Member Beta tester

    Joined:
    Jan 29, 2015
    Ratings:
    +412 / 0 / -0
    really look forward to a track and car "ID" value, also could we get the steering angle?
     
    • Agree Agree x 1
  13. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Not sure if it was mentioned before, but how possible is it to get the data for all cars on track? Too much data maybe?

    If this would be possible, this will enable me to do a live timing app! :)
     
  14. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    I'd also like a bit more data for other cars. I'd also like to know how far round the lap distance the player is - metres from the start line I guess
     
    • Agree Agree x 1
  15. Gil Ritter

    Gil Ritter Well-Known Member

    Joined:
    Feb 26, 2015
    Ratings:
    +91 / 0 / -0
    It would be nice to get at least all data from the own car like car (name), track, lap and sector times. We need it for our Portal Track Records. At the moment it is quiet hard to read all the needed data from the memory (without the api)
     
  16. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    I've been wondering where the next version of Crew Chief might be able to add, on top of the usual updates and stuff.

    One thing that'd be nice is if RaceRoom had a writeable shared memory block. This could contain pit stop actions selected by an external application. Say, an Int for each tyre (0=leave, 1=change_to_prime, 2=change_to_option, 3=swap_for_opposite tyre, etc). And a value for the fuel to add, a flag for 'repair' for any aero damage, flags for 'serve stop go' and 'serve drive through'.

    That kind of stuff.

    Then when you pit RaceRoom carries out the pit actions contained in that writeable shared memory (of they're set), without the play having to fiddle with buttons. Obviously with all the different rules and series options this will get complicated, but it should be manageable. Perhaps the existing read-only shared memory block could have the player's predefined pit options too so they could select a single pit option and the external app fills in the individual parameters in the writeable shared memory.

    For added awesomeness, the text name of each pit option (or, say, 100 characters of it) could also be in the read-only shared memory. I could then load this text into the speech recognition engine. So you say to Crew Chief "full tank and front tyres", or "Plan A", etc (the name you gave to whatever pit option you want the game to apply). Because that's in the shared memory I can load it into the speech recogniser when the game starts, so Crew Chief will be able to pick the right set of options (again, these are in the read-only shared memory) and write them to the writeable shared memory.

    Does that make sense? Is it a sensible request?
     
    • Like Like x 2
    • Creative Creative x 1
  17. Christian G

    Christian G Topological Agitator Beta tester

    Joined:
    Apr 8, 2015
    Ratings:
    +2,411 / 0 / -0
     
  18. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    If raceroom allowed aero or tyre pressure adjustments in the pits, crew chief could ask "how's the balance?", as you get near the pit window. If the player says "too loose" then crew chief might write something to shared memory to increase rear wing, or front tyre pressures at the pit stop. Lots of cool possibilities but lots of new work :)
     
    • Creative Creative x 4
  19. nipzon

    nipzon Well-Known Member

    Joined:
    Jan 30, 2015
    Ratings:
    +59 / 0 / -0
    You're the best man:)
     
    • Agree Agree x 1
  20. Culley

    Culley New Member

    Joined:
    Aug 16, 2015
    Ratings:
    +0 / 0 / -0
    Any chance of uploading some Python code to access the shared memory?