Skip to content

Let each controller stick's dead zone be set, in percent - #526

Merged
bnunu merged 1 commit into
testingfrom
controller-dead-zones
Nov 3, 2026
Merged

bnunu merged 1 commit into
testingfrom
controller-dead-zones

Conversation

@GuvenHuso

Copy link
Copy Markdown
Collaborator

A worn stick that drifts needs a larger dead zone than the game's own (9000 of 32767, about 27%), and a player who wants finer aim a smaller one. This makes each stick's dead zone a setting.

What changes

  • Two settings, input.left_stick_dead_zone and input.right_stick_dead_zone (HALO_LEFT_STICK_DEAD_ZONE, HALO_RIGHT_STICK_DEAD_ZONE): -1 (DEFAULT, the game's own 27%) or 0 to 50 percent. Stock by default.
  • A STICK DEAD ZONES screen under Settings > Gamepads (after BUTTON REMAPPING and BUTTON APPEARANCE), with DEFAULT first and then 0% to 50% in steps of 5.
  • source/input/input_xbox.c (marked port:) reads each stick's dead range from halo_stick_dead_range() (port/linux/src/xinput_sdl.c) instead of GAMEPAD_STICK_DEAD_RANGE.
  • The check of whether the right stick, not the mouse, aimed last uses the right stick's dead zone when it is set below that check's deflection.
  • On Android and the web the touch controls' stick goes through the same path, so the left setting applies to it too.
  • Gamepad Setup's screen is written again by tools/port_settings.py (not by hand): eleven rows at its 27px step would put the last in the help text, so it takes a 25px step and Video Setup's help position.
  • The settings table in port/linux/README.md documents both settings.

No network version change: the dead zone only shapes a player's own input before it is predicted and sent.

Checked

  • The settings screens' generator and the menu files are identical on testing and where this was written, so the generated XML matches the generator's output.
  • ninja windows builds.
  • The harness (tools/harness, tools/test_touch_menu.py) on Windows: the same failures as on testing (the Windows-only environmental ones), none new.

🤖 Generated with Claude Code

A worn stick that drifts needs a larger dead zone than the game's own
(9000 of 32767, about 27%), and a player who wants finer aim a smaller
one. Each stick's dead zone is now a setting, input.left_stick_dead_zone
and input.right_stick_dead_zone: -1 (DEFAULT, the game's own) or 0% to
50% in steps of 5. A new STICK DEAD ZONES screen under Gamepad Setup sets
them, after BUTTON REMAPPING and BUTTON APPEARANCE.

- source/input/input_xbox.c reads each stick's dead range from
  halo_stick_dead_range (port/linux/src/xinput_sdl.c) instead of
  GAMEPAD_STICK_DEAD_RANGE, which stays the default.
- The check that the right stick, not the mouse, aims last uses the right
  stick's dead zone when it is set below that check's deflection.
- On Android and the web the touch controls' stick goes through the same
  path, so the left setting applies to it too.
- Gamepad Setup's screen is written again by tools/port_settings.py:
  eleven rows at its 27px step would put the last in the help, so it takes
  a 25px step and Video Setup's help place.

Nothing the machines send each other changes: the dead zone only shapes a
player's own input before it is predicted and sent.

Checked: the settings screens' generator and the menu files are the same
on testing as where this was written, so the generated XML is unchanged;
the Windows build; the harness against testing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bnunu
bnunu merged commit 47f68d9 into testing Nov 3, 2026
7 checks passed
TechnoidAlpha pushed a commit to TechnoidAlpha/OpenH1 that referenced this pull request Nov 4, 2026
A worn stick that drifts needs a larger dead zone than the game's own
(9000 of 32767, about 27%), and a player who wants finer aim a smaller
one. Each stick's dead zone is now a setting, input.left_stick_dead_zone
and input.right_stick_dead_zone: -1 (DEFAULT, the game's own) or 0% to
50% in steps of 5. A new STICK DEAD ZONES screen under Gamepad Setup sets
them, after BUTTON REMAPPING and BUTTON APPEARANCE.

- source/input/input_xbox.c reads each stick's dead range from
  halo_stick_dead_range (port/linux/src/xinput_sdl.c) instead of
  GAMEPAD_STICK_DEAD_RANGE, which stays the default.
- The check that the right stick, not the mouse, aims last uses the right
  stick's dead zone when it is set below that check's deflection.
- On Android and the web the touch controls' stick goes through the same
  path, so the left setting applies to it too.
- Gamepad Setup's screen is written again by tools/port_settings.py:
  eleven rows at its 27px step would put the last in the help, so it takes
  a 25px step and Video Setup's help place.

Nothing the machines send each other changes: the dead zone only shapes a
player's own input before it is predicted and sent.

Checked: the settings screens' generator and the menu files are the same
on testing as where this was written, so the generated XML is unchanged;
the Windows build; the harness against testing.

Taken into OpenH1 from OpenCommunityEdition#526, still open
upstream, from its branch: the settings and input_xbox.c's dead ranges as
they are; the STICK DEAD ZONES screen is left to OpenH1's settings
generator, in a later commit.

(cherry picked from commit 12e92b6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: medium Normal priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants