Closed wong-justin closed 3 years ago
What you're seeing is the difference between physical inputs and processed inputs. This is expected.
controller.current
is the physical inputs that you've queued up, but haven't sent yet.
gamestate.player[port].controller_state
is the processed inputs for that same frame.
A
controller.current
should be the same asgamestate.player[port].controller_state
for any given frame, but the sticks and trigger values don't match.Sample logs during a frame: From controller:
(<Button.BUTTON_MAIN: 'MAIN'>, 0.45, 0.62) (<Button.BUTTON_L: 'L'>, 0.52) Button.BUTTON_A
From gamestate:(<Button.BUTTON_MAIN: 'MAIN'>, 0.5, 0.6875) (<Button.BUTTON_L: 'L'>, 0) Button.BUTTON_A
I set random values for the main stick and L trigger at the beginning of a match. The controller state read directly from the controller matches those values as expected, but from the gamestate it's mostly wrong. The stick coords are roughly close, and the trigger just stays 0. The other digital buttons seem to be recorded fine (eg. A).
Tested with ports 1 and 2 on v0.20.2.