Strange behaviour of the platform... behaviour!

0 favourites
  • 10 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • Hi everyone! =)

    I recently made a micrometroidvania for MiniLD #34 (you can find it here: ludumdare.com/compo/minild-34 ) and everything went quite smoothly, apart from a strange glitch I only noticed yesterday.

    To put it brief, the main sprite sometimes gets stuck midair on the side of a platform. It can still be moved away without any problem, but this thing is really strange. It's something like this:

                ----

    ----------| |

                | |

                | |

    ----------| |

                ----

    where the big rectangle on the left is the platform and the smaller one on the right is the player.

    Now, the platforms are 24x24 blocks with the Solid behaviour. The player is made out of two parts: an invisible 24x48 block with the Platform behaviour and the collision mask slightly shaved off on the upper part, and a player sprite with no behaviours at all that gets moved to the invisible rectangle's position on every tick.

    Anybody's got an idea about this strange behaviour? I'd like to avoid it in the future, since I'd like to write a proper and bigger metroidvania with Construct 2. =)

  • This is probably caused by ever-so-slightly sloped collision masks. If you have rotated objects or non-bounding-box collision masks, a very slightly off-vertical line can count as a very steep slope, and in some circumstances the platform behavior can land on very steep slopes. So I'd double check your collision masks, and if that doesn't help, post a .capx example showing what's going on.

  • Yeah, Ashley is right. I had a similar problem and couldn't figure out what was up. The problem was my collision polygon, it was slightly slanted, and this caused some rather embarrassing issues.

  • We discussed this issue a while ago and came up with a few alternatives to fix it.

    Hope this helps you out!

  • This is probably caused by ever-so-slightly sloped collision masks. If you have rotated objects or non-bounding-box collision masks, a very slightly off-vertical line can count as a very steep slope, and in some circumstances the platform behavior can land on very steep slopes. So I'd double check your collision masks, and if that doesn't help, post a .capx example showing what's going on.

    I checked the collision mask and it's actually vertically skewed by one pixel on the right side, but I don't think that's the origin of my problem since the sprite gets stuck on platforms on the left side as well. =|

  • We discussed this issue a while ago and came up with a few alternatives to fix it.

    Hope this helps you out!

    Thanks for pointing that out!

    It doesn't exactly apply to my problem, but it's very instructive nonetheless. And quite scary, since I really hoped the Platform behaviour was going to work flawlessly out of the box. =P

  • Well, technically, it is working flawlessly. It just so happens that many people's situations don't require being able to hold onto steep slopes! If you think about this, any way Ashley could have implemented sliding down slopes would be unsatisfactory to some people, so it was a good move to avoid this extremely complex situation (even more so because the platformer has to put up with rotated gravity!)

  • [...] It just so happens that many people's situations don't require being able to hold onto steep slopes! If you think about this, any way Ashley could have implemented sliding down slopes would be unsatisfactory to some people [...]

    That's right, I know. It's just that seeing my player get stuck on normal, square platforms is kinda strange. =P

  • the link to the discussed topic is broken

    I just wanna make the player fall/slide off the rotating platform instead of just awkwardly staying in the same spot while the platform rotates underneath.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the link to the discussed topic is broken

    I just wanna make the player fall/slide off the rotating platform instead of just awkwardly staying in the same spot while the platform rotates underneath.

    lastsliceofpie

    This thread is 4 years old in a the C2 General Discussion section. Not really appropriate for your post.

    It looks like you require specific help, so it would be best if you created a new topic in the 'How Do I' section with as much detail as you can, preferably with an exported .capx for us to look at.

    Thanks

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