The online racing simulator
#1 - Dac
Need following distance for Psychology experiment
Im developing a Psychology experiment for my 3rd year project and ive decided to study certain effects on following distances.

Id just like to know how easy is it to get a following distance in time and distance without relying on split times. Id also like the split times not to be included on the screen.

Thanks,
i don't know about time-based, but the aleajecta insim had this portion that detected if you were riding up on someone's bumper... i'm sure with a couple tweaks, you could use the car's speeds to detect how many seconds are inbetween the cars.

hope this helps somewhat.
#3 - Silox
This should work for the time:

Pseudocode:

if node = x
ArrayTimesOnNodeX redim preserve
ArrayTimesOnNodeX.Ubound = time
end if

TimeInBetween = ArrayTimesOnNode(ubound) - ArrayTimeOnNode(ubound - 1)
PrivMsg("The person in front is at TimeInBetween seconds")

Just basic code, it still needs editing, bugfixes, more checks, ... But I think it should work?

The distance is something different, it has to do with the x, y and z coordinates. There are a few threads around here, just search for them.
Pretty sure he meant distance in time, not laptimes.
First you need the distance between the two cars, then you calculate how long it would take for the following car to reach the point the leading car is at, assuming the following car maintains it's current velocity.

DistanceTime = Distance / Speed.
For example, a car driving 100 metres behind another car will need 3.6 seconds to reach the leading car's position at 100kph. The distance expressed as time would be 3.6 seconds

I did a really quick one, tested it with an AI and it works okay


If, however, you meant the time it would take to catch up, the approach is a different one. For that you have to factor in the velocity of both vehicles.
Perhaps you chould clarify what exactly you need? Including how you expect it to be displayed, if at all (maybe you want it logged to a textfile).
Attached images
distance_time.jpg
Quote from morpha :First you need the distance between the two cars, then you calculate how long it would take for the following car to reach the point the leading car is at, assuming the following car maintains it's current velocity.

DistanceTime = Distance / Speed.
For example, a car driving 100 metres behind another car will need 3.6 seconds to reach the leading car's position at 100kph. The distance expresses as time would be 3.6 seconds.

I think that right there, sir, is the nail!

Quote from morpha :If, however, you meant the time it would take to catch up, the approach is a different one. For that you have to factor in the velocity of both vehicles.
Perhaps you chould clarify what exactly you need? Including how you expect it to be displayed, if at all (maybe you want it logged to a textfile).

If your going for that approach don't forget that if both cars are travailing at the same speed the time is infinite, if one car is stopped, while the other is not, the time is also infinite. Visually, I would display this as 00:01.24 as being 1.24 Seconds until you catch up to the next car, as in your never going to catch up to that car (infinite), and 00:01.63 as in your losing 1.63 to the car in front of you if you keep this pace up.
#6 - Dac
Quote from morpha :Pretty sure he meant distance in time, not laptimes.
First you need the distance between the two cars, then you calculate how long it would take for the following car to reach the point the leading car is at, assuming the following car maintains it's current velocity.

DistanceTime = Distance / Speed.
For example, a car driving 100 metres behind another car will need 3.6 seconds to reach the leading car's position at 100kph. The distance expressed as time would be 3.6 seconds

I did a really quick one, tested it with an AI and it works okay


If, however, you meant the time it would take to catch up, the approach is a different one. For that you have to factor in the velocity of both vehicles.
Perhaps you chould clarify what exactly you need? Including how you expect it to be displayed, if at all (maybe you want it logged to a textfile).

Thats exactly right Morpha, thanks a bunch!

In essense the driver will follow a lead car to get a standard measurement, then factor A will be included and the following distance (in time) will be recorded again, then factor B etc etc.

Thanks again.
#7 - Dac
Ive been looking into the research and it seems simply taking data points a couple of times per lap wont be accurate enough, rather the standard seems to take continuous recordings and plot them against a time/distance graph to get an overall picture of following distance. This is because drivers dont follow at a set speed but rather close up and fall back in a circular motion.

So im guessing it will be possible in LFS to produce such a graph?
Quote from Dygear :If your going for that approach don't forget that if both cars are travailing at the same speed the time is infinite, if one car is stopped, while the other is not, the time is also infinite.

What you probably wanted to say: if the car behind is stopped the time is infinite.

OR: If the Difference between the speed of the front car :heyjoe67_brm: and the speed of the car behind :heyjoe67_ferrari: is equal or greater than zero, the time cannot be calculated.


:heyjoe67_ferrari: :heyjoe67_brm:



e:

"So im guessing it will be possible in LFS to produce such a graph?"

Not in LFS, but with a custom program which uses the insim interface.
(speedCarInFront - speedCarBehind) / distance = time

That will get rid of the infinite problem. If both cars a stationary then you will once again get infinite, but ... that's to be expected. Also if speed matches then you'll be dividing with zero, not good, so be sure to test that before you do the equation.
#10 - Dac
Quote from Dygear :(speedCarInFront - speedCarBehind) / distance = time

That will get rid of the infinite problem. If both cars a stationary then you will once again get infinite, but ... that's to be expected. Also if speed matches then you'll be dividing with zero, not good, so be sure to test that before you do the equation.

I have some programming experience in Java do you think it would be doable on my own or worth asking on here?

Even if the data is just output to a .txt file every .5 sec i will be able to make that into a graph.

I have already made a set for the XF with 50% intake reduction and increased 5th gear ratio so that it maintiains 70-75mph on the oval, which gives a good pace car for the participant to follow in say a de-restricted XF or even the XR.
Yeah, I think you can do it. If there is only 2 cars on the track. Good luck.

How are you going to track these cars? I mean in a race there could be 24 cars, so each car has to correlate to 23 other cars. That's alot of data, even @ .5 second intervals.
#12 - Dac
Quote from Dygear :Yeah, I think you can do it. If there is only 2 cars on the track. Good luck.

How are you going to track these cars? I mean in a race there could be 24 cars, so each car has to correlate to 23 other cars. That's alot of data, even @ .5 second intervals.

Correct there will only be 2 cars, the AI 'pace' car and the participants car. They will follow the pace car around the oval for maybe 20 laps in which time i will designate a certain number of laps to a different factor, currently fast/slow paced or loud/quiet music and measure the effects these have on following distance.

I have already found a study which used Midtown madness in 2002 to measure the effects of music tempo on driving performance, and also another study which used a 5 lap driving simulator race to measure vigilance tasks with a music element.

I think LFS will be a much better tool for the job due to its increased realism.
Interesting, can't wait to see the results!

(What with me being a small fan of Midtown )

FGED GREDG RDFGDR GSFDG