You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I bind "fire" to an analog trigger of a Xbox 360 controller, the item triggers twice when I press the trigger from top to bottom once.
Steps to reproduce
Plug a Xbox 360 controller into a computer.
In STK's gamepad mapping, double-click Fire and press the left trigger. This binds firing to "Left trigger (-+)".
Start a time trial (which gives you 3 boosts), and try pressing the left trigger gradually to use a single boost.
For debugging purposes, you can get a better idea of what's happening by binding "Look Back" to left trigger.
One boost appears when the trigger is pressed around 20%, and another at around 75%. A third boost is used when the left trigger is released to 20%.
This problem does not happen if you half-press the left trigger before binding, so the screen says "Left trigger" without the (-+). But this is an unintuitive thing to do.
It appears that on Linux, STK sees the 360's analog triggers as signed/offset numbers rather than an absolute value. On Dolphin, when I bind the 360's analog trigger, it binds "Full Axis 2+/5+" and behaves as expected, whereas if I half-press the trigger before binding, it reports "Axis 2+/5+" and only starts triggering once the trigger reaches the halfway point.
Dolphin's code is located at https://github.com/dolphin-emu/dolphin/blob/2d9f789940aba806f75cd329905253c05577d837/Source/Core/InputCommon/ControllerInterface/CoreDevice.h#L92, and you can Ctrl-F for FullAnalogSurface. There's a long comment at virtual ControlState GetState() which implies that input mapping is quite janky. Dolphin apparently splits all axes (like sticks and triggers) into positive and negative parts (Axis 2+ triggers when pressing > 50%, and Axis 2- triggers when releasing < 50%), and reconstitutes these parts into an "unsigned value" (Full Axis 2+ = (max(0, Axis 2+) - max(0, Axis 2-) + 1) / 2 = 50% + signed Axis 2, Full Axis 2+ = (max(0, Axis 2-) - max(0, Axis 2+) + 1) / 2 = 50% - signed Axis 2, source code).
I'm not sure how Dolphin determines whether to use a regular or full axis when you press a stick/trigger.
How would this translate to STK?
Idea: The input options should highlight digital/analog items whenever the corresponding button is pressed (just like Dolphin). This would make bad configurations more obvious to the user.
Currently STK currently treats any amount of analog input as mapping to a digital input. If I bind "fire" to right stick movements, even the smallest movement (outside the deadzone? idk) causes the item to be used.
Oddly, if I bind left trigger to "look back", it triggers at every point in its movement except the resting position (full negative) and halfway (zero). This is why pressing and releasing it uses the item 3 times (it transitions 3 times from unpressed to pressed).
Binding "fire" to "Left trigger" (Axis 2+) works as "expected" because this analog value is ≤ 0 (IDK your internal representation) until the trigger is pressed over halfway, at which point you instantly fire as soon as the trigger is pressed above zero.
Binding "fire" to the upper half of the trigger's movement range shows the raw name "Axis 2-" like Dolphin.
, I've found strings for "Left trigger" and " (-+)" and " (+-)", though this just prints actions and doesn't record them. If you're interested I can look further into the code behind input handling.
Configuration
STK release version: 1.4
STK Source (PPA, distribution package, official binary, etc.): Flathub
System: Arch Linux???
Graphics card: AMD Radeon RX 570 Series
CPU: AMD Ryzen 5 5600X 6-Core Processor
Gamepads/keyboards models if related to the issue: Xbox 360 wired USB
Description
When I bind "fire" to an analog trigger of a Xbox 360 controller, the item triggers twice when I press the trigger from top to bottom once.
Steps to reproduce
One boost appears when the trigger is pressed around 20%, and another at around 75%. A third boost is used when the left trigger is released to 20%.
This problem does not happen if you half-press the left trigger before binding, so the screen says "Left trigger" without the (-+). But this is an unintuitive thing to do.
Semi-related: #4674
A detour to Dolphin input
Looking in the forums I've found https://forum.freegamedev.net/viewtopic.php?f=17&t=11656&p=84946&hilit=360+analog#p84946, which seems related. However it seems the option has been since renamed to
--gamepad-visuals
.It appears that on Linux, STK sees the 360's analog triggers as signed/offset numbers rather than an absolute value. On Dolphin, when I bind the 360's analog trigger, it binds "Full Axis 2+/5+" and behaves as expected, whereas if I half-press the trigger before binding, it reports "Axis 2+/5+" and only starts triggering once the trigger reaches the halfway point.
Dolphin's code is located at https://github.com/dolphin-emu/dolphin/blob/2d9f789940aba806f75cd329905253c05577d837/Source/Core/InputCommon/ControllerInterface/CoreDevice.h#L92, and you can Ctrl-F for FullAnalogSurface. There's a long comment at
virtual ControlState GetState()
which implies that input mapping is quite janky. Dolphin apparently splits all axes (like sticks and triggers) into positive and negative parts (Axis 2+ triggers when pressing > 50%, and Axis 2- triggers when releasing < 50%), and reconstitutes these parts into an "unsigned value" (Full Axis 2+ = (max(0, Axis 2+) - max(0, Axis 2-) + 1) / 2 = 50% + signed Axis 2
,Full Axis 2+ = (max(0, Axis 2-) - max(0, Axis 2+) + 1) / 2 = 50% - signed Axis 2
, source code).I'm not sure how Dolphin determines whether to use a regular or full axis when you press a stick/trigger.
How would this translate to STK?
stk-code/src/input/gamepad_config.cpp
Line 197 in a6af689
Configuration
STK release version: 1.4
STK Source (PPA, distribution package, official binary, etc.): Flathub
System: Arch Linux???
Graphics card: AMD Radeon RX 570 Series
CPU: AMD Ryzen 5 5600X 6-Core Processor
Gamepads/keyboards models if related to the issue: Xbox 360 wired USB
Additional information
stdout.log: stdout.log.txt
input.xml:
The text was updated successfully, but these errors were encountered: