Poor performance on mobile devices (low fps)

0 favourites
From the Asset Store
A futuristic device, can be used as radarscreen, optionscreen, infodisplay, research device, ...
  • 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

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • 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.

  • Fantastic ! thanks a lot for your amazing help.

  • jayderyu

    [quote:1esh973a]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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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.

    i'm using this technique to preview on my mobile phone directly using chrome browser

    here is the instructions:

    scirra.com/tutorials/247/ho ... al-network

  • The web site preventing me from posting urls, just search tutorials for: how-to-preview-on-a-local-network

  • A new test of Flabby bird game style to test performance on mobile phone.

    * Fullscreen scaling: low quality

    * Clear background: no

    * using "every 0.33 sec" instead of "every tick"

    * forcing chrome browser to use "webgl" renderer

    and the average fps is 22 on Samsung s3 mini, and about 50 on Samsung Galaxy note 3

    How can i improve the performance ? after adding backgrounds and animated spirits i think the frame rate will drop significantly!

  • Sounds like you are testing with the Mobile Browser. And I can honestly say that the stock Android Browser is awful for games. Incredibly aweful.

    If you can't use the current version of Chrome, and your not up to getting test XDK, then your better of using CocoonJS for straight forward testing. Heck your device might not even have WebGl. I suggest going to CJS Launcher in the mean time.

  • I'm using the latest chrome browser for android with "Override software rendering list" enabled to allow using the webGL renderer

    i found a new update now for chrome, I'll test again and come back with the results.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)