Only registers collision every 3 frames


  • Posts: 235
Today, I encountered an odd error where Stencyl was only registering a collision every 3 frames. I would stand on a tile and it would work perfectly, registering a collision every frame. Then, I would step onto a platform and suddenly it would only register a collision every frame. What's odd is that the character did not fall through the platform or even change animation, implying that it was constantly colliding with the platform. This problem occured across multiple scenes and on multiple platforms. The platform had no behaviours attached to it.

I moved every behaviour and setting (including physics settings, etc) to a separate actor which had its own default collision boundaries, and the problem was gone. Therefore, it seems that the issue is with the collision boundaries on my player actor.

My player actor is the default one from the 'run and jump extended' kit. However, I did modify the collision boundaries because of the 'jump into the corner of a tile' issue, which was removed by me modifying the collision boundaries. If I reset the collision boundaries to the default ones (with 12 vertices on a polygon), the problem disappears. It therefore seems that I have to choose between two different bugs - jumping through the corner of tiles or not registering collisions properly on my platforms.

The collision boundaries that I had set were simply rectangles. The platform's collision boundary was a rectangle, as was my player character's. This issue only surfaced after moving the game to another computer via a USB drive, but I think that's simply a cooincidence.

EDIT: I have updated all the latest patches and it still is bugged.

EDIT: I removed one vertex at a time from the default collision boundary which worked, and there was a point where it went from working to not working as soon as a particular vertex was removed. The collision boundaries were 3 on each 'corner'. I removed the 2 'outer' boundaries on the top-left and bottom-left of the sprite and it continued working. When I did the same to the bottom-right, however, the problem occured. I don't know if this means anything to anyone. It's hard for me to continue testing this since editing collision boundaries is really awkward in Stencyl (with no zoom-in or copy/paste feature) so it's hard for me to see why it isn't working...

EDIT: Okay, I found a way to get around the bug. It seems that if the bottom of the collision boundary of my player character is a straight line, it only registers a collision once every 3 frames. By making the line at the bottom of the boundary a down-sloping line, the problem is immediately solved. Therefore, I'm just changing all my rectangular boundaries into polygons where the bottom-right corner is 1 pixel lower than the bottom-left corner, and it works. This still doesn't explain why it worked fine on tiles and not platforms, unless custom collision groups work differently. To be honest, the entire collision system seems to heavily bugged.

EDIT: Maybe the downward slope lead was a bit misleading, since my 'crouch' animation is still a rectangle and works perfectly. My crouch animation is the only one to use a different overall collision area size, which could be related.

« Last Edit: July 09, 2011, 06:36:17 am by Weasel8778 »