Understanding Torque's Vehicle Physics
by Ian Winter · in Torque Game Engine · 12/31/2005 (10:35 am) · 14 replies
I've had a look round the site but can't really find anything mentioning how various values effect the vehicle physics in Torque. Working from the default starter.racing I find the default buggy settings leave the vehicle rather slow, increasing max wheel speed gets the speed up but the car has a tendancy to slide around everywhere and straightening up can be rather difficult. I've tried increasing mass to make the car stick to the floor a bit better and not fly around like once of those little bouncy balls you could get as a kid each time the vehicle shows a hint of leaving the ground but that only slows the car down again. I'm trying to essentially acheive the effect of a car that can reach a nice fast speed whilst still holding the ground well and maneuvering well, does anyone have any idea which values need to be tweaked to acheive this?
Further, does anyone know any good sites or have any good resources explaining the wheeled vehicle physics as well as general simulation of wheeled vehicles in computer games?
Again, thanks in advance!
Further, does anyone know any good sites or have any good resources explaining the wheeled vehicle physics as well as general simulation of wheeled vehicles in computer games?
Again, thanks in advance!
#2
12/31/2005 (11:49 am)
I'm interested in this too, as I'd like much tighter precise control than what I have seen so far. Thanks for the links, will be interesting to see what can be done with the built in vehicle code, and whats needed to get things closer to my existing project.
#3
12/31/2005 (2:04 pm)
Thanks Kirby, definetely helped with understanding the steering code and changing speeds, I'm still not totally sure how to stop the car taking off the ground and rolling over so easily though from it.
#4
Also still not having such a great time of the steering. Is this all simply that Torque's vehicle physics really aren't too great or is it just difficult to find the right values to have a much nicer vehicle simulation?
Essentially, a real car doesn't take off and roll over then start slipping around everywhere when it lands at speeds of 40 km/h, so I'm trying to simulate this much more closely in Torque - i.e. keeping the car on the ground and keeping it from losing control of it's rear end constantly.
01/01/2006 (9:57 am)
Really struggling with these vehicle physics still, it seems no matter what values I modify the terrain feels like ice, the car just seems to skid around far too much as if the tyres have no grip on the surface whatsoever. Anyone know how to fix this icy effect of the terrain surface so that it's not treated as if it's on some icy surface?Also still not having such a great time of the steering. Is this all simply that Torque's vehicle physics really aren't too great or is it just difficult to find the right values to have a much nicer vehicle simulation?
Essentially, a real car doesn't take off and roll over then start slipping around everywhere when it lands at speeds of 40 km/h, so I'm trying to simulate this much more closely in Torque - i.e. keeping the car on the ground and keeping it from losing control of it's rear end constantly.
#5
01/01/2006 (11:22 am)
Try this for starters, leave all the settings alone except "static friction" and "kinetic friction." Double or triple those two friction forces. You'll suddenly find your car sticking like it had velcro tires, doing hairpin turns with the greatest of ease. Then follow the wheeled vehicle datablock spec to tweak closer to what you actually want.
#6
Lowering the spring length helps a lot but still leaves me with erractic quick turns when I lose the terrain from the wheels slightly.... getting there ;) Tweaked a few other things and the car is sticking better but when it's still taking off going down what are only about 20 degree slopes. I'd prefer to keep the car on the ground unless it reaches at least say a 40 degree slope.
01/01/2006 (1:01 pm)
Have given them a try Ben, but now the car just seems to roll over with the slightest turn. Have tried various values, lower values mean I slide everywhere, higher values mean I roll at the slightest hint of a turn. I guess I need a higher friction and then change some of the spring values, I just can't find the right combination of which ;)Lowering the spring length helps a lot but still leaves me with erractic quick turns when I lose the terrain from the wheels slightly.... getting there ;) Tweaked a few other things and the car is sticking better but when it's still taking off going down what are only about 20 degree slopes. I'd prefer to keep the car on the ground unless it reaches at least say a 40 degree slope.
#7
01/01/2006 (2:14 pm)
Maybe the car is too fast or too light? That would cause it to launch at the top of slopes. Also, those two parameters as well as the center of gravity may be why it's rolling over so easily. Try slower, heavier, lower CoG in combinations to reduce the rolling over on quick turns.
#8
01/01/2006 (3:32 pm)
Increasing the vehicles mass slows it down. Slower holds the floor better but a slow racing game is just wrong ;) As I say I'm fairly new to Torque, does it have a global gravity setting or some such? I'm thinking of maybe increasing the strength of gravity to hold the vehicle to the floor if that's possible.
#9
This setting worked pretty fine for me with the buggy model:
massCenter = "0 0 -0.7";
Lowering the center of gravity will prevent the vehicle from rolling over.
01/01/2006 (5:06 pm)
I think you problem is that the center of gravity is too high.This setting worked pretty fine for me with the buggy model:
massCenter = "0 0 -0.7";
Lowering the center of gravity will prevent the vehicle from rolling over.
#10
01/01/2006 (5:48 pm)
It's possible to get good feeling racing out of Torque's physics, though ultimately you may want to roll your own. Torque's vehicles are more "accessories to 1st person play" than "totally focused on going really, really fast down tracks." There's a significant difference between the two (compare how the Warthog in Halo handles vs. your favorite Nascar racing game or Burnout...).
#11
01/01/2006 (6:27 pm)
I would look into using the hover for that. It is very easy to add mod the hover in the C++ code. It just takes a while to understand all the fiddly bits.
#12
Tried hover but can't even get a successful one to spawn, tried playing with the one I found when searching but it's really old and although I managed to get into game it wont spawn properly for me, it just starts underground and then the game crashes after a few minutes.
Think I'm going to have to give this project up as a lost cause unfortunately.
01/02/2006 (12:38 pm)
Unfortunately I don't have anywhere near the knowledge of physics to roll my own physics system.Tried hover but can't even get a successful one to spawn, tried playing with the one I found when searching but it's really old and although I managed to get into game it wont spawn properly for me, it just starts underground and then the game crashes after a few minutes.
Think I'm going to have to give this project up as a lost cause unfortunately.
#13
01/04/2006 (10:13 pm)
I am also working on this same thing and currently looking for a phyics engine to hybird into the game and could use some help if your willing.
#14
01/05/2006 (7:23 pm)
The spawning issue is a datablock/create function issue. You wouldn't really be rolling your own, just tweaking the existing until you got a better understanding of what all the calls do. You really are only concerned about updating two variables: mRigid.force and mRigid.torque. However, the real trick is using the matrix calls to turn human comprehendable information into the stuff mRigid needs. You really do not need in depth knowledge to do this. Just hack at it until it makes sense if you really want to understand it.
Torque Owner Kirby Webber
This one is wheeled vehicle specific.
~Hope that helps.