0
$\begingroup$

I'm making a web game that requires a player to change gears at the proper RPM zone to win the race.

If the player misses the prime RPM zone he will be slowed down by a factor relative to the distance he was away from the prime RPM zone.

The 'prime' RPM zone is the exact time the player must shift the car in order to receive the highest speed output.

So basically here is the problem:

The car needs to accelerate on its own at an exponential rate. If the car reaches a set max speed in a certain gear than it will not go any faster until the gear is changed. The RPM zone is from $1-10$ Changing the gear at $8$ would be a perfect shift, hence maximum speed outcome.

Now here's where I get stuck:

If the player changes gear at prime RPM zone of $8$, I need the car to accelerate as normal. If the player misses $8$, I need it to take the difference from the prime RPM zone and use that to factor in a new speed for the car, being slower the further away he was from $8$ - keep in mind after the new speed is calculated the car still must accelerate at an exponential rate until it reaches the max speed for the gear.

Basically the cars acceleration needs to be realistic and manual - I can't figure out the mathematical formulas needed to achieve this goal effectively and realistically.

I cant really put it in to words too good, and I don't need exact answers just tips or advice to help me achieve this. I'm not asking for any code I know this is a mathematics only website.

Any help/advice is greatly appreciated! Thanks

$\endgroup$
1
$\begingroup$

Actually check some torque curves vs RPM and HP. What you need is to realise that Car Speed and RPM are tied, since there is a fixed ratio between your engine revolutions, the gear box ratio, and the traction wheel RPM. If you check those curves, the torque is acceleration, but is slightly lower at lower RPM. Also, you can add air resistance, which is DRAG. Those will be enough to have some real life sensation (engine revs fast at low gear, engine revs slow at high speeds and higher gears)

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you as well! Anyone else please add if you have something else to share. $\endgroup$ – novs12 Jan 13 '14 at 5:54
0
$\begingroup$

Your model is not representative of reality. A much more reasonable model is that engine torque, and therefore acceleration in a given gear, is constant up to some RPM, then decreases linearly to zero. When the player shifts, there is a short span of time with no acceleration, then the acceleration goes to the new value for the new gear ratio. So you might have 1g in first gear, then 0.7g in second gear, and so on reducing by the gear ratios.

Acceleration is rarely exponential-that would require it to rise as the speed increases.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Very well, that you for directing me down this path. These are exactly the answers I'm looking for. This clears things up a bit! If anyone else has anything else to add please do I could still use it! $\endgroup$ – novs12 Jan 13 '14 at 5:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.