Search Unity

2017.2 Tilemap Vs Sprites

Discussion in '2D' started by RosieGarden, Oct 16, 2017.

  1. RosieGarden

    RosieGarden

    Joined:
    May 4, 2013
    Posts:
    33
    Does the new tilemap feature in 2017.2 offer any performance improvements over using sprites?

    Since my game will be procedural anyway, it doesn't make much difference in ease of use between using the tilemap, or just placing the tiles manually via code.

    So I'm wondering, does the tilemap have a more optimized renderer that will give better performance, or is it pretty much the same as using lots of sprite objects?
     
  2. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    982
    Haven't looked at it but I'm reasonably sure it's going to be packing tiles into chunks of larger meshes. This will reduce the work needed to perform dynamic batching as well as significantly reduce draw calls when using real time lights.
     
  3. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    I'm not sure about the details, but using a Tilemap is going to be much more efficient than placing sprites as game objects. You can test this by placing a few thousand sprite game objects in a scene vs. a few thousand tiles in a tilemap. A tilemap is a single game object.
     
  4. naryk86

    naryk86

    Joined:
    May 28, 2017
    Posts:
    4
    But with tilemap it is not possible create prefabs with "pieces" of ground (for example, a prefab with flat ground, another one of water with some ground platforms...) to use for 2D sidescroller games like infinite runner... or it is possible?
     
  5. AssembledVS

    AssembledVS

    Joined:
    Feb 23, 2014
    Posts:
    248
    Tilemaps are game objects like any other, and yes, you can make prefabs out of them. This means that you can instantiate them via script as well.

    I think that you should take a look at the tilemap, which is included in the latest version of Unity.