Trouble with actor physics

TheRoboticRobot

  • Posts: 14
I'm having trouble getting my actors (primarily boxes that are being pushed around) to behave as intended.

My scene gravity is 100 down.
All actors in question can rotate, obey gravity, and weigh less than 1kg.
The only behavior set to the actors in question is the default "always simulate" with continuous collision turned on.

example:

Here you can see a simple little puzzle. The player pushes the long rectangle, then hops aboard as it rolls on the barrels beneath. Eventually the barrels will roll out, the rectangle will tip over and the player will fall off if they are still on board.

When the long rectangle is well-balanced, it rarely shows any problems, but when it gets further into its journey and tips over, it causes multiple problems.

The rectangle will often ignore its collision and spazz-out, sometimes getting caught in the tiles, when it hits an angle of about 40 degrees or more. The faster it rotates, the more likely it is to do this. Sometimes the player will jump or fall onto the rectangular platform and it will jitter in such a way that it drops through its supports or causes the player to pass right through it.

I haven't been messing around with custom behaviors for these actors.

I've been unable to determine whether this is a physics problem, or a collision problem, or both, or neither. I'd appreciate some direction.

Thank you!  :D

Hectate

  • *
  • Posts: 4643
I have to say that, given the shapes, this is a higly unlikely cause but I have to ask. Are any of your shapes using custom polygon collision shapes that are concave at any point? This includes "terrain" shapes added to the scene (but not tiles).

I had similar "jitteryness" issues in Dreaming Big when I first made the physic objects. The solution was to create multiple shapes - all convex - to replace the concave ones.

Again, I doubt that this is the issue, but it's similar enough in description that it's worth asking.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

TheRoboticRobot

  • Posts: 14
nope, that's not it. The rectangles have rectangle collision boxes, the square boxes have square boxes and the barrels have circles.

The player's collision is always a 4-point shape as well, but it changes depending on the animation. Could that potentially affect this?

Hectate

  • *
  • Posts: 4643
How often does the animation change while on the block? If the animation changes frequently (and thus the collision shape) it can generate a sort of re-occurring bounce effect. If that's happening, it could be applying force (from falling short distances repeatedly in a short period of time) to the board and causing it to jitter.

It's best if the collision shapes have the same bottom end between animations - other people have had similar issues.

Try eliminating all other animations (maybe use a temporary player actor - just a box w/ 1 animation) and see if it still happens.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

TheRoboticRobot

  • Posts: 14
I tried this level with jumper (the default rectangle player) and it seems that the problem isn't nearly as persistent, but it is still there.

I then changed the size and positioning for the collision boxes of all of my custom player's animations to be the same. Again, it helps, but it's still happening.

I think initially, it was most commonly set-off by the change in collision between my "falling" animation and my "idle" animation; since there was a few pixels difference, it may have caused the collision box to clip into the platform, causing the player to pass through it.

We're making progress, but I'm not completely there yet. I think the length of the platform may be affecting the problem. I might be forcing it to make too many collisions at once to correctly calculate where to go. ...But I want this to function so bad  :'(