Wheeled vehicle not driving straight
by Christopher Stewart · in Torque Developer Network · 08/16/2007 (12:07 am) · 2 replies
Greetings,
Not sure if this is the right place for this post but I just looked and couldnt find a better one..
This is my first post and it would be fair to say that I am new to the world of game devlopment. As an artist I am coming to understand how diffuclt the programing side can be. A friend and I are trying to make a racing game.
Anyway,
My mate implemented the engine code changes to make the wheels on the buggy demo car pull straight when you accelerate. The fix can be found here:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6305
The buggy has also been made into a 4WD.
Since these updates were completed, I have been adjusting physics parameters in the car.cs file in the starter.racing mod. and have noticed some rather odd behaviour.
When I change a parameter, the buggy's behaviour reflects the change. but the steering becomes strange. Meaning that when I adjust a parameter such as engine torqe, or maxwheel speed, The car will no longer drive in a straight line.
As soon as I turn a corner and then press the up key the wheels straighten up but the car doesn't. it keeps doing a donut with straight wheels. After turning, if you stop the buggy with the wheels straight, and then start driving forward again still with straight wheels, the car starts to turn and eventualy you are again doing a donut with straight wheels.
So, the buggy will not pull straight even though the wheels are straight.
Ive spent a day and a half adjusting parameters now and trying to work out why it keeps turning like this and I cant seem to find an answer.
Being new to this whole game development thing I have probably missed something obvious,
Any ideas would be a great help,
Thanks,
GreenLotus_
Not sure if this is the right place for this post but I just looked and couldnt find a better one..
This is my first post and it would be fair to say that I am new to the world of game devlopment. As an artist I am coming to understand how diffuclt the programing side can be. A friend and I are trying to make a racing game.
Anyway,
My mate implemented the engine code changes to make the wheels on the buggy demo car pull straight when you accelerate. The fix can be found here:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6305
The buggy has also been made into a 4WD.
Since these updates were completed, I have been adjusting physics parameters in the car.cs file in the starter.racing mod. and have noticed some rather odd behaviour.
When I change a parameter, the buggy's behaviour reflects the change. but the steering becomes strange. Meaning that when I adjust a parameter such as engine torqe, or maxwheel speed, The car will no longer drive in a straight line.
As soon as I turn a corner and then press the up key the wheels straighten up but the car doesn't. it keeps doing a donut with straight wheels. After turning, if you stop the buggy with the wheels straight, and then start driving forward again still with straight wheels, the car starts to turn and eventualy you are again doing a donut with straight wheels.
So, the buggy will not pull straight even though the wheels are straight.
Ive spent a day and a half adjusting parameters now and trying to work out why it keeps turning like this and I cant seem to find an answer.
Being new to this whole game development thing I have probably missed something obvious,
Any ideas would be a great help,
Thanks,
GreenLotus_
#2
I checked out the resources and it does indeed seem to be a fishtailing issue. Infact even driving straight from the start position leads into a turn with straight wheels. (I cant wait to get home so I can jump in my car and head to some gravel. It will be good to see how a real car behaves when the accel is pushed down in a straight line..and then to do some donuts while listening to 80s metal.)
I ramped up the anti sway force but it didnt appear to change much so I think im going to have to research those numbers and car physics in general.
cheers,
Chrisso_
08/16/2007 (7:53 am)
Thanks for the swift reply Kirk,I checked out the resources and it does indeed seem to be a fishtailing issue. Infact even driving straight from the start position leads into a turn with straight wheels. (I cant wait to get home so I can jump in my car and head to some gravel. It will be good to see how a real car behaves when the accel is pushed down in a straight line..and then to do some donuts while listening to 80s metal.)
I ramped up the anti sway force but it didnt appear to change much so I think im going to have to research those numbers and car physics in general.
cheers,
Chrisso_
Torque Owner Kirk Longendyke
http://www.veoh.com/videos/v196682hkekWtZX
There's also this one that explains a bit more:
www.modernracer.com/tips/frontwheeldriveoversteer.html
Net effect, is paying attention to the ratio of your engine output vs your dampings, ect.
Further research terms you'll be looking into is oversteer, understeer, and the american colloquialism 'fishtailing'
Also, you'll find things are mitigated alot by ramping up the anti-sway force a bit.