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

0 favourites
  • 6 posts
From the Asset Store
You think you can guess the character’s name?! Then let’s see how smart you are!
  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • 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

  • 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.

  • Thank you guys so much for the time and advice, I will put it into action.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)