AS3 2.1 Port (Alchemy), WCK Update and Kinematic Demos

If that's the case, the loop variant doesn't seem to work for me, in the sense that the smooth collisions don't appear to work (it works exactly as before). I'll use edges and report back my findings.

My canonical test case is a scene with an actor that moves in 4 directions and a slab in the middle. If I walk towards the slab from the bottom, hit the bottom edge and then slide left and right, I will snag one of the corners rather quickly.

http://www.stencyl.com/tests/stuck1.swf

(If the case above works, try walking into it from the sides and then moving up and down past the corners. You will get stuck just as quickly.)
I can only get it to snag once it moves completely out of contact with the slab and then moves back toward it.

Example: I move right and touch the left of the slab. I move up to the top of the screen, so I'm no longer touching the slab. I move back down and am blocked by the top left corner of the slab.

I thing this is expected behavior (but obviously not ideal). Erin could give you a better explanation.

For a while now I've been wondering if a built in, pixel-perfect tiling engine would be a worth while project. Tile based physics are dead simple. Getting them to interact with the rest of Box2D would be difficult though.
The problem i have with loop shapes is the same as i had with edge shapes, sometimes objects pass through them, which to me makes them kind of useless.

I don't know about anyone else but i much preferred the older build, it seems much more stable, objects feel more solid, joints are more stable...
That is also an issue if the objects are small and travel quickly enough, but it's my impression that you could work around it by turning on CCD?
Got one more issue I'm running into.

With edge loops, it appears that a loop that contains 24 or more vertices will crash, and the stacktrace, after some trial and error to hunt it down in the C++ part of the code, is caused by b2Fixture.cpp:Create -

Code:
m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy));


I was thinking that there may be some constant that is at play, but I can't find anything related to loops or edges.

Picture 1 - 22 edges (OK)
Attachment:
Picture 1.png
Picture 1.png [ 5.86 KiB | Viewed 224 times ]


Picture 2 - 24 edges (Crashes)
Attachment:
Picture 2.png
Picture 2.png [ 5.66 KiB | Viewed 224 times ]


Code:
[object AlchemyExit]
   at <anonymous>()
   at <anonymous>()
   at Box2DAS.Dynamics::b2Fixture()[/Users/jon/Desktop/redacted/sandbox/enginef/Box2DAS/Box2DAS/Dynamics/b2Fixture.as:25]
   at Box2DAS.Dynamics::b2Body/CreateFixture()[/Users/jon/Desktop/redacted/sandbox/enginef/Box2DAS/Box2DAS/Dynamics/b2Body.as:105]


Edit: Modifying the b2BlockAllocator to up the block sizes averts the error, but it also causes all my bodies to become stationary.
Jon wrote:
hat is also an issue if the objects are small and travel quickly enough, but it's my impression that you could work around it by turning on CCD?


It happens with CCD on. If you play around with the "edges" demo in the none WCK testbed you will see it, the box can be dragged through the single edge, and dragged inside the box made of edges.

Everything is fine if i use good old fashioned static polygons for my world collisions.

As for the other problems with the new build, in the "ragdoll" demo drag a ragdoll over a corner of the box in the middle of the screen. The joints just pull apart, they remain solid in older builds.
I agree there are some valid issues with the latest C++ code in SVN. I think the best approach is to put together some C++ test beds that demonstrate the issues so Erin can see them in action. I've been meaning to do this for a while but would appreciate the effort if anyone else wants to give it a go.
If I'd like to add a flag to loop shape to not close up the loop, where's the logic for creating the "loop" - I can't find it in the obvious places like b2LoopShape.as/h/cpp.
I have some problem with WCK. In the Blank Project, if I just change the value of the World gravity to something else it stops moving, like there is no gravity at all. I get no error. Doesn't matter if I put it back to 10 again.

If I change "scale" it throws this error:
Code:
Assertion failed: (bd->position.IsValid()), function b2Body, file ../Box2D/Dynamics/b2Body.cpp, line 27.

[object AlchemyExit]
   at Function/<anonymous>()
   at Function/<anonymous>()
   at Box2DAS.Dynamics::b2Body()
   at wck::BodyShape/createBody()
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at wck::World/doOutsideTimeStep()
   at wck::BodyShape/create()
   at misc::Entity/ensureCreated()
   at Function/<anonymous>()
Assertion failed: (bd->position.IsValid()), function b2Body, file ../Box2D/Dynamics/b2Body.cpp, line 27.

[object AlchemyExit]
   at Function/<anonymous>()
   at Function/<anonymous>()
   at Box2DAS.Dynamics::b2Body()
   at wck::BodyShape/createBody()
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at wck::World/doOutsideTimeStep()
   at wck::BodyShape/create()
   at misc::Entity/ensureCreated()
   at Function/<anonymous>()


If I change values on Joints, for example changing lowerlimit and upperlimit on the ragdolls in the water demo, the joints freaks out and starts spinning a lot.

I'm using the latest version. Anyone knows why this happens when I use the component interface?
boasera: I tried changing both scale and gravity in the blank project - it worked fine. Really not sure at all what could be happening on your end.

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