Tilemaps for large levels improve performance VS sprites?

Discussion and feedback on Construct 2

Post » Mon Apr 13, 2015 12:24 am

Hi everyone,

If I want a platformer with large levels, will using the tilemap object (seamless mode on) improve performance over using sprites for all the tiles to create the level?

Thanks,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,071

Post » Mon Apr 13, 2015 1:03 am

@Brashmonkey

Yep(at least for my platformer game). It's far better and less object for C2 engine to handle. I've encountered this issue and immediately change to tilemap for better performance.
B
84
S
24
G
14
Posts: 391
Reputation: 12,658

Post » Mon Apr 13, 2015 3:23 am

Immensely. Especially when paired when rendering cells, if used properly.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Mon Apr 13, 2015 6:32 am

While tile maps don't benefit from render cells, they work in a same way with collisions cells, and so, by default, tilemaps are scalable easily to a far larger world size than the screen.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

Post » Mon Apr 13, 2015 8:15 am

Thanks very much everyone for confirming this. I wanted to assume as much, but it was strange that in the official documentation for Tilemap they neglected to point out the performance benefits. They should really mention that near the top of the Tilemap extension page.

Cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,071

Post » Mon Apr 13, 2015 10:28 am

One of the advantages of the tilemap object is that it effectively uses render cells internally all the time regardless of the layer's 'Use render cells' setting. The layer setting applies to entire objects, but tilemaps are often so large they sit in every render cell and negate its performance benefit. So to avoid that the tiles are internally split up in to cells and only ones touching the viewport are iterated.

It also works with collision cells in a similar way, and that works especially well when you don't change the collision poly for tiles, since it can take entire rectangular areas of different kinds of tile (assuming they all use full-tile collision), and test them as a single box.

So even if you have an extremely large tilemap object covering a huge layout, it still collision checks and renders efficiently. This is still possible to achieve with other objects, but harder. I added a note about the performance benefits to the Tilemap manual entry to highlight this.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Mon Apr 13, 2015 8:13 pm

Thanks for the info Ashely, and for the awesomeness that is C2. ;)

Cheers,
Mike
B
49
S
9
G
4
Posts: 426
Reputation: 7,071


Return to Construct 2 General

Who is online

Users browsing this forum: Voytek and 4 guests