Home Technical Talk

So, how do you make destructible 3d enviorments?

polycounter lvl 18
Offline / Send Message
HonkyPunch polycounter lvl 18
I'm talking Red Faction, Magic Carpet series, ETC
Various things like that, how do they pull it off?

Replies

  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Magic Carpet was just deforming heightmaps if I remember right. Easy enough, most engines are capable of it these days.

    Not sure how Red Faction handled it.

    You should probably check out the Battlefield Bad Company "Destruction" videos, it's got some footage and interviews which might shed some more light on that. Google it smile.gif
  • Rick Stirling
    Options
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    Often you build 2 or 3 or 4 versions, swapping models in and out.
  • aesir
    Options
    Offline / Send Message
    aesir polycounter lvl 18
    Eh, depends on how you mean.

    Lets say you have a game and you want to be able to shoot through a certain wall, exposing the room behind it. I think you'd create all the wall geometry like a normal wall, then right inside that wall, you make a bunch of wall pieces all jigsawed together. When the wall takes enough damage in game, you hide the solid wall, revealing all the pieces, which can then have an animation applied to them of them hitting the ground in certain ways, or some sort of dynamics solution used on them.

    That'd be my assumption for most things.
  • PolyHertz
    Options
    Online / Send Message
    PolyHertz polycount lvl 666
    I think what you'd do is actualy create a wall, make a bunch of closed slices into its surface, mirror them to the back, then detach each closed piece (without moving them) and bridge each of the opposing pieces to their coresponding one. After that apply gravity and force to them in an animation, and just have that play in the engine once the walls taken enough damage.
  • Rob Galanakis
    Options
    Offline / Send Message
    I think there are some tutorials on the half life/Source wiki about building destructible models and how they work. That said, procedural destruction like vegetation in Crysis is handled somewhat differently... how, I am not sure yet.
  • HonkyPunch
    Options
    Offline / Send Message
    HonkyPunch polycounter lvl 18
    I just assume with Crisis they had the trees as physics models (Given the way they sway in the wind) with strong anchor points that are indestructible (the trunks) and allow fracturing at the various "Bendable" joints.

    But thanks for the input.
    It's a little far ahead of what I need to know at this point (still working on the basics of making games, I still haven't made a comprehensive 3d model to this day)
    But it's still good to know.
  • Eric Chadwick
    Options
    Offline / Send Message
    I've read about some of the newer methods that don't use canned pre-broke meshes or anims. I have some threads saved at work, will break them out when I get in.

    IIRC the basic idea is to subdivide the mesh dynamically, at the contact point. You use an algorithm to determine the shapes of the chunks (max/min sizes, avoiding degenerate faces, aesthetically-pleasing shapes, etc.). You bridge/cap the internal parts between inside and outside shells, to make the chunks "solid". Then let them react to physics, using ellipsoid or cubic collision meshes for speed.

    Not much artist input though, since it's programmatic "live" meshing. Artist would provide inner-wall textures, also ancilliary effects like dust/particles, etc.

    Problems with gameplay though, like if you let the player destroy every wall, does the whole building tumble? How do you update all the NPC pathfinding? Creates problems with controlling flow of the level, maintaining fun factor. Also performance issues, can't cull those interiors revealed by the cuts. Performance gets worse as you cull less.

    Portal solved it kind of, by restricting # of recursions, special rendering tricks like rendering it all in one buffer, etc. Probably not transferrable to random-edged/sized cuts though. Dev commentary was cool.

    Crysis' trees don't use canned cut points as far as I can see, but they do limit the smallest log length. You can also see when you play at full rez that they replace the initial super-spiky interior with a simpler flatter interior after it breaks.

    Just shootin the shit here, haven't played with any of this. Remember the zombie demo has limited stuff going on there, not a full game enviro + NPCs etc. Very simple lighting, etc.

    Cool topic. Will try to dredge up the programmer threads I saved off.
  • HonkyPunch
    Options
    Offline / Send Message
    HonkyPunch polycounter lvl 18
    hmmm, that's true.
    Although I'd imagine if crisis could do it with multiple trees being broken (such as a major explosion or tornado)
    then a game could do the same with the zombie shit.
    I'm simply interested, because I enjoy coding, but can't be arsed to sit and learn it (hence my GD thread)
  • Rob Galanakis
    Options
    Offline / Send Message
    Crysis vegetation "physics" is explained in GPU Gems3. Not the destructible stuff, though... Eric is probably in the right vein but I'd really like to know more. And you can probably get a good idea, too, from playing with the editor.

    But yes, most games (ie, Stranglehold), use swapping of models.
  • HonkyPunch
    Options
    Offline / Send Message
    HonkyPunch polycounter lvl 18
    BLAH
    Motherfucking crisis doesn't run on any of my computers reminding me of why i'm fed up with all this next gen dickery.
    I LOVE old games like magic carpet.
    SO much more potential there. I want to make a game with an expansive universe to explore with destructible environment, awesome rpg elements, hundreds of npcs....
    Particle physics...
    Just a giant fucking game with oldschool graphics and a good art direction.
  • East
    Options
    Offline / Send Message
    East polycounter lvl 14
    Hehe, so stop complaining and make that game then tongue.gif Or buy a semi-modern PC.

    As for how Red Faction did it, I remember reading some scanned article from some magazine about it at some point. They got a bit technical about it, so my eyes just kinda glossed over..

    When it comes to Bad Company, judging by the movies released by EA/DICE, destruction is not as dynamic as they want you to believe. Might just be alpha/beta-footage, though, but my eyes keep picking up patterns in the damage done..
  • Eric Chadwick
    Options
    Offline / Send Message
    Sumotori Dreams should run on your pc.
    http://www.youtube.com/watch?v=fwn90ULOlHA

    Uses dynamic fracturing for the menus and the walls. Find the hidden part and you can shoot all the walls apart. Pretty cool.

    Oh yeah, and there's a mod for the Crysis demo that exposes the non-demo weapons. If you shoot the nuke into the palms, it sways them all outward from the blast but none of them break! Not calibrated I guess.

    Besides, a huge number of chunks raises the entity-transform cost, slowing performance. Games fade out your bullet-hits and dead enemies for a reason.
  • Jesse Moody
    Options
    Offline / Send Message
    Jesse Moody polycounter lvl 17
    Check out the tech demos for the new Star Wars game. The Force Unleashed.

    Stranglehold was swapping of meshes.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    really old but small info on original red faction http://john.slagel.com/Geomods.html

    there used to be another site by one of the geomod coders, who also did tools for physx, (had maxscript tools on convex hull mesh), but I lost the link to it...
  • HonkyPunch
    Options
    Offline / Send Message
    HonkyPunch polycounter lvl 18
    Yeah I need to stop pissing and moaning about everything and actually do stuff so i think disconnect my internet now.
  • doc rob
Sign In or Register to comment.