Shared Memory API

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

  1. Racki

    Racki Well-Known Member Beta tester

    Joined:
    Aug 17, 2015
    Ratings:
    +131 / 0 / -0
    I just tried a quick and dirty windows app for telemetry data today. Just to see whats possible. What are you guys working on?

    If I had 3 wishes for upcoming features:
    - tire grip values to see locking on breaks or slipping
    - suspension height for spring, damper and ride height optimization
    - activated driving aids

    Best regards from Austria
     
    • Like Like x 1
  2. Stevo

    Stevo New Member

    Joined:
    Aug 30, 2015
    Ratings:
    +2 / 0 / -0
    Hi,

    I'm the creator of LiveRacers

    Is there any way to read data from all cars on the track? Can it be added?
    This is to display live timing.

    Thank you,
    Stevo
     
    • Like Like x 2
  3. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    Don't think live data for all cars is available yet. The server api has it for the broadcast stuff, but you'd need to log into the server as another client in 'broadcast mode'. This client could then use JavaScript to record the timing data.

    Pixeljetstream wrote a lua app that can be run on the server which interprets the game's results files after the race is finished.

    Afaik there are no other approaches at the moment. I'm hoping that the server live timing data (or some subset of it) gets added to the shared memory block on each client
     
  4. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Live data is there only for the driver on the client pc unfortunately. I asked before for this data to be added for live timing but I guess they are busy with other stuff.

    This could be interesting and I think it's what Stevo is looking for as in rFactor 2 that's what we do, we get data off the server.

    Have not played with it yet, but I think I should add it to my live timing too. Where do I get more info on the Mr. Belowski? :)
     
  5. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    There's a broadcast API sample app in Github here https://github.com/sector3studios/r3e-spectator-overlay but I've never looked into it in any depth. I suppose you could run an instance of the game with the server's IP and the address of the broadcast overlay webpage, and whatever else it might need in the game start arguments (via the Steam interface). Then it'll use whatever web page you give it to overlay the broadcast data, but instead of overlaying that data your web page makes local Javascript calls to write the data out to the file system.

    I've never attempted this and don't know if it'd work, I'm just kinda guessing to be honest :)
     
  6. Sascha Brandenburg

    Sascha Brandenburg Well-Known Member

    Joined:
    Feb 17, 2015
    Ratings:
    +56 / 0 / -0
    I talked with Stefan 2 hours ago about that way. But u cannot use the boradcast command cause u were unable to drive with this command so we need a command that do the same but without getting into the viewer mode :D
     
  7. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    So, one cannot start a server with TV Overlay and people still join? Cause if people can still join from the client, then its ok...
     
  8. Sascha Brandenburg

    Sascha Brandenburg Well-Known Member

    Joined:
    Feb 17, 2015
    Ratings:
    +56 / 0 / -0
    Maybe i was with my thoughts a little bit in the wrong sentence :D So for the live data u can use the web overlay from mape. but u need a server with running R3E as a Stream Server for example thats my knowledge i have.
     
  9. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    I'll do some experiments but I need access to some server. Will ask around :p
     
  10. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    I think you need a regular r3e multiplayer server with 1 or more free slots, and a client dedicated to capturing live data. Your regular racing clients connect as normal, and your live data capture client has to connect before the server's full.

    The live data client needs to be a separate r3e user, and can't share an external ip with a racing client
     
    • Informative Informative x 1
  11. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Not very user friendly and practical like that. Hopefully Sector 3 comes up with a nice solution (like a server plugin or API) for live timing and telemetry :)
     
    • Like Like x 1
  12. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    I'm hoping they put all the server data into the racing clients' shared memory object
     
    • Agree Agree x 2
    • Disagree Disagree x 1
  13. rbn

    rbn Well-Known Member

    Joined:
    May 31, 2015
    Ratings:
    +69 / 0 / -0
    I am creating an app to send data to an Arduino with segment display with leds.
    From what I can see in the API it doesn't send pit limiter info.
    I want to blink the rev leds when the limiter is engaged.

    Am I missing something?, could this be added? or is there a workaround?
     
  14. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    The data isn't in there I'm afraid. I have to make a guess. If the ControlType is AI and the SessionPhase is Green and the Player.GameSimulationTime is > 60 seconds then I assume that the player is in the pitlane. Obviously this only works for the race, and doesn't take account of whether the player's pressed his pit limiter button.

    Could you listen for the button on the controller too?
     
  15. rbn

    rbn Well-Known Member

    Joined:
    May 31, 2015
    Ratings:
    +69 / 0 / -0
    I looked at pCars API and there is a pit limiter value 1 or 0.
    That will make life a lot easier, if I have to guess it will not work 100%.

    Since I also want to make the app compatible with pCars (and maybe others) listening to controller buttons is only for R3E and not really an option.

    I guess I just have to wait for S3 to add it.
     
  16. mr_belowski

    mr_belowski Well-Known Member Beta tester

    Joined:
    Apr 23, 2015
    Ratings:
    +1,307 / 0 / -0
    I'm sure it'll come eventually :)
     
  17. Robert Holm

    Robert Holm KW Studios Developer

    Joined:
    Jan 15, 2015
    Ratings:
    +162 / 0 / -0
    Hi there :) Gonna give shared mem a little more love.
    About data from all cars, what's needed?
     
    • Like Like x 2
    • Winner Winner x 1
  18. Stefan Mizzi

    Stefan Mizzi Well-Known Member

    Joined:
    Feb 6, 2015
    Ratings:
    +625 / 0 / -0
    Thanks Robert!! It would be great if we can add data from all cars :)

    For my live timing, I use the following data.

    Postion
    Driver Name
    Vehicle Name
    Vehicle Number
    Team Name
    Vehicle Class
    Last Lap Time
    Best Lap Time
    Time Behind Leader
    Time Behind Previous Driver
    LastSector1
    LastSector2
    LastSector3
    Velocity
    Total Laps
    Number of Pitstops
    Is In Pits
    Car Status

    //to draw track map and simulate cars
    World Position X
    World Position Y
    World Position Z

    Thanks again!

    Cheers
    Stefan
     
    • Like Like x 1
  19. Gil Ritter

    Gil Ritter Well-Known Member

    Joined:
    Feb 26, 2015
    Ratings:
    +91 / 0 / -0
    Robert, maybe you also have some love left to improve the server logs. ;)
     
    • Like Like x 1
  20. tobias.schlottbohm

    tobias.schlottbohm Member

    Joined:
    Jun 24, 2015
    Ratings:
    +17 / 0 / -0
    @Shared Memory:
    I really also need some information about the current track/-layout (their IDs respectively).