Building Destruction Demo - Stress Test

Good day dearest Unity Community

Over a year ago I started a small project of attempting real time building destruction however I never really got it to a point where I could use it in a real project.

It was just the other day that the idea sparked my interest once more so I decided to try and finish what I had started and even possibly try to implement it into another project that i’m working on.

Below is the very latest Demo that i’ve built. It comes in two scenes with two separate solutions.

Stress Test 1:
The destruction in this scene is not done procedurally, meaning that the destroyed bricks have been “pre-stacked” into prefabs and are simply re-created when the static wall is destroyed. A very primitive and yet efficient way of doing things.

Stress Test 2:
The destruction in this scene is done procedurally, meaning that the bricks are stacked in real-time. I’ve aimed to get a better performance than the 1st scene. The script can stack walls in all dimensions, there are some problems with the rotation though.

I’m not an expert in unity, and i’m very sure that there are more/better ways of approaching this problem.

Current Demo: http://users.tpg.com.au/arthur64//webBuild03.html

Any and all feedback is much appreciated. If it is not too much to ask, I’d also like to request some “performance results” from both scenes.

In the GUI you will find your current/minimum/maximum/average FPS results, if not too much to ask, i’d like you to post them :smile:

Controls:
WASD to move
Click to fire
Esc to pause/exit/panic mode

for those interested in the older demo I posted here a year + ago, here it is.

Old Demo: http://rohonora.webs.com/PhysTest_1.3_Web.html

controls:
WASD to move
Click to fire
2 to change to rocket launcher

Thank you all for watching/reading/testing :smile:

I like the overall look (nicely colored) and feel of the scene.
Of course, it is in early stages but you know how we expect advanced features,
like the buildings falling when enough of the support is removed…

:slight_smile:

Here is a video showing my stats:
http://hometime.net/building_destruction_demo/building_destruction_demo.html

So at any point do you combine the different pieces into one mesh through scripting? This of course saves a lot on draw calls.

If you haven’t read this approach yet by Peter from Sysiac, check it out:

Article: Sysiac Games
Demo: http://www.sysiac.com/destruction/Build_01.html

Thank you for the reply’s =D

For the buildings falling part, I have a solution however it doesn’t work properly, well not enough to showcase anyway!

For combining meshes, do you mean the meshes from which the building is built or the “crumbling” meshes when the building falls apart?

If it is the crumbling meshes, then I’m not sure how I could combine them as they are all individual physics objects with their own colliders. They do not stay in the scene for long as I have my trusty “Trash-Collector” script clean them up shortly after the building crumbles.

As not to overwhelm the system generally the more trash there is in the scene the faster they are destroyed. I should add a setting that allows the user to define the amount of crumbled units they would like to have in the scene at any one time.

well, all the pieces you combine into one mesh at the beginning. then, after it’s hit you delete that entire object and instantiate a new group, and those pieces that are affected react as per normal and gets destroyed.

the remaining “still standing” pieces you then combine into one mesh again. and so the process goes on and on…