Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
Reference video: youtube.com/watch?v=3lxjAVGcPCk&feature=related –  Daniel Aug 6 '11 at 2:17
2  
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
add comment

2 Answers

up vote 26 down vote accepted

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,

enter image description here

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

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

enter image description here Then added detail meshes around the destroyed section.

enter image description here

And the final step is to add the destruction mask.

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)

share|improve this answer
8  
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
add comment

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.

share|improve this answer
    
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? –  Nick Wiggill Aug 6 '11 at 9:59
1  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.