Poor performance on mobile devices (low fps)

Discussion and feedback on Construct 2

Post » Mon Oct 27, 2014 9:05 am

After working for several days on finding a proper way to export games from Constrict 2 for android I found that the average fps is 15 !
my trials included the following:-
* Reading Performance Tips for Mobile Games on Scirra website.
* Exporting for Android and building in intel XDK (crosswalk android) beta and stable.
* Exporting for CocoonJS (slight fps improvement but still below average).
* Debugging on my mobile phone (Samsung s3 mini) directly on Chrome browser.
* Exporting some of construct 2 included examples! even simple examples have a very low fps on mobile.

At the end I can't find any way to improve game performance on mobile phones and it seems that the issue is not related directly to the used effects, assets, physics, etc. ,even with no effects at all or no physics the fps is always terrible !

Construct 2 is an AWESOME software, the performance on desktop is really amazing with constant 60 fps
my problem is with exporting for mobile phones so please help me.

Thanks
B
15
S
5
Posts: 192
Reputation: 1,514

Post » Mon Oct 27, 2014 10:10 am

The S3 mini is an antique, in HTML5 terms.. Getting anything to run reasonably well on a device like that is quite a task. Even without physics and effects you have to be really careful and optimize aggressively, to get things done.

Try the following: New project, set the resolution to 320*480 (portrait), set full screen scaling to low quality (very important!) and put a few sprites onscreen (a few as in: 5) and move them a bit and then check the fps.

If you need your games to run on devices like that you are pretty much restricted to a few genres, that do not require too many and/or too large objects, and preferably don't do any scrolling. If you read the guides already, you might want to look again at the sections mentioning overdraw. On "crap" devices like that it really helps performance to minimize it.
B
72
S
28
G
32
Posts: 477
Reputation: 19,640

Post » Mon Oct 27, 2014 10:48 am

Thanks alot for your reply, very useful notes and i'm going to test again now.
I'm not sure about the devices available on market nowadays, i guess there are so many people using devices like mine or even lower (at least in my country) so I'm trying to consider that in making games.
Thanks for help and if you have any additional notes it will make a huge difference.
B
15
S
5
Posts: 192
Reputation: 1,514

Post » Mon Oct 27, 2014 9:03 pm

I tested the attached file on Chrome directly (Samsung s3 mini , Renderer: Canvas 2d) and i noticed that the frame rate starts low ( from zero to 20 fps) and after about 5 or 6 seconds it becomes 30 average, touching the screen early will cause a non smooth movement of the orange and red squares, the window size : 854, 480 and i really want to keep it that range to avoid any pixelation on large mobile screens or small tablets . may be 800, 480
i know that the rotation movement and changing text every tick is very intense, I'm just trying to know how far can i go with my games on such a device.
any advice ?
thanks alot.
You do not have the required permissions to view the files attached to this post.
B
15
S
5
Posts: 192
Reputation: 1,514

Post » Mon Oct 27, 2014 9:22 pm

Test constantly on the minimal target device. Especially on additions.
Group images on to fewer Sprite types.
Group Sprite images by layer and types
Watch your memory
It's really easy to do killer performance code(ie kills performance)
Minimize trigonomic mathematics
Minimize EveryTick( As Much As Possible stick to Event Triggers).

Bake your backgrounds if you can. fewer objects the faster the renderer can work.

Most new developers just run and go not realizing the micro optimizations that professional studios due. They do them to get fantastic graphics on weaker platforms.


Ok no as for you work work.
1. Understand that lerping everytick on older chips can cause performance problems. It's less precise. but you can find a timer step value which does similar results without lerping. Though keep in mind that lerping isn't that heavy.

2. Don't embed "wait" embeded in Every Tick. C2 does not pause the Actions. It creates a branch process. So your Evertick will get called again. This will create a build up of Wait Events. This won't Tick, wait, tick.

3. Rotate SUCKS on older devices. Don't use Rotate evertick. http://c2.studioryu.net/?p=139
Cut down how often you rotate. Or create a sprite that rotates by frame animation.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Mon Oct 27, 2014 9:44 pm

very interesting!
can you please tell me how to make a smooth movements without lerping everytick ? what do you mean by "time step value" ? every 0.1 sec or so ?
another question about smooth movement: "is moving an object from one point to another smoothly more or less cpu & ram consuming than making the same movement as spirit animation ?" if i want to make a movement of buttons at the start of my game should i make it by moving the same object (button) on screen as spirit movement or make 10 frames of animation (in after effects for example) ?

is there a way to stop "everytick" event to wait ? what should i do instead?

and finally do you advice me to build\compile using intel XDK or CocoonJs or something else ? i just need to push performance limitations as far as it possible for my game.

Thanks for your reply.
B
15
S
5
Posts: 192
Reputation: 1,514

Post » Mon Oct 27, 2014 10:00 pm

Every 0.033 Tick
L = InverseLerp( startTime, endTime, time)
SetX = Lerp(startX, endX, L)

ValueStep style. This isn't as smooth as doing stuff everytick
PPS = 500
Every 0.033
stepValue = PPS * dt

EveryTick
AddX stepValue

No. You can't stop any Trigger from occuring without additional conditions.
For your example
var isWaiting = false
EveryTick & isWaiting==false
-- setyellow
-- isWaiting = true
-- wait 0.1
-- setRed
-- isWaiting == false

Unless CJS get's picked up again I suggest XDK. However I suggest investing in the time to make a test Crosswalk build that will pull resources from a C2 Preview. that way you can test far more often and easier. Similar to how CJS tests.

Also most of the games on the device your talking about are written to run at 30fps. C2 can't run at anything less than trying 60fps.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Mon Oct 27, 2014 10:14 pm

Fantastic ! thanks a lot for your amazing help.
B
15
S
5
Posts: 192
Reputation: 1,514

Post » Tue Oct 28, 2014 5:36 pm

@jayderyu

However I suggest investing in the time to make a test Crosswalk build that will pull resources from a C2 Preview. that way you can test far more often and easier. Similar to how CJS tests.


Can you please elaborate more what you mean and on how to set that up?

thanks!
B
82
S
39
G
15
Posts: 982
Reputation: 16,712

Post » Tue Oct 28, 2014 9:32 pm

If you do an XDK build with just a simple index.html file that refers to where you have your preview over lan. You can then just use that single XDK build to just call your current preview. THen you don't need to constantly make builds you have to push up, then download for every test.

However there are some technical details in regards to allowing cross content that you need to deal with. Good luck.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Next

Return to Construct 2 General

Who is online

Users browsing this forum: jakezinis and 6 guests