Optimization question.

0 favourites
  • 5 posts
  • I am currently working on optimizing my game, "Psi." One method I'm using is doing an instance count before having the sub events activate. If Boxmutant.Count > 0 then... Does that seem like a good approach?

  • Without more info about the sub-events I'd say no. If the sub-event has conditions that pick boxmutant objects then comparing the object count is redundant since if there are no instances then it automatically won't run.

    Basically for optimizing you should only optimise slow areas and somehow check performance before and after to see if things were improved. Me personally, I try to keep events simple and readable. The profiler can be useful to check what percentage of the country's each event group is using, and help identify what areas need More attention.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound - if the sub event is a "for each" loop, would a count condition keep the loop from running when no instances are present or will the loop not run anyway, without such an additional condition?

  • The golden rule: if you can measure a performance improvement, it's worth it; if not, you're wasting your time.

    I doubt you will be able to measure any performance improvement from disabling when there are no instances, because in that case there are no instances to run conditions/actions/loops on, so there's still nothing to do.

  • OK, thanks Ashley - I'm trying to wrap my head around optimization and the most efficient use of events.

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