View Full Version : Computing Values for Easy Comparison of Vehicles

4th Mar 2006, 10:58 PM
Hey guys,

For the mod I am making, it would be nice for people to be able to compare the game's vehicles by simple statistics you'd find in any racing game. I have chosen Top Speed, Acceleration and Steering as a good place to start.

Steering is eay enough to compare - steerSpeed is as good an indicator as any of a car's handling. However the other two present problems and I really need someone who understands wheeled vehicles to give me an answer on them.

The values generated dont really have to mean anything, so long as they give a good indication of one car's performance relative to another. I don't want to use plain variables to hold the values, because they may not be accurate and could be used to represent a vehicle falsely.

As a variable for top speed, I had thought of taking the vehicle's max engine RPM and factoring in transRatio and the largest gearRatio, but that's just an early guess and doesnt really sound right. Acceleration I have no idea about.

Any help appreciated

5th Mar 2006, 06:29 AM
Well why dont you just use the KMaxSpeed value, that is the actualy maxspeed :)

As for acceleration that shouldnt be too hard, when you want to go forwards in the code, you pass your own values of Force into KApplyForce, just take the forces you used in UpdateVehicle and divide them by the mass of the vehicle. (you may have to do conversions so that mass is in KG and UnrealUnits is in metres) That should give you the acceleration.

5th Mar 2006, 01:07 PM
KMaxSpeed is somewhat irrelevant to wheeled vehicles.

6th Mar 2006, 05:40 AM
that's true. KMaxSpeed is just something to make sure the object never exceeds that speed. With air vehicles and stuff, it's pretty useful. But with ground vehicles, most often they don't nearly accelerate up to those sorts of speeds.

Also I cant really use your other idea (although it was a very good one) because I need to do this all from static methods and variables.

I think what I may do is create a blank, flat map and see how long it takes my car to go from 0-60, and also at what point its speed taps out.

[SAS]Solid Snake
6th Mar 2006, 01:59 PM
Or you could possibly do this? VSize(Velocity)?

6th Mar 2006, 10:40 PM
nup! I'm still limited by needing this to be a static variable. So I can't make an instance of the vehicle and drive it around in order to test unofrtunately.

What I have done is put a debug flag on my main vehicle class that the maker of the vehicle can set. They then spawn that vehicle into my test map - flat featureless one - and drive it in a straight line. The code outputs the time it took them to get from 0-xUU/sec, and also the max speed reached before the car starts to decelerate. The modder can then set those two values to class variables. It's not particularly elegant, but it works well for my purposes.

6th Mar 2006, 11:33 PM
Ok so I could make some suggestions but I had a look and found these, probably more useful than anything I can suggest ;)