Search Unity

2D Sprite Shape VS 2D Tilemaps - When to use what?

Discussion in '2D' started by GazingUp, Oct 25, 2021.

  1. GazingUp

    GazingUp

    Joined:
    Jun 16, 2015
    Posts:
    271
    I recently found out about sprite shapes and seem to be rather easier to work with but I was wondering what the pros/cons were with Sprite Shapes and Tilemaps, if anyone's got an opinion? I couldn't really find any comparison between the two.
     
  2. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    nothing to do with one another

    sprite shape is to deform sprites

    tilemaps is to set tiles
     
  3. GazingUp

    GazingUp

    Joined:
    Jun 16, 2015
    Posts:
    271
    But you could use sprite shapes to design entire levels. You can use tilemaps to do the same as well. Sooo why would one use one or the other?
     
    N8W1nD likes this.
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    Mostly it comes down to whether you want to paint your levels using a regular geometric grid and even potentially move your characters strictly using that grid although that part isn't a necessity. You can reuse tiles all over the place allowing a pretty detailed design over large areas without having large textures or simpler repeating textures. Tiles work well with isometric (2.5D) views. However you need to author your art using tiles so that's your design decision.

    SpriteShapes can give you more control over simpler Sprites allowing a more "organic feel" to them but whilst they are powerful, they may not be suited to a specific game design because each and every part of it is a unique object you need to tweak.

    Very quickly it becomes one of, what does my game design require and what would be most suitable for those requirements, not the other way around.

    For any game design, one approach will feel awkward and the other less so, potentially both might and you need to use another approach. Personally,
     
  5. GazingUp

    GazingUp

    Joined:
    Jun 16, 2015
    Posts:
    271
    So I guess if a 2d platformer needs a bit more organic feel to the level design, Sprite shapes are better? Or do designers use both?
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    "Better". Maybe better for your project. You seem to be looking for absolute rules before you even know your design. It might be "better" for your design in terms of it being easier, more flexible to achieve your goals but it doesn't make it absolutely "better". It also might be more restrictive.

    Is wallpaper better than paint? Same thing, what are your design goals.

    I'm not trying to dodge a question here though. It simply comes down to understanding what the pros/cons of each are by using them and then decide, in the face of your design, which technology best suits.
     
  7. GazingUp

    GazingUp

    Joined:
    Jun 16, 2015
    Posts:
    271
    Makes sense. Thank you. I've only used tilemaps for all these years and just found out about Sprite shapes last week and was curious about the two.
     
  8. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Hey @GazingUp, I thought that's a great question. I just wanted to chime in here.

    Did you know that we have a relatively new-ish downloaded 2D demo called the Dragon Crashers which is available for free in the Asset Store. This demo uses Tilemaps for the Grounds and Walls and Sprite Shapes for the more organic elements such as the rail tracks similar to @MelvMay's point.

    Dragon Crashers (1).png

    Also for pixel art games which requires strict pixel fidelity of 8/16/32 bit like Stardew Valley or Terraria, Tilemaps may sometimes be a better choice (over Sprite Shapes). :)
     
    keineisteinek and GazingUp like this.
  9. GazingUp

    GazingUp

    Joined:
    Jun 16, 2015
    Posts:
    271
    Thank you for the response. I think I understand now. For pixel art games, for pixel perfect gameplay, tilemaps are the way to go. If not, Sprite shapes are better. It's also good to know that Sprite shapes can be used for organic elements on top of tilemaps.
     
    Xiangting_Su likes this.
  10. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    253
    Yes, you got it! Feel free to play or experiement with either of them as they are both really powerful and extensible tools. There'll also be times where we may need to deviate from these "guidelines" depending on what the outcomes are and that's completely okay too. So long it achieves what you want. :)