How'd they do it: Destructible environments in BF:BC2 and BF3

How did the folks at Dice create the destructible environments in the more recent Battlefield games?

Did they just assemble the buildings out of predefined sub-regions that break apart when there is an explosion or something similar? I can't think of anything else.

-
Reference video: youtube.com/watch?v=3lxjAVGcPCk&feature=related – dcousens Aug 6 '11 at 2:17
There are 2 documents on destruction & deformation of Frostbite Engine under the publication section in the website of DICE. One is under Thesis category and another is under Rendering category. – iamcreasy Aug 6 '11 at 8:28

To put it simply yes that what they do. But the go an extra length to cover up the straight edges using destruction mask. After removing the part of the geometry, they add detailed mesh around the destroyed section to make it look believable.

Here is how it works,

When destroying a part of this house, they begin by removing a piece of the geometry

Then added detail meshes around the destroyed section.

They also use particle effects and mesh debris for more dramatic look.

(All the reference is taken from those 2 publications I mentioned in the comment)

-
Well the particles do look dramatic, but it does also allow geometry swap to be hidden from the player by smoke and whatnot. – AttackingHobo Aug 6 '11 at 8:51

This is CSG -- Constructive Solid Geometry (although in this case, it's destructive, strictly speaking), if you want to do more research on how the algorithms actually work.

The standard approach is to use the two existing meshes A & B (the house and the subtracted "explosion" volume) to generate a third "mesh" (graph) where the two meshes planes and edges intersect, C -- which describes the area they share. In 2D:

``````      / \
/   \
/  A  \
|   |
| /-|-\
| |C| |
---  ----- | ------- G
|  B|
\---/
``````

A is the house, B is the is the explosion volume, C is the union / intersective area between A and B. G is the ground.

The mathematics / logic behind it is not trivial, as there are many edge cases to deal with and half or more of this task is just recognising which of the possible types of outcome graphs are special cases which need to be catered for in code. I've seen the problem described by the veterans on gamedev.net as "a very hard problem" and I can tell you from attempting it in 2D, even, and having a moderate degree of success where only a couple of edge cases fail, that it is no small task.

A way that might be easier is to use a polygon decomposition algorithm, and use the geometry that creates as a basis for your geometry destruction instead.

-
Anonymous downvoter, care to comment on your attitude? Please go and read the stackexchange FAQ, and tell me how this answer is non-constructive? Or just hide in the shadows? – Arcane Engineer Aug 6 '11 at 9:59
It might have been downvoted because it was not overly related to the question, as it asked about the methods used for a particular game. Stegmayr's thesis was written while BF:BC2 was developed - so the methods and results achieved in it probably have influenced the design of the destruction system. Sadly though, it does not seem to have survived intact into the game itself, which is not uncommon when it comes to new techniques in R&D. (And no, I didn't/can't do it.) – Lars Viklund Aug 6 '11 at 22:40