Questions about tilemap's collision ...

0 favourites
  • 8 posts
From the Asset Store
Enchanted Forest & Cave 16x16 Tilemap with Environment Sprites
  • I'm using the following tilemap to create my collisions for my layout/level:

    I've already read this, but I still have some questions... Which of the following methods is the best to use for detecting tilemap's collision (in term of optimisation/draw calls):

    Also, does it help to use only 1 tile and rotate it (instead of 4) ? ... That would reduce my tilemap from 25 tiles to 7 tiles.

  • Identical tiles within the same rectangle are only drawn in one call (as long as the tilemap is setted for that, which is by default), I am not sure about collisions, but I would think than less collision points and less tilemap with collision enabled would be better (enough to make a big difference that justify doing it? Not sure.).

    I personnaly remember doing once in a bubble bobble type of clone (never really gone too far yet into it) having different tilemaps (one graphical only with collisions off and one that used collisions but set to invisible), that would let you have a collision different than the graphics if you want it that way.

  • Your proposed alternatives will probably not show up any significant performance difference. The way to check it is to see if you can measure any performance difference; if you can't, it doesn't matter.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Identical tiles within the same rectangle are only drawn in one call (as long as the tilemap is setted for that, which is by default).

    So you are saying that if I use only one tile and rotate it, there would be only 1 draw call for it (instead of 4 draw calls for 4 tiles). Also, are draw calls used when the tilemap is invisible ?

    I personnaly remember doing once in a bubble bobble type of clone (never really gone too far yet into it) having different tilemaps (one graphical only with collisions off and one that used collisions but set to invisible), that would let you have a collision different than the graphics if you want it that way.

    That is what I am doing now since is a RPG map (like Pokemon/Zelda).

    Your proposed alternatives will probably not show up any significant performance difference. The way to check it is to see if you can measure any performance difference; if you can't, it doesn't matter.

    So the performance increase would be minimal to none ... I've thought that, but wanted to make sure. My maps will be from 2000x2000px to 3500x3500px with tiles of 72x72px.

  • The tilemap object internally breaks up tiles in to cells a bit like the collision cells optimisation, so it works on screen-sized chunks at a time instead of the whole thing. So the size of the tilemap should not affect performance.

  • So you are saying that if I use only one tile and rotate it, there would be only 1 draw call for it (instead of 4 draw calls for 4 tiles). Also, are draw calls used when the tilemap is invisible ?

    Rotated tiles are considered as different tile for rendering I think

    And the draw on screen is skipped for invisible objecs, so the draw calls should not be a problem

  • The tilemap object internally breaks up tiles in to cells a bit like the collision cells optimisation, so it works on screen-sized chunks at a time instead of the whole thing. So the size of the tilemap should not affect performance.

    I understand, so the collisions in tilemap are calculated differently. That was the reason I asked about the examples in the first post (I've thought that less collisions points would be better)

    Also, using:

    or

    Would not have any difference except a few less Kb in file size.

    Thanks, I know about "Optimisation: don't waste your time", but I wanted to make sure I use the tilemaps correctly

  • Rotated tiles count as different tiles for rendering. But there's really not much point asking - unless draw calls show up high in the profiler then it's a waste of time worrying about it.

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