dynamic collisions in iminib3d

BlitzMax Forums/MiniB3D Module/dynamic collisions in iminib3d

jhocking(Posted 2010) [#1]
I've found that dynamic collision detection slows my game to a crawl. Is this expected, and are there any tricks I can do to speed things up while retaining the very useful dynamic collision detection? I'm thinking about trying out this code archive entry to see if it works:
http://www.blitzmax.com/codearcs/codearcs.php?code=898

My latest level had been having horrible slowdown on device, and after a bit of snooping I've figured out that turning off the dynamic flag on objects clears it right up. I didn't notice at first because there's no slowdown in the simulator, but once I tested on device the framerate dropped like a rock.

Incidentally, when I had dynamic true for just a couple objects it was fine, but in my latest level I had it set for 8 objects (still not a huge number) and that killed my framerate.


simonh(Posted 2010) [#2]
Yeah dynamic collision detection is quite slow I'm afraid, especially on a standard 3G. The routine you link to is what's used in iminib3d. One way to speed it up is to only turn on the dynamic flag when you need it.


jhocking(Posted 2010) [#3]
heh yeah I only just noticed that you're the author of that code archive entry. I was thinking I might try only turning on the dynamic flag for objects when they are moving (which will only be one at a time) so hopefully that works for my situation. My main concern is that if I wait until they are moving to turn it on then it might be too late, so I'll need some way to figure out which are about to move before they actually move.

EDIT: yay that optimization worked