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

Joystick axis range #72

Closed
macsforme opened this issue Mar 9, 2017 · 1 comment
Closed

Joystick axis range #72

macsforme opened this issue Mar 9, 2017 · 1 comment

Comments

@macsforme
Copy link
Member

The raw joystick axis readings are currently subject to several obscure calculations prior to being used for driving speed/rotation. One of the factors is based on the mousebox size. While this does allow for some control over the joystick sensitivity, the results do not seem ideal. For example, at mousebox size -5, my gamepad stick reaches the full value at approximately 10% in one axis, and about 15% in the other. This makes it very difficult to play the game with a joystick. The obvious solution is to just map the actual values onto a -1, 1 scale. However, with a circular axis (as some joysticks have), with the stick in a diagonal direction, the maximum in each axis will be (√2)/2 (or approximately 0.7), putting joystick players at a disadvantage. While a calculation is possible to map a circular area onto a square, some sticks (such as mine) do not have a 1.0 magnitude at all angles. Some users may also need/want to adjust the sensitivity of their sticks.

It appears the solution will be to map circular sticks to the control box (square), to have some kind of test to determine the full range of the joystick, then mapping it appropriately and also offering the user a way to adjust the sensitivity of the joystick. Some kind of visual feedback will probably also be helpful.

@macsforme
Copy link
Member Author

Looking at this again, I think the solution is to detach the joystick sensitivity from the mousebox entirely and just use the raw axis values, and then having the following configurable settings in the menu:

  • Assign joystick axes (including negated axes, e.g., 1, -1, 2, -2, etc.) to
    • Movement (forward/backward)
    • Rotation (left/right)
  • Set sensitivity (fractional part of axis to be actually used for control)
  • Set dead zone (maybe we can find a sane default for this? but then each controller is different...)
  • Map circular zone to square (true/false, so that holding a stick at 45 degrees will read 1,1 rather than ~0.7,~0.7)
  • Ramp type (linear ramp, exponential ramp)

I think that about covers every contingency. Thoughts?

macsforme added a commit to macsforme/bzflag that referenced this issue Jun 21, 2020
…settings to accommodate variations between devices and users' preferences.

Closes BZFlag-Dev#72.
blast007 pushed a commit to blast007/bzflag that referenced this issue Jul 22, 2023
…settings to accommodate variations between devices and users' preferences.

Closes BZFlag-Dev#72.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant