"Destroyable objects for Torque" Pack Released
by Apparatus · 08/30/2008 (9:30 pm) · 19 comments
Ever wanted to actually affect the objects you shoot at, applying a bit of damage, maybe destroy it altogether in a ball of fire smoke and sparks, leaving only a smoking wreck behind?
Now you can.
Kaboom!Pack or Destroyable Objects for Torque will give you just that. A lot of examples to pick up from:
1. breakable objects ~ destroy an object entirely, onHit sound effect /particle effect per object;
2. breakable objects with damage states and wreck left on the map
3. explosive objects (derived from above)
BREAKABLE STRUCTURES :P ~ may seem tedious (is not really) but with a bit of work you can have your own destructive environments in Torque.
Lets explain the concept behind this pack for a little bit.
First of all, we needed a way of making things appear like they take damage. That was simple. We added onHit effects (particles and sounds) to each object.
Then we needed a way to apply 'visual' change on the object. Than could have been done by changing the texture or changing the shape altogether. Changing the shape seem the objous choice if we wanted various damage states and a broken /final model (the wreck).
Now, destroying crates is simple. Believe it or now, destroying buildings is just as simple. After all, a crate is a model and a building is a structure that can be created with many destroyable models. One simply has to design first how wants a building / structure to take damage and set out to create the parts; One of the most advanced engines around (Crytek) does things exactly the same - ok, we replaced the debris controlled by physics with debris controlled by script.
Here is a simplestructure example:

As you can see, there is a base structure model and each wall (just one in this shot) is a destroyable object.
Once we managed to destroy an object we needed to step further a bit and add more eye candy ~ after all, if you explode a barel nearby a building, you'd expect some burning / smoking debris left behind; So we added this too; After we destroyed the objects, here's how the mission looks like ~ a battlefield indeed : )

video:
YouTUBE link with alternative rock sound : )
Here are the actual changes made to the starter.fps stock 1.5.2:
SERVERSIDE CHANGES
"~/server/scripts/"
game.cs - adding execs for new files.
fxData.cs - location for shared effects (sounds, particles) new for destroyables, and generic template effects
bomb.cs
crossbow.cs
player.cs - added inventory limits for the bomb and ammo - see PlayerData(PlayerBody); commented out references to BulletAmmo, RifleAmmo, Rifle; added code for onHit style damagefx blood splatter - see function armor::Damage(), added a "damageFX" property to PlayerData(PlayerBody)
staticShape.cs - added control methods for destroyables
rigidShape.cs - moved from demo, added control methods for destroyables
"~/server/scripts/destroyables"
crate.cs
barrel.cs
tanks.cs
tree.cs
fence.cs
furniture.cs //removed chair table models
pottery.cs
simpleStructure.cs
warehouse.cs
"~/server/scripts/destroyables/rs" - example rigidshape destroyables scripts
expBoulder.cs
expCrate.cs
expBarrel.cs
CLIENT SIDE CHANGES
"~/client/scripts/"
default.bind.cs - added keybind "2" to use the bomb. Crossbow defaults to "1" DO NOT MOVE!!!
These are just additions on top of stock assets. Nothing was changed or removed.
for non-generic particle effects:
"~/data/shapes/particles/fire_A"
"~/data/shapes/particles/smoke_A"
"~/data/shapes/particles/splinterwood"
"~/data/shapes/particles/stonedebris"
"~/data/shapes/particles/spark_h3"
"~/data/shapes/particles/leaf01"
"~/data/shapes/particles/leaf02"
shared sound effects
"~/data/sound/destruction/explosion2.ogg"
"~/data/sound/destruction/destroyedcrate.wav"
"~/data/sound/destruction/woodhit.wav"
"~/data/sound/destruction/stereo/crumblewall.wav"
"~/data/sound/destruction/stereo/hitwall.wav"
"~/data/sound/destruction/stereo/hitmetal.wav"
"~/data/sound/destruction/stereo/metaldebris.wav"
for the bomb:
"~/data/special/expDecal"
"~/data/sound/h3/throw.ogg"
for crossbow:
"~/data/special/bowhit01"
"~/data/special/bowhit02"
"~/data/special/bowhit03"
"~/data/special/bowhit04"
"~/data/special/bowhit05"
"~/data/sound/destruction/quiver.ogg"
"~/data/sound/destruction/arrow_hitting.ogg"
Models breakdown list:

The pack comes with actually 2 starter.fps - a 'stock' one and a modified one courtesy of M (SilentMike) Hall. We would have liked to work more on the particle effects themselves but we decided to take the Particle editor for a fix later on, so anyone can create simple smoke or complex explosions.
All the work/scripting/coding was done by Mike. I just merely pushed the pen around complaining about everything. Much of the code is in there, ready to be discovered, cleaned up and used. Mike has a lot of experience from the Tribes days so he did a great job.
Some more screens:










Download Preview Doc Here
Product page
Special thanks to M(silentMike)Hall.
Now you can.
Kaboom!Pack or Destroyable Objects for Torque will give you just that. A lot of examples to pick up from:
1. breakable objects ~ destroy an object entirely, onHit sound effect /particle effect per object;
2. breakable objects with damage states and wreck left on the map
3. explosive objects (derived from above)
BREAKABLE STRUCTURES :P ~ may seem tedious (is not really) but with a bit of work you can have your own destructive environments in Torque.
Lets explain the concept behind this pack for a little bit.
First of all, we needed a way of making things appear like they take damage. That was simple. We added onHit effects (particles and sounds) to each object.
Then we needed a way to apply 'visual' change on the object. Than could have been done by changing the texture or changing the shape altogether. Changing the shape seem the objous choice if we wanted various damage states and a broken /final model (the wreck).
Now, destroying crates is simple. Believe it or now, destroying buildings is just as simple. After all, a crate is a model and a building is a structure that can be created with many destroyable models. One simply has to design first how wants a building / structure to take damage and set out to create the parts; One of the most advanced engines around (Crytek) does things exactly the same - ok, we replaced the debris controlled by physics with debris controlled by script.
Here is a simplestructure example:

As you can see, there is a base structure model and each wall (just one in this shot) is a destroyable object.
Once we managed to destroy an object we needed to step further a bit and add more eye candy ~ after all, if you explode a barel nearby a building, you'd expect some burning / smoking debris left behind; So we added this too; After we destroyed the objects, here's how the mission looks like ~ a battlefield indeed : )

video:
YouTUBE link with alternative rock sound : )
Here are the actual changes made to the starter.fps stock 1.5.2:
SERVERSIDE CHANGES
"~/server/scripts/"
game.cs - adding execs for new files.
fxData.cs - location for shared effects (sounds, particles) new for destroyables, and generic template effects
bomb.cs
crossbow.cs
player.cs - added inventory limits for the bomb and ammo - see PlayerData(PlayerBody); commented out references to BulletAmmo, RifleAmmo, Rifle; added code for onHit style damagefx blood splatter - see function armor::Damage(), added a "damageFX" property to PlayerData(PlayerBody)
staticShape.cs - added control methods for destroyables
rigidShape.cs - moved from demo, added control methods for destroyables
"~/server/scripts/destroyables"
crate.cs
barrel.cs
tanks.cs
tree.cs
fence.cs
furniture.cs //removed chair table models
pottery.cs
simpleStructure.cs
warehouse.cs
"~/server/scripts/destroyables/rs" - example rigidshape destroyables scripts
expBoulder.cs
expCrate.cs
expBarrel.cs
CLIENT SIDE CHANGES
"~/client/scripts/"
default.bind.cs - added keybind "2" to use the bomb. Crossbow defaults to "1" DO NOT MOVE!!!
These are just additions on top of stock assets. Nothing was changed or removed.
for non-generic particle effects:
"~/data/shapes/particles/fire_A"
"~/data/shapes/particles/smoke_A"
"~/data/shapes/particles/splinterwood"
"~/data/shapes/particles/stonedebris"
"~/data/shapes/particles/spark_h3"
"~/data/shapes/particles/leaf01"
"~/data/shapes/particles/leaf02"
shared sound effects
"~/data/sound/destruction/explosion2.ogg"
"~/data/sound/destruction/destroyedcrate.wav"
"~/data/sound/destruction/woodhit.wav"
"~/data/sound/destruction/stereo/crumblewall.wav"
"~/data/sound/destruction/stereo/hitwall.wav"
"~/data/sound/destruction/stereo/hitmetal.wav"
"~/data/sound/destruction/stereo/metaldebris.wav"
for the bomb:
"~/data/special/expDecal"
"~/data/sound/h3/throw.ogg"
for crossbow:
"~/data/special/bowhit01"
"~/data/special/bowhit02"
"~/data/special/bowhit03"
"~/data/special/bowhit04"
"~/data/special/bowhit05"
"~/data/sound/destruction/quiver.ogg"
"~/data/sound/destruction/arrow_hitting.ogg"
Models breakdown list:

The pack comes with actually 2 starter.fps - a 'stock' one and a modified one courtesy of M (SilentMike) Hall. We would have liked to work more on the particle effects themselves but we decided to take the Particle editor for a fix later on, so anyone can create simple smoke or complex explosions.
All the work/scripting/coding was done by Mike. I just merely pushed the pen around complaining about everything. Much of the code is in there, ready to be discovered, cleaned up and used. Mike has a lot of experience from the Tribes days so he did a great job.
Some more screens:










Download Preview Doc Here
Product page
Special thanks to M(silentMike)Hall.
#2
08/30/2008 (10:02 pm)
This is so cool. I am So wanting a TGEA version of this. How about it Apparatus? Will it work in TGEA - I don't mind not having normal maps, just as long as the scripts, particles, etc work.
#3
jaimi~ It should work, I will test it; it's really just the scripts and particles.
//staticShape.cs - added control methods for destroyables//
//rigidShape.cs - moved from demo, added control methods for destroyables//
if these don;t interfere with tgea innerworkings, it must work.
08/30/2008 (10:07 pm)
morrock~ as soon as I settle down and complete what I already have started (way behind already) a little game is due, based on the siege ideea;jaimi~ It should work, I will test it; it's really just the scripts and particles.
//staticShape.cs - added control methods for destroyables//
//rigidShape.cs - moved from demo, added control methods for destroyables//
if these don;t interfere with tgea innerworkings, it must work.
#4
Also i will send you a email
Keep up the amazing work
08/30/2008 (10:41 pm)
I will make sure i get the TGEA verson, also do you have plans on releasing another breakable pack? If you need idea i have tons.Also i will send you a email
Keep up the amazing work
#5
Out of interest, would it be relatively easy to adapt this for destruction on collision? I'm working on a street racer and have drive-through destructible scenery on my to-do list, so hopefully this will save me some time.
08/30/2008 (11:39 pm)
Another addition to my "must buy" list, sneaking in near the top. Great stuff, guys.Out of interest, would it be relatively easy to adapt this for destruction on collision? I'm working on a street racer and have drive-through destructible scenery on my to-do list, so hopefully this will save me some time.
#6
08/30/2008 (11:44 pm)
Unless Mike went and found a different way to destroy objects, it would be very easy to implement this into onCollision, as long as you know very basic scripting.
#7
@Jaime: It should work just fine in TGEa. The particles may need a some adjusting, but the scripts themselves just build on what's already there for tracking damage levels and states.
My old laptop broke (how appropriate was that) about the time we started this, so I ended up building a spare parts computer just so I could work on it. Unfortunately TGEa refuses to run on it so I never got to test it there.
@Ross: It would be easy to switch over to an onCollision type damage control, but I think you would end up with collision time resolution problems that would stop you dead in your tracks - that would be bad for a racer. But it could probably be worked out with a little work.
@Morrock: Things changed quite a bit from that Siege prototype, but now I know how to do it even better. The rigid body/shape physics in Torque still needs some work, so we went mostly with a staticshape approach here.
08/31/2008 (12:28 am)
Blowing stuff up is fun!@Jaime: It should work just fine in TGEa. The particles may need a some adjusting, but the scripts themselves just build on what's already there for tracking damage levels and states.
My old laptop broke (how appropriate was that) about the time we started this, so I ended up building a spare parts computer just so I could work on it. Unfortunately TGEa refuses to run on it so I never got to test it there.
@Ross: It would be easy to switch over to an onCollision type damage control, but I think you would end up with collision time resolution problems that would stop you dead in your tracks - that would be bad for a racer. But it could probably be worked out with a little work.
@Morrock: Things changed quite a bit from that Siege prototype, but now I know how to do it even better. The rigid body/shape physics in Torque still needs some work, so we went mostly with a staticshape approach here.
#8
08/31/2008 (12:37 am)
How different is it aside from being changed to staticShape? I've been doing destructables as statics now too (Those broken windows will look cool as hell, I'm telling you App :D) Or would you rather not give it away?
#9
08/31/2008 (1:25 am)
@Apparatus: looks like your website is screened by Great Wall (Chinese governmental firewall) as it is not possible to go there from China.... need to set-up proxy access.
#10
This will go really well with the Explosions FX pack :D
08/31/2008 (1:35 am)
Awesome work apparatus and co. So are there any tutorials on how to rigup your models to make them destructable ?This will go really well with the Explosions FX pack :D
#11
08/31/2008 (2:09 am)
So are you including all the states of destruction with the same mesh and hiding them until required?
#12
08/31/2008 (2:26 am)
if only you can make it dynamically make objects destructable.
#13
I like the way the crossbow arrows stay in the world; is that a custom feature, or tweaking scripts?
08/31/2008 (6:24 am)
Nice work! This is a great feature for FPSs. Question - what are the decals on the ground in the second last large screen? Looks like something similar to what I'm doing, but I may be misinterpreting them... ;)I like the way the crossbow arrows stay in the world; is that a custom feature, or tweaking scripts?
#14
TSquared@aye, i wonder if that's possible too;
Frank@ For a second there I wondered how you knew than i noticed your location is Beijing. It's kinda cool to be censored by the Great Wall though : )
08/31/2008 (5:37 pm)
Andy@ pick up the pdf file from the link in the post for info; there are separate dts models for each damage state so you can control everything; having all models in one dts is also possible with visibility animation but that meant extra animation work, calling the animations and so forth.TSquared@aye, i wonder if that's possible too;
Frank@ For a second there I wondered how you knew than i noticed your location is Beijing. It's kinda cool to be censored by the Great Wall though : )
#15
@Daniel: those are the crossbow projectile's explosion decals.
I always thought the exploding crossbow bolt was silly. The effect of them remaining in the world is from using arrow shaped debris, so yes, all in script. They fade after time, but can easily be made permanent, also in script. But that would look odd on a moving object like the player or a vehicle as they wouldn't move with it.
09/01/2008 (8:22 am)
It all builds upon existing groundwork already in Torque. It can easily be extended to vehicles and players also. You can use any modeling strategy you wish to use. I originally was working with animation sequences in fact, but mesh hiding would work just as well and as simply. Only it requires source code changes, and we wanted to demonstrate that destructible environments are more than possible in 'stock' Torque.@Daniel: those are the crossbow projectile's explosion decals.
I always thought the exploding crossbow bolt was silly. The effect of them remaining in the world is from using arrow shaped debris, so yes, all in script. They fade after time, but can easily be made permanent, also in script. But that would look odd on a moving object like the player or a vehicle as they wouldn't move with it.
#16
Apparatus, did you record the demo on the WeGame software, or a commercial one? I was wondering if the WeGame recorder works with TGE or not.
09/01/2008 (4:30 pm)
Quote:They fade after time, but can easily be made permanent, also in script. But that would look odd on a moving object like the player or a vehicle as they wouldn't move with it.There is a resource out which allowed projectiles to stick out of players. It was a huge resource though, and I'm not sure if all of it is up to date with 1.5.2 however. That is a modification best left to the source, I can't think of any way to add arrows sticking out of non-static objects in script that wouldn't just overcomplicate things. If you'd like arrows to stick right out of the object instead of using a debris, you could just add a static arrow shape transformed by the collision's normal. Than schedule a delete a bit later.
Apparatus, did you record the demo on the WeGame software, or a commercial one? I was wondering if the WeGame recorder works with TGE or not.
#17
09/01/2008 (5:07 pm)
weGame does not work with TGE unfortunately. Still looking up ways to record sound ~ or ways to replace the sound library in TGE altogether that is :))
#18
09/02/2008 (6:41 pm)
Almost every one of Apparatus's blog posts need one of these, but better late than never.
#19
In fact, thanks GG, and thanks Community too!
App.
09/02/2008 (6:54 pm)
Wooops, I did it. Thank you Deborah! Big thanks to SilentMike for the great help on this one as well.In fact, thanks GG, and thanks Community too!
App.
Torque Owner Morrock