Jump to content
  • Advertisement
Sign in to follow this  

Front wheel/back wheel old school physics

This topic is 4358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, so this is a problem that has been bugging me for a long time. I love making little physics demos moving things around, bouncing them around, all that good stuff. But I have not found/come up with a good solution for the way the old school programmers did games such as Sprint and Badlands (games you can try in MAME or on the NES). Basically, what it "feels" like is the car is being turned on a pivot point of the nose. That way the velocity pushes you and makes your car drift, which makes cornering really fun. so now how to go about coding this? Currently my code is pretty simple, you have a velocity vector containing the angle and the length (vector.angle, vector.z) and you move the angle based on turning the wheel. The angle.z is brought up to a maximum velocity depending on how long the key has been pressed. any help or ideas would be greatly appreciated!

Share this post

Link to post
Share on other sites
You want to keep track of more than just velocity. You want to run a physics simulation of your car.

For parameters in your physics simulation, try:
Velocity of Car. (speed and direction)
Angle of Car and Rate Angle of Car is Changing.
Angle of Front Wheels and Speed of Rotation of Front Wheels.
Speed of Rotation of Back Wheels (and maybe Angle, if back wheels can turn relative to the car).
Current Power output of Engine.

Each timeslice, you take the above parameters, and you advance your simulation.

Ideally you want to take into account the wheel's ability to grip (and slip).

Wheels that are not pointing the way you are going will generate sideways forces on the car. Wheels with enough power will generate forward forces on the car -- wheels without enough power will generate backwards forces. Wheels that grip and move with the road, and wheels that have "slipped" behave differently (static vs dynamic friction).

Forces applied by the Wheels cause the Velocty of Car and the Rate Angle of Car is Changing to change. You then advance the simulation, and recalculate forces.

How the physics simulation is done (how you calculate forces and the effects of forces) is the interesting part. :)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!