Tiled Backgrounds performance problems

Discussion and feedback on Construct 2

Post » Thu Apr 09, 2015 1:04 pm

Hi, I just found some strange performance issues on mobile browsers when you rotate layouts or layers with Tiled Backgrounds in the project.
Maybe these issues are related to my mobile devices, I don't know...

Layout rotate test

This example consists in rotate the game layer by 45 degrees steps, every 5 seconds.
Objects in the project:
-WallTile (64x64 Tiled Background)
-Sprite with bullet behavior

Issue (iPad 2 safari)
By default, everything is smooth(60FPS), but if you go to WallTile image editor, and resize the image to 4x4, the performance become really bad when layer angles are not 0,90,180 and 270, with FPS around 13/14FPS.
Smaller power of two Tiled Background image result in horrible performance at specific angles.

I was wondering if anyone could take a look and test the example, and share the results.
Thx
Last edited by cesisco on Sat Apr 11, 2015 2:38 pm, edited 3 times in total.
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Fri Apr 10, 2015 10:47 pm

once transition hits (every 5 sec) and sets cameras to 'rotate'
you start doing the event cameras = "rotate" layer game angle to level angle degrees.
it happens every tick and all the time, even if the angle is the same. try adding cameras="" under it and test then.

also try resizing the background tile - size 4032x992 is just HUGE. you can reduce it to window size - reduce it to 2560x256 and try again.

also reduce the wall tiles. 2592x288 or even less. i just don't know why you don't use a simple sprite that is not background tile. use a simple black sprite - it's static, can rotate and doesn't tile. definitely more performance friendly.

also of course that background tiles are slower. it's obvious.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
39
S
14
G
12
Posts: 617
Reputation: 9,297

Post » Sat Apr 11, 2015 1:21 am

Hi, I made a simpler example, maybe I didn't explain myself too well,
I'm not trying to achieve a better performance in this particular example, I know the best practices in game design.
I just want to figure out if when the layer angle is 45, it's not supposed that the performance should be equal than when the layer angle is 0.
I deleted the background tile just to make the things simpler.

Test the default capx in iPad2-see the results.

Then resize the WallTile to 4x4 in the image editor, and test it again.

What I'm seeing is when the WallTile is 64x64 the performance is good in all angles, but when WallTile is 4x4 ,the performance is good in angle 0, but very poor at layer angle 45.
I'm just asking if it should be good at both angles or not.
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Sat Apr 11, 2015 3:02 am

Im getting 60 fps Ipad3, 30 fps Chrome on my desktop, and 50 on FF.
Chalk it up to hardware and os.
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588

Post » Sat Apr 11, 2015 8:04 am

newt wrote:Im getting 60 fps Ipad3, 30 fps Chrome on my desktop, and 50 on FF.
Chalk it up to hardware and os.


Hi newt, those results are with the WallTile image size 64x64, or 4x4?

Thx
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Sat Apr 11, 2015 11:00 am

@cesisco - is your iPad 2 updated to iOS 8? iOS 7 and older don't support WebGL and the iOS canvas2d mode is very slow at drawing tiled backgrounds. Since iOS 8 uses WebGL it works around this and should always be fast with tiled backgrounds.
Scirra Founder
B
382
S
223
G
86
Posts: 23,998
Reputation: 189,773

Post » Sat Apr 11, 2015 11:55 am

Hi @Ashley , in fact I'm on iOS 7.
But the example only performs bad when the layout angle is 45 degrees.It costs more to draw a tile background at that layout angle?
Anyway I'll update to iOS 8
thx
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Sat Apr 11, 2015 2:18 pm

No difference, cept graphically the tiled bg with 4x4 is showing lines.
Not sure why.
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588

Post » Sat Apr 11, 2015 2:35 pm

OK thx, it seems that the performance dropping issue only happens in iOS 7
B
36
S
11
G
9
Posts: 399
Reputation: 10,283


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests