Acceptable number of objects and collision checks

Get help using Construct 2

Post » Thu Jun 26, 2014 6:14 am

Hi, I recently added a new feature to the game I'm making, and for some reason I'm taking a hit in performance.

The debugger tells me the game averages between 150 and 200 objects, and collision checks/s go from 100 to 4000.

CPU utilization ranges from 10 to 40%.

The worst thing is that for some reason, the engine sometimes doesn't detect collisions between moving objects that were detected before (this is not consistent, I checked with save/load in the debugger, and most of the time detection works). I'm using the moveTo behavior and the fastest moving objects move at 200 pixels/s (their collision polygons are 10x10 in size)

I won't post a capx for your sake (more than 250 events in the game), but if anyone wants to help and needs more information, I'll gladly provide it.

Cheers
B
6
S
2
Posts: 79
Reputation: 608

Post » Thu Jun 26, 2014 6:06 pm

any insight into this?

I just read scirra's HTML5 test topic (I can't post the url because of my rep :c)

And the game they're using to test uses a lot more sprites than I do, and I'm guessing a lot more collision checks per second also, so why does it run so smoothly? My game doesn't even have effects yet
B
6
S
2
Posts: 79
Reputation: 608

Post » Thu Jun 26, 2014 6:46 pm

I have more than 1000 objects in one layout, and the check is 14000 per tic.

I think you have bad event or many animation frames or big frames.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu Jun 26, 2014 8:07 pm

I just figured out that the debugger itself (especially while inspecting the System object) uses a whole lot of CPU. If I run the preview without the debugger (or simply don't select any object to inspect) it runs just fine, and I don't get the inconsistent collision checks D:
B
6
S
2
Posts: 79
Reputation: 608


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, GrogIsGood, koops and 4 guests