Collision logging

Discussion in 'Plugins' started by hardtohandle, Aug 31, 2013.

  1. hardtohandle

    hardtohandle Registered

    Joined:
    Jul 15, 2013
    Messages:
    364
    Likes Received:
    54
    Hi, I am interesting in trying to create a rf2 plugin or external tool even which could be used to detect where any collisions occur in a race. If this is possible, I can then take things a stage further and create an interface for reviewing race collisions.

    So if theres 4 collisions in a race, I would like to pickup the point on track where it happened, and the time, so I could then (theortically) control the replayer programatically to shoot straight to the place and time where the collision occurred so the user can review the incident.

    I am in the very early stages of thinking about this. With my limited knowledge I have gotten the following 2 possible solutions.

    1) Read the VCR files, try and detect collisions from this, and log collision points/times to a file for later use.
    2) If the above is technically impossible, then i guess I will need a plugin to run whilst the race is actually running on server, and try and detect collisions whilst race is in progress and log it that way.

    I am not experienced in writing plugins, but I know what I'm doing with C++ and I am happy to have a crack at it.

    Can you guys who know a bit more than me advise me on the viability of doing this? Perhaps such a thing is not possible, but if there is a way I would be very interested to hear your views.

    Many thanks,
    hardtohandle
     
  2. 88mphTim

    88mphTim Staff Member

    Joined:
    Sep 23, 2010
    Messages:
    10,725
    Likes Received:
    125
    Ill ask if its possible for this to be in the plugins.


    Sent from a mobile device using Tapatalk
     
  3. hardtohandle

    hardtohandle Registered

    Joined:
    Jul 15, 2013
    Messages:
    364
    Likes Received:
    54
    Thanks Tim
     
  4. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,641
    Likes Received:
    3,223
    The results xml files in rF1 had an <Incident> tag that got most stuff that happened in a race (car hitting object, or 2 cars hitting each other complete with some indication of the severity). Not in rF2. Why? Who knows...

    Getting that back, and having more info as you suggest, would be great.
     
  5. hardtohandle

    hardtohandle Registered

    Joined:
    Jul 15, 2013
    Messages:
    364
    Likes Received:
    54
    Since I posted the above I have gotten up and running compileing plugins with visual c++ and have got the example 'InternalPlugins' working - and straight away this contains collision info in the UpdateTelemetry function.

    ExampleInternalsPlugin::UpdateTelemetry has an 'info' parameter of type TelemInfoV01, and from that I can get all of the following valuable infrmation....

    info.mLastImpactET,
    info.mLastImpactMagnitude,
    info.mLastImpactPos.x,
    info.mLastImpactPos.y,
    info.mLastImpactPos.z
    info.mDentSeverity[0-7] for damage on defferent areas of car

    And I am logging these out to a csv file.

    Problem now is though all the above variables log out zero all the time no matter how much I drive the car into a wall. I have damage multiplier 100%.

    Either I am doing something wrong or these variables are not presently being populated with any values in rf2.

    Be glad of advice,
    hardtohandle
     
    Last edited by a moderator: Sep 2, 2013

Share This Page