Platform behavior - Deceleration when turning around

This forum is currently in read-only mode.
From the Asset Store
Like tourists, Travel around the world as fast as you can!
  • This is something I've found very odd with the platform behavior. It's a lot more noticable at high speeds. When a sprite with a platform behavior is walking in one direction, and th player suddenly makes him/her turn the other way, the object does not slow down in the direction that it was going in. However, when the player releases the movement keys, the object slows down. Am I the only one who sees this as a problem?

    Really, it would be more realistic for the character to decelerate quicker by moving in the other direction than just stopping. Maybe there should be an option for this? It just seems... Jarring, at the moment.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried the Simple Platformer template, and it does have acceleration when you change direction. It doesn't change direction instantly like you describe. Maybe your Floor Acceleration/Deceleration values are wrong?

  • Er... beaten by Ashley but I'll post anyway.

    Play with the floor/air acceleration and deceleration until you get the effect you're looking for. For instance, setting the deceleration very high (in the thousands) will stop the player instantly upon releasing the key.

    If you want it to look like you player is turning around faster than he can stop, then set the acceleration higher than the deceleration.

  • I think you misinterpreted what I meant. Deadeye knows what the heck I mean, now. If you want to see the effect I'm talking about, here's a cap that Deadeye made:

    http://willhostforfood.com/files3/6094689/sliding.cap

    Now, when playing, get a good run-up, find a good stopping point, and then do two tests. For the first test, let go of the keys, the player should stop fairly quickly. For the second test, instead of letting go of the keys, quickly switch to pressing down on the opposite movement key. The character will slide much further.

  • He's right, it does act funny. Stopping happens quickly but when turning around you sliiiiiiide for a long way.

    At higher acceleration and deceleration values it's not as noticeable, but since he's trying to recreate Sonic's movement, it's very noticeable.

  • I don't think its anything unusual. It's just that the floor acceleration is much lower than the deceleration.

    When you let go of all the controls, you decelerate to a stop (at the floor deceleration rate).

    When you press the opposite direction, you accelerate in the opposite direction (at the floor acceleration rate).

    So yes, if you set the acceleration much lower than the deceleration, you'll get this slightly weird behavior. It doesn't seem to be a problem with the whole movement - just this specific combination of settings. Perhaps it would be more realistic, if you are changing direction, to add the deceleration and acceleration rates together. Then when you start accelerating in the direction of the arrow key you are pressing, it carries on at just the acceleration rate.

  • Perhaps it would be more realistic, if you are changing direction, to add the deceleration and acceleration rates together. Then when you start accelerating in the direction of the arrow key you are pressing, it carries on at just the acceleration rate.

    Yes, I think that's the effect he's going for. It does seem strange that when stopping you slide say ten feet in the direction you were going, but when turning around you slide twenty feet. Turning around should make you slide less than stopping, not more, no matter what your acceleration is set to.

    Even if your acceleration was set to 1 you should slide just about as much when turning around as you do when stopping.

  • That is pretty trippy. Maybe if you think hard enough you can find a real life situation to match. Maybe it's like when you're in a car on ice and slamming on the breaks sends you into a slide.

    But if you ask my two cents ...

    ...

    ... well I'll give it anyway. I would think most objects will come to a stop in about the same time whether they're planning on heading the opposite direction afterward or just remaining stationary.

  • I too have found this problem rather annoying, since it�s impossible to have a character that accelerates slower than he decelerates and still having the movement relatively sane. However, I would say that it�s still a problem if you have a higher acceleration than deceleration since this will still provide a slower change of speed than it should. I guess what I�m saying is that acceleration and deceleration should always be summed together when turning around. Also, in my opinion, any good platformmovement should have higher deceleration than acceleration (as in Mario, Sonic, Wonder boy and many others) and this is simply not doable right now (at least without making some events of your own). I actually for a time thought this was something that was going to be fixed, but now I have learned to manage anyway.

  • I made a workaround for this situation, but I too found it to be a pain.

    +"Move Left" is down

    +Not "Move Right" is down

    -Player: Set angle to 180

    -Player: Set acceleration to 300

    ++Player[Platofrm].VectorX Greater than 0

    --Player: Set acceleration to 1500

    Perhaps the behavior could include a feature like this by default? Even better than just setting the acceleration to a particular number, you could make the turnaround acceleration to acceleration + deceleration.

  • This is corrected in the next build. When you change direction, the deceleration and acceleration are added.

  • This is corrected in the next build. When you change direction, the deceleration and acceleration are added.

    Woho! Thank you very much, this will really help improving the platform behaviour.

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