Actor gets stuck on other actors and decelerates, ruining game play. Any help?

sonicspeed53

  • *
  • Posts: 136
I've been working on a physics puzzle game kinda like drop box, except I plan to have very complex systems and puzzles, all of which rely on the physics system cooperating. After working on the game for a few days, I found this "glitch", and how sometimes, by random chance, an actor with a box collider when sliding on other actors with a box colliders, will get stuck when sliding between two of the actors.

Video:
https://youtu.be/1cZvVGTUNbM

This could potentially ruin gameplay, as breaking the right combo of blocks should always result in a victory. (Currently, I have a level which the glitch can occur on. If it occurs, the crate doesn't have enough momentum to clear a gap, which results in a loss even if all the proper boxes are broken for the level to normally complete.) Does anyone know how I could potentially fix this?

Thanks in advance!

DTH

  • *
  • Posts: 148
have you set the box friction to 0?

sonicspeed53

  • *
  • Posts: 136
The box has a friction of 0.01. I set the value to 0 and the problem still exists.  :'(

sonicspeed53

  • *
  • Posts: 136
Another example: https://youtu.be/GoQJmAZVTEE

When the video gets to the second level, the way I broke the blocks should have resulted in a victory. Instead, the crate collides with one of the breakable boxes the wrong way, and it screws everything up. Anyone have any ideas how to fix this?

DTH

  • *
  • Posts: 148
 you can post 100 videos showing the glitch but without knowing how you setup the world even Mystic Meg will struggle with finding a reason, there are multiple factors involved

if it was my game first I would turn off friction for all objects involved, reduce the mass of the main block and maybe reduce world gravity slightly, the down force could be causing the stutter, if persists check and double check collision shapes, turn on debug shapes and use magnifier to zoom in and check the "levels" of the shapes, if all was ok I would make a small example testing different surfaces (actor/tiles) and see if Stencyl/Box2D is reacting the same to both, and then I would post that example to the forum and ask how to fix once I have either isolated the issue or offered up a working example for the sake of forum etiquette

I'm new to Stencyl yes, but I know Box2D from other frameworks, when the physics are not working right its almost 100% of the time because physics settings are wrong





sonicspeed53

  • *
  • Posts: 136
you can post 100 videos showing the glitch but without knowing how you setup the world even Mystic Meg will struggle with finding a reason, there are multiple factors involved

First off, I didn't know whether or not the first video proved it's point, as it was a minuscule version of the bug. I uploaded the second hoping it might clarify something. Excuse me if I was wrong.

Second, I turned off all objects friction, reduced world gravity, and I would have reduced the main block's mass, except it was already 0.01. I tried using Continuous Collisions and tried without it. I then attached the debugger and built a scene to test the difference between actors and tiles. If by "levels" of the shape you mean to check if the shapes are all flat and non rotated, they are gridlocked with no rotations. If that is not what you meant, can you please clarify? Excuse me for uploading another video, but here are the results: (I slowed down the game on the 3rd attempt) https://youtu.be/Zm9OnFURlA4. I isolated the issue to be an actor on actor issue, and I don't know how to fix it.

Please excuse my lack of forum etiquette, as I have not used Stencyl or it's forums in quite a while.

LIBERADO

  • *
  • Posts: 2647
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

DTH

  • *
  • Posts: 148
You seem to have taken my comment very personally, it was not intended to cause any offense, Mystic Meg is a very funny comedy character portrayed by Brian Conley (ah, no that was Septic Peg but there the same thing) and I expected my comment to be taken with the same comedy intent with which it was written, my bad.

with your reply also came the reason and solution to the issue, the corner of the box is snagging on one of the seems, LIBERADO's solution will sort that out, but I'm left wondering is this a bug, with zero friction no gravity should there be snag of a box edge passing over a seem of 2 actors ..... or just a quirk of Box2D ..., certainly worth investigating.... no?

sonicspeed53

  • *
  • Posts: 136
You seem to have taken my comment very personally, it was not intended to cause any offense, Mystic Meg is a very funny comedy character portrayed by Brian Conley (ah, no that was Septic Peg but there the same thing) and I expected my comment to be taken with the same comedy intent with which it was written, my bad.

It's cool, I never heard of Mystic Meg and kinda brushed it aside as sass, haha. Sorry about that...

You can use the solution that I suggested in this thread: http://community.stencyl.com/index.php/topic,42099.msg236482.html#msg236482

Believe it or not, this actually made it worse... https://youtu.be/EDUwhz0mIPo It seems that basically, making the corners like that helps it flip, haha.

with your reply also came the reason and solution to the issue, the corner of the box is snagging on one of the seems, LIBERADO's solution will sort that out, but I'm left wondering is this a bug, with zero friction no gravity should there be snag of a box edge passing over a seem of 2 actors ..... or just a quirk of Box2D ..., certainly worth investigating.... no?

I don't know how frequent Box2D is updated, but back in the Stencyl 1.0 days, this was never a problem. I do remember hitting this bug in 2013 though... So unless new version of Box2D were introduced to Stencyl, this might be a Stencyl problem.

DTH

  • *
  • Posts: 148
Box2D was last updated on the 5/4/2014 and as I can find no mention of an update in the forum based change-log I would assume the toolset components are kept current, the same system is dealing with the tiles to so yea I agree there must be an issue with Stencyl's implementation for actors as tile collision work flawlessly

I was planing a game with a mechanic like that hence why I was eager to get to the issue, looks like we going to be forced to use the Tile API instead of actors for now, not to painful, with a slight adjustment you can still make your game, or a basic version of it at least

LIBERADO

  • *
  • Posts: 2647
Set to 0 the bounciness of all actors.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

letmethink

  • *
  • Posts: 2547
Tile API would work equally bad. The problem isn't Stencyl's implementation of box2d, it is box2d itself. Box2d doesn't have pixel perfect collision so estimates boundaries, making it sometimes slightly wrong. The reason tiles work flawlessly is because Stencyl converts them into one collision shape (not multiple joined ones). (Turn on debug drawing to see this)
~Letmethink