Skip to content

Add angle snapping to better support circular analog sticks #569

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

halest
Copy link

@halest halest commented Mar 2, 2025

This change is the result of this discussion.
I will also add the text at the bottom.
The goal of this change is to make circular design analog sticks (like on the XBox-Controller) behave much more closely to the notched controllers that were originally used on the N64 or the GameCube.

These commits introduce three new settings:

  • astick-snap-active
  • astick-snap-max-angle
  • astick-snap-min-displacement-percent

These are used as follows:
astick-snap-active: Enable / Disable analog stick angle snapping

astick-snap-max-angle: The maximum angle offset that will snap to the nearest cardinal direction. Example: A setting of 5 will snap 85 to 95 to 90. A setting of 10 will snap 80 to 100 to 90.

astick-snap-min-displacement-percent: The classic, notched controllers will only guide you to a cardinal direction when the stick displacement from the center is close to a maximum. This allows full freedom on slower movement. This setting, if for example set to 80% will only snap to the next cardinal direction as soon as the stick is at least 80% to its' maximum displacement from the center.

Thank you for your consideration.
Halest


Here's what was originally said:
Many emulators have a setting to snap the control stick to cardinal directions to simulate a notched control stick like on the N64 or GameCube controller.
Usually this includes a setting, which offsets to snap to the nearest cardinal direction.
For example the setting is set to "5", angles from 85 to 95 would snap to 90.

Why

  • Closer emulation of classic controller behaviour
  • Speedrunning and such
  • Better support for circular controllers

@m4xw
Copy link
Collaborator

m4xw commented Mar 4, 2025

I'll see how that feels and report backm can take a week tho, need to find my N64 controller adapter as well

@halest
Copy link
Author

halest commented Mar 4, 2025

For the best effect I recommend using a circular design analog stick controller like the xbox controller. Currently I'm using 16 degrees and 75% and find many things feel more like they would on a classic controller. It's especially evident on things like backwalking in OoT/MM, which regularly requires a very correct angle and other related tricks.

@m4xw
Copy link
Collaborator

m4xw commented Mar 4, 2025

I will be testing nintendo switch joycon and a real n64 controller

@m4xw
Copy link
Collaborator

m4xw commented Mar 4, 2025

Also i think this might be evident in glover too, that always feels a bit janky for some reason

@halest
Copy link
Author

halest commented Mar 4, 2025

Okay, I'm looking forward to the result. Since the analog stick is notched on these, I don't know if the effect will be too evident besides correcting hardware related discrepancies

@m4xw
Copy link
Collaborator

m4xw commented Mar 4, 2025

"ideally" they should have no real impact on n64 controller, but only one way to find out

@halest
Copy link
Author

halest commented Mar 25, 2025

Feels great, right?

@m4xw
Copy link
Collaborator

m4xw commented Mar 27, 2025

Haven't gotten around testing yet but thanks for the reminder

@m4xw
Copy link
Collaborator

m4xw commented Apr 14, 2025

Still some holdsups... I hope to get around to it this week

@halest
Copy link
Author

halest commented May 6, 2025

Any updates on your tests @m4xw ? In the meantime I have added this change to another core who have long since merged it :D

@m4xw
Copy link
Collaborator

m4xw commented May 6, 2025

Any updates on your tests @m4xw ? In the meantime I have added this change to another core who have long since merged it :D

I've ran into some unrelated issues with my game controllers :/
Would be nice if you can extend it also with octagonal snapping as thats what the n64 has, but i will also accept the current approach, just as is it wont be as good as the original implementation that fzurita did for their fork way back.

I'd be up to merge it blind if we gate it off by default.

grafik
init safe defaults if user entered garbo
It might look like the others dont do it but they are just handled elsewhere

@halest
Copy link
Author

halest commented May 6, 2025

Hey, the current approach is octagonal if I understand you correctly (I'm snapping to the next 45 degree angle, 360/45 = 8)
Feel free to wait and test it, I'm locally using my modified version so I'm in no hurry. Just wanted to remind you.

@m4xw
Copy link
Collaborator

m4xw commented May 6, 2025

Hey, the current approach is octagonal if I understand you correctly (I'm snapping to the next 45 degree angle, 360/45 = 8) Feel free to wait and test it, I'm locally using my modified version so I'm in no hurry. Just wanted to remind you.

Oh thats what i remembered but when i looked at the code right now it just looked like it snaps on 4 axis, didnt have my coffee yet mind you.

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.

2 participants