Unity3D Building Damage Tutorial

Introduction
There are many ways to implement damage model for buildings. Usually, there are two ditinct methods.
 * 1) Static Damage Model
 * 2) Dynamic Damage Model

1. Static Damage Model

 * In this way, the artist creates a few "stages" of destruction, usually as diffrent meshes, or textures. During the game, as a result of inflicted damage, the models are swapped, thus creating dectruction immersion. Advantages of this method are clear. It is of small computing cost (no need for difficult simulation) and moreover, pre-modelled damage can be very difficult. In other hand, every time an oject is damaged, the destruction is the same, so player can lose the immerion of reality. In addition sometimes, predefined models "don't match" the way the tructure was damaged.



2. Dynamic Damage Model

 * Here, the damages are simulated in runtime, during the play. The way structure is affected (place, energy) ha effect on the destruction. The main advantage of this, is the superior immersion of reality. Moreover, well developed damage model can reduce the time necessary to produce pre-produced models od damaged buildings. Unfortunately, simulating a destruction is usually extremaly time-consuming, as a result negatively inflicting framerates.

Of course things which i've written here are very simplified. Usually damage model is somehow mixture of this two above. For example, a building consits of number of "static-damage" objects, but overall reaction of structure is proceeded dynamicly.

Anyway, my aim in this series of "articles/tutorials" i to produce of fairly simple damage model of wooden cabin, which is being burned. No bombs, no tornadoes, just fire. To make it simpler i will work on single verticles of mesh, not predefined "chunks".

Envoriment
I am using Unity3D 4.1.5f with MonoDevelop 2.8.2 added to it. The map i'm going to develop is from great RTS creating tutorial in Elgar's Code Mustings blog, part XIII. I've slightly modified it by adding Multiple units selection and enhanced HUD. I am going to code only in C#, for now.

Parts

 * 1) Part I - Mehes in Unity3D
 * 2) Part II - MeshManager Class
 * 3) Part IIb - Verticle Class
 * 4) Part III - Simple Damage
 * 5) Files version 1
 * 6) Part IV - Simple Fire
 * 7)  Part V - Thick Mesh
 * 8) Part V b - Thick Mesh in diffrent way
 * 9) Part VI - Walls between Alias and Twin
 * 10) Part VII - Optimalisation
 * 11) Part VIII - Simple UV and Normals problem
 * 12) Part IX - Branches
 * 13) Part X - Health, damage spreading and open edges
 * 14) Part XI - Hovering parts destruction
 * 15) Part XII - Classes architecture modification