InternalsPlugin: UpdateTelemetry - rF1 vs rF2

Discussion in 'Plugins' started by B1K3R, Jun 26, 2013.

  1. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Hello

    I am exploring the internals plugin for rF1 so that I can read data as well and noticed that "mID" is missing in rF1 plugin. If this is missing, then how can I link the Telemetry to the Vehicle score object?

    I could not find a unique key in the Telemetry class to match the same key in Score/Vehicle Score. The closest is the vehicleName, but this is surely not unique.

    This has surely been solved as there are many rF1 plugins out there. I would appreciate your ideas.

    Thank you! ;)

    Cheers
     
  2. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Not at my computer right now so i cant verify but in scoring there is a variable called isPlayer or something like that. If isPlayer is true then that is the one you want to tie to the telemetry.
     
  3. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Hi Noel,

    Thanks for taking the time to answer :) isPlayer will not solve my problem I think. What I meant is that I am saving the Telemetry, Score and Vehicle Score to a database for all drivers.

    But I could not find a link between Telemetry and Vehicle Score. In rF2 I managed to link them by using mID, but this is not available in rF1.

    In rF2, I can have unique (to a certain extent) records by mID and DriverName which is in Vehicle Score.

    But in rF1 Telemetry, there is only VehicleName which is not enough to know to whom (driver) that object belongs to...

    Not sure if I explained better :)
     
  4. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    I think Noel's in the same position as me - I wasn't aware even in rF2 that telemetry was available for anything but the player's car (not that I ever tried, I'll admit) so I doubt he'll have tried to do what you're doing.
     
  5. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    No! So in rF1 the Telemetry is not available for all cars???
     
  6. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    I have no idea... :)

    I never tried, and to me at least it wasn't obvious from the comments. I always thought UpdateTelemetry() was given a reference to a single info struct, and I thought that was the case in rF2 as well... lol
     
  7. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    well, I'll I'm taking is the velocity only from telemetry, guess rF1 has to do without it then. I'll do some more experiments and see if I can link the telemetry to the vehicle score.

    Something else I noticed is that with rF2 I can throw a couple of AI and stay testing with them, but in rf1 updateTelemetry does does not work with AI. yeah, I tried setting it in the header to to true, 1 and 2 but nothing...
     
  8. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Even in rF2 the telemetry data is only available for the player. Just think how much bandwidth it would need to send all that data to every client on the server.

    Also, update telemetry work for AI in rF1 and 2 but most values are 0 while AI is driving. For debugging what I normally do is let the AI drive the car and wait for it to get on a straight and then turn it off. It will then start updating all telemetry data until it ends up in a wall.

    Velocity is in the scoring data (in rF1 and 2) for all drivers. You can get the speed in MPH like this:
    Code:
    sqrtf( (vinfo.mLocalVel.x * vinfo.mLocalVel.x) + (vinfo.mLocalVel.y * vinfo.mLocalVel.y) + (vinfo.mLocalVel.z * vinfo.mLocalVel.z)) * 2.23693629
     
    Last edited by a moderator: Jun 27, 2013
  9. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Yeah, true, I can get the velocity from the scoring data too. In that case, I won't even need the Telemetry object for my purpose.

    However, I'm still not sure regarding the telemetry data only available for the player. Then why in my plugin, if there are 20 players, I get 1 score record for the player, 20 vehicle score records and 20 Telemetry records?

    In rF2, the Vehicle Score records match the Telemetry records by mID (which is not available in rF1).

    As you can see, in my database, at any moment (a snapshot of the records during a session), I have 20 Telemetry records and 20 Vehicle Score. These are linked by mID in rF2.

    Maybe we are talking about different data/objects here? When I mentioned Telemetry, I am referring to the method UpdateTelemetry( const TelemInfoV2 &info ) and struct TelemInfoV2.

    Telemetry Records
    View attachment 8397

    [​IMG]

    Vehicle Score records
    View attachment 8398

    [​IMG]

    Thanks!
     
    Last edited by a moderator: Jun 27, 2013
  10. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,382
    Likes Received:
    6,600
    And that's why I'm not sure what's going on and just leaving it to people who might know better; I've previously seen screenshots of yours (I'm pretty sure!) showing telemetry data for all cars present, with the data itself indicating it was being updated properly. Whether that only works with AI or what, I don't know.
     
  11. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Hmmm, I'm pretty sure it's not just for AI but will have to double check that....
     
  12. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    What game did you get telemetry updates on all cars? rF1 or rF2?

    I will have to take a look at the rF2 plugin again. From what I remember it was no different than rF1. I could see it providing minimal data for AI in an offline race but there is no way it is going to send all that data 90 times per second for every car to every client on the server.

    I will take a look today and report back.
     
  13. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    The data shown above is for rF2 Noel. I did not test this in rF1. To be honest, I did not check the update frequency but the telemetry data coming from the plugin seemed in synch with the score.

    Like I said, I only used the velocity (which rightly enough I could also get from the score) so I am not 100% sure how accurate the data in the telemetry was.
     
  14. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    Unless something changed in rF2, Scoring is 2 updates/sec and Telemetry is 90 updates/sec.
     
  15. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Hehe, 90 updates per sec would be a killer like you said :) Though I did not see any performance issues.

    I at times race with my plugin on (as I forget it) and FPS is the same. This would I think only generate my telemetry, but when dedicated server is on, it generates for all drivers.
     
  16. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    It isn't a performance problem, it is a bandwidth problem and somewhat of a security problem (you don't want all your telemetry data available to the public). In rF1, UpdateTelemetry isn't even called on a dedicated server. I seriously doubt this has changed on rF2.
     
  17. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    Very true. I'll check the data on some live server to see what's going on.

    Thanks.
     
  18. 64r

    64r Registered

    Joined:
    Jan 16, 2012
    Messages:
    191
    Likes Received:
    35
    Hi,

    Sorry I missed the start of this. The following points may help, let me know if you need more details.

    UpdateScoring is called at 2hz for both rF1 and rF2.
    UpdateTelemetry is called at 90hz for rF1 and 100hz for rF2, but only when the vehicle is under the control of the player. When the vehicle is under the control of AI the rates are 40hz (rF1) and 50hz (rF2).

    If the plugin is taking to long to perform the calculation (or write to a file etc for each method) the method will slow down the FPS. This is because the internal plugin is called in the same thread as the graphics update.
     
  19. B1K3R

    B1K3R Registered

    Joined:
    Apr 6, 2012
    Messages:
    1,605
    Likes Received:
    88
    No worries 64r and thanks for the info. I am now getting the velocity from vehicle score and finally managed to make the rF1 plugin work too (had to assign an ID to each record myself though).

    Have only tested the Reiza Truck and GSC2012 (which are based on rF1) and they are working fine till now.

    Cheers
     
  20. Darrter

    Darrter Registered

    Joined:
    Jun 26, 2013
    Messages:
    15
    Likes Received:
    0
    I saw this in the rf
    Code:
    virtual long WantsTelemetryUpdates() { return( 0 ); }        // whether we want telemetry updates (0=no 1=player-only 2=all vehicles)
    I did not test it yet but it looks like you can get Telemetry Data from all vehicles.
     

Share This Page