How do I optimise this?

0 favourites
  • 6 posts
  • Hi Guys,

    I'm doing a simple shooter and I already see some prformance issues... Could you take a look on this one please.

    This screen has been taken while all enemies were dead so the "isDead" boolean is true. I also checked with the "qq" variable if it searches for the path for dead enemies - and it's not. So the only one thing here the engine is doing is just loop through enemies (100 objects) and check the isDead boolean.

    As far as I know there is nothing (or almost nothing) faster than checking a boolean value. And it takes 3 to 4 % of my i7 CPU O.o.

    Can this be optimised somehow?

  • "Move along path" should be in event 3, not 2. Not sure if this will improve performance, but it is incorrect at the moment.

  • Ah that is true. Thanks However this doesn't solve the performence problem. Engine is not even passing the condition, so it looks like family SOL/loop is slow.

  • You could try a "For each Enemy". Sometimes you end up picking more objects than you expect, so "Event 0.5" AND "For each", then move the rest to a sub-event.

  • I tried that earlier, I thought maybe engine is looping enemy for every condition or something... but no - same result.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I just realized that I was looking all that time at how to optimize "Enemies track player" group... and just noticed that it's wrong group... the one which brings problems is "Enemies attack player".

    And I even pointed that with a red dot on the screenshot haha... time to go sleep.

    BTW: The "Enemies track player" uses 0.1% so checking boolean values is indeed as fast as expected

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