Vehicle physics tweaking help
Posted: Sat Sep 13, 2008 9:27 pm
Hi,
Ive been using BepuPhysics for a few days with my XNA port of Need for Speed 1 (it uses the tracks, models and art from NFS1, but the engine is in XNA). BepuPhysics has been nice and easy to integrate compared to JigLib or PhysX.
I am having a few issues tweaking the Vehicle/Wheel physics models to get the right behaviour. I'll just list a couple of issues I have and what Ive tried to get around them.
Problem: Car too tail-happy, will spin completely out of control with little provocation
Tried: Shortened, firmed suspension, set centerOfMassOffset forward (this helped, but meant that the car sometimes nose-dived into the ground around corners). Increased angular damping (this only helped at high values which stopped the steering working correctly). I also tried adjusting the slideFriction on the back wheels, had some effect but not enough to prevent spinouts.
Also tried just accelerating the front wheels only - no noticeable effect.
Problem: Car floats too much over jumps
Tried: Upping the simulationSettings.gravity to -25 instead of -9.8. This made the car behave realistically in the air, but pushed the car down to the ground. I couldn't find a value on the suspension that would firm it up enough to hold the body up.
Problem: Cant change the wheel size
Tried: Changing the .375 wheelSize in the demo - the car behaves strangely but the wheel.WorldMatrix doesnt change scale.
Basically what I'm after at this stage is some tips for a 'safe' vehicle model - one that might be boring, but doesnt slide out all the time. I can post code samples or a demo if that makes it easier.
thanks!
Ive been using BepuPhysics for a few days with my XNA port of Need for Speed 1 (it uses the tracks, models and art from NFS1, but the engine is in XNA). BepuPhysics has been nice and easy to integrate compared to JigLib or PhysX.
I am having a few issues tweaking the Vehicle/Wheel physics models to get the right behaviour. I'll just list a couple of issues I have and what Ive tried to get around them.
Problem: Car too tail-happy, will spin completely out of control with little provocation
Tried: Shortened, firmed suspension, set centerOfMassOffset forward (this helped, but meant that the car sometimes nose-dived into the ground around corners). Increased angular damping (this only helped at high values which stopped the steering working correctly). I also tried adjusting the slideFriction on the back wheels, had some effect but not enough to prevent spinouts.
Also tried just accelerating the front wheels only - no noticeable effect.
Problem: Car floats too much over jumps
Tried: Upping the simulationSettings.gravity to -25 instead of -9.8. This made the car behave realistically in the air, but pushed the car down to the ground. I couldn't find a value on the suspension that would firm it up enough to hold the body up.
Problem: Cant change the wheel size
Tried: Changing the .375 wheelSize in the demo - the car behaves strangely but the wheel.WorldMatrix doesnt change scale.
Basically what I'm after at this stage is some tips for a 'safe' vehicle model - one that might be boring, but doesnt slide out all the time. I can post code samples or a demo if that makes it easier.
thanks!