Skip to content
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

Decrease the default deadzone value for actions to better match real world use cases #7069

Closed
stephanbogner opened this issue Jun 12, 2023 · 10 comments · Fixed by godotengine/godot#97281
Milestone

Comments

@stephanbogner
Copy link

Describe the project you are working on

A game allowing a gamepad as input.

Describe the problem or limitation you are having in your project

The default deadzone value is 0.5. By being the default value this implies that it's a reasonable choice.

Other people recommend a much lower deadzone value (0.05) and even the Godot docs use 0.2 as an example value.
According to my experience this also behaves weirdly (on my Xbox 360 controller this feels more like using a d-pad than a stick). This might also confuse newer devs that have never heard about deadzones.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Change the default value to something that is more realistic but also works with older/worse hardware.
Maybe to the 0.2 mentioned in the Godot docs.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Change the default value.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Basically everyone must change the setting in the input map.

Is there a reason why this should be core and not an add-on in the asset library?

It's already core, it's just about changing the default.

@and-rad
Copy link

and-rad commented Jun 12, 2023

Sounds reasonable to me. If I remember correctly, UE uses something like 0.25 and Unity somewhere around 0.15.

@Calinou
Copy link
Member

Calinou commented Jun 12, 2023

On principle, this change sounds good to me. Maybe we could even go as low as 0.15. One caveat with decreasing the deadzone by a lot is that it also affects "binary" actions associated to axes. Do we want the deadzone to be only 0.2 or 0.15 for those binary actions, e.g. when you associate the right trigger to a Shoot action?

Also, the way this should be implemented should not change existing user-created actions to avoid breaking compatibility. Only built-in actions and newly created actions should be affected by this change.

@stephanbogner
Copy link
Author

@Calinou Good point regarding binary actions! Would it technically be possible to separate them?

  • Having a default value of 0.15 for sticks
  • Having a default of e.g. 0.5 or 0.4 for triggers (but I haven't checked which value is common, maybe it's actually also around 0.15)

@Calinou
Copy link
Member

Calinou commented Jun 13, 2023

Good point regarding binary actions! Would it technically be possible to separate them?

This would add a lot of complexity to the deadzone implementation (what if you bind both a stick and a trigger to a single action?). I'm not sure if it's worth the added complexity.

I'd suggest trying various AAA/indie games and see what happens when you bind axes to binary actions such as shooting, jumping, etc. Run the game in a window (or on a second monitor), keep a gamepad visualizer open (such as the Godot Joypads demo) and see at which strength the action is triggered in the game.

@Calinou Calinou changed the title Change default deadzone value Decrease the default deadzone value to better match real world use cases Jun 13, 2023
@Calinou Calinou changed the title Decrease the default deadzone value to better match real world use cases Decrease the default deadzone value for actions to better match real world use cases Jun 13, 2023
@stephanbogner
Copy link
Author

Thanks for your thoughts!

In my quick test also a default value of 0.15 or 0.2 would be fine also for binary actions like shooting (but just my opinion).


Great idea regarding testing other games: I play mostly on console, so I have to check which games run on my machine or if I ping a friend regarding this, but def. wanna try.


Your point regarding multiple bindings on one action, also brings up the question of where to define the deadzone …

From a user perspective the following is more intuitive:

  • Set deadzone for left stick
    • Technically two axis, but normally settings only allow only one value for both axis
  • Set deadzone for right stick (likely often the same deadzone as left stick)
  • Set deadzone for left trigger
  • Set deadzone for right trigger (which again likely is the same as for left trigger)

So defining it on an action level is probably not even the best/most useful way.
But I am gonna leave it at that because it‘s a different topic, and e.g. already discussed here.

@jancborchardt
Copy link

jancborchardt commented Jul 6, 2023

Did a bit of trigger sensitivity testing with the Godot joypads tool and an Xbox Series controller.
These are the values at which the triggers activate the action, sorted by sensitivity. Sensitivity was always the same for both triggers:

  • Dead Cells: 0.363
  • GTA:V: 0.280
  • Hades: 0.268
  • Hollow Knight: 0.213
  • CS:GO: 0.174
  • Hunt:Showdown: 0.120

Feel free to add to the list so we can figure out more. :) From the sample it seems that something around 0.200–0.250 could be a better default. Let me know if I should do more or different testing.

@stephanbogner
Copy link
Author

Thanks for the investigation @jancborchardt!

Honestly I don't have enough experience to conclude anything. I think everything lower than the current 0.5 is an improvement. So: 0.2 sounds great to me, but 0.25 would also be fine.

@Calinou:
Do you want to decide this? Or how should we move forward?
And if we move forward should I create a PR with the chosen default value?

@Calinou
Copy link
Member

Calinou commented Jul 6, 2023

Do you want to decide this? Or how should we move forward?
And if we move forward should I create a PR with the chosen default value?

Feel free to open a PR with 0.2 as the default value 🙂

But as I said, the implementation must not interfere with existing projects in any way as I said above:

Only built-in actions and newly created actions1 should be affected by this change.

Built-in actions probably don't need to be modified in fact, since these are only used for binary actions unless the user is using them for non-UI purposes (which isn't recommended).

Footnotes

  1. To clarify, I mean actions created after the pull request is merged.

@stephanbogner
Copy link
Author

@Calinou Sounds great.
I am gonna dig into the code base (haven't contributed yet, but looking forward) 🙂

@akien-mga
Copy link
Member

Implemented by godotengine/godot#97281.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants