Number of collision checks

0 favourites
  • 6 posts
From the Asset Store
Jump on numbers in the proper order and reach the sun!
  • My game contains ~150 objects per level (let's say: 15-20 moving enemies, some boxes and lots of coins) and tilemap. Debug mode shows between 3000-8000 collisions per second, but some times even 12000 (even on static screen). Is it normal? If not - can I improve it somehow?

    I already disabled collisions for all background objects.

    [My viewport is 1280x720, cell count i.e. 372, layouts are 40.000 - 100.000 width and 6000 height and I scale them to 0.3)]

  • that's pretty good

  • What only matters is how your game performs on hardware that you are targeting. You can't observe the number of collision checks outside of the debug environment (which distorts the CPU loading) so you can add a HUD text object to display the fraction of time the CPU is required to perform your game's tasks - the larger the fraction and the closer you are to 1, the closer you are to max-ing out the browser. The debug Profile is an awesome tool to use as well (as long as you use event sheet groups) so you can see if there are any groups that use up a disproportionate fraction of processor time.

  • I would like to run smooth game on dual core CPUs (like 14.000 in Antutu) however my last phone is broken, so I can test only on new one (26.000). It's going smooth but my friend has some older tablet, and he can see jittering. I'm using CocoonJS (I tried one time Chromium from CocoonJS, but it just gave me white screen).

    or maybe I should ask Ashley - what exactly means "collisions"? Does 1 object generate 1 collision check?

  • Actually, that's a pretty good reading. Even at the high end (12,000), that's only 200 checks per tick. If you are only incurring around 2*objectcount number of checks, you are doing something right.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would like to run smooth game on dual core CPUs (like 14.000 in Antutu) however my last phone is broken, so I can test only on new one (26.000). It's going smooth but my friend has some older tablet, and he can see jittering. I'm using CocoonJS (I tried one time Chromium from CocoonJS, but it just gave me white screen).

    or maybe I should ask Ashley - what exactly means "collisions"? Does 1 object generate 1 collision check?

    As far as I can tell, a collision test between object A and object B will create A.count*B.Count collision checks, minus the ignored instances via collisions cells or filtering.Behaviors benefits too of the collisions cells which will really help.

    a collision check in C2 terms is not yet checking the collisions polygons overlapping, but the bounding boxes (aka the smallest non rotated rectangle that fits the object inside), if those are overllaping, the polycheck (aka collision polygon check) will be tested, this one is far slower so keep an eye on it.

    Some behavior combinations (solid, platform, jump thru, LoS, bullet with the bounce off solid) will increase the number of collision checks, but keep in mind that they can benefit from the collision cells, which means they will ignore too far off objects (under some circumstances that you must follow, aka not using different parralax rates for collisions).

    while it is true that keeping the number of collisions checks low is nice, testing on the device you are targetting (or ask someone to do so) will be decisive, as there is never a "universally recognized" number of collisions checks to not go over, each device being different.

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