Never do a family1 against family2 collision check

  • I was perplexed when my collision checks were costing me 25% cpu and spent hours trying to figure out a way to remedy this issue.

    It then dawned on me later that my enemy family check against a rocket (which is not a family reference but a sprite) used almost no cpu where as my enemy family check against the Weapon family used 25% CPU ALL THE TIME even if bullets were not present.

    I then made each check happen individually and based on which weapon was equipped and suddenly the cpu dropped below 1%.

    Is this a glitch or just the nature of families? What exactly is going on behind the scenes? Is C2 literally doing a collision check for every type of weapon in the weapon family per enemy per tick?? it certainly seems so! This was quite a discovery as my game now runs considerably faster.

    Just thought I'd share... Thoughts anyone?

    Austin Morgan (SunTanK)

  • Hmm... Interesting. I can't say that I've run into this issue before, but I will certainly keep that in mind when doing my collision events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for sharing. If I remember right, Ashley said something similar not long ago in one of the topics.

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