This roughly matches real 1/4 mile times without requiring huge speed stats. However, the speed difference between, say, 182 atk and 1000 atk cars isn’t as distinct as it should be.Before, I used:
Â
Milliseconds per tile = 1000 / (1 + ln(speed))
Â
with speed representing horsepower, but this required extremely high speed values to get realistic times.
I’m not confident with the math here—any advice on a better formula to scale power-to-weight properly? Also, is there a way to avoid using int() in the source code calculations?
Question
CharmingClyde
I'm working on a formula to calculate 1/4 mile times in my racing game that uses attack (atk) and defense (def) to simulate power-to-weight ratio.
The goal is to create noticeable speed differences between light/heavy and low/high power cars.
Â
Currently, my formula is:
Â
Milliseconds per tile = 1000 / (140 * int(atk) / int(def))
Â
This roughly matches real 1/4 mile times without requiring huge speed stats. However, the speed difference between, say, 182 atk and 1000 atk cars isn’t as distinct as it should be.Before, I used:
Â
Milliseconds per tile = 1000 / (1 + ln(speed))
Â
with speed representing horsepower, but this required extremely high speed values to get realistic times.
I’m not confident with the math here—any advice on a better formula to scale power-to-weight properly? Also, is there a way to avoid using int() in the source code calculations?
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now