destroyable buildings

Blitz3D Forums/Blitz3D Beginners Area/destroyable buildings

hohde(Posted 2005) [#1]
Is there a smart way to do destroyable buildings in 3d. I was thinking about making lots of small models, and then making the building like a lego house, but I wonder if the amount of models (although very simple) could became a problem. Are you aware of better ways to do this?


Beaker(Posted 2005) [#2]
You could either make predefined animations (in your 3D modeller) using bones.
OR
Use some sort of single surface system to construct and deconstruct your buildings.

Don't forget that in your lego system that each block/brick will be a surface (as well as a model). Many surfaces will grind your game to a halt.


Dirk Krause(Posted 2005) [#3]
http://www.melax.com/csg/


jfk EO-11110(Posted 2005) [#4]
I solved this by pre created animated destruction sequences. This method is very limited. You may use LoadAnimSeq to apply multiple destruction animations to a building. You could use 3 phases of destruction, and 3 diffrent animation groups, thats 3*3=9 animations phases, phase 2 starts where phase 1 ends etc. This way the destruction wouldn't look the same all the time.

But the creation and animation of the buildings is pretty hard and also requires to use special tricks and a higher number of polygons.
In my engine I use animated objects for "walls that can be broken down by explosives":
The wall was made of a lot of pieces that are building an intact wall. The animation will then explode the pieces. (Additionally I use some particle FX here)

Here's the wall in the moment of the explosion:


And here after the explosion:


I used the same method for crates of explosives that will explode when the player shoots them.

Other game engines sometimes use realtime CSG (see code archives) that is altering a mesh, using carving etc. but it turned out that this is too slow for use in Blitzbasic. The game engines that are using realtime CSG are heavily optimized on a low, cpu-near level for that purpose.

A further method is to use multiple versions of the building and simply show and hide them, depending on the destruction state of the building. If you mix this with some explosion and smoke particle FX, it may look pretty good (especially in topdown adventure and sim stuff).


hohde(Posted 2005) [#5]
Thanks for the tips. I'll look into animations and CSG, although I think I'll end up using simple disappearing blocks with some particle FX for now. You mentioned too many surfaces will be a problem. What if the "game" is top-down and most of the surfaces won't be rendered? How many is too many?


jfk EO-11110(Posted 2005) [#6]
1 thousand or so, depends on the situation. you have to do some tests.


Ross C(Posted 2005) [#7]
I've found that about 100 surfaces, depends on your machine, produces slow results on my computer. Depends on a lot of factors tho...