Home Technical Talk

Ways to destroy buildings for game.

JoseConseco
greentooth
Offline / Send Message
JoseConseco greentooth
Hi, I would like to know what interesting methods are there for destroying buildings. I spotted this paper of Valve about wound, and it looks promising as way for destroying buildings too.
I would like to avoid physics simulations, but at same time I would like to get some of variation in destruction depending from with direction the blast come. So simple swapping building by it's damaged version is not what I want. Is Valve paper mentioned above good for this kind of thing, or are there any better solutions?

Replies

  • commander_keen
    Offline / Send Message
    commander_keen polycounter lvl 18
    It kinda depends on what you are trying to do. I have only quickly looked over that valve paper, but it seems like its pretty expensive. If you had a few hundred destruction cuts on screen it would probably get pretty slow. If you only need 20 or so on screen and dont need to actually change the collision of the mesh then you could do something like that.

    If you need a lot more on screen you probably want to actually modify the mesh its self on destruction so it only has to render a simple mesh each frame. If the building is not too high res you could do that with some really optimized booleans over a few frames, then add some chunky debris pieces around the edges of destruction.

    I made a very simple building destruction prototype that was designed to be very fast and work on low res buildings where there could be a destruction event happening pretty much every frame.

    [ame="http://www.youtube.com/watch?v=-4ARFZ_rgqQ"]Simple Procedural Destruction - YouTube[/ame]

    Its done by setting vertex color data every time an impact happens and then alpha testing with those colors in the shader to blend out to destruction (you could mix in a destroyed texture and a rebar/debris texture to make the edges look broken). After the vertex colors are set, any triangles with blacked out vertex colors are removed to update collision. Of course this only works on low res buildings with paper thin walls, and the buildings need a uniform tessellation.
  • JoseConseco
    Offline / Send Message
    JoseConseco greentooth
    commander_keen, your example looks promising. Bout valve paper, it seems fast cos I played it with lots of infested terrans and there was no real slowdown.
    Would your technique work with thick walls?
    I guess it would be possible to blend alpha based on mix of vertex color and some dirt texture, so edges wouldn't be so simple, right? I would like to have more jagged edges with some thickness.
Sign In or Register to comment.