# 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.

## 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 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. :)

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5

• 10
• 14
• 30
• 13
• 11
• ### Forum Statistics

• Total Topics
631782
• Total Posts
3002338
×