The question is answered, right answer was accepted
What is the best way to calculate the performance stats of a car in a racing game?
Prior to buying an upgrade, I would like to let the player see how the performance stats of the car, such as 0-60 mph acceleration time, 60-0 mph braking distance, top speed, lateral grip in gs, etc. will be affected. There are many upgrades ranging from engine enhancements to body modifications that reduce rigidbody drag. What is the best way to use all of these numbers to calculate a car's performances?
realistically you're just going to have to get and use the famous Edy's Car Package from the asset store.
program$$anonymous$$g cars is a HUGE, HUGE, HUGE engineering job. it's the sort of thing a $$anonymous$$m of people spend a year on. you're not realistically going to be able to start off and do it
See the wheel friction curve on this post. That alone is something that really needs some math:
http://docs.unity3d.com/$$anonymous$$anual/class-WheelCollider.html
Are you trying to create a realistic driving simulator, or an arcade racer?
The game is for mobile, so I'd like to stay away from wheelcolliders, especially because I can have upwards of 10 cars that require accurate physics (traffic cars use a separate, less expensive physics system). I am using a physics system that I created myself. It is simply a frictionless collider for the wheels that uses rigidbody.addforce() to move. The physics are mostly arcade-like.
That still leads back to my original problem. Even if the measures are unitless, a quicker car should have a faster acceleration stat value... But how would I calculate that acceleration stat? Everything from tire grip to gearbox efficiency to engine torque to rigidbody drag still needs to be factored in.
To answer how acceleration, torque, speed, friction etc. are related, you might want to invest in a copy of Physics for Game Developers. But, like I said, you can use any number of stats and any formula you want to combine them - I wouldn't worry about physical accuracy (and certainly not for a mobile game!)
Answer by tanoshimi · Jan 17, 2016 at 07:06 PM
In that case, I'd recommend you avoid expressing stats in any kind of units such as mph, gs etc. - go for unitless measures of "acceleration", "top speed", "drag", "handling" etc. as is common in almost all casual racing games - that way you can combine them using any function you want to get a result that feels right (which, ultimately, is what games should be about), rather than one that is physically accurate.
Follow this Question
Related Questions
Car steering on a Rigidbody (Mario Kart) 0 Answers
We can't give snake movement to 3D car 0 Answers
GameObject fall Slowly [C#] 1 Answer
Car not shooting like bullet properly 2 Answers
troubles setting center of mass with rigid body in a car script 0 Answers