destructible terrain

recently i became interested in destructible terrain and i wanted to see what i could do with blender. i came up with a roundabout solution, after several others failed, but it kinda works. feedback would be appreciated, as well as other ideas/suggestions.


tank.blend (899 KB)


I don’t do the BGE yet, but I downloaded this file for my son for him to look at after dinner.
Just trying it quickly, it crashes my 2.5 (r29567) when I press P.

Looks cool though! :slight_smile:

Pretty neat dude :smiley: I can however see lines between the segments.

I had a true terrain deform file some time back, literally smashed the terrain. However the physics of the land did not follow. So practically it only looked like the land got smashed :stuck_out_tongue:

sorry, the scripts wont work in 2.5. its all in 2.49.

yeah, i’m okay with the lines for now. its only because each crater is a separate mesh (the only way to do it i think). its especially time consuming because you have to model, texture, and logic each crater separately.

i’d love some more ideas…

that is a realy interissting thing, but i think that you would need a more complex script.

You would need to place a layer of cubes as ground.
whenever there is a detonation point, like say a bomb hits the ground,
you would run the script.

this script would need to calculate how deep this explosion would be, direction etc,

then with all that data collected, you would simply remove all cubes that are in the detonation globa and place new ones around that globe.

Ofc this sounds simpler than it is, as you would need alot of other things to calculate as, if here can be a cube or not. But basicly ^^ that is what i have on my mind.

What i would not recommend is, to make like 1 bazzilion cubes and then simply remove it, that would kill your FPS.

greets Equal

Thanks for the blend, I will look through it to see how it worked.

Interesting solution, generally games that have terrain deformation just displace vertices and place a decal but as currently Blender can’t update physics meshes, that doesn’t work (it will in 2.5 though)

@Equal- What you’re aiming for is essentially volumetric terrain- it’s obscenely resource intensive, and pretty goofy looking (without any sort of smoothing between cubes, everything looks like it was made from legos)

here is a before and after picture.

i dont think that volumetric is the way to do it. what i wanted to do initially was just have a displacement modifier parented to an empty, and each explosion would add one, making bigger and bigger craters, but that doesnt work in BGE obviously. i tried 2.5 as well and couldnt make it work.


Updating a displacement modifier in realtime would be awesome. I won’t know what to do with myself if that ends up in 2.5.

i tried that in 2.5 and got a rather frustrating result. see, in 2.49 the modifier wouldnt show up at all in the GE. then, in 2.5 it would appear how it should have been, but the modifier wouldnt follow the empty that it was parented to. i dont really understand why.

Most, if not all modifiers are applied before the game starts, so they can’t be updated or changed in real time.

However, a much more efficient method would be to just displace the vertices through python, and a quick search on these forums should turn up at least a couple scripts for that. I know I and at least one other person have made scripts to that effect (I don’t remember if I put mine online though)