Destroyable Vehicles
by Tim Lane · in Torque Game Engine · 08/23/2004 (12:05 pm) · 12 replies
Hi all!
I'm new 2 Torque and have been doing some of the tutorials. I'm impressed with the vehicle physics and have been importing my own vehicle models and driving around with them.
My question is, though, can the vehicles be damaged to the point of coming apart(i.e. DRIV3R, GTA:VC, BURNOUT, MIDNIGHT CLUB II)? Like, can the bumpers or fenders bend? Or can wheels come off?
As it is now, they can crash and flip, but they just kinda bounce around like Gran Turismo or Auto Modellista or something.
LOL! I guess this may be a bit ambitious. Anybody have any ideas?
I'm new 2 Torque and have been doing some of the tutorials. I'm impressed with the vehicle physics and have been importing my own vehicle models and driving around with them.
My question is, though, can the vehicles be damaged to the point of coming apart(i.e. DRIV3R, GTA:VC, BURNOUT, MIDNIGHT CLUB II)? Like, can the bumpers or fenders bend? Or can wheels come off?
As it is now, they can crash and flip, but they just kinda bounce around like Gran Turismo or Auto Modellista or something.
LOL! I guess this may be a bit ambitious. Anybody have any ideas?
About the author
#2
Thanks again, man.
-Tim
08/23/2004 (1:12 pm)
Wow, thanks Kirby! I didn't think that was possible. I'll definately try what you said. Don't know how to swap out .dts's yet though. I'll just read up on the docs i guess. But this will really come in handy for the idea I have.Thanks again, man.
-Tim
#3
08/24/2004 (3:34 am)
With the existing code base you can make a debris file. . .basically a file containing all the parts of the vehicle, wheels, fenders, steering wheel whatever. Make sure each mesh is at the origin of the world (they will be overlapping). Then when the vehciles' damage is at zero it will trigger the debris file and fling all those lovely part all over the place.
#4
Say you build a car frame, skeleton like. Then mount doors, bumper, hood etc to it. You can have different versions of the bumper, no damage, smal dent, extreme deformation etc.
This way you can check for point of impact, say frontal, and just replace the bumper with a more deformed one.
Now, since i am also pretty new to torque, i am not sure if the car has the ability to mount shapes like the player, but it should be easy to implement.
Just my 2 cents - Sascha
08/24/2004 (5:14 am)
Just an idea, but would it be possible to use the mount system?Say you build a car frame, skeleton like. Then mount doors, bumper, hood etc to it. You can have different versions of the bumper, no damage, smal dent, extreme deformation etc.
This way you can check for point of impact, say frontal, and just replace the bumper with a more deformed one.
Now, since i am also pretty new to torque, i am not sure if the car has the ability to mount shapes like the player, but it should be easy to implement.
Just my 2 cents - Sascha
#5
08/24/2004 (5:31 am)
Or you can use the "hide node" tutorial by Justin Mette, recently it was modified to hide a generic mesh given its name here, I don't know if it works with vehicles but surely can be adapted, pratically what you have to do is to create your model including all the damaged models, then just hide the damaged models and then show them up in the correct order.
#6
Here's an example of what I'm planning:
1 - The car starts off perfect.
2 - It crashes into something. The perfect bumper is "hidden" and a damaged version is "shown" in its place.
3 - It crashes again. This time the damaged bumper is "hidden." An even more damaged bumper debris file is loaded and launched off from where the old bumper was. The car now rolls around with no bumper.
Do you all think this would work? I'd greatly appreciate some input from the community.
08/24/2004 (4:00 pm)
Thanks for the help everybody. Some time ago, I downloaded the vehicles from GTA3 in .max format. It looked like Rockstar included the damaged vehicle parts right there in the model. I'm guessing they must have done something similiar to what Davide suggested.Here's an example of what I'm planning:
1 - The car starts off perfect.
2 - It crashes into something. The perfect bumper is "hidden" and a damaged version is "shown" in its place.
3 - It crashes again. This time the damaged bumper is "hidden." An even more damaged bumper debris file is loaded and launched off from where the old bumper was. The car now rolls around with no bumper.
Do you all think this would work? I'd greatly appreciate some input from the community.
#7
08/24/2004 (6:23 pm)
Sounds good to me.
#8
12/21/2006 (1:38 am)
Has anyoone got any examples of damageable cars code with the new TSE? Thanks.
#9
Plan about deformation
Just do a search using the terms Mesh Deformation. That will help with denting doors and stuff. Then use the node hide stuff mentioned by Tim in this thread for individual parts.
12/21/2006 (5:49 am)
Morph ResourcePlan about deformation
Just do a search using the terms Mesh Deformation. That will help with denting doors and stuff. Then use the node hide stuff mentioned by Tim in this thread for individual parts.
#10
Ever when a vehicle hits something, the hitpoints were deformed?
Hope it's understandable.
12/21/2006 (6:07 am)
Is there a way to do this:Ever when a vehicle hits something, the hitpoints were deformed?
Hope it's understandable.
#11
Yep trying to find how to make the vehicles get dents when hitting other cars, buildings and objects. Also to be able to shoot up a car and have it damaged and explode.
12/22/2006 (12:09 am)
Thanks for the links. Yep trying to find how to make the vehicles get dents when hitting other cars, buildings and objects. Also to be able to shoot up a car and have it damaged and explode.
#12
12/22/2006 (12:57 am)
And how?
Torque Owner Kirby Webber
Torque can absolutely do all those things, though it's going to require a fair bit of rigging on your part.
To start off, I would direct you to several vehicle tutorials in the resources section - two that leap to mind are buy Harold "LabRat" Brown, and the other is by BadGuy.
Between these two tutorials, you should get a fair idea of how to get your vehicle to apply damage (mathematically) to your model.
Now for the tricky part...
If you are lookign to display VISIBLE damage at varyign degrees/ stages of health, there are a number of ways to go about this.
For starters, you can apply "decals" to your existing model dynamically through script. An example of this was in Tribes 2 and was used to "paint" damage areas to the model in real time.
Now - if you want your fenders and whatnot to *actually* crumple and dent, yuou're going to have to model it.
-I'm just brain storming here, but I'd envision something like this:
Player starts out with model 'A' - full, undamaged car.
At 75% health, several damage decals get applied.
At 65% health, the existing model is "swapped" for model 'B', which has dents and additional damage already painted into the skin.
**At this point, I'd fire up a light damage emitter to get some smoke rolling out - not too much though.
At 50% health, more damage decals get applied - particle frequency of the damage emitter is increased.
At 40% Health, the model is swapped again - for an even more defunct mesh with an even more damaged looking skin - switch to the heavy damage emitter and start puring out some black smoke (useInverseAlpha = True;)
At 30%, More declas, heavier smoke.
At 10%, another model swap - heavier smoke, maybe some fire.
At 0 - BOOM.
As a note, each time you swapped out the model, I'd strip out the existing decals (painted into the mesh now) to keep the memory free'd up - but that may just be me.
~I hope that didn't raise more questions than it answered. =\
BTW: If you are wanting to apply dents to the exact point of impact at the time of collision - well, that's beyond my scope.