How do I lower CPU usage?

0 favourites
  • 6 posts
From the Asset Store
Eatable Numbers Math Game
$3.20 USD
60% off
Hit lower numbers and eat them to get bigger and go higher!
  • When debugging I see that the game uses 50%+ CPU usage. How do I lower it? We're making a game for iOS and android.

    Worth noting that the PC I'm testing it on atm is really bad. But when we build the app via Intel XDK and transfer it to my friends Sony mobile, it's really laggy so I don't think that it's the PC that's wrong.

    Does anyone have any tips on what to do for the lowest CPU usage possible? I can attach a capx for anyone who wants to. (though I'd rather not as it's a pretty important project for us and it'd be easy to steal )

  • It could be a number of things that could cause this. Check out the mobile optimisation guides. Look through your events, you maybe able to find events that can be optimised further. I.e reduce loops where there may be a lot of iteration. Use sprite sheets. There a lot of info in the developing for mobile guides that's a good starting point.

  • Would it be better to use a big transparent sprite used for if touching object or would it be better to just use a variable that checks the X area of the touch? I feel like it would take as much CPU usage as a big transparent sprite, but I read somewhere that sprite objects without an actual image (just transparency) takes ALOT of resources?

  • Remember that Debugger itselfs takes quite a few % from the CPU to process and display all the data in the Inspect window. When you run debugger go to the Watch or profile tab and then see how big is your CPU usage.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The Profiler tab in the debugger is the best place to look for what is using the most CPU time.

  • some sources of performances loss :

    • too many sprites : ~30 max per screen.
    • too many collisions check : try to use collisions check only if it is really necessary.
    • complex collision polygons : use "set to bounding box" every time you can.
    • useless events : don't forget the "trigger once while true" condition, which can avoid a lot of iterations of the same event.
    • huge resolution : if you are making a mobile game, it's often not necessary to have a full HD resolution.
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)