Kaboom! Images of destruction.
by Michael Hall · 11/28/2008 (2:39 am) · 2 comments

Several months ago I had a conversation with Apparatus about how to destroy or break and blow things up in Torque. Now this was something that I was extremely interested in doing. I felt that having damageable props and other destroyable objects in a game would contribute to better immersion and interaction with a game environment. I've been asked a few times about how this pack works and what went into making it. I've never offered a blog here either. So to celebrate that the awesome folks at GarageGames now offer something in their store that I helped create why not blog about it.
Our first idea was a simple wall. What was unique about this wall was that it had 3 animation states that could be triggered in script. It was a simple matter to control these animation states by setting them when the wall reached a certain level of damage: healthy, damaged, wrecked. Once it was destroyed or reached the maximum damage level then it was time for an explosion effect with debris, and possibly rubble, and the removal of the wall.

So we had a damageable object that had debris effects and was removed once it was destroyed. But that was only the beginning, it was time to refine and improve the damage control scripts, Apparatus wanted the code to be simpler to understand and more of a template on how to do things. And of course we wanted to add even more features. One such feature was unique onDamage impact/hit effects with visuals and sounds. We wanted some objects to be completely destroyed and others to leave behind wreckage. You hit a metal barrel and you will see sparks and hear the appropriate sound. Shoot a tree, a wooden crate or a piece of furniture and little splinters of wood will fly off. To test the new hit effects I ended up disabling the crossbow explosion - I thought that was silly anyway. Being able to see wood chips, stone fragments, sparks, or even blood when you shoot something adds to the overall experience in my opinion. To make up for taking away the big bang for the crossbow we added some nice new crossbow bolt projectile decals and the bolt itself now bounces back once it hits something - a neat effect - but in the future I would like to have the bolt actually stick into something.

This was three whole intact pieces of pottery, I've damaged them in order to show how using differing shapes indicates the "breakable-ness" of some objects. The screenshot missed missed capturing the debris.

Apparatus can spit out a large volume of work real quickly once he gets going - I had a hard time keeping up with just creating datablocks for the new objects that he would send me.

I tossed in an idea to create a few wall props that could be used to build a simple structure and we soon had a wood and plaster shack, a metal walled warehouse, and a glass greenhouse - all of which could be broken, smashed, and destroyed. But wait we wanted even more. If you destroy or blow up a fuel tank/fuel barrel shouldn't it leave fire and smoke billowing up into the sky? I really wanted to be able to have a spreading fire and proximity damage to a fire - wouldn't it be fun to see a flaming orc running around - but time constraints put a stop to that. We had already exceeded our design plan but I did get the wreckage fire and smoke in there.
Did I mention the trees? Well, the trees don't explode, but limbs will break off and leaves will scatter on the wind if you shoot one enough times.

The initial release a couple months back was for TGE only, but it took just about 10 minutes to port it over to a TGEa Stronghold codebase. There are no definite plans as of yet but there may (will probably) be a more advanced followup sometime down the road - I'm already compiling ideas and if anyone has any suggestions or possible means of improvement feel free to let me know.

About the author
Been dabbling with game-programming since the age of 10 when I got my first computer, a Commodore. Got serious about game-development after modding Tribes for several years. Doesn't sleep much. Drinks rum. Teaches guitar. Plays cello.
#2
11/29/2008 (8:43 am)
Thanks Mike. I might have gotten a little carried away with the comments ;) I'm glad to hear you are getting a lot out of it. That was one of our main goals that people could use the pack and be able to learn from it. 
Torque Owner Mike Rowley
Mike Rowley
Thanks guys.
Edit to add:
I love the way you commented everything you did. Lots of great comments in there, especially server/scripts/game.cs
Awesome job. I'm learning a lot. :-)