Performance - Disabling Event Groups

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.
  • Hi there,

    I'm considering setting up event groups that will be enabled / disabled at very short intervals. Hoping this will improve performance by avoiding all events being tested 50 times per second.

    I would set up one event group to enable / disable (i.e. Run once) every 10 seconds (for spawns), and another to run 5 times per second (instead of 50) for the HUD display items (scores, radars etc).

    What I want to know, is the overhead with enabling / disabling at this frequency actually going to end up making it slower than just executing everything 50 times per second?

    Would the alternative of using the 'every X seconds' be better for performance?

  • I don't know.

    But it makes sense that if you have less code being run, then the game will perform faster.

    You could try doing this experiment yourself, and see how the performance compares. Perhaps just duplicate a lot of your code, till you notice it bog down, then see if your technique thing works.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What I want to know, is the overhead with enabling / disabling at this frequency actually going to end up making it slower than just executing everything 50 times per second?

    Enabling / disabling + the groups actions called 5.1 times per second will be more performant than executing the actions involved in said groups 50 times per second.

    However, don't take my word for it, just test it (this goes for pretty much all performance questions)

    run 5 times per second (instead of 50) for the HUD display items (scores, radars etc).

    I recommend a system that updates X when you change X, rather than updates X on a timer.

    For example,

    Timer based (Not recommended, imo)

    Character earns 1 point

    Every x Seconds:

    Score text updates to current point total

    Trigger based

    When character earns a point:

    Update score text to current point total

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