Collision error in testbed example

Firstly, my apologies if this has already been mentioned - I am truly sorry, I have looked around briefly and saw nothing of the kind.

Secondly: Hello, I am Hiato and I'm new around these parts. I have been programming for just over two years now in Delphi (FPC), Ruby (less time), C group (even less) and other misc languages [though I am very experienced in Delphi]. I have created my own Esoteric Programming Languages and many cryptographic applications/ideas/ciphers.

I have, however, recently been creating a game from scratch in Delphi and the collisions, inertia, gravity and momentum were becoming annoying (using straight line intersections was too painful and slow). That is how I landed here 🙂

I must say that I am highly impressed with what you have done so far Erin, and I cant wait to see more quality work! As things stand, I am contemplating porting my current progress in my game to the C group so that I can use this Physics Engine.

Nevertheless, the reason my post is here, and is named with its title is this:

In the testbed examples (with which I have been messing around), specifically in the stack cubes one, there seems to be an error of collision detection. If you remove, say the top cube, and drag it quickly along the ground it will go straight through the bottom cube and not affect the stack at all (they remain the stable/blue colour). Is this me, a known issue, or something strange?
What you are seeing is the effect (or lack of effect) of using discrete collision detection. The box you are moving has a high velocity so in the first frame it is completely on one side of the obstacle and the next frame it is completely on the other side of the obstacle. The engine did not check for in-between collisions. This effect is called tunneling.

The forthcoming version 2.0 of Box2D has continuous collision detection to catch in-between collisions and perform the necessary sub-steps to resolve the collision. Continuous collision detection is expensive so it should only be used on collisions that need it. So big stacks usually won't use it, but it is always used between moving objects and static (ground) objects.
Aha, I see. Thanks for the reply (no sarcasm [curse the text only world]) 🙂

I which case, I cant wait to see 2.0 alive and kicking publicly 😀
I've been using SVN 2.0.0 work-in-progress builds for some time now for a fast-paced arcade-action game, and the continuous collision detection works great when used appropriately. It's not that expensive under normal circumstances, but large "clumps" of bodies with continuous collision detection enabled can easily cause performance issues. I accidentally left it enabled for a relatively common enemy homing projectile that (unlike most projectiles) collided with a wide variety of objects, including others of its own kind. The Box2D world step started taking an unusually long time once these projectiles started piling up, but turning off continuous collision detection for them fixed the problem.

Original thread: https://box2d.org/forum/viewtopic.php?t=375