-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Movement doesn't work as expected when mapping keys and axes to the same action #45628
Comments
Possibly related to #44721. I don't have access to a PS4 controller; so, to help with troubleshooting, please provide the output (which button number or numbers is reported to be pressed) for each direction of the D-Pad when running the Joypads demo under both 3.2.3-stable and 3.2.4.rc1. |
Thanks @madmiraal The button numbers for 3.2.3-stable and 3.2.4.rc1 are the same. Let me know if I can help with something else. |
@mapedorr I'm struggling to understand what the problem is and it's difficult to tell from the video what is happening vs what is expected. With the joystick connected, please complete the following table:
|
@madmiraal Hi, sorry for the late response and for not making clear what's going on.
Same occurs for diagonals (pressing two buttons at the same time). |
@mapedorr Just to clarify: It's behaving as if you've released the button when you haven't, but you don't see that in the Joypads Demo? |
@madmiraal Exactly \ (-^〇^-) / |
I am having this issue as well, my player stops and goes when using d-pad inputs in 3.2.4-rc2 not registering the key presses consistently. <:( |
This may be a duplicate of #43674 i.e. the |
@mapedorr Does the problem go away if you remove the axis mappings from the Input Map |
Yes @madmiraal . The problem disappears if I remove the axis mappings. 😄 |
@madmiraal yes, I have them mapped them to same action, in this case movement and the input is checking action_strength. |
Mapping multiple keys or a key and an axis to a single action is known to cause issues: see #30888 and #39287. #30890 updated the documentation for @bojidar-bg suggested, changing the behaviour of |
I'll update my code to handle this. Thank you so much for your help @madmiraal . |
@mapedorr @robertarnborg I've created a PR (#47599) that should fix this problem. However, I don't have a PS4 controller to test it with. Please test it for us. |
This GDScript workaround might help: #30890 (comment) |
I have noticed this same behavior for |
There's currently no way to disable controller support entirely, but I suppose that will need to be added eventually (e.g. with a project setting and |
… support) Currently the 3.2.X and 3.3.X branches of Godot seem to have issues having multiple actions set to the same input. godotengine/godot#45628 (issue) When a joystick axis and a dpad direction are put together the added joystick axis breaks the dpad behaviour. Resulting in the dpad stoping randmonly after a couple of presses (ranges from 1 to 6 presses before stopping fully). 4.0 should have a fix for this review support then or if the fix is backported to the >=3.3.X series of Godot versions. godotengine/godot#47599 (fix)
@joemicmc, I was recently hunting this issue with my game and someone playing it through a Steam Deck. Fortunately (unfortunately), someone else reported similar behavior with a different device entirely. Through testing, the different device was issuing axis events along with dpad events. But from what I can tell with the Steam Deck's virtual controller, once it's engaged (at least with Godot) it fires off a continuous flurry of axis events at close to 0.0 levels. I believe this behavior is a mistake in the Steam Deck (hardware or software--I don't know). The resulting behavior is that even if you are listening for action events via _input, even if you are just using dpad, unwarranted axis events most likely registering under the action's dead zone will "unpress" the behavior you may have associated with dpad. And depending on how things are engineered, wonky behavior can ensue. What does this have to do with the "different device"? Well, I had to tighten up my input processing to be robust enough to deal with both nonsensical & unexpected behavior. An easy & less ideal way out is to decouple the game pad axis from the action associated with your dpad. I'd recommend doing that unless you really need both to work. |
I have the exact same issue : my controller, when plugged, is throwing some random events (the left joystick), and it calls the actions which is mapped to the "d" key of the keyboard. I understand that this #47599 will fix the issue. But why do we have a deadzone parameter in the "controls" section of godot if it doesn't apply ? I mean, the events of the joystick are really small, something like 0.17, but it still sends the event wheareas the deadzone parameter is defined at 0.5 ? I don't understand why it throw events if we have this 0.5 deadzone... From my point of view, the deadzone parameter is not working as expected, no ? |
@jordanlis, I agree in that I was thrown off by these events coming in despite the dead zone. But when you think about it, you have to get at least one event that registers under the dead zone, in order to report the action is not "pressed". So either it is up to Godot to filter out redundant events or the onus is on Godot clients. I believe you are advocating the former. Note that even if that was done, it wouldn't resolve the issue @hawkerm is having. In which case, I don't think Godot can be made generally intelligent enough to handle every case without potentially stomping on another. I could be wrong. That being said. If Godot did try to reduce redundant axis events above and below the set dead zone, it certainly would save a lot of headache. |
Well, first I don't understand the deadzone feature (how is it useful if it doesn't work as it should ?) From what I understand the only solutions are :
I just wish I could have another solution. Anyway I can be patient and wait for a next release.
Totally agree on that |
@jordanlis You can use jakeymg's workaround here, for now. |
It seems to be a solution for dpad and joystick. Maybe it can be done the same way with keyboard / controller... I'll have to test. These days, I didn't have any issues with this joystick, the joystick seems more stable. Anyway. I know where to look when I'll try to fix it in the future. |
"Device sending a flurry of events" is usually a sign of broken device and/or drivers, so it's alarming to hear that Steam Deck exhibits that behavior (it's too new to be a hardware fault) Definitely means this issue should be given a higher priority (not to mention it's blocking an important QoL PR ) |
@Zireael07, yea I was surprised to see it. A user reported the associated behavior to me so I bought a Steam Deck and saw it on my own as well. The odd thing is joystick deadzones can be set & tested on a Steam Deck--when I tested mine I saw no visible jitter or movement outside the default deadzones. Worth noting again that I saw the "flurry" only after any button on the deck is engaged; until then it is silent. My gut intuition says that it's likely a software meets hardware issue on the Steam Deck's side, closely associated with behavior of the "Steam Virtual Gamepad". Where might such an issue be reported? I assumed noting the behavior here was sufficient enough, given Valve stated they "talk to Godot" 😂: |
Did they? I have not seen any Valve employee even talk about this engine, much less add to it.
Considering that this is happening with other controllers while Steam is not running, I think it's safe to say that it's probably not Steam and more of a logic error. |
I have this issue with a PlayStation DualShock 4 controller on both a Windows system and a macOS system, with Godot 4.1.1. The reproduction was the same as others are seeing here: buttons randomly stop reporting being pressed. Since I am new-ish to Godot, it wasn't obvious whether I was doing something wrong or if the issue was with the engine. Unfortunately, I lost half of a vacation day to tracking down the root issue (combining buttons and joystick inputs). I got to learn a bit about Godot in the process, so it wasn't entirely wasted, but I can't imagine the Godot maintainers want new users to go through this frustrating experience. If the Godot maintainers are not ready to merge the proposed patch, please consider adding a warning in the Input Map dialog that says "Combining Joystick and Button presses in the input map is not supported: see issue #45628"; or disable combining buttons with joystick axes entirely. The warning/error would have saved frustration; and I can see from the comments on this issue it would help others as well. |
I'm completely new with godot since a few days ago and immediately ran into this issue in my first 30 minutes of making a project and trying to make a character move. I had no idea this had anything to do with a controller being connected so it took me days to figure out this was the issue. I did figure out that 4.0 and 4.0.4 don't seem to have this issue at least for me. I only have this problem in 4.1 and 4.1.1. In my completely clueless opinion as someone new to the engine, maybe the default behavior for godot should be to only accept inputs from either controllers or keyboards, not both at the same time? If this kind of functionality is wanted it should be a choice by the developer? Or go back to the handling in 4.0 where this wasn't an issue? |
This issue isn't new in 4.1. It's also present in 3.x.
It's likely feasible to ignore inputs that don't come from the last used device type (controller or keyboard), but a proper fix will probably require not much more effort than a workaround like that. |
I can't reproduce this bug in 4.2 dev using the attached project. |
Oooh, I will test in the next 4.2 release with my Steam Deck as that is where I saw issue. |
Nice. Will this fix end up in 3.6 too at some point? |
Yes (if the fix is confirmed to work correctly), but the fix can't be trivially cherry-picked. It shouldn't be too difficult to redo for Edit: This issue needs to be fixed first: #81164 |
The following issue described in #68433 is still happening on 4.2-beta1: One axis should be 1, the other 0 if you press a single key, however I get values such as (0.998444, 0.055762) if either:
I have found this to be true if a ps5 dualsense is plugged in while pressing keys. When the dual sense is unplugged, this does not happen to the keyboard inputs. |
This is still an issue for me on Godot 3.6. I confirmed using the sample project. Used a PS4 DualShock controller, Windows. |
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version:
3.2.4.rc1.official
OS/device including version:
Windows 10 (19042.746)
Issue description:
When I plug in a PS4 controller, KinematicBody2D doesn't move properly while using the d-pad buttons or the keyboard. Same occurs if I use DS4Windows to emulate a Xbox 360 controller (XInput).
(!) Note The same code works fine in Godot v3.2.3.stable, both for the PS4 controller (with and without DS4Windows) and the keyboard.
Steps to reproduce:
Repeat steps 1 and 2 in Godot v3.2.3.stable.official and the rectangle will move without problems.
Minimal reproduction project:
GamepadInputError.zip
The text was updated successfully, but these errors were encountered: