Need help getting my car stop drifting :)
by Kristoffer Benjaminsson · in Torque Game Engine Advanced · 08/30/2007 (1:38 pm) · 2 replies
Hi,
I'm playing around with the WheeledVehicle class trying to figure out how things work. Right now I'm trying to get my cars to behave rather kart-like, i.e. little if any drift, stiff suspension, .etc. I've based my tweakings from the base car you get when purchasing the Rally Car pack and I have a car working with descent driving characteristics, with the exception that no matter what I tweak, my cars never stop drifting once they've started to.
My test level is absolutely flat and if I drive straight the car goes straight. But if I make heavy turns to get the car into a drift, counters the drift and then centers my steering to go straight, the car will keep a small drift (at least that's how it feels), i.e. it continues to "slide". The only way of getting it to go straight again is to slam the brakes and re-start.
So my question is if someone have some nice tweaking tips to get my car to go straight :)
/Kristoffer
I'm playing around with the WheeledVehicle class trying to figure out how things work. Right now I'm trying to get my cars to behave rather kart-like, i.e. little if any drift, stiff suspension, .etc. I've based my tweakings from the base car you get when purchasing the Rally Car pack and I have a car working with descent driving characteristics, with the exception that no matter what I tweak, my cars never stop drifting once they've started to.
My test level is absolutely flat and if I drive straight the car goes straight. But if I make heavy turns to get the car into a drift, counters the drift and then centers my steering to go straight, the car will keep a small drift (at least that's how it feels), i.e. it continues to "slide". The only way of getting it to go straight again is to slam the brakes and re-start.
So my question is if someone have some nice tweaking tips to get my car to go straight :)
/Kristoffer
#2
I went for the beefed rear wheels and without any real tweaking I've got a much better handling from the car.
Thanks!
09/11/2007 (11:04 am)
Super explanation! Thanks a million Mathew. Not ony did you solve the sliding, but you really helped me understand why it slid.I went for the beefed rear wheels and without any real tweaking I've got a much better handling from the car.
Thanks!
Torque 3D Owner Matthew Jessick
-----
Once the front wheels are turned far enough to be sliding, they have to be turned back far enough to NOT be sliding before the force that they produce changes any. (While they are still sliding, the force is constant.) You can get into situations where centering the steering wheel is not enough to get the fronts to stop sliding. You actually have to turn the wheel somewhat farther to the opposite side until you can get it gripping again.
(In the examples below I start out by assuming some value (5 degrees) for the steer angle of the front tires where they start sliding. This will most likely be different between your car and the example, but hopefully the example will still make sense.)
EXAMPLE:
Assume that the cars front wheels can rotate 5 degrees before the wheels start sliding. Once you turn them that 5 degrees via the steering, the car starts rotating and eventually assumes some "drift angle" itself. Assume this is 6 degrees. (How far the drift angle grows to depends on the relative abilities of the front and rear tires and the basic geometry of the car.)
Once you have gotten the vehicle to that 6 degree drift angle, the rear tires are at 6 degrees (and probably fully sliding themselves if the tires are the same front and rear), and the fronts are at 6+5 degrees or 11 degrees and are "very sliding." (Technical term ;) )
If you now center the steering wheel, the fronts reduce from 11 back to 6 degrees which is still > 5. As long as you are over 5, changing the front wheels between 11 and 6 deg HAS NO EFFECT on the force (because the tire is already fully sliding). So the car seems to totally ignore the fact that you have centered the steering wheel: feels freaky.
PROBLEM FIX:
OK, that is the problem. To fix it, simply adjust the vehicle setup so that the final "drift angle" is less. This can be from either letting the rears provide more force times moment arm = yawing torque sooner (e.g.: increase the "lateralForce" field value), so that the fronts can't rotate the vehicle to so large a drift angle. OR, you can reduce the ability of the fronts to create yaw moment (e.g.: reduce the front tire lateralForce) so that the drift angle tops out less than before. Or do both. Another way to reduce the final drift angle is to move the center of gravity with the "massCenter" field. Moving massCenter.y more positive will put the mass center farther forward, reducing the moment capabilities of the front and increasing that of the the rears.
NEW EXAMPLE WITH FIX IN PLACE:
If the final drift angle is reduced to be only 4 degrees, the rears are at 4 deg and the fronts are at 9 degrees with 5 deg of steer. Remove the fronts steering and they are now at 4 degrees which is less than their 5 degrees angle for maximum force so you have reduced the "yaw moment" that the fronts provide and the cars drift angle should start to reduce. The drift angle should reduce smoothly down to zero which is what one normally expects when centering the wheel.
CAVEATS:
Reality is not quite so easy as the simplified examples above because the fronts and rears see slightly different angles to the velocity when the car is turning hard. However, this doesn't really affect the fix any: beef up the rears or reduce the fronts so that the final drift angle is less, such that centering the steering gets the fronts back under their fully sliding limit so the car will thereafter start reducing its drift angle as the driver expects.