How do I - will using groups optimize performance ???

0 favourites
  • 7 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • hi,

    iam using 200 object moving on every tich self.y+5*60*dt and destroy them when y > 800

    i know its too much ... iam trying to use groups on even sheet but i see that i have same performance

    cpu usage is about 40 to 50 %

    and the game is really slow on mobile

    any suggest ?

  • Have you tried just lowering the number of objects? 200 is insane for a mobile device, the max I ever use for mobile dev is 25 - I mean can you even make out 200 objects on screen?

    In regards to your question, I was unaware of any performance gain related to using event groups, to my knowledge its a cosmetic feature with the added benefit of letting you call large chunks of event code

  • I fail to see, if you *need* to move 200 sprites onscreen, how groups could help.

  • Groups are not only usefull for organizing your event sheet, but mostly for the ability to activate/deactivate large pieces of code when not needed..

    For instance:

    If you put all your events for an ingame menu in a group and only activate that group when the menu is visible/available it can save construct a lot of checking time and as such improve performance..

    I wonder why you need to use 200 objects this way..

    Must be a better method, meaning one with less impact on performance..

  • If objects are slow moving, try moving them less often.

    If they are moving faster, try adding motion blur to prevent jerky movement at less than per-tick intervals (for very fast objects, this can even help with every-tick movement quality).

    Reducing the number of objects always works; again, if we are talking bullets here, try making clusters of projectiles (say a triangle of 3 bullets) to maintain density while dramatically reducing your object count.

  • hi , thanks for all for reply

    the 200 object are not all on screen

    only 20 are on screen

    but the rest are moving to be visible on screen

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If it was me? I'd add behavior Destroy Outside Layout to the sprites & then use a different method to get them back onto the screen. When you have the 200 sprites still doing stuff offscreen, the computer still has to do all the math associated with the sprites' motion AND image. That's probably what's causing the CPU usage.

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