Collision cells, Hit or miss?

Discussion and feedback on Construct 2

Post » Tue Jan 28, 2014 12:03 pm

Not really a performance problem, but there's another byproduct of the collision cell update that at least has affected me and the game I'm developing: particles no longer collide with sprites. I know (as Ashley has told me before) that particle and sprite collision was something not really supported or featured, and it may actually be some kind of hidden bug-feature, but I'm just stating it as it's my biggest concern with this update right now.
I'll put a link to my original post, where I also uploaded a capx in case anyone wants to look at it: http://www.scirra.com/forum/particles-sprites-and-collisions_topic84682.html
B
9
S
4
G
2
Posts: 12
Reputation: 2,772

Post » Tue Jan 28, 2014 12:41 pm

@Kybele - post a bug report following all the guidelines or the problem won't be looked at.
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Tue Jan 28, 2014 1:10 pm

So as @STARTECHSTUDIOS reported (thanks for the clear repro!) there is an edge case with collision cells: turret behaviors with extremely long ranges can in some closes be slower. The turret behavior is not really designed for that, and it should be easy to work around. More details in this thread: http://www.scirra.com/forum/improving-upon-the-performance_topic84725.html
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Tue Jan 28, 2014 10:14 pm

@Ashley does the line of sight behavior cause similar issues? I have a layout with about 13 enemies spread over it and they have a pretty short line of site (300px or so) and that particular layout continues to generate upwards of 50K collision checks while all my others have dropped to less than 10K and in most cases less than 5K...
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573

Post » Tue Jan 28, 2014 11:06 pm

@Ashley

Thanks for the quick reply and detailed response.

I greatly appreciate your concern for this topic...

Only one problem, the issue still exists in my current project which I have been working on for over 6 months...it is now broken.

I sent in a simple .capx and a detailed bug report, but the problem still remains unresolved.

So what are my choices:

Choice #1) Try to retool my project that has been finely tuned and was working perfectly before the update...

Choice #2) Use an older release of Construct 2 indefinitely :(

Choice #3) Ask the developers of Construct 2 on the forums to please help. (Personal Favorite)... :).

Choice #4) Throw in the 'Pixelated Towel.' Which I predict would probably lead me away from Construct 2...Most Disappointingly :(

I have posted a reply to your last message in the link:

http://www.scirra.com/forum/topic84725_post495791.html#495791

Again, thank you for your attention to detail concerning this issue...it's great to have developers who are so responsive to the needs of their user base! You guys are Awesome!! Seriously... :D.STARTECHSTUDIOS2014-01-28 23:16:17
B
82
S
32
G
7
Posts: 281
Reputation: 10,675

Post » Wed Jan 29, 2014 12:24 pm

@BluePhaze - quite possibly... but it still shouldn't be a problem unless you have loads of objects or can measure a reduction in framerate.

@STARTECHSTUDIOS - as my post says, in theory #1 is straightforward: if you want turrets working over unlimited range, just replace them with events to always rotate towards the target.

Either way, I guess this proves edge cases exist where there's a big performance difference. I'll see if an option can be added to enable/disable collision cells after all.
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Wed Jan 29, 2014 1:33 pm

Wouldn't it be better to just optimize the turret behavior and line of sight to work better in those edge cases? I.e. switch the turret off from collision cells if it detects that it's doing extra work...?
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Wed Jan 29, 2014 4:17 pm

@Ashley Thanks, yeah there is a big performance difference on that layout on mobile devices, the others run smooth, but that particular one stutters on many devices. And it is a much simpler layout than most of my others which have nowhere near the amount of collision checks happening. My only assumption is that it is the line of sight behavior. I have two sets of checks on that particular layout, the enemies test if they have collided with a particular type of sprite block (I originally had them checking against a family with all my terrain blocks, but changed it to see if it was causing the issue), and they also check to see if they have line of site with the player sprite as they patrol back and forth.

Somehow between these behaviors the 13 enemies are causing over 50k-90k collision checks. It is a bit crazy, luckily it is only one layout but it tends to kill performance. But with that said, it still performs better than it did with brute force. Brute force checks on that particular layout were doing 70-100k checks prior to the implementation of collision cells. So I am seeing the benefits, I just can't figure out this particular layouts issue.BluePhaze2014-01-29 16:20:35
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573

Post » Wed Jan 29, 2014 4:39 pm

@Fimbul - it's very hard to define a specific point at which to switch over, and the switch point could always still make it slower depending on how many objects are involved. It's probably not practical.

@BluePhaze - it's easy to test your theory: turn off the behavior and see if performance improves! Collision cells should never increase the collision checks count, but in some cases it may make each collision check more expensive.
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Wed Jan 29, 2014 4:52 pm

@Ashley, but do you even have to have a switch point? Wouldn't it be better if, instead of having the "use collision cells" be a project-wide setting, why not let it be a property of the turret/LoS behavior?Fimbul2014-01-29 16:53:12
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Google [Bot], vegapomme27 and 6 guests