Never do a family1 against family2 collision check

Discussion and feedback on Construct 2

Post » Thu May 26, 2016 10:48 pm

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)
B
20
S
2
Posts: 70
Reputation: 1,466

Post » Thu May 26, 2016 11:31 pm

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.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Fri May 27, 2016 8:42 am

Thanks for sharing. If I remember right, Ashley said something similar not long ago in one of the topics.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717


Return to Construct 2 General

Who is online

Users browsing this forum: BackendFreak, Elliott, Rastacity and 8 guests