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.
The Profiler tab in the debugger is the best place to look for what is using the most CPU time.
Develop games in your browser. Powerful, performant & highly capable.
some sources of performances loss :