Collision cells, Hit or miss?

Discussion and feedback on Construct 2

Post » Wed Jan 22, 2014 8:02 am

The introduction of collision cells to increase performance was more than welcome, as optimised as C2 is "brute force" collision checking in a frame rate undulating browser environment, is a bottle neck on many projects...

Unfortunately I did not get the performance gains I had hoped for, in fact I got a drop in performance, despite my game being pretty much a perfect fit as far as I can tell, breaking none of the Caveats "many static instances, same type, same none parallax layer"

Even reworking events removing "focusing" collision checks moving collisions to top level ect, did not help...

I find it difficult to believe that C2 sizing the cells automatically can be optimal for each and every project, and surely if the cells are unused due to caveats, the fact it has checked for them, will give a performance drop overall?

The caveats, can be difficult to track in a complex event sheet with many objects involved, maybe I have missed something? and that's half the problem.

I am curious if Cell sizing options or a collision cells off option, would allow fine tuning of collision check heavy games, I would certainly like the option...

So my question is, has anybody else gained or lost performance, in games that were in development prior to the introduction of collision cells?
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Wed Jan 22, 2014 10:58 am

If your project is not bottlenecked on collisions it won't have any effect at all. What does the debugger profiler/system performance stats tell you? Is the performance difference the same across all browsers?
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Wed Jan 22, 2014 1:18 pm

Maybe this as come across as a complaint, but actually I am really impressed with C2 performance overall...

At the moment I am stress testing, running R153 At fullscreen 1024x768 it's pushing 169 meg of video ram with average 900 objects in the layout, hitting anything from 200-1000 poly checks per tick! CPU average 35%-40%

In chrome I'm getting a consistent 50-60 FPS, node webkit rarely drops below 60, firefox struggles at 15-20 FPS.

Not bad, In a browser environment on a seven year old system running windows XP, fitted with an ATI radeon 3400 graphics card...

What I don't get is why exactly the same game, after updating to a C2 build that uses collision cells loses me 20 FPS on chrome 10 FPS on Node and Firefox sits at 10 FPS but still functions...just.

If the cells are not suited to My game, "Brute force" is fine by me, but I could just do without the performance drop.

I did notice that in recent C2 versions the poly checks per tick can rise by a good few hundred and only 1 cell ever seems to move, but that's in my brute force optimised build, I gave up on the cells weeks ago...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Wed Jan 22, 2014 5:44 pm

I haven't done any load testing yet, but that's pretty weird. The collision cells should have a very minimal performance loss. These question may help narrow the problem.


- In your build, are you having all your objects randomly placed in the window? (as opposed to clumped up in one small area)

- How large are your objects?

- By "brute force optimized" build, do you just mean that all the objects have rectangular/square collision bounding boxes? Or is there more?
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Thu Jan 23, 2014 12:42 pm

@danialgoodwin I was under the impression the collision cells were a performance enhancing feature, so minimal is too much...

Objects are a mix of random, player placed and static, but mostly static after being randomly placed at start of layout not sure that's relevant as most object in any project would be similar...

objects again a mix but pretty small 16x16 the most prevalent objects, that is probably why I can get away with so many collision checks per sec...

By "brute force optimised" I mean, I have not edited My event sheet, to ensure I do not break any of the caveats, required for the collision cell performance gain.

Cheers for feedback.

So nobody has gained or lost performance since collision cells were introduced?... Kinda odd...Pixel perfick2014-01-23 14:15:59
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Thu Jan 23, 2014 1:44 pm

I found no difference, was optimistic for potential performance gains but nope.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Thu Jan 23, 2014 6:00 pm

[QUOTE=Pixel perfick] @danialgoodwin I was under the impression the collision cells were a performance enhancing feature, so minimal is too much...[/QUOTE]

I should clarify myself. From the way I understand collision cells, it takes a little bit of overhead to have, but theoretically (and most of the time) you won't notice the very slight drawback because the benefits are much greater.

Each of those questions I asked provided a use case where there could potentially be more work required for using collision cells rather than using only brute force.

Maybe you could share your simplified load-testing CAPX? I wouldn't mind running it to test my computer.danialgoodwin2014-01-23 18:05:35
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Thu Jan 23, 2014 11:14 pm

Cell checking shouldn't result in a performance loss at all , on the worst case , the performance shouldn't go lower than the "brute force" approach .

Could you give us a bit more details
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,481

Post » Thu Jan 23, 2014 11:49 pm

Collision cells, by their design, should not affect the number of poly checks. If you find it changes it's hard to comment further without a .capx.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Fri Jan 24, 2014 1:43 am

For my particular game, on all but one layout my collision checks dropped from an average of 60,000-90,000 to around 5,000. That is a huge difference. I only have one layout now that still gets over 40000 collision checks and I can't figure out why for the life of me. But overall it has made for a huge boost in performance.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,603

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests