Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2D Map Destruction

Discussion in '2D' started by xVishera, Mar 24, 2015.

  1. xVishera

    xVishera

    Joined:
    Mar 24, 2015
    Posts:
    4
    Hello Folks!

    I'm wondering about the best way to destroy some points of a 2D map, just like Worms !
    After playing worms on Android for a while, I noticed that the map was builded on runtime.

    Someone know a good way to make something like it ?

    Regards
     
  2. DallyMoore

    DallyMoore

    Joined:
    Mar 17, 2015
    Posts:
    9
    xVishera likes this.
  3. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    I think I'd just use tile maps for it. For efficiency 2 layers. Most of the terrain would be 16x16 or 32x32 tiles (or larger it all depends on your target resolution). A second layer would be 4x4 or 8x8 tiles. Whenever terrain is destroyed... if a tile exists in the low res (big tile) layer then it is removed and that area in the corresponding high res (small tile) layer has tiles added to it. In all cases process the impact on the high res layer. Animating those little tiles showing destruction and leaving them a bit rough looking or simply rounded down.

    This way you get the benefit of the majority of the terrain being displayed from the larger tiles (less game objects) while getting the benefit of the high resolution layer (which will only exist across the top of the terrain and where an impact has occurred).

    Haven't actually made such a game but off the top of my head that is how I would approach it.
     
    xVishera likes this.
  4. xVishera

    xVishera

    Joined:
    Mar 24, 2015
    Posts:
    4
    Hmm , Thanks for the links @DallyMoore

    @GarBenjamin , is a good idea , but doing it this way it will be difficult to have a nice background ... I was thinking of something like a static image as a background , a 4x4 / 8x8 " platform " , and when the ground be destroyed , I'll remove these tiles in the impact area . But it will be difficult to build a great platform based on this idea.
     
  5. sleekdigital

    sleekdigital

    Joined:
    May 31, 2012
    Posts:
    133