Skip to content
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

Make controller aiming analog #1818

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

McSinyx
Copy link
Contributor

@McSinyx McSinyx commented Aug 22, 2022

A few problems with this patch:

  • UX for aiming stick customization must be changed entirely (to left/right options only)
  • Aiming usually gets reset after the stick is released

The direction is also over-polling (updated on all controller analog events) but if restricted to just RIGHT{X,Y} it might not get updated at all. Perhaps it could be reduced to just attacks inputs 🤔

@dorkster
Copy link
Collaborator

Thoughts:

  • I'd like to keep the "digital" mappings for aiming and have analog aiming be a separate option.
  • We want to avoid manipulating the mouse here, since we generally warp it to (-1, -1) when using a controller. Instead, I think a better approach would be to add a "value" array like we have for pressing and expose event.caxis.value. It'd be a good idea to normalize this value so that it's between -1.0 and 1.0.
    • This change would respect the deadzone setting, which this PR doesn't currently do.
    • The mapping UX could remain unchanged.
    • Because the mouse wouldn't change, MenuActionBar::setTarget() would need to support this third method of targeting.
  • I think I'm fine with the aim resetting when releasing the stick. Basically a way to "fine-tune" the digital aiming.

@@ -605,7 +606,7 @@ void MenuActionBar::checkAction(std::vector<ActionData> &action_queue) {
}

// joystick/keyboard action button
else if (!inpt->usingMouse() && slots[i]->checkClick() == WidgetSlot::ACTIVATE) {
else if (!have_analog_aim && slots[i]->checkClick() == WidgetSlot::ACTIVATE) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct, as it is handling the player clicking on an action bar slot as opposed to clicking on the play field.

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