TileMap made Mobile Device FPS Drop [Solved]

Get help using Construct 2

Post » Thu Dec 12, 2013 8:35 am

Hi Constructors, I'm new to Construct 2 , and I made a game with some pixel tilemap as Land and Sky , When I tested the game on Chrome PC, it worked very well ,but I used CocoonJs on my android Nexus 7 , the FPS drop to 15-24 . Then I delete the tilemap , it worked fine on android again (FPS 50-60) . So the problem has something to do with the tilemap or its settings.My tilemap images are very small , about 1KB,made with PyxelEdit
This is my Project settings :

Pixel Rounding : On
Window Size : 720p
Fullscreen in browser : Letterbox integer scale
Use High-DPI display : Yes
Sampling : Point
Clear Background ; No


Capx Download: https://www.dropbox.com/s/nsj0bc26hke7t4v/Sugar.capx
BitMaps: www.dropbox.com/s/vc8v87ifci0hehi/SugarPicture.rar

It was solved , thanks !
Solutions:
@Ashley
that's a very inefficient use of tilemaps. Since you're just using it to repeat a single image, it would be far, far more efficient to use the Tiled Background object.

If you run it in the debugger you can see it reports 441 draw rects for that tilemap, mainly because every tile is different and there are no areas of the same tile. This means it's about the same work as drawing 441 sprites. If you used a single tiled background object, it would take 1 draw call, which would be approximately 400 times more efficient.

@ThunderZ
How amazing bad use of tilemap and C2.

As Ashley say use tiled background.
Exemple :
1 pixel color gradiant for your blue background (non alpha) + 1 tiled sprite for 'clouds' with alpha. (the size you want placed at top of the gradiant sprite).Zaoeyo2013-12-13 01:20:47
B
5
Posts: 17
Reputation: 291

Post » Thu Dec 12, 2013 9:56 am

@Ashley check this
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,371

Post » Thu Dec 12, 2013 1:25 pm

How many unique tiel did you use ?

C2 does a baching but only for tile that are identical.

The better way will to have a global batch with the tile system (1 layer = 1 draw call) but with ou memory management it's impossible.

You just need to design your worl/tile/level, to be more efficient with a low number of draw call.
B
85
S
14
G
6
Posts: 72
Reputation: 7,237

Post » Thu Dec 12, 2013 1:32 pm

Hard to comment without a .capx. If you have a tilemap with loads of random, very small tiles, then there will simply be a lot of rendering work. Are you doing that? Also is WebGL enabled?Ashley2013-12-12 13:32:42
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Thu Dec 12, 2013 3:02 pm

@ThunderZ
About 5 maps , I uploaded the .capx file , download link in the main post .

@Ashley
I do have many small tiles , but only about 5 kind of map image ,the WebGL is on.
I have uploaded the .capx in main post .


I tried to decrease the tile number , the fps up to about 25 - 35 ,maybe make a big map using PS,and import into C2,will get the right result,but it will increase the size of the game,and isn't convenient.

Thanks for your answers !Still trying to figure out a best solution.
B
5
Posts: 17
Reputation: 291

Post » Thu Dec 12, 2013 4:10 pm

@Zaoeyo - that's a very inefficient use of tilemaps. Since you're just using it to repeat a single image, it would be far, far more efficient to use the Tiled Background object.

If you run it in the debugger you can see it reports 441 draw rects for that tilemap, mainly because every tile is different and there are no areas of the same tile. This means it's about the same work as drawing 441 sprites. If you used a single tiled background object, it would take 1 draw call, which would be approximately 400 times more efficient.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Thu Dec 12, 2013 4:39 pm

How amazing bad use of tilemap and C2.

As Ashley say use tiled background.
Exemple :
1 pixel color gradiant for your blue background (non alpha) + 1 tiled sprite for 'clouds' with alpha. (the size you want placed at top of the gradiant sprite).


B
85
S
14
G
6
Posts: 72
Reputation: 7,237

Post » Thu Dec 12, 2013 4:53 pm

I could correct your capx if you send me the original bitmap. ;)
B
85
S
14
G
6
Posts: 72
Reputation: 7,237

Post » Fri Dec 13, 2013 1:18 am

@Ashley
Thanks ! i will solve the problem ,really help!

@ThunderZ
Thanks for taking your time! Main post has the Bitmaps .
B
5
Posts: 17
Reputation: 291

Post » Fri Dec 13, 2013 5:49 pm

Here the game modified (only the game layout for you see the difference with the menu) -> capx + modified bitmap.

https://dl.dropboxusercontent.com/u/732352/sugar_modified.zip
B
85
S
14
G
6
Posts: 72
Reputation: 7,237

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Nicolas951, tarek2 and 13 guests