Vehicle damage
by CodingChris · in Torque Game Engine Advanced · 01/15/2008 (7:13 am) · 3 replies
Hi,
I just want to do a simple vehicle damage system. What I want to do: Get the hitpoint, where the vehicles hit each other and I want to add a decal on that point of the vehicle. What how to do that?
I just want to do a simple vehicle damage system. What I want to do: Get the hitpoint, where the vehicles hit each other and I want to add a decal on that point of the vehicle. What how to do that?
About the author
#2
A better solution though would be swapping out mesh parts for 3D damaged parts of your vehicle. This approach is vastly more involved to setup than decals but the results are much more impressive. There are two resources you should look at for this method; hiding meshes and hitbox implementations. You can do a search for either of those terms and find the resources.
With hiding meshes you create two duplicates of your vehicle model, one is a clean version the other is a damaged version. In your model hierarchy the clean copy is linked to the start node while the damaged version floats unlinked. The hitbox resource will track damage according to vehicle part and then swap out the clean part for the damaged part using the hide mesh code when the max hitpoints are reached.
Hope that helps.
01/18/2008 (12:37 pm)
Decals are just a layer of 2D masked graphics added to your model's texture. You would have to create a decal for each part of your vehicle that will get damaged. I'm not sure about the status of decals in Torque. At one time code controlling decals was there but I think it got turned off. Either that or there is a resource for implementing decals.A better solution though would be swapping out mesh parts for 3D damaged parts of your vehicle. This approach is vastly more involved to setup than decals but the results are much more impressive. There are two resources you should look at for this method; hiding meshes and hitbox implementations. You can do a search for either of those terms and find the resources.
With hiding meshes you create two duplicates of your vehicle model, one is a clean version the other is a damaged version. In your model hierarchy the clean copy is linked to the start node while the damaged version floats unlinked. The hitbox resource will track damage according to vehicle part and then swap out the clean part for the damaged part using the hide mesh code when the max hitpoints are reached.
Hope that helps.
#3
01/18/2008 (1:09 pm)
Okay, much more complicated... Seems to be like always in TGEA: Something is not finished. I'll try out what you said, but the problem about your solution is that I'm not an artist, so I have to find someone who could do the different parts for me...
Torque 3D Owner CodingChris