Is this collision check count normal / reasonable?

Discussion and feedback on Construct 2

Post » Mon Jan 05, 2015 1:15 am

I have attached a capx and screenshots showing what I am seeing.

The red circles called "Segments" have the platform behavior and pin behavior using Rope style.

The blue squares have Solid behavior.

There is a total of 60 objects, but I am getting 50K-60K+ collision checks per second.

Is this normal / reasonable?

RopeStylePin_Platform_Collisions.png


RopeStylePin_Platform_Collisions2.png


RopeStylePin_Platform_Collisions.capx
You do not have the required permissions to view the files attached to this post.
B
21
S
5
Posts: 196
Reputation: 1,974

Post » Mon Jan 05, 2015 1:37 am

It's something to do with having so many objects with the platform behaviour... I'm not exactly sure what, but I've come across some threads were people were saying it caused problems to have too many platform behaviour objects.

EDIT: oh, and to actually answer your question (sorry).. that might be a bit high, but it really only matters if it's causing problems on whatever device you're targeting...
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Mon Jan 05, 2015 1:51 am

So 9 objects with Platform behavior is considered a lot?
B
21
S
5
Posts: 196
Reputation: 1,974

Post » Mon Jan 05, 2015 1:54 am

well.. whether it is or not, that's where your collision checks are coming from...
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Mon Jan 05, 2015 2:19 am

The use of the platform behavior was just to add "gravity" to those segments... as it turns out just lerping the segments down on the Y axis every tick accomplishes the same thing and reduces the collision checks to zero.
B
21
S
5
Posts: 196
Reputation: 1,974

Post » Mon Jan 05, 2015 2:21 am

Because its exponential, the more objects you have on screen that has behaviors or physics or anything that requires checking for collisions, the more it has to check between each iteration of the object.

The best way is to filter out, but using instance variables and don't check for overlap or collisions until required (trigger). But it depends on the game design.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Mon Jan 05, 2015 2:29 am

This has something to do with using the pin behavior mixed with the platform objects. If you remove the pin events and just create the segments then the collision checks reduce to 1/4 what there was before.

Why not use physics behavior....?

RopeStylePin_usePhysics.capx


I checked a previous project of mine that had 6500 objects on one layout (mostly solids) and, with a tiny bit of optimization (turning the behavior off when outside a certain range etc) there were approx 250 collision checks per tick. If you can get the effect you want on the hardware you're targeting then there's no problem with what you've done....

Here's an optimized version using platform behavior that disables collisions that are far away from the objects that use rely on it.

RopeStylePin_optomised.capx
You do not have the required permissions to view the files attached to this post.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,230
Reputation: 44,892


Return to Construct 2 General

Who is online

Users browsing this forum: mihirolover and 16 guests