XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Damageable environments in a 2D scrolling level

Last post 6/2/2008 6:07 PM by Rick Bolton. 3 replies.
  • 5/30/2008 10:13 AM

    Damageable environments in a 2D scrolling level

    Hello. I'm totally new to XNA, and I also haven't done any games programming in a decade. Starting out on my project, I get the impression that the capabilities of modern hardware will allow me to get away with things that were pretty much impossible back in the day, but I'm not really sure how to best achieve what I want.

     Basically, I want a 2D scrolling level ranging from something like 10x10 to 20x20 screens in size. The rub is that I intend to make the walls and foreground scenery totally destroyable. My plan for this has always been to create a huge persistent damage bitmap, showing where the remaining solid ground is, and use that to stencil the graphic tiles (and also to run collision detection on). The Worms games do something like this, though I get the impression that holes are punched directly into the graphical bitmap, as it isn't that big. Would it still be a good idea to run a tiles/tilebrush engine with my stencil, or are modern platforms capable of running the whole thing as a persistent bitmap, as in Worms?

     Also, as I'm a novice in XNA, I'd be very grateful if anyone can point me in the direction of some decent 2D graphics tutorials. I'm particularly interested in possibilities for combining 3D models with my 2D backgrounds, and also zooming in and out.

  • 5/30/2008 5:55 PM In reply to

    Re: Damageable environments in a 2D scrolling level

    off of the top of my head, it seems like you could do what worms does, but break your level up into individual maps, each the size of a screen. You should only need to draw and do calculations on 2 maps at a time. It will still use a lot of ram to hold all the textures, but if you program it right you might be able to get away with it. (Again, I am a 2d scolling noob, but if I was just starting to build something like you want, that is how I'd start)

     

    EDIT: also, reading your post again. You could possibly break it up even more. Into say 128x128 tiles. Then when you want to apply damage or check collision, get all the tiles within a certain radius and check against those. That might help you do much less brute force work by not using those huge textures. The only problem is that with xna, I don't know how you would be able to store different instances of the same image so they could each have their own damage.


  • 6/1/2008 11:19 PM In reply to

    Re: Damageable environments in a 2D scrolling level

    I think this article may be exactly what you are looking for.  Ziggyware also has a great selection general graphic tutorials/articles.

    http://www.ziggyware.com/readarticle.php?article_id=154

     

  • 6/2/2008 6:07 PM In reply to

    Re: Damageable environments in a 2D scrolling level

    Thanks to both of you. The Ziggyware article looks promising - hopefully I can tailor it to what I want to do. I seem to have made my first XNA project more difficult than it needs to be by keeping the design in my head for something like eight years.
Page 1 of 1 (4 items) Previous Next