Tilemap and solid behaviors work?

0 favourites
  • 3 posts
From the Asset Store
Enchanted Forest & Cave 16x16 Tilemap with Environment Sprites
  • What's the best way to use tilemaps for solid collision? Does it listen for collision on every tile drawn on the map? Is it better to have just a visual tilemap and overlay it with invisible solid shapes?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • While I don't know the specifics, I'm pretty sure the tilemap at most generates a separate collision box for each tile, rather than having a single collision box for the entire map. With that said, according to the manual, there are optimizations built in already.

    [quote:3ji5sxww]The Tilemap object can optimise collision detection and rendering in a way that should scale well even with extremely large Tilemap objects.

    I believe there is also some built in collision culling based on distance as well.

    I can't say if it is better to have a visual tilemap with solid helper objects, but that is definitely a viable approach. I wouldn't worry about which way is better until you visibly notice performance issues using the tilemap as solids (more likely to happen if your tiles are itty bitty). Then it would be a simple matter to remove the behavior and collisions from the tilemap and place helper sprites instead. Start with using the tilemap's collisions because you are going to have to set up your tilemap regardless anyways.

  • I have always used the invisible object over tile map approach. It's simple, flexible and seems to work well for the games I make.

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