Skip to content

Conversation

grishhung
Copy link

Changes

This PR changes the way that haptics work when using an InputView. The ultimate goal is to make clearer when inputs are being released and maxed out, and the thumbstick haptics have accordingly been redone entirely to better mimic the sensations of a real eight-pointed N64, GCN, or Wii joystick.

Button haptics changes

  • Made it so that when a button is released, a light haptic is played (which is softer than the button press haptic, medium). This makes it easier to tell when buttons have been lifted, which can be particularly helpful in some racing games where accelerate and brake are pressed and released repeatedly.

Thumbstick haptics changes

  • Made it so that if the stick hits the edge of the frame (defined by an outer deadzone of 0.05), a rigid haptic is played and the user knows that they cannot go any further; also made it so that if the stick moves along the edge, a rigid haptic is played for each new octant that is entered. Octants are defined such that octant 0 is (0, π/4), octant 1 is (π/4, π/2), and so on (the inner deadzone counts as nil). This was done to mimic the feel of the tapping of the stick and the hard plastic enclosure.
  • Made it so that if a new octant is entered while the stick is not at the edge, a soft haptic is played for each new octant that is entered. This was done to mimic the soft tactile sensation when moving a stick along the interior, but in eight slices rather than the previous four (which matches the behavior of a real stick).
  • Made a soft haptic play when the stick is removed from or reintroduced into the inner dead zone. The exception to this is when the stick is released from outside of the inner deadzone and snaps back to the origin, a light haptic is played. Previously, this release was a medium haptic, which could be confused with the medium haptic used for a button on press.
  • Made the input's inner deadzone a circle rather than a cross. Previously, the deadzone was bounded by half widths of 0.1 extending upward and sideways rather than a circle with radius 0.1; this is inconsistent with some other emulators and leads to unintended directional snapping and incorrect haptic behavior when moving up and away from the center or moving from one quadrant to another (these deadzones would often cause the haptics to fail to trigger at all).
  • Extended bounds to the true width of the frame. This is in contrast with before, where 75% of the circle by area was outer dead zone, making the stick extremely sensitive and difficult to control. This was also done to make it such that when the visual stick stops moving, the user feels the haptic of maxing out the magnitude at the same time; this previously created a visual disconnect.

Testing

  • Tested on an iPhone 13 Pro running iOS 26.
  • Verified button changes on all emulators on in both portrait and landscape modes.
  • Verified thumbstick changes on various N64 titles in both portrait and landscape modes.

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

Successfully merging this pull request may close these issues.

1 participant