Skip to content

Add angle snapping to better support circular analog sticks#569

Open
halest wants to merge 2 commits into
libretro:developfrom
halest:develop
Open

Add angle snapping to better support circular analog sticks#569
halest wants to merge 2 commits into
libretro:developfrom
halest:develop

Conversation

@halest

@halest halest commented Mar 2, 2025

Copy link
Copy Markdown

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

m4xw commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

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

@halest

halest commented Mar 4, 2025

Copy link
Copy Markdown
Author

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

m4xw commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

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

@m4xw

m4xw commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

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

@halest

halest commented Mar 4, 2025

Copy link
Copy Markdown
Author

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

m4xw commented Mar 4, 2025

Copy link
Copy Markdown
Collaborator

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

@halest

halest commented Mar 25, 2025

Copy link
Copy Markdown
Author

Feels great, right?

@m4xw

m4xw commented Mar 27, 2025

Copy link
Copy Markdown
Collaborator

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

@m4xw

m4xw commented Apr 14, 2025

Copy link
Copy Markdown
Collaborator

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

@halest

halest commented May 6, 2025

Copy link
Copy Markdown
Author

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

m4xw commented May 6, 2025

Copy link
Copy Markdown
Collaborator

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

halest commented May 6, 2025

Copy link
Copy Markdown
Author

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

m4xw commented May 6, 2025

Copy link
Copy Markdown
Collaborator

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.

@halest

halest commented Jun 14, 2025

Copy link
Copy Markdown
Author

Hey @m4xw , I never explicitly commented on the default value question: The set values are in my opinion close to optimal for emulating the original hardware feeling and I use these settings daily for my Zelda Speedruns/Randos.

@hizzlekizzle

Copy link
Copy Markdown

@halest hey man, I put in this input-related PR awhile back, as well: #581 and it doesn't look like they conflict, exactly (basically, yours would affect the default analog handling and be bypassed if mine is enabled, I think?), but if mine is merged, it's going to move around where yours fits in.

Would you be up for testing that interaction?

@halest

halest commented Dec 2, 2025

Copy link
Copy Markdown
Author

@hizzlekizzle Hey, awesome, thanks for the heads up. I have pretty much given um on this ever being merged and switched to another core. They merged it within days but I can recreate this setup and test it with you, absolutely. Probably not before some time next week though if that's alright.

@hizzlekizzle

Copy link
Copy Markdown

Sure, no big hurry. Thanks!

@m4xw

m4xw commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

Hey, awesome, thanks for the heads up. I have pretty much given um on this ever being merged and switched to another core. They merged it within days but I can recreate this setup and test it with you, absolutely. Probably not before some time next week though if that's alright.

if i didnt plan on merging it, i wouldve closed it long ago. If you both settle on what we gonna merge, i am gonna go ahead

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.

3 participants