Performance issues on mobile

Get help using Construct 2

Post » Wed Jun 14, 2017 11:03 pm

Hi,
So my game used to have a very poor performance while previewing on a mobile device, but I have made some 'radical changes' (like making images way smaller, making events more efficient, followed this https://www.scirra.com/manual/134/performance-tips) and it had a nice result. But it is still not enough.

The objects using CustomMovement sometimes move in a slow-motion. My min FPS is 30, but the FPS never drops below 30 when moving (the fps drops when the object is triggered to move).
I have also no effects, no objects that move all the time, no animations that keep replaying (i have a maximum of 15 objects that have looping animations, and these objects are very small), no fading objects.

Also, there is this problem with the screen which keeps blinking even though i have 'Clear Background' set to 'No'.

I have over 300-400 objects in each level, and over 900 collision checks per sec.
I have tried cutting the number of objects on half, but that didn't change anything (90% of my objects are not moving at all), the CustomMovement and some objects I am being scrolling (even though I use 'dt') are still in slow-motion and the screen keeps blinking.

So, this is my first project and I am not very experienced with making performance more efficient....
Any advices?
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Thu Jun 15, 2017 9:52 am

Play your game in "debug" mode to see where things are slow:

1. Create a group called "test group" and move things into and out of this group. Narrow it down to a few event sheets that are the biggest resource hogs, and try to optimize from there.
2. Put a text object called "fpstext", or something similar, in the upper left hand corner of the screen. Every tick, set fpstext's text to the following:

Code: Select all
round(fps)&newline&" FPS"&newline&round(cpuutilisation)&"% CPU"


With this in place, play the game on mobile. If fps is low, but CPU is also low, it means you are limited by the GPU and need to use smaller textures to reduce the number of time pixels are being told to redraw each frame. If fps is low and CPU is high, then you need to optimize your events because your mobile CPU can't keep up with your desktop.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
45
S
11
G
20
Posts: 363
Reputation: 14,174

Post » Thu Jun 15, 2017 7:56 pm

Hi, thanks for the reply.

I have already done step 1 (my CPU ranges from 12-30%, I've done everything I could to make it better, but that's all I can do, my events simply require this much CPU usage...)
As for step 2 I have done this as well, but without the CPU, so, now I did just like you told me to and the CPU percentage is 0%, and occasionally becomes 1%, never more than that..
Also, the fps seems to be even higher on my mobile device, it ranges from over 30 to 60. On my laptop the max is 40, but movement doesn't go into slow-motion as in mobile..

Weird..
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Thu Jun 15, 2017 9:07 pm

It sounds like you are GPU-limited. Is there a significant amount of pixel redraw going on with multiple transparent sprites trying to draw on the same pixel?
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
45
S
11
G
20
Posts: 363
Reputation: 14,174

Post » Thu Jun 15, 2017 9:19 pm

No. My game is something similar to the bomberman game. There are blocks placed in a grid and the player moves between these blocks. The only transparent thing in the layout are the shadows of these blocks, so I have disabled the shadows just to test if they are the source of the problem, but the problem with the movement was still there.
Yet this problem occurs in other layouts as well, but there's also no transparent sprites..
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Fri Jun 16, 2017 2:36 am

Hmmm... Weird. What device are you testing on?

I'm not much into 2D games -- everything I have been creating game-wise is 3D, and I have found most of the time on mobile I have been CPU-limited. Perhaps someone more experienced with 2D games has a better idea?
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
45
S
11
G
20
Posts: 363
Reputation: 14,174

Post » Fri Jun 16, 2017 3:28 am

same here
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Fri Jun 16, 2017 12:29 pm

I am testing on multiple mobiles like samsung and xperia. The problem occurs on each one of them
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Sat Jun 17, 2017 1:14 pm

I have made my own movement system, it is better now, but not perfect. Also, my fps sometimes drops bellow 30 (that's the minimum fps) and it causes the player to glitch and move through blocks..
Also, the blinking on the screen is still there and I have no idea how to stop it :/
B
18
S
6
Posts: 138
Reputation: 1,643

Post » Sat Jun 17, 2017 4:35 pm

same here .. i'm suffering test and using html5 games on my mobile
i'm using cordova and intel xdk
the best to use before was ejecta it was very very fast than intel xdk or cordova
but the c2 side has also the reason
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Next

Return to How do I....?

Who is online

Users browsing this forum: apalm1341, blissfulwizard and 15 guests