30
\$\begingroup\$

How did the folks at EA DICE create destructible environments in Battlefield Bad Company 2 and Battlefield 3?

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.

\$\endgroup\$

closed as off-topic by Gnemlock, Vaillancourt, Engineer, DMGregory, Josh May 16 '17 at 16:05

  • This question does not appear to be about game development within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Reference video: youtube.com/watch?v=3lxjAVGcPCk&feature=related \$\endgroup\$ – deceleratedcaviar Aug 6 '11 at 2:17
  • 2
    \$\begingroup\$ 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. \$\endgroup\$ – Quazi Irfan Aug 6 '11 at 8:28
  • 4
    \$\begingroup\$ I'm voting to close this question as off-topic because it asks how a specific publisher creates a specific mechanic in a specific game. Typically, we can not tell you for sure without speculation, and as such, these questions are off-topic. Generally, we would ask how to create such a mechanic, ourselves, but I feel that this question is to old to provide any tangible benefit from doing so. \$\endgroup\$ – Gnemlock May 12 '17 at 8:03
27
\$\begingroup\$

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)

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

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ 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.) \$\endgroup\$ – Lars Viklund Aug 6 '11 at 22:40

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