Box stuck in level ground

I've written up and diagrammed what I thought could be happening:

Image

This would make some sense if the solver was only performing one iteration, but my understanding of it is that the position iterations and velocity iterations parameters are there to specifically do more than one iteration, and I'm using 10 for each (and have tried many different combinations).

Does anyone know if I'm even on the right track there?
The cause of the problem has been described in other posts. Basically the bottom corner of the character is hitting the upper corner of the ground box. The ground boxes don't _know_ that they have adjacent neighbors and form a smooth surface.

In Box2D shapes have a skin with radius b2_polygonRadius. Shapes in sustained contact have slightly overlapping skin. In a system that uses floating point math, this kind of overlap always happens. This is how these box corners can collide.

There is a FAQ about tile based worlds in the wiki:
http://code.google.com/p/box2d/wiki/FAQ

I'm working a solution for edge chains, but there is no solution for adjacent polygons. You are really better off using one or more circles for character vs environment. Most professional games using modern physics engines use smooth shapes, like capsules, for characters. Using box shapes for characters really only works well in systems that use pixel based collision with integral math (i.e. older console games).
I'm working on a platformer an ran into the same or at least similar problem as cloove did. In my game the world constits out of a lot of connected squares wich are technically compound bodies with multiple fixtures. Since the level is breakable, i need to have collisions on each fixture and also my fixtures maintain different frictions.

https://www.dropbox.com/s/si70drzugqbvn ... 134344.png

So when the player is pushing a tile and it slides along the ground, it happens to get caught between two fixtures, which completely destroys the gameplay.

@Erin: Since you posted you answer in 2010 - have you found a solution yet?
The chain shape mentioned has now been implemented, so you can replace the polygons with a single chain shape for the outline to avoid the sticking problem. If that proves to be too much trouble (given that you want different frictions and dynamic ground) you might have to settle for bevelling off the corners of the tiles.
One approach I've used for games with tile-based environments is to preprocess your game environment, marking each environment object to give it knowledge of the directly adjacent ones.

For each side of each object, check whether it's fully concealed on each side by objects adjacent to it. You could do this outside of Box2D, like I do, if you know your objects' view/skin matches the size of their Box2D shapes.

For each side of each simple rectangular environment object that is concealed, mark one of 4 boolean values to false - "useRightSide=false", for example. Then, in your ContactListener, use the collision normals between your player/moving entity and those walls/floors, and if your normal indicates that a particular side has been hit, check the corresponding property to decide whether you should use that collision. If you shouldn't, then set the contact to enabled=false.

I've never really cared how inefficient this is, because I saw no noticeable impact with my game. It was a sophisticated enough solution for my simple game.

This can also be an issue with moving platforms, but technically you could be modifying these useSomeSide properties at certain cue points during gameplay. If you know your moving platform connects with two neighbouring but distanced floors, perhaps build those floors in such a way that they're stacked, with a top layer of floor whose height matches the moving platform's height. Then, modify the use/ignore flag for their left/right sides as the platform meets either end of its path. Quite a nuisance, but it should work. I just haven't got round to it yet!

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