How do I reduce the cpu usage within an app

Get help using Construct 2

Post » Wed Oct 22, 2014 6:31 pm

I've made a simple game that runs just 3-4% cpu on my desktop but once its implemented into the app its using about 90% and crashing the app. The developers are telling my it is cpu heavy but everything is as small as possible, script minified and its a simple game so I'm unsure what more I can do...
B
5
Posts: 11
Reputation: 256

Post » Wed Oct 22, 2014 9:00 pm

Whats the number of collision checks?
How many objects usually on the screen?
In debug profile window what shows to use most of the processor?
Do you use behaviours/plugins that are not by default in C2?
B
10
S
1
Posts: 56
Reputation: 654

Post » Wed Oct 22, 2014 9:18 pm

Are you one of the developers?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Oct 27, 2014 12:51 pm

Hi,
I just have an 'on collision with' set between the phone and apps - can i reduce how often it checks for them?
Also though about lowering the fps but doesn't look like you can do this.
Probably max 10 items on screen...

This is the game:
http://appcatcher.connect-api.io/
(If you're on desktop you'll need to resize browser to portrait)

I've built the game in C2, I'm not an app developer...
Hope you can help!
B
5
Posts: 11
Reputation: 256

Post » Mon Oct 27, 2014 1:13 pm

Simple question:
Might you have forgotten about destroying the sprites when they've left the bottom of the screen?
If you have, the object count will constantly increase, which might be the reason of the overload..

A simple game like this shouldn't be a problem..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 27, 2014 1:21 pm

They are set to destroy outside layout through the behaviors panel...

The apps fall due to being assigned the bullet behavior, may be better to use this method do you think?

https://www.scirra.com/tutorials/67/del ... dependence

And also wanting to reduce how often it checks for collisions, but i can't work out how? :(
B
5
Posts: 11
Reputation: 256

Post » Mon Oct 27, 2014 1:35 pm

Bullet behaviour is already framerate-independant..

It's impossible for us to see what is causing the issue, without seeing the events and/or the capx..
Try opening the app in debug mode to see what is using the most cpu..
Look at the amount of collision-checks..
See how many objects there are..
(The debugger should be your best friend if you have these kind of issues)
Look if you don't have unnecessary every tick events..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 27, 2014 2:23 pm

I think it is the collision checks... it varies up to about the highest like this 816 (~13/tick)

I can't find anywhere how to reduce how many checks it does... do i need to put it as a sub event of system every 0.X seconds or something?
B
5
Posts: 11
Reputation: 256

Post » Mon Oct 27, 2014 3:05 pm

Attached is my source file...
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 11
Reputation: 256

Post » Mon Oct 27, 2014 3:43 pm

I can see no reason why this app should have cpu issues.. (some minor things could be improved event-wise, but won't make much difference)
Try playing it as a web app through the internet and you'll see it works just fine..
The problem seems to be with the wrapper "The Developers" are using.. (Do you know which one they use?)
Could be you'll get better results when exporting without minifying, but the problem seems not to be in your app..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: farsen, lahbach, newt and 26 guests