Mobile games performance, let's be honest

  • delgado - how does the Profile view look in the debugger? The areas of code with the biggest demands on your cpu will be shown in the profile and will indicate where you're best trying to streamline your code. If you are using any webgl shader effects in cocoonjs then they will kill your performance as well (I set my project up to use them on a sprite font... a simple color shader reduced performance by 30 fps ).

  • Colludium "The areas of code with the biggest demands on your cpu will be shown in the profile"

    You mean?:

    i dont use text obiect in layout of game and i do not use shaders

  • delgado, if this is my game, i might do the followings to check:

    1. Kill half outside enemy/items object and see if the problem gets fixed.

    2. If yes, that means C2 is busy dealing with them.

    3. Try to use spawn spot to create enemy instance when player approaching spawn spot.

  • delgado - that's the one!

    To me it seems that there's quite a lot of CPU effort going into running the Engine event sheet, but it's impossible to identify the culprit without breaking that sheet's events down further. So as to isolate which areas of your code are causing the CPU the most work, you'll need to add Groups to each chunk of code in that sheet. The profile will then show the percentage CPU being used for each Group so you can then see with more detail what's causing the CPU so much work.

    If some of your layout animation / controls are for off screen objects then the next step could be to disable those Groups until the player is nearby and they are needed. It might be that there's a lot of control work going on that doesn't need to be done all the time - you might even find that there's a bug or two in your code that way (that's usually what happens to me!).

  • jomo can you explain me why i have low performance in menu layout? (on my sony xperia S)

    new update on android: https://dl.dropboxusercontent.com/u/447 ... signed.apk

  • delgado your menu works smooth and fine on my phone. But I noticed 2 things

    1. It seems that you used a filter effect to let ur airplane tunneling through the title. If you use any layer with force own texture on, try to turn ut off.

    2. C2 loads the game layout by layout. Since u have a ultra long layout, it takes very longttime to load after press game start.

  • In the behaviour tab on the left, have collisions disabled by default, so you don't need a trigger X is NOT on-screen -> set col disabled.

    Also this is going to need input from Ashley, perhaps send him your capx project for them to take a look. It will be interest to know for the rest of us, whether all the objects off-screen on a larger layout for scrollers consume that much CPU cycle is normal.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley if you would like to have a look at this issue?

  • I can't help without a .capx.

  • Ashley i send you email

  • I had a quick look at your events. Your collision checks are done very inefficiently.

    You have a *lot* of collision checks that look like this:

    + On collision between A and B

    + Var = 1

    -> Do something

    + On collision between A and B

    + Var = 2

    -> Do something

    + On collision between A and B

    + Var = 3

    -> Do something

    + On collision between A and B

    + Var = 4

    -> Do something

    + On collision between A and B

    + Var = 5

    -> Do something

    etc. etc. This example does 5 separate collision checks.

    If you use subevents like this:

    + On collision between A and B

    ----+ Var = 1

    ----> Do something

    ----+ Var = 2

    ----> Do something

    ----+ Var = 3

    ----> Do something

    ----+ Var = 4

    ----> Do something

    ----+ Var = 5

    ----> Do something

    That does one collision check, then does a simple check for the variable. This is literally 5x faster than the previous way, and you do this again and again and again in your events.

  • I wonder, is the "Not overlapping" just as hungry as the "Is Overlapping"? Or is it more, because it's happening more often?

  • An inverted overlapping condition takes the same CPU as when it's not inverted.

  • Ashley

    + On collision between A and B (when player pick up a power up)

    + Var = 1 (this is level of power to upgrade in game store)

    -> Do something (when level is high do something better)

    So its my only idea how behave player when have upgraded level "var 1,2,3 etc.

    It is inseparable part of the game and must be, even if this cause performance problem, I have no a better idea before how to minimize it.

    i take your tips

  • delgado - I might be misinterpreting your post, but as Ashley said you're doing redundant work. Read up on sub events: https://www.scirra.com/manual/128/sub-events

    Sub events remember the picked instances of the parent events, so you only need to do one collision check, and the sub events that compare a variable will continue to only check and act upon the picked instances of the parent event.

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