How do I reduce the CPU load for this event group?

0 favourites
  • 3 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • So i'm trying to have exploration take place via probes that explore, and ive made it so whenever the amount of explored units to actually translate to a explored zone is reached, it makes a variable a RNG wherein the result decides what type of zone is granted to the player.

    if im getting more than 5 zones/sec, the game falls behind and cant catch up with the exploration variables. is there a way to reduce CPU load here?

    also, the reason i have the original formula twice is so that i can keep a running total count while also sending off the amount to the random number generator section

  • Don't calculate the same thing twice! Set ExploredUnits2=ExploredUnits. Use ELSE for your DiscoveryMod checks. It will reduce the number of tests, on average, and you'll only need the <= test for all but the first one. Do you really need to test those every tick? If not, use every 0.x seconds.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • awesome, thanks for the info. will utilize at least 3 suggestions

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