Complex collision mask = more CPU usage?

For questions about using Classic.

Post » Mon Aug 08, 2011 9:10 pm

With the physics behaviour you can edit the custom collisionmask.
Should i try to keep it simple or is the diffrence in performance so low that it does not matter.
I have over 50 large sprites with complex shape that i will put collision mask on.
B
18
S
4
G
1
Posts: 413
Reputation: 2,512

Post » Tue Aug 09, 2011 3:12 am

I've heard someone mention that a complex/custom collision mask will produce some slow-down, but I don't know if it will be significant on its own. Best bet is to use box or elipse wherever you can though.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Tue Aug 09, 2011 6:29 am

the fastest shape is ellipse, polygonal shapes are generally more computationally expensive as they become more concave and/or more complex as in # of vertices.
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Tue Aug 09, 2011 6:29 am

From my personal experience, custom collision masks for the physics behavior can have a big influence. When working on a fluid simulation I first used a custom collision mask with only 4 points and could use 300 instances. With the help of the community I found another method where I could use ellipse collision. The result was 6 times the number, or 2400 objects.

The more objects with custom collision and the more points in the collision mask, the more influence on the frame rate. On the other hand you might only have 50 objects in total, so it's hard to tell, when exactly it is unusable for you.

You will need to test it. Just create a sprite of the intended size and a collision mask with the number of intended points. Create 50 instances and watch the framerate.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests