0 Favourites

What could cause the CPU Use to skyrocket?

  • While testing my game after making a few minor changes, it slowed down to a crawl and eventually stopped. I was wondering what could cause that. It was working fine before the changes.

    The only changes I made were just copy and paste of existing events and reapplied to a new object. I made a new level using the new object and that's when it started. Nothing else is new and I've made dozens of levels with nothing like this happening before.

    I could keep checking my event sheet, but I wanted to know if there was anything specific that could cause this to help speed up the search for a possible error. I'm just a little confused.

    Thanks for the help!!!

  • sounds like your object count could be the culprit. Or a particle system who's lifetimes are too long.. etc..

    How long does it take to slow and then stop?

  • Aquanex2

    Run the game in debug mode:

    1) Watch the object count and see if it starts to climb - if so you know that you either have a loop somewhere that's churning out objects, or you're not destroying objects.

    2) Check the profile tab and look at the percentages for the different systems - is there anything that's using a crazy amount of CPU time? If so that's most likely the culprit.

    3) If neither of these tests identify the problem go back to your code and start disabling events one by one of the latest stuff you added in and run it - don't worry if it breaks other things - just see if it fixes the slowdown; this should help you zone in on the offending events.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Aquanex2

    Run the game in debug mode:

    1) Watch the object count and see if it starts to climb - if so you know that you either have a loop somewhere that's churning out objects, or you're not destroying objects.

    2) Check the profile tab and look at the percentages for the different systems - is there anything that's using a crazy amount of CPU time? If so that's most likely the culprit.

    3) If neither of these tests identify the problem go back to your code and start disabling events one by one of the latest stuff you added in and run it - don't worry if it breaks other things - just see if it fixes the slowdown; this should help you zone in on the offending events.

    Thanks guys! I've been testing the level over and over again, but I couldn't recreate what was happening on a consistent basis, and after the last 20 times I've tested it, nothing happened. If it ever happens again, these tips will surely help!

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