I'm wondering how to do this. I want different racers with different max speeds, but I want gameplay to be balanced. The racers are currently hinged on acceleration, speed, and max speed. As the title says how do I go about making the racers comparable to each other?
The way I've handled this is to curve the amount of acceleration added by the speed of the racer, something like this:
`y = (x - 1)^2`
the racer's speed divided by his max speed is `x`, a number between 0 and 1 (inclusive.) which once put through that equation gives you how much of it's acceleration the racer gets to use. So the closer he gets to his max speed the less he gets to accelerate.
here's how you'd get that in javascript:
var x : float = currentSpeed / maxSpeed;
var y : float;
if (x < 0) {
y = 1;
} else if (x > 1) {
y = 0;
} else {
y = Mathf.Pow(x - 1, 2);
}
currentSpeed += acceleration * y;
BUT you'll still need to balance each racer's speed and acceleration to make it fair(ish) A racer with a higher top speed might have a lower acceleration so it takes him longer to get to his top speed.