How do I lower CPU usage?

Get help using Construct 2

Post » Thu Sep 17, 2015 9:14 am

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 ;))
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Thu Sep 17, 2015 1:51 pm

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.
My Games on google play

ImageImage
B
33
S
7
G
4
Posts: 100
Reputation: 3,405

Post » Fri Sep 18, 2015 9:22 am

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?
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Fri Sep 18, 2015 9:48 am

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.
ImageImageImageImage
B
158
S
66
G
43
Posts: 2,603
Reputation: 35,868

Post » Fri Sep 18, 2015 1:14 pm

The Profiler tab in the debugger is the best place to look for what is using the most CPU time.
Scirra Founder
B
399
S
236
G
89
Posts: 24,524
Reputation: 195,380

Post » Fri Sep 18, 2015 2:38 pm

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.
B
8
S
1
Posts: 76
Reputation: 628


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests