Maybe dumb question, should I disable collisions ?

Get help using Construct 2

Post » Tue Sep 23, 2014 6:52 pm

Should I be disabling collisions for sprites that do not need it? Or will the C2 engine only check for collisions against objects relevant to the event? I have hundreds of instances of sprites that serve as background decoration.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 7:12 pm

well you can just reduce the polygones to the minimum, but leave it active , making disable collision actions, might use resources more than leaving it enabled.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Tue Sep 23, 2014 7:26 pm

You can disable collisions in the object properties, so no events would be needed.
I always disable collisions for objects that don't need it..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 23, 2014 7:26 pm

Thanks!

@warville

I meant to disable in the GUI, I did not mean calling actions to disable it. However if C2 uses some form of ABBA collisions it might not be necessary?
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 7:31 pm

You can disable them in properties, as shown in this screenshot:
You do not have the required permissions to view the files attached to this post.
B
32
S
7
G
4
Posts: 398
Reputation: 4,591

Post » Tue Sep 23, 2014 7:35 pm

I know I can disable them in the object properties, that is what I'm asking about!

PERFORMANCE WISE

If All Sprites are flagged with collision, will ALL sprites be tested against on each frame

OR

does C2 use an algorithm similar to ABBA so that only objects relevant to the collision are checked?

I'll just turn them off to be sure.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730

Post » Tue Sep 23, 2014 8:19 pm

Of course Construct 2 does not check collisions for any objects if it's not requested by a collision event or behavior. That would be really inefficient and slow down your games for no good reason. So it doesn't do it. Therefore disabling collisions for any objects you don't actually test collisions for has zero effect on performance.

Even of the objects that are checked for collisions, it only checks nearby objects (using the collision cells optimisation), and of those, it does a really fast AABB rejection test.
Scirra Founder
B
399
S
236
G
89
Posts: 24,546
Reputation: 195,436

Post » Tue Sep 23, 2014 9:04 pm

Awesome, thanks ashley. I had assumed something like that but wasn't sure.

Ashley you have amazing patience for answering newbie questions. Thank you for that.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 19 guests