Input lock bug

Kasumi

New member
I've toyed with reporting this since minutes after trying Super Beta Bros. 3. Finally decided to.

Switching directions in one frame causes input to be ignored until a button is pressed again.

bJTmxw9.gif

The player ends up holding left, but the character will not move left until the player releases, then presses left again. (The animation will continue, though.)

It's more an issue with the provided scripts than the software itself. I have ideas about how to fix the scripts, but I'm not a beta dude so I can't actually test them.
 

Mihoshi20

Member
I've noticed this a lot when specifically trying to go right, but might be an issue with all inputs universally. Seems to happen fairly consistently.
 

RadJunk

Administrator
Staff member
Yeah, it’s a problem with the simplicity of the scripts :) well aware. These are ‘dumb movemenr’ scripts. Essentially, it’s happening because when you release a button, it stoppa. So if it reads a button release AFTER a button press, it stops. I’m aware, but sonce the engine is sort of a dummy engine, we’re more focused on the tool interface itself. Still, these are good to see!
 

RadJunk

Administrator
Staff member
Looking a bit deeper - it's not an *input lock* that you're experiencing. What's almost certainly happening is that if you are pressing LEFT and then press RIGHT and then let go of LEFT, the letting go is the last thing it reads, which makes it "stop moving horizontally" as per the scripts. This would not happen with a controller (or should not) since I don't think it's possible to press opposite directions simultaneously. However, a fix I could implement engine wise is to have one script that makes it move (which is activated on button HELD) and one that makes it change direction / state (activated on button PRESSED). That way, if you're holding the button after the other is released, it will respect the hold, as it will continually be checking for that.
 

Kasumi

New member
There is never a frame where both directions are pressed simultaneously. A frame of left, then a frame of right. A frame of right, then a frame of left also works, as does a frame of up, then a frame of down, or a frame of down, then a frame of up. Two frames, each with exactly one direction pressed.

But even if it were simultaneous left+right, relying on a controller to filter that is not a good move. That's (part of) why you can skip levels in Wario Land, and crash or beat Yoshi's Island very quickly.
 

RadJunk

Administrator
Staff member
Kasumi - yes. This is not a final input code by any means. This is a *simple* code to demonstrate very easily how the input manage works.

Are you SURE it's not the release of a button causing the stop? Because logically, the way the current simple code works, that makes sense. Like, if you're holding right, and let go of left, it will stop horizontal movement, thus no right movement...since we're only activating the physics engine on "pressed" rather than "down". This is how the problem should really be fixed, however I was trying not to overwhelm users with code pointers in the first tutorial (using pressed, down, AND released).

Let me know if you're sure it's NOT coming from a release event...I know you know how to tech this stuff pretty well. :)
 
Top Bottom