PlatformerObject Default Controls, sustained jump issue!

I know that I am not the only one who experienced the following issue, but was wondering if there could be a way of setting the expected default controls for the PlatformerObject behaviour?

The issue arose out of trying to create a jump that would not bounce into a second jump as soon as the player hit the ground if the jump button/key was still being pressed.

The simple solution would seem to be setting the jump event to only ‘Trigger Once’ right?

This worked on the most part, but resulted in tiny jumps as using ‘Trigger Once’ prevents the Platformer behaviour from applying the sustain jump feature, which I wanted to keep.

I saw a work around for this from NiorPhamtom89 which was to ignore the default controls when the player is on the floor and to not ignore them when the player in jumping, therefore, even with ‘Trigger Once’ on the initial jump event, the PlatformerObject continues to use sustain as default controls are still enabled during a jump.

It seemed to work like a charm and I thought that it had totally cured the problem, with everything working perfectly as expected, until I tried using the gamepad, at which point the tiny jumps immediately returned as there are no default controls for gamepad and of course, whilst pressing the A button to jump, I was not pressing the Space bar (Default jump control) to sustain that jump.

It is only a thought, but would it be possible to have a default gamepad control layout in PlatformerObject, i.e D-Pad for up, down, left and right and A button for jump?

Or alternatively allow the developer to configure the expected defaults for PlatformerObject, including gamepad button options?

It is particularly frustrating as the one reoccurring issues that players have found with playing my current demo is the bounce jumps, which are not received well at all.

Almost everyone that has played has commented that they would rather have a single jump per press, but the sustain is also important, so losing one for the other is not a sufficient fix for what I am aiming for.

My current build has the fix in place for playing on keyboard, but is still broken as far as gamepad play is concerned (Still bounce jumping)

Any suggestions for alternative workarounds would be greatly appreciated also.

Thank you for reading.

A few things to clarify:

  • What you’re thinking about in regards to Gamepad support isn’t part of the engine. You’re thinking of the gamepad extension, which is a community extension.
  • Unfortunately, due to this there wouldn’t be a way to map extension controls in the platformer behavior.

That said, I think you’re going about this a bit more complex than you need. You should eliminate default controls entirely from your keyboard controls, because you’re trying to do actions that are outside of what the default controls are designed for (they aren’t made for limited jumps).

I’m pretty sure you can accomplish what you’re looking for with a “hasbeenreleased” style variable for the jump button.

  1. Set up your jump as normal. Add a condition of “jumpReleased is true” to the event.
  2. Set up another event that checks if the player is falling and the jump button (or key) is pressed, then set the variable “jumpReleased” to false.
  3. Set up a third event that checks if the player is falling (or on the floor) AND the jump button (and key) are not pressed (as in use the “is pressed” conditions and invert them, do not use the released variation, that goes weird in some situations). Then set the variable “jumpReleased” to true.

This should cover what you’re looking for. I did a test in the platformer example real quick to ensure it worked as I’d expect. I set the jump sustain to 0.5 as well.

Separate from all of that, with all of the conditions you have around animations and other variables, you’re probably going to want to start looking into Finite State Machines (FSMs), otherwise you’re going to potentially run into a mess of conditions that become more complex as time goes on. You can see examples of FSMs in Not-A-Vania, and there is a more basic tutorial on the wiki using animations.

Thank you for the reply, I’ll try that out later.

I was running entirely without the default controls on before I ran into this problem.

I wasn’t too bothered by the bounce jump and it worked fine with that, but I can understand the players that wanted a tighter control and must admit it does feel better on keyboard with no bounce.

Hopefully your solution will be the answer I am looking for, I’d been experimenting with a jump variable, but I hadnt tried it the way you have it set up there.

It can sometimes be frustating trying to get the logic straight in your mind, but this is where community helps, so thank you kindly!

1 Like