• This Website Is Not For Sale
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to get live data from Race07?

Discussion in 'RACE 07 - Official WTCC Game' started by Lars Bargmann, Jan 22, 2013.

  1. Hi all.

    I've been googling for several days now, but come up with practically nothing. [​IMG]

    I am currently working on a piece of software for Leo Bodnar's Sli-devices (to replace the "official" one) and trying to get support for Race07-series.
    I am able to get live telemetry data (like Rpm, speed, and all that) but I cannot for the life of me, figure out how to get trackname, carname or other "session" related info.
    The only "solution" I've come up with, is to monitor <Documents>\SimBin\ for filechanges, and then assume that the first changed plr-file is the current players plr-file (to get the trackname) and watching for changes to tempgarage.svm for getting the carname. I am doing this AFTER I confirm that Race07 is doing it's memory mapped file for the telemetry, so I'm thinking this approach is pretty bulletproof, but it just doesn't seem to be the "right" way of doing things... [​IMG]

    Does anyone know if/how this info can be retrieved in a better way???
    Pretty, pretty please?

  2. Hej Lars,

    Jeg kan se at du er dansker som jeg og skriver derfor på dansk.
    Har du fundet en løsning på dit problem ?

    Jeg så dit indslag og det ser ud til at vi er "ikke helt" i samme båd. Jeg har udviklet en del special software til forskellige formål. Jeg arbejder på et stykke software til styrring af en Märklin modeljernbane hvor alt styres digitalt, i øjeblikket er min interesse dog koncentreret omkring Sim racing. Jeg har aldrig arbejdet med memory mapped filer før og står over for en udfordring som er svær at finde en løsning på. Jeg kan se at du har fundet løsningen på at hente live data fra Race 07. Er du villig til at dele dine erfaringer ? Jeg har søgt efter en plugin som kunne leverer de data fra Race 07 men det synes som en umulig opgave. Jeg håber at jeg måske kan hjælpe dig med dine udfordringer og vil så snart jeg har noget brugbart poste dem i dette forum.
  3. Selvfølgelig da.
    Lad os tage den på mail istedet...
    Hvilket programmeringssprog bruger du?
  4. Marco Bijl

    Marco Bijl
    adMAXIhater (O.O.O.)


    Please keep it in English, so others can read and understand it as well. Remember that problems and questions occur everywhere, and if we keep the answer in an understandable language for all visitors of RD, we can help more people.

    Now, I know I cant make you, so I try to encourage you to post your communication here, instead of via email ;). Same reason, so others can learn from it as well.

    Thanks in advance,

  5. Of course, Marco!

    Henrik was stating that he is working on a project, where he needs Race 07 data, and that he has seen that I have got it working, so asked for pointers.
    I replied, that I would help and directed him to my mail, because of the language thing.
    • Like Like x 1
  6. Marco Bijl

    Marco Bijl
    adMAXIhater (O.O.O.)

    I figured something like that. Danish is, in reading terms, somewhat simular to Dutch, so I can understand it a bit.
    It was a headsup from me, as we value all the information about the different platforms posted on our forums, and it makes a great knowledgebase when all is understandable :).

    Thanks for understanding.
  7. Hi Marco,
    Of course. I understand. I will keep it up in English in the future.
    • Like Like x 1
  8. I've been wondering about something that seems pretty related to this thread.
    I'd like to see data about my braking, speed, acceleration, and race-line on each track. Is this possible with Race 07 or external software?
    I've got XD of course, and also found Real Time Telemetry .. but neither of those do that AFAIK.
  9. You can enable Motec telemetry in Race07 somehow...
    ...but thats about all I know, so that wasn't much help... :)
  10. Race07 is based on the Gmotor 2 engine so I suppose the plugins follow the same structure. You can have a look here under "rFactor internals plugin":
  11. Knut, no, sadly it doesn't... :-(
    rFActor plugins don't do anything for Race07, as far as I know...
  12. Ok thats too bad. But if you look at the source codes they provide you can find parameter names such as vehicle name and track name. Could be worth a shot to try similar coding for R07.
  13. Nope, that doesn't work.
    I have figured out a very dirty way of getting track- and carname, though, as described in the first post.
    The available data in Race07's Memory Mapped File is this :

    float userInput[ 6 ]; // This structure allows for a number of parameters to be
    // passed from the user to the exteral application via control input
    // in the game. The ISIInputType enum describes which element of this
    // array corresponds to which in-game control. Note that this data
    // is floating point, and can be configured in the game to be driven
    // by an analog input device (joystick). The user may also map the
    // control to a keyboard key, or a digital controller button. This
    // means that the value may be anywhere between 0.0 and 1.0. Also note
    // that these values will not be debounced; if the user
    // maps the "External Signal Up" control to a key on the keyboard,
    // the coresponding value in this array will remain 1.0 for as long
    // as the user holds the key down.
    float rpm; // Engine speed, Radians Per Second.
    float maxEngineRPS; // For use with an "analog" rpm display.
    float fuelPressure; // KPa
    float fuel; // Current liters of fuel in the tank(s).
    float fuelCapacityLiters; // Maximum capacity of fuel tank(s).
    float engineWaterTemp; //
    float engineOilTemp; //
    float engineOilPressure; //
    float carSpeed; // meters per second
    long numberOfLaps; // # of laps in race, or -1 if player is not in
    // race mode (player is in practice or test mode).
    long completedLaps; // How many laps the player has completed. If this
    // value is 6, the player is on his 7th lap. -1 = n/a
    float lapTimeBest; // Seconds. -1.0 = none
    float lapTimePrevious; // Seconds. -1.0 = none
    float lapTimeCurrent; // Seconds. -1.0 = none
    long position; // Current position. 1 = first place.
    long numCars; // Number of cars (including the player) in the race.
    long gear; // -2 = no data available, -1 = reverse, 0 = neutral,
    // 1 = first gear... (valid range -1 to 7).
    //float tireTemp[ TIRE_LOC_MAX ][ TREAD_LOC_MAX ]; // Temperature of three points
    float tirefrontleft[3]; //tire values from [0]=left to [2]=right
    float tirefrontright[3]; //tire values from [0]=left to [2]=right
    float tirerearleft[3]; //tire values from [0]=left to [2]=right
    float tirerearright[3]; //tire values from [0]=left to [2]=right
    // across the tread of each tire.
    long numPenalties; // Number of penalties pending for the player.
    float carCGLoc[3]; // Physical location of car's Center of Gravity in world space, X,Y,Z... Y=up.
    //float carOri[ ORI_MAXIMUM ]; // Pitch, Yaw, Roll. Electronic compass, perhaps?
    float pitch;
    float yaw;
    float roll;
    //float localAcceleration[3]; // Acceleration in three axes (X, Y, Z) of car body (divide by
    // 9.81 to get G-force). From car center, +X=left, +Y=up, +Z=back.
    float lateral; //Force left-right
    float vertical; //force up-down
    float longitudinal; //force faster, slower
    • Like Like x 2
  14. http://www.motec.com/i2/i2overview/

    I never managed to get live data with this but gives you a very extensive readout. Pretty cool to help analyze youre laps etc.
  15. thanks .. that looks like professional software tho. i can't tell if there's a free version. is there? i'm not so into sim-racing that i'd pay for such a thing.
  16. the motec software is free for sim use, you have to pay for the real world version.... there is a big thread on it over at nogrip with all the info on how to get it working... it will display data for throttle and brake postion etc but only retrospectively, there is no real time display for it.

    Lars, have you tried looking in the log files created in the userdata folder (assuming you have logging turned on in your plr file) I'm not sure if this file is updated in real time or if it is updated when entering the garage. It certainly contains all the data you could need but it depends if that data is available when you need it....if that makes sense...
  17. I am using VB6. I have send you an email, but am sure if you got it.
  18. Oh, ok, I haven't got an email... or maybe gmail is acting up... :)

    Anyways, I know practically nothing about pointer-gymnastics in VB, let alone Mem-mapped-files...
    I am certain there are tons of examples out there, that you would understand better than me... :)
    I posted the structure above, that describes what is in the shared memory that Race07 makes.

    The name of the mem-map-file is "$race$" (without the quotes) as far as I rememer (the same structure is used for gtr2 if you're interested; for Gtr2 the name is "$gtr2$" as far as I remember)

    Let me know if you still need some help...
  19. Thank you very much Lars.
    I send the mail to the email address you posted. Hmm... computers have their own life :)
    The name of the MMF is just what I need. Thank's a lot.
  20. Yeah, that's how I ended up getting the data.
    When I discover that the Race07 mem-mapped-file is available, I start monitoring the <docs>\simbin-folder for changes to plr-files, and when I detect one, I get the data from there...
    Extremely dirty solution, but it seems to be the only way... :-(