Acceptable number of objects and collision checks

  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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.

  • 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:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)