Switching Layouts uses over 50% Engine CPU....?

Get help using Construct 2

Post » Tue Jun 02, 2015 2:04 am

I've made a fairly simple game with about 30 total sprites, 500x375 layouts and a good amount of running mechanics such as physics engine, constant creation and deletion of replicated sprites and variable interactions.

But when I switch layouts from start to game and game to start, it uses over 50% and 30% of the CPU power respectively (using the debugger), making my FPS below 15 from the normal of 60. This also makes the game unplayable as it crashes on mobile devices when switching layouts I'm not sure if it's because I have over 15 actions in "On Start of Layout", too much objects at one time (30 max), or because of another reason. :?

If anyone has had any experience with a similar problem or has any suggestions at all, please give a reply....

Thank you :)
B
7
S
1
Posts: 17
Reputation: 495

Post » Tue Jun 02, 2015 10:03 pm

Hey Apex,

It is normal for your game to spike up the cpu usage when changing layout, especially if you have the debugger open while your doing so but it shouldn't be crashing. what is the error message?

Can you strip the project down to the bare bones and post it for us to have a look?
ImageImage
B
118
S
23
G
7
Posts: 1,070
Reputation: 12,964

Post » Wed Jun 03, 2015 1:07 am

Hey GenkiGenga, thanks for your quick reply.

The game only crashes on mobile devices (Tried Samsung Galaxy Tab 2 and Samsung smartphone-unknown model) and the error message just said something like: "Unfortunately, Application Name has stopped working".

This is the Project file itself: https://www.dropbox.com/sh/dxt30xex37wz ... 1yjea?dl=0

Again thank you so much for giving your time to help me as I am fairly new to the game development and C2 world. :)
B
7
S
1
Posts: 17
Reputation: 495

Post » Wed Jun 03, 2015 6:27 am

Your estimated memory use within C2 is nearly half a gig, which I'd guess may be a problem for quite a few mobile phones.

Ashley has answered many questions and written blogs on dealing with mobiles and it's imperative that you design with mobiles in mind from the very begining.

As an example, just one graphic - the GoldenStar - is nearly half a MB and is 1276x1276.

Here's a useful blog from Ashley:

https://www.scirra.com/blog/112/remember-not-to-waste-your-memory
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,375
Reputation: 58,432

Post » Wed Jun 03, 2015 8:09 am

Like Zenox said, you have to optimize everything for mobile. If your star is 128x128 in game you should design it as 128x128 which should be a few kb instead of a half mb. So avoid scaling your sprites as much as possible.
B
54
S
23
G
12
Posts: 747
Reputation: 11,910

Post » Wed Jun 03, 2015 10:33 pm

Thank you guys so much for the time and advice, I will put it into action.
B
7
S
1
Posts: 17
Reputation: 495


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests