Friday, February 4, 2011

Widespread Demolition

Target the support columns near the
base and rest comes tumbling down.
The assignment was to create a completely destructible environment in an open world game. A lofty goal for sure. Physics were already routinely used for small inconsequential objects in the world like crates and barrels, and for sparsely positioned landmark objectives (e.g. gates, walls, and other player impediments). We were planning to add physics to where it mattered during game play... and in an open world game, game play is EVERYWHERE. Whole city blocks would need to be leveled to advance objectives and the player would be provided with wildly creative ways to do so.

The entire city would need to have the capacity to be flattened by the player. No structure would be able to withstand any substantial blast, be it from mortal shells, rocket fire, missile launches by a gunship circling overhead, or even by the gunship itself, should it be shot down and crash into a building.  Every building would be destructible.

Such a task is daunting for a "normal" level, but how do we find a solution for an open world game? Nearly impossible right? Well, nearly...

The biggest problem was frame rate. Buildings are large objects, which when destroyed, break apart into millions of pieces. The bigger the building, the more pieces on screen requiring physics, the more calculations needed to be performed. All attempts to make a structure break apart in believable fashion, with dozens if not hundreds of chunks of debris, would give the engine a heart attack. The small quantity of physics objects the engine could handle was paltry and the destruction of large structures looked horribly cheap. The only option available from our old engine was to have the entire building, as a whole sink, into the ground. No amount of smoke and dust effects could make a building 'slide' into the earth and not look absolutely ridiculous.

We needed the buildings to break apart like buildings should. Walls needed to be blown away to expose interior space, chunks had to break off and fall to the ground and explode to even more chunks. Buildings needed to tilt and topple over, and whole floors whose support columns have been compromised needed to be flattened in succession like pancakes.

We needed a LOT of physics. We didn't have a lot of room for physics.

The breakthrough came with a proprietary debris system that split the difference between effects and physics. If debris pieces could be stripped to their bare minimum in terms of physics, (i.e. contain very simple collision), they would not cost much more than effects. The system enabled us to load up our screen with hundreds of 3D meshes showering down upon the player and colliding with each other and the ground, but costing little more than regular 2D effects. This debris combined with smoke effects allowed us to cheat the number of real Havok chunks needed to mimic a destroyed building. We finally had the impossible look we were after.

With the technology now available, the challenge became developing the production pipeline to build such a level in a reasonable time frame. And the assets needed to be effiicient and streamlined to fit within engine limitations.

The environment artist was challenged with devising a system of creating buildings that used generics wall pieces specially designed for easy implementation of Havok destruction, but such that the buildings appeared unique and distinctive so that the level would not look repetitive. 

Modulation was key. All textures needed to adhere to strict guidelines. Every building would be designed from a template to maximize reusibility. Building size and floor heights had to be standardized. Shaders needed to be organized and components such as textures, alphas, grime maps, needed to be shared and be as interchangeable as often as possible. We partnered with technical artists to develop robust shaders that would open the path for environments to be built with flexibility and efficiency.

The system was built and our road map was laid out, but the project was put on hold. It remains buried somewhere under a mound of rubble... waiting to be resurrected.

No comments:

Post a Comment