dim3 Forum

Full Version: Destrucible landscapes/objects?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am currently trying to script a turn based game similar to Worms; however I am having issues with the landscape. Is there a way to make a destructible landscape and related objects, so that player attacks damage the landscape? I think you can do it with world objects, and I examined the barrel script to see if I could figure it out, but so far, no luck....


I was thinking of possibly making the terrain a mesh in and of itself, so that I could perform damage calculations as needed; however I neither know if that would be possible; if it would even be a feasible option, or what program I might try to use to do this.


Any help would be greatly appreciated!
Few games have destructible terrain. There may be a way, but I don't really know of one right now.

Destructible objects is fairly simple however, in the Object Script, look for the Damage/Dead(destroy) function. What you're going to want to do, is switch the object mesh to a destroyed looking mesh, and then fire several projectiles from the damage or destroy function. These projectiles would be parts of the object, but would each be their own model.

For instance, if you had a rock wall, you would give the rock wall model TWO meshes (animator meshes). One would be the standard mesh, non-damaged. The other would be the damaged mesh. In the function where the rock wall is destroyed, you would script the object to switch meshes, and then to fire lots of projectiles in different directions from the rock wall. These projectiles would be individual rocks. Thus, when you shoot the rock wall, the rock would blast off, and the wall would appear to be damaged from the missing rocks.

Make sense?
Ahhhhh, so what you're saying is to make two separate meshes, one damaged and one not, and when the required level of damage has been done to said object, the function in which the object is damaged or destroyed would switch to the damaged mesh, and at the same time fire projectiles that would appear to be pieces of whatever object was destroyed?


I think that would work; perhaps I could even use additional meshes as needed for different states of damage; I am of course correct in assuming that once said object is destroyed it would fade out, or would I have to script that myself? When players and the like die, I want their body to remain onscreen for a few moments, then slowly fade out.

I think the ability to script destructible terrain would be a nice addition to Dim3's functionality. That and a less complicated way to implement shaders; my kingdom for a reflective shader that simulates shiny surfaces!
Yes you understand correctly. Additional meshes for different states of damage would work fine. By default, a model does not fade out when the object is destroyed, you'll have to script that yourself, thankfully there is an API just for it.

A lot of us dimmers would LOVE to see cube-map reflections, however Brian is working on the Editor right now, so until he gets to working on the Engine, we'll have to wait.
Reference URL's