Misusing Tilemaps

Discussion and feedback on Construct 2

Post » Fri Jul 28, 2017 2:22 am

After (of course) developing 50% of my pretty large game, I've finally read something about tilemaps that worried me. I was using them to get tons of variation on almost every tile (ie platform floors with 3-4 variants, BG walls with 6-7 variants, windows that are 4-6 tiles wide/long, etc.), but I'm realizing for each next different tile it has to issue a whole new draw call. So a window in the background, even though its really only 4 tiles, it has to render 4 draw calls instead of having a single sprite of a window and only doing 1 draw call.

Now, my levels aren't HUGE, per se, but some of them have a lot of variations going on and nothing is really being "tiled". Is this something I should go back in and look at, or because it's pixel art it's not a huge deal? Or am I (once again) misunderstanding how the tilemaps are supposed to be used?
B
40
S
12
G
1
Posts: 532
Reputation: 4,147

Post » Fri Jul 28, 2017 9:44 am

unless things have changed then
draw calls are per rectangle of repeated tiles

Therefore to optimise this, the Tilemap plugin searches the tilemap for areas of repeated tiles. It identifies the largest rectangles it can where the same tile is repeated, and remembers these. When it comes to be drawn, it draws the whole rectangles at a time rather than going tile-by-tile.

https://www.scirra.com/blog/ashley/3/tech-blog-tilemap-tidbits

So I suppose if your windows and walls are not at least partially using adjacent repeating tiles then it may not be the best option.
...
B
45
S
23
G
7
Posts: 291
Reputation: 8,020

Post » Fri Jul 28, 2017 2:07 pm

@NetOne - right. That's where I read that. I guess my question is "will doing all the legwork to fix it be worth it?"
B
40
S
12
G
1
Posts: 532
Reputation: 4,147

Post » Fri Jul 28, 2017 4:17 pm

Personally I would crack on with the game then if you start to hit GPU ceiling on your target devices maybe think about optimising these sort of things.

Thing is that unless you are wanting to deploy to old mobiles or trying to render crazy amounts of sprites then most GPUs are so powerful these days that, especially with browser based games using webgl, you are more likely to hit CPU ceiling first.

I'm no expert though.
...
B
45
S
23
G
7
Posts: 291
Reputation: 8,020

Post » Fri Jul 28, 2017 6:53 pm

@NetOne - yeah that's what I worry about. Would this affect the GPU fillrate? Because if it does, it's already hampering slower machines and needs to be taken care of.
B
40
S
12
G
1
Posts: 532
Reputation: 4,147


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests