I'm developing my first game containing player controlled cars, and therefore ofcourse I need proper car physics. I've got basic car accelleration and turning done, however, no skidding is currently done.
Basically, when a driver drives a car at n speed and applies the brakes 100%, the car will skid IF the friction between the tires and the road isn't enough to hold the car that is still going forward. If the friction is large enough, it would stop at once (like when driving at very slow speeds). When you turn a force is trying to press the car out of the road (when you turn left, the force is pressing the car against right; out of the road). If the friction between the tires and the road is enough to hold it back, the turn goes smoothly, if not, the car will skid against right, uncontrollable if not ABS brakes. That's what I know, so no need to teach me that again.
What I wonder about is ways to calculate this properly (please give me nothing but proper equations/values, otherwise i get a problem getting this done). Basically a way to calculate the breaking resistance (percentage of speed before calculation is the result? per second?) when skidding (time=v*friction, however, that's the time), and to calculate when the breaks are applied too hard, so the car starts skidding (force pushing car forward too much for friction between tires and road to handle). I take things like grass, asphalt, wet asphalt, sand, snow and ice does have different friction values against a normal tire too. Also at some angle, at some speed, the car will probably also stop skidding before it has stopped fully after the breaks are released, so some algorithm to find out about that would also be nice. I don't need more values than velocity and how hard the breaks are applied (percentage 0-100% maybe) I hope, or? Air resistance is done later, and will be applied globally.
That's one of two problems, the next problem is (sharp and fast) turning. I need a way to find if the force pushing trying to push the car out of the road is higher than the friction between the tires and the road, to trigger skidding (accelleration on unrelieable surface; ie ice, can trigger this too I know). The velocity, and the frontwheel angle would be nice values to calculate this from I guess.
Please don't come with waaaay toooo complicated answers, as I'm only 15, and haven't learned anything about this on school (none of my teachers knows this stuff either).
Help is appreciated :)
Added: It's a 3D game!
Start Free Trial