Game Development Community

Vehicle Suspension

by Nate "Nateholio" Watson · in General Discussion · 02/28/2003 (11:31 am) · 6 replies

To make a vehicle have an animated suspension do you make bones that go from the tires to the body and animate them? Also once everything is animated, how do you get them to move independently when the vehicle is moving over terrain?

#1
02/28/2003 (4:24 pm)
ok, well i'm kinda a novice in this field but i'm planning on doing simillar suspension stuff for a quadbike, all this is theoretical by the way:

ok, first i was gonna make the quadbike into two seperate parts, the chasis/main body and the whell structure, not linking them in anyway, the main body would not need animating but the wheels would for turning and stuff. when moving the quad around, i would position the body and wheels in the same positions but the body slightly higher. when doing the suspension code, the wheels + structure will always be on the ground while u would be controlling the height difference between the wheels + structures and the main body to create the suspension illusion.

so say for example when the quadbike jumps over a gap and land on the ground, the wheels + structure remains on the ground while the body (height controlled by ur code) moves down close to the wheels + structure and then moves back up to its normal position so it looks like it has suspension. haven't really thought much about it but i'd guess you'd use some sine formular or something the modify the height difference.

The advantage of using this method is that you can always vary the difference in height between the body and wheels depending on the force of gravity, using an animation would make it fixed but i'd guess if you did it well, it would create a simillar fx.

ps all this is theoretical pls tell me if i'ts bull :)
#2
02/28/2003 (4:51 pm)
You need to have a separate animation for each wheel named spring# where # is the same as the hub#. Then the first frame of the animation is the spring extended down and the 2nd frame is the spring extended up. (It might be reverse, can't check right now). Then export your model with those animations and the engine should do all the tweening for you depending on the spring force. I think that's all you need to do...
#3
03/01/2003 (4:27 pm)
I know that you should keep the tires and vehicle in different dts files, but why? And can a vehicle be made up of a frame, body, and tires in Torque - or is it just limited to body+frame and tires? As I have it now, its a truck frame with full suspension (independent 2x wishbone front, and solid rear axle), driveline, brakes, etc. so I can animate it once and use different bodies and tires on it (at least thats the plan). I'm curious mainly because I'm still working on the frame, but don't want to waste my time if its not possible to have three seperate elements to a vehicle in Torque.
#4
03/02/2003 (8:30 pm)
Having two DTS files has the benefit of two texture images and code can independently move the wheels. If only one DTS is used then the vehicle is limited to one texture image and canned animation sequences.
#5
03/02/2003 (8:45 pm)
Thats not all the way true. As far as the texture goes your not limited to 1 texture. You can use a Multi Sub object Texture (MAX2DTS anyway). That will allow you to use as many textures as you want or need.

We make our Vehicles with all four wheels attached. The hub Nodes are mounted in the correct place on the vehicle for the wheels. The actual wheels that we export as a seperate file are invisible (Alpha channel at 255,255,255).
We did this so we could get Shadows outa the wheels. We did do a little modification that allows the steering to play on the wheels that are visible as well as control the steering. We had to change a few more things to accomidate the new CODE for vehicles. Playing the animation on the wheels that are visible is just a script mod. Basically you do a PLAYTHREAD on Your models animation of the steering. You parse it according to the position of the mouse. I don;t know all the details I didn't write it.
We also have a RIDER on our vehicles that is a seperate model that has its own animations according the the vehicles action.
Matt
#6
03/03/2003 (11:21 am)
Thanks for the info, but does anyone know if vehicles can have frames which are seperate dts files of the wheels and body? I can think of one reason why this would be a good thing to have off the top of my head - if the body of a vehicle gets badly damaged, it doesnt hurt the performance much, if at all. Sure, it may reduce the armor protection the vehicle provides, but one can still drive it to make their getaway or whatever they may be doing. On the other side, if the frame, suspension, etc. gets pretty beat up, one can make their stand in the vehicle protected by the body and maybe get out of the situation alive. Other advantages include seperate damage dts? files for body, frame, and wheels; assembly-line type vehicle modelling, more detailed requirements for making vehicle repairs (useful for RPGs), and relative easy modification of vehicle attributes. As I always say when writing posts like this, I don't know much about Torque or modelling, but any info is appreciated.