TileMap Vs Tile Sprites

0 favourites
  • 5 posts
From the Asset Store
Piano tiles
$9.99 USD
Template for a piano tiles game, fully documented in comments and video
  • I couldn't find any Up to date Blog talking about this, all the ones I found are quite old and I'm not sure if the content was useful related to this year.

    I have for a long Time a battle with my self (shall I use Sprite as Tile or a TileMap) as from the blogs that I found it wasn't really clear how it works the (draws calls) in those two cases and the differences between them that's why I decided to ask to clear up the mess I have in my brain and to be able to choose wisely depends on the type of Game that is been created.

    I'm gonna give an example so I can understand it better

    Let's say I need a total of 400 Tiles on the Map and for this, I have 4 different "Graphics" tiles that I need to use in the whole Map at the same time so it will be mixed between this 4 Tiles

    1-

    If I use Sprites Tiles = how many draws calls will it use?

    If I use TileMap = how many draws calls will it use?

    2-How do you calculate which is the best option (TileMap or SpriteTiles) to choose depends on the Type of Game you are creating.

    3-From this blog post, I quote from "INCREDIBLE TILEMAP PERFORMANCE"

    https://www.construct.net/gb/blogs/construct-official-blog-1/announcing-the-construct-3-runtime-904

    [quote:xiiuzp66]The C2 runtime has to switch texture every time it draws a different tile. This has quite a high performance overhead, especially if every tile is different.

    If I'm gonna need (400 Tiles) using 4 different "Graphics" Tiles,

    will creating one Tilemap for each "Graphics" Tile with a total of four TileMap be the best option here?

    each Tilemap using just one "Graphics" Tile or is there another way of doing it better?

    Thank you

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don´t have that much insight on tilemaps but from what I understand...

    1

    The drawcalls will be the same. Each sprites needs a drawcall, each tile also does. This also means it´s not recommended to have single objects span over multiple tiles, because each tile will be rendered individually. So an entire tree is better off beeing a sprite rather than 20 tiles in a tilemap. I think though there is more going on in regards to rendering. Also:

    [quote:144y045s]Tilemaps also have significant performance benefits over achieving the same results with other kinds of objects, such as arranging a grid of Sprites. The Tilemap object can optimise collision detection and rendering in a way that scales well even with extremely large Tilemap objects.

    I have no idea how impactful this is though, considering construct already uses collision cells and basically doesn´t render anything outside the viewport and such. On a sidenote, people have been building some cool stuff using 1x1 pixel tilemaps, where there are several thousands of 1 pixel sized tiles on the layout with no performance impacts. Maybe Ashley has better answers to that. It also has some downsides though, that´s why I personally never really liked working with tilemaps. For example, you cannot animate tiles and I generally found it a bit cumbersome to work with for various reasons. It also depends on where you want to play the final product. For mobile it´s probably a better idea to use tilemaps because you wanna use that limited power well, on a PC you probably can get away with just using sprites, I don´t think you´d run into a bottleneck anytime soon on any reasonably modern machine.

    2

    Hard to say. If the game is entirely based on tiles, it´s probably a good idea to use a tilemap since it offers tools (like a drawing tool) that are not available with sprites. You have to keep the downsides in mind though. If you want to use animations in all your tiles except a few, you probably should just use sprites. I don´t think you can calculate it.

    3

    No, I doubt that using 4 tilemaps with 1 tile each is the way to go. You defenitely want to use one tilemap with 4 tiles.

    Also always a good thing, the manual --> https://www.construct.net/at/make-games ... ce/tilemap

  • [quote:31ijvx8s]The drawcalls will be the same. Each sprites needs a drawcall, each tile also does. This also means it´s not recommended to have single objects span over multiple tiles, because each tile will be rendered individually. So an entire tree is better off beeing a sprite rather than 20 tiles in a tilemap. I think though there is more going on in regards to rendering. Also:

    Interesting, so if you have 4 different (Animation Tiles) to use on 400 Tiles is not a good idea to use the TileMap I guess, unless I'm not understanding well, I thought that I read in other threads that if the Tiles are the same it counts the draw call as 1 but still were a bit confusing to understand as the TileMaps have many different Tiles animations

    [quote:31ijvx8s]It also has some downsides though, that´s why I personally never really liked working with tilemaps. For example, you cannot animate tiles and I generally found it a bit cumbersome to work with for various reasons.

    I agree is a bit messy and hard to follow the events once the project starts to get big as they don't have the option to use variables and booleans

    [quote:31ijvx8s]It also depends on where you want to play the final product. For mobile it´s probably a better idea to use tilemaps because you wanna use that limited power well, on a PC you probably can get away with just using sprites, I don´t think you´d run into a bottleneck anytime soon on any reasonably modern machine.

    The project is for Mobile any tiny performance gain is much Welcome

    2

    [quote:31ijvx8s]Hard to say. If the game is entirely based on tiles, it´s probably a good idea to use a tilemap since it offers tools (like a drawing tool) that are not available with sprites. You have to keep the downsides in mind though. If you want to use animations in all your tiles except a few, you probably should just use sprites. I don´t think you can calculate it.

    I guess there is no an easy "Equation" to assess who will be much better suited for the Job which is why I opened this thread to find out, is strange I read most of the Threads on this topic and the Manuals c2/c3 many times but yet I always end up more confusing as it doesn't give any clear guide to be able to choose wisely, I will have to keep looking

    WackyToaster Thanks for your Time

  • [quote:89k7o52y]4 different (Animation Tiles) to use on 400 Tiles is not a good idea to use the TileMap I guess

    4 different tiles are fine, BUT you cannot animate them. So if you don´t intend to animate them, use the tilemap.

    [quote:89k7o52y]I thought that I read in other threads that if the Tiles are the same it counts the draw call as 1

    Is should be sort of true if you use the same tile. So if you use the same tile 100 times it should be 1 drawcall (I´m not sure if it´s actually only a single drawcall but it should be faster) if you have 100 different tiles, each will have a drawcall.

  • [quote:3sbgnu9v]4 different tiles are fine, BUT you cannot animate them. So if you don´t intend to animate them, use the tilemap.

    I see what you mean, they are just static animation

    [quote:3sbgnu9v][quote:3sbgnu9v]I thought that I read in other threads that if the Tiles are the same it counts the draw call as 1

    Is should be sort of true if you use the same tile. So if you use the same tile 100 times it should be 1 drawcall (I´m not sure if it´s actually only a single drawcall but it should be faster) if you have 100 different tiles, each will have a drawcall.

    /quote]

    Cool, that's what I was looking for, as in all the threads talking about this topic they mention if the Tiles are the same it counts the draw call as 1 but they end up with as long you don't use many different (Tiles Animations) which instead will be better to use sprites, since my confusion of how much will be categorize to

    much (different Tiles Animations) as it sounded you cant mix up many different Tiles that's why I asked if 4 Tilemaps will be more efficient.

    But if you can mix tiles as you said then is much easier to know who will be a better choice

    TileMap of 400 Tiles: using 4 different animations, say 100 tiles for each animation that will be = 4 Drawcalls

    400 Sprites: using 4 different animations, say 100 tiles for each animation that will be = 400 Drawcalls

    if this correct is much easier to see who is the winner unless I missed something

    WackyToaster thanks very much for helping me clear up the confusion

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)