Odd behaviour - Player can run over gaps.

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi all

    I found an odd behaviour today that I was able to recreate in the sample platformer in C2.

    Basically what happens is that, given a small enough gap, a player running over the gap without jumping hits the opposite edge and travels downwards - but then pops back up and continues on the floor.

    Sample Capx

    To see this in action, just run right. The player should bounce back up and continue on, despite the bottom edge of the box actually catching. One quick fix is to crank the gravity up for the player, but that also affects his jump arcs.

    Has anyone ever noticed this before? Is this an issue with Construct or something more fundamental to programming?

  • Construct's platform behavior has always had a weird way of rounding off corners. I've tried forcing the player down a few pixels when running over gaps (using collision offsets) but nothing has worked very well and if it does it looks bad.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not that surprising. The gap is very small because the player doesn't fall until they're completely off the platform. This is when the player starts to fall (when moving slowly, moving faster it would go even further off the edge before it starts to fall):

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/walkovergap.png" border="0" />

    So the gap to cross is less than 32 pixels.

    Depending on the movement speed and value of gravity, you can make it across the gap before you fall down.

  • Interesting, I hadn't thought of that.

    Based on this, I wondered if this a problem with any platformer. I loaded up some flash platformers and was able to replicate this problem. I also wondered perhaps this could be replicated in old Nintendo games? Especially games with quite floaty characters like Super Metroid.

    I went and watched some videos of a few SNES games and it's funny how rare they have two platforms of the same height next to each other. They always seem to be 32 pixels up or down. Sneaky <img src="smileys/smiley1.gif" border="0" align="middle" />

    I came to the same conclusion you did by setting the gravity higher, but I found it also changes the jump arc quite a bit. I'll play with the settings a bit more and see how it goes but I think I'll also update my level design a bit to try and avoid small gaps like this.

    Thanks for the responses. Discovering little design issues like this, even in old games, I always find fascinating.

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