Save speed and position

Hi, I am new to this forum and I hope that I can get some help. I want to store driving information into a log file to use it in my studies. Speed, position on the track or in the lane would be perfect! My first idea would be to use a script and write the current information on a trigger event into a file, but I havnt found useable commands in the documentation so far. The idea is pretty simple, so I hope that there is an easy solution or a standard tool that I could use?!

Furthermore, does anybody know a good and easy track that includes the possibility of a vehicle follow assignment? So where a car drives in different speeds and the player could try to stay behind?

Thank you!
 
On the first part, deep in racer.ini you can enable logging that writes exactly that.

log
{
enable=1 ; 1 will turn it on
...
Then you can pick the groups you want and the file format. Position and velocity in particular sounds like what you want.

If I remember right, it saves the log to data/dump when you end the session, and by default always uses the same filename so overwrites.
 
Thank you very much for your fast reply! I found the file and I will try to access and arrange it the way I need the information! This is a very good start! Thank you!

To the second question, is there an existing track where you have a lead car?

The projected task is to tell the driver to keep a certain distance to this car.

A basic roundtrack is sufficient, with one specific car that somekind of leads. Maybe with changing speeds. So basically a ghost car, with the possibility to wait for the driver if the driver gets off the street for example. I will look into the ghostcar topic now to see if there is a fitting solution.
 
To the log file. It stores the file as .rtd. Is there the possibility to store the file as txt? How can I access or maybe export the data so that I can use them?
 
Last edited:
To change it from rtd, inside the log section, change type=2 to type=0. Once you do you get space separated info something like this:
Code:
time  sr0 sr1 sr2 sr3 ax ay az
50  0.000000 0.000000 0.000000 0.000000 0.032341 -8.991184 -0.000020
60  0.000000 0.000000 0.000000 0.000000 0.032259 -9.883239 -0.000007
70  0.000000 0.000000 0.000000 0.000000 0.032107 -9.912122 0.000044
80  0.000000 0.000000 -0.000051 0.000042 -0.035837 -8.733254 0.003788
90  0.000000 0.000000 -0.000225 0.000083 -0.046434 -7.141990 0.021855
100  0.000000 0.000000 -0.000417 0.000131 -0.004737 -6.107080 0.048189
(this is only the 4 slip ratios and acceleration xyz because I was checking the ABS performance). Sim time in ms + a row of data for each time step.

Racer has a few kinds of non-player cars.
The ghost car's just a recording of a specific lap, it'll drive identically each time. These get recorded automatically each time you drive a faster lap.
The AI car's based on a recording of a specific lap, but it's actually driving the car, so it varies slightly. It also sometimes avoids hitting the player. If a track doesn't come with a recording for a specific car, it'll drive at 50km/h in the middle of the track. You can record these with Shift+F6/F7 - the console says what to do, but generally you just push one, drive a lap, then push the other to store it.
The traffic's able to move between preset waypoints and can be controlled by scripts. Neither of which is present in any track to my knowledge.
 
Thank you for the fast support. I get the Velocity in 3D now. It seems like its in m/s. Is there a possibility to get it in KM/h directly?

My first attempt is to calculate it from this data. So take sqr(vx^2+vy^2+vz^2)=v (in m/s) and then multiply by 3.6. Or is there a more accurate possibility?!

I found the pacecar option and that might work for me! I guess thats what you meant with AI right?
 
Last edited:
This is probably again a very easy question:

I tried to load music.

The files are in the folder 'music' and I tried the following code in the music section of the racer.ini

race
{
song1=lied1.mp3
volume1=200
song2=lied2.mp3
volume2=200
}

What do I have to change, or are there any other places I have to activate the music?
 
Last edited:
Another question right away.
Can I somehow write more info about the AI_cars in the logfile? Or is that stored somewhere else (The position with the timestamp would be interesting)
Can I somehow relate the data from the AI files to the current position and time?!

Currently, I can only store the ai_line_delta, but I dont know how these relate to the driver. I would like to calculate the distance between driver and AI..
 
Last edited:

Latest News

Do you prefer licensed hardware?

  • Yes for me it is vital

  • Yes, but only if it's a manufacturer I like

  • Yes, but only if the price is right

  • No, a generic wheel is fine

  • No, I would be ok with a replica


Results are only viewable after voting.
Back
Top