Material based damage engine
by Adam Al-Ahmary · in General Discussion · 05/20/2005 (12:56 pm) · 6 replies
Hi
I am a big fan of physic simulations and the torque engine. I have set aside money to purchase the torque engine in july along with the early adopter torque shader engine license. I would like to know how to get started making a damage engine/simulation like that of carmaggedon 2 but with emphasis on applying it to the torque engine.
I am enamored with the whole material based damage simulation concept as well but I understand that I am not even close to being capable of doing that yet. I do want to know how feasible it is to attempt to try something like this in conjunction with the torque engine as well as how I would begin to properly think about this.
If I am not using the correct terminology to phrase my question feel free to correct me.
Thanks
Adam
I am a big fan of physic simulations and the torque engine. I have set aside money to purchase the torque engine in july along with the early adopter torque shader engine license. I would like to know how to get started making a damage engine/simulation like that of carmaggedon 2 but with emphasis on applying it to the torque engine.
I am enamored with the whole material based damage simulation concept as well but I understand that I am not even close to being capable of doing that yet. I do want to know how feasible it is to attempt to try something like this in conjunction with the torque engine as well as how I would begin to properly think about this.
If I am not using the correct terminology to phrase my question feel free to correct me.
Thanks
Adam
#2
05/20/2005 (2:52 pm)
I think he means like Counter-Strike models materials? Example: you shoot at metal, your bullet doesn't penetrate, but it will through wood.
#3
One (kinda inefficient I'd think) way to do this in script:
You'd have to do a lot of ray-casting.
Each penetratable object and penetrating weapon would need datablock information describing how they interact.
1) break up building-type-shapes (.dts?) into a number of different masks.
2) Each weapon would need to have a "penetration" mask of materials it couldn't penetrate. Building this into each weapon's datablock would allow for relatively easy twidling I'd think.
3) It'd also need a list of materials it would go through at reduced damage.
You'd then cast a ray multiple times:
1) Things the projectile couldn't penetrate
If nothing was found in step one:
2) Things the projectile could penetrate, but at reduced damage.
I'm not at all sure how you'd determine how much of an object you'd passed through if you wanted to reduce damage based on "thickness". Hmmm... Then again:
1) Having cast the first ray, you'd have a point of impact on the material.
2) Casting a ray back at it from some distance down the ray would give you a point on the other side. You could then just measure the distance between them.... (though this could break for concave shapes: shapes that might have hollows/dents/etc in them, where the ray might pass through some space that isn't filled by the shape in question). I have No Idea if the ray-caster can look for collision with a specific object though. Hmmm.
Poking around the site, I've noticed that ray casting is done from a container. It may be possible to add only the object you initially collided with to a container and cast a ray within it to check for the "other side", though this still doesn't fix problems with concave meshes.
05/20/2005 (4:09 pm)
Counterstrike-style penetration:One (kinda inefficient I'd think) way to do this in script:
You'd have to do a lot of ray-casting.
Each penetratable object and penetrating weapon would need datablock information describing how they interact.
1) break up building-type-shapes (.dts?) into a number of different masks.
2) Each weapon would need to have a "penetration" mask of materials it couldn't penetrate. Building this into each weapon's datablock would allow for relatively easy twidling I'd think.
3) It'd also need a list of materials it would go through at reduced damage.
You'd then cast a ray multiple times:
1) Things the projectile couldn't penetrate
If nothing was found in step one:
2) Things the projectile could penetrate, but at reduced damage.
I'm not at all sure how you'd determine how much of an object you'd passed through if you wanted to reduce damage based on "thickness". Hmmm... Then again:
1) Having cast the first ray, you'd have a point of impact on the material.
2) Casting a ray back at it from some distance down the ray would give you a point on the other side. You could then just measure the distance between them.... (though this could break for concave shapes: shapes that might have hollows/dents/etc in them, where the ray might pass through some space that isn't filled by the shape in question). I have No Idea if the ray-caster can look for collision with a specific object though. Hmmm.
Poking around the site, I've noticed that ray casting is done from a container. It may be possible to add only the object you initially collided with to a container and cast a ray within it to check for the "other side", though this still doesn't fix problems with concave meshes.
#4
One neat way to possibly to it would be simply to make bullets not detect collision. Instead they simply travel along and deal damage untill they dealt 100% of their value, and then they die. Yet that would involve giving everything some type of barrier rating. Thus when a 9mm pistol shoots a steel plate it's damage value would be something like 2, and the steels barrier rating might be 4. So the round dies right there. Then if the same round hits say a wooden fence with a barrier rating of 1. Then the round will deal it 1, and continue on with a damage rating of 1.
Although anyway you slice it that would be a lot of extra computing with modern weapons. Perhaps a better way would be just to set certain walls, etc. as passable by projectiles. Wouldn't be entirely realistic but better than nothing. Then the round only needs to check if it can pass through the object struck. Then have a method of setting what each weapons prjectile can pass through.
I've always been annoyed by games where your firing a .308 at a guy behind some barrels, and they just bounce off.
05/21/2005 (8:38 pm)
Don't forget that rounds going through objects change direction, and slow down. lolOne neat way to possibly to it would be simply to make bullets not detect collision. Instead they simply travel along and deal damage untill they dealt 100% of their value, and then they die. Yet that would involve giving everything some type of barrier rating. Thus when a 9mm pistol shoots a steel plate it's damage value would be something like 2, and the steels barrier rating might be 4. So the round dies right there. Then if the same round hits say a wooden fence with a barrier rating of 1. Then the round will deal it 1, and continue on with a damage rating of 1.
Although anyway you slice it that would be a lot of extra computing with modern weapons. Perhaps a better way would be just to set certain walls, etc. as passable by projectiles. Wouldn't be entirely realistic but better than nothing. Then the round only needs to check if it can pass through the object struck. Then have a method of setting what each weapons prjectile can pass through.
I've always been annoyed by games where your firing a .308 at a guy behind some barrels, and they just bounce off.
#5
Velocity is self explanatory, its how fast the object is travelling.
Mass is how much the object weighs. For example a heavy projectile does not have to travel as fast to impart the same impact as a lighter projectile.
Penetration factor, well, is it a steel core, copper jacket, frangible, or just soft lead?
Armour factor. The difference between wood and steel plate.
Velocity, Mass and Penetration against Armour determine whether or not the object penetrates/passes through the target. Penetrating affects velocity in proportion to its total penetration factor.
I'm wrapping my head around the maths, and hopefully I'll share the results. Add in 3d decals, and it will rock. Not quite Red Faction or Soldner, but true enviromental interaction with projectiles will be possible.
05/23/2005 (3:39 pm)
I'm thinking about doing it with velocity, mass and penetration factor against an armour factor. Using those, you can work out unique damage and whether the object penetrates or not.Velocity is self explanatory, its how fast the object is travelling.
Mass is how much the object weighs. For example a heavy projectile does not have to travel as fast to impart the same impact as a lighter projectile.
Penetration factor, well, is it a steel core, copper jacket, frangible, or just soft lead?
Armour factor. The difference between wood and steel plate.
Velocity, Mass and Penetration against Armour determine whether or not the object penetrates/passes through the target. Penetrating affects velocity in proportion to its total penetration factor.
I'm wrapping my head around the maths, and hopefully I'll share the results. Add in 3d decals, and it will rock. Not quite Red Faction or Soldner, but true enviromental interaction with projectiles will be possible.
#6
i recently learned that certain ultra-high energy cosmic rays
are just a single proton, but with the momentum of a fastball !
.. that means if you had just one gram of such ultra-high energy protons,
you'd have the momentum of about 10^24 fastballs !
(that's about 1,000,000,000,000,000,000,000,000 fastballs)
(edit: originally had way too many zeros)
05/23/2005 (4:16 pm)
Totally, insanely off-topic, buti recently learned that certain ultra-high energy cosmic rays
are just a single proton, but with the momentum of a fastball !
.. that means if you had just one gram of such ultra-high energy protons,
you'd have the momentum of about 10^24 fastballs !
(that's about 1,000,000,000,000,000,000,000,000 fastballs)
(edit: originally had way too many zeros)
Torque 3D Owner Stephen Zepp