Collision gap problems, 8 direction and platformer

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
Ride an endless hill on your skateboard, jump gaps and chase high scores.
  • Can anyone help with these issues?

    1) 8 direction occasionally randomly stops just before wall, leaving a visible gap. The player will expect to stop at the wall every time

    2) Similar with platformer. Moving left or right, sometimes the player stops short of the wall.

    I've tried everything, adjusting hit boxes, turning pixel rounding on and off, changing acceleration and deceleration, and events to move the player one more pixel--also google and searching similar topics on this forum. Nothing seems to get it to work smoothly every time.

    I think pixel rounding setting may help with the platformer walls somewhat. But can't figure out what to do for 8 direction. And I am still not sure what to do for platformers.

    Is there any definitive help on these issues.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I mean I know why it happens. It’s an artifact of how those behaviors resolve collisions.

    The collisions are resolved roughly by moving in steps till there is no overlap. Since it moves in steps it’s only approximate but is generally good enough. With zoomed in pixel art the error is magnified though.

    Anyways, I don’t think there’s any setting to eliminate it, but shrinking the collision poly could shift to look like it’s slightly overlapping instead of having a gap.

    You could also do your own collision handling. Aka don’t use the solid or jump through behaviors and do your own collision detection/resolution. You might get away with doing that with the 8direction behavior but with the platform behavior it would likely be better to just do the whole behavior from events.

    Focusing on how we could do a better collision resolution, we could do a progressive stepping solution that moves in big steps first then increasingly smaller steps to get a very close near perfect touch between the objects. Alternately, you could focus on calculating where the objects should be to be just touching. Either way we’d need to be able to calculate the collision normal to be able to update the velocity.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)