Shared Memory API

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

  1. Robert Holm

    Robert Holm KW Studios Developer

    Joined:
    Jan 15, 2015
    Ratings:
    +162 / 0 / -0
    Next code update I'd assume
     
  2. Robert Holm

    Robert Holm KW Studios Developer

    Joined:
    Jan 15, 2015
    Ratings:
    +162 / 0 / -0
    Work has been done to it already, not sure about the details
     
    • Love it! Love it! x 1
  3. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Robert,

    I am not sure if it was mentioned before or if its even a bug....but FuelLeft never changes for me...

    // Current amount of fuel in the tank(s)
    // Unit: Liters (l)
    public Single FuelLeft;

    Thanks!
    Stefan
     
  4. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    It only works in online races which have fuel enabled. I don't think there's any fuel use in single player.

    I've definitely seen it working.

    Robert, will the api stuff in github for c++ and c# be updated when the patch goes live? And will the update to the shared memory actually be in this weeks patch?
     
    • Informative Informative x 1
  5. Robert Holm

    Robert Holm KW Studios Developer

    Joined:
    Jan 15, 2015
    Ratings:
    +162 / 0 / -0
    Stefan, fueluse is something not fully implemented yet, but think it can be used in online races.

    Mr_Belowski, I believe it'll be incl in patch. Structs on github will be updated with new data, not sure when to get time to update examples though.
     
    • Like Like x 1
  6. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Don't worry about the examples, its just the structures we need :)
     
    • Agree Agree x 2
    • Like Like x 1
  7. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Any chance of getting the struct layout this evening? I'm chompin' at the bit here ;)
     
    • Like Like x 1
  8. Robert Holm

    Robert Holm KW Studios Developer

    Joined:
    Jan 15, 2015
    Ratings:
    +162 / 0 / -0
    Think Mikael has updated github, at least with the C version.
     
  9. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    You'll find the change here.

    The C# version will take a bit longer, since we're having trouble getting C# to play nicely with fixed-size buffers of structs. They only seem to allow fixed-size buffers of primitive types right now. If anyone more versed in C# has any idea how to get around this I'd love to know. Right now the plan is to drop down to C++ by bundling a C++/CLI library that populates the struct and then passes it back to C# somehow, but I'm not super psyched about having to resort to that.
     
  10. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    awesomeness, there's some lovely stuff in there :)

    That's going to keep me busy for a little while
     
    • Like Like x 1
  11. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    [edit]

    sent you a Conversation message Mikael. If I use the code from your example to read the Project Cars shared memory (which contains very similar stuff to the stuff you've now got in the Raceroom block), it fails with some cryptic error message about non-native types.

    I've sent you a link to the code the I use to read the PCars block. Which I borrowed / stole / hacked / adapted / failed to fully understand. But it works :)
     
    Last edited: Oct 20, 2015
  12. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    So it seems I was a bit trigger happy with the GitHub repo and some changes made it in that hadn't been integrated into our release branch yet, namely the push_to_pass entry. I just removed it, so feel free to sync again and hopefully the driver data should start making a bit more sense.
     
  13. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    I should probably mention that r3e_u8char represents a UTF-8 code unit, and driver names are therefore UTF-8 encoded, not ASCII.
     
  14. Zappadoc

    Zappadoc New Member

    Joined:
    Jun 29, 2015
    Ratings:
    +3 / 0 / -0
    Thanks Mikael and Robert for this great new entries in API!

    To all SLIMax Manager users, the plugins for R3E are out now and you can get the update by using "Check For Update" as usual, see the EKSIMRacing plugins page for more info.
    Cheers,
    z
     
  15. mr_doedel

    mr_doedel Member

    Joined:
    Sep 17, 2015
    Ratings:
    +9 / 0 / -0
    Is it possible to have fields in the API for a collision with another car ?
    A reference to the other car, the direction (front,back,left,right) and who is fault would fine :rolleyes:

    I am thinking about building something like ranking app for RRE. Points for clean laps, minus points for tracks cut
    and collisions. Off course points for fastest lap and race position. Also points for just finishing the race.
    I hate that a lot of people don't finish the race.
     
  16. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Hi Mikael,

    I have managed to write the struct in C# and map it successfully. Though I'll test that all the class properties are mapped with the correct values and if all good I'll upload the code.

    Cheers
    Stefan
     
  17. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Also wanted to ask you, how do we get the values to map to these Ids?

    Thanks!


    DriverInfo.PNG
     
  18. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    That would be much appreciated, Stefan. Apologies for the delay. I'm caught up in a bunch of other stuff these days. The ID lookup is available in the r3e-spectator-overlay repository, which I also failed to mention.
     
    • Like Like x 2
    Last edited: Oct 29, 2015
  19. Robert Holm

    Robert Holm KW Studios Developer

    Joined:
    Jan 15, 2015
    Ratings:
    +162 / 0 / -0
    ID lookup slipped my mind as well..
     
  20. Mikael Hermansson

    Mikael Hermansson Well-Known Member

    Joined:
    May 3, 2015
    Ratings:
    +48 / 0 / -0
    Updated my previous post with proper link to the JSON lookup data.
     
    • Like Like x 3