JibbSmart / JoyShockMapper

A tool for PC gamers to play games with DualShock 4, DualSense, JoyCon, and Switch Pro Controllers. Gyro aiming, flick stick.
Other
793 stars 67 forks source link

Feature Suggestion: Gyro movement around Y(top-down) axis option #49

Open NightWarrior opened 4 years ago

NightWarrior commented 4 years ago

Hey guys, really love this repo, just stumbled on it today and it works like a charm. I have a suggestion, Right now the (using joycon) gyro's movement is around its length axis which i believe is its Z axis in 3d space, so if i point the remote towards the screen like a pointer, then rotate my hand (like a screwdriver) to the sideways on the Z axis... then all gyro movements from there onwards are not natural to the hand, like rotation towards left side then moving the joycon up moves to the right.

JibbSmart commented 4 years ago

Hi! The gyro movement should not be around the Joy-Con's length axis by default. When pointing the Joy-Con at the screen, I can turn it left and right to move the mouse left and right, and turn it up and down to move the mouse up and down, kinda like how one would use a Wiimote (no screwdriver-rotation). Can you confirm that this is what's happening, and what configuration settings you're using?

NightWarrior commented 4 years ago

Hi! So i made a small (sloppy) video related to what i'm talking about. https://imgur.com/io7DE23 I think its very natural for humans to not keep a remote in their hands facing up and that can make for inaccurate movement on the screen. As i rotate the joycon more, the up and down movement starts to convert to left and right movement.

As for my configs, I just used the provided windows.txt and made very minor changes like keybinds and sensitivity. Here are my configs:

Windows interaction using gyro

Clear previous settings

RESET_MAPPINGS

Calibration

REAL_WORLD_CALIBRATION = 5.3333 IN_GAME_SENS = 1 COUNTER_OS_MOUSE_SPEED

Button mappings

GYRO_OFF = E UP = 1 DOWN = 4 LEFT = 2 RIGHT = 3 LLEFT = A LRIGHT = D LUP = W LDOWN = S R = LMOUSE L = RMOUSE

  • = ESC ZL = LSHIFT S = SPACE N = R
  • = ESC

Aim settings

Gyro sens of 1 means you'll turn the same amount in game as in the real world

MIN_GYRO_SENS = 2 MAX_GYRO_SENS = 4

Gyro thresholds are in degrees per second

MIN_GYRO_THRESHOLD = 0 MAX_GYRO_THRESHOLD = 75

Stick sensitivity is in degrees per second

STICK_SENS = 360 STICK_POWER = 6 STICK_ACCELERATION_RATE = 1 STICK_ACCELERATION_CAP = 2

RIGHT_STICK_MODE = FLICK

RIGHT_STICK_MODE = AIM

JibbSmart commented 4 years ago

Thanks for the video example. It appears you want the option for JoyShockMapper to use global rotations instead of local rotations. This could be done by using the accelerometer to estimate the direction of gravity and combine it with the local rotations to figure out the new orientation -- this is called "sensor fusion".

Sensor fusion makes gyro aiming less precise, though, because it becomes a compromise between two sensors that don't always agree with each other. It also makes the controls less intuitive -- when your controller is pointing up you now have to twist the controller around the gravity axis to turn it left and right, and this feels weird when it doesn't match your orientation in-game. It requires the player to be sitting upright to be useful, and even then you can find yourself in weird edge cases.

JoyShockMapper intentionally does not do that and just uses local angular velocity. It's like how the game you're playing doesn't know (or care) where on the mousepad your mouse is. If you hold the mouse sideways, it's gonna be weird. But if you hold it straight and understand that all reported motion is in the mouse's local space, it's a very consistent and reliable input.

In the same way, the way JoyShockMapper works gives you more precision and consistency with your gyro aiming. You can play the same lying down as you can sitting up. You could be hanging upside down. You could be skydiving. It'll all work the same.

Sensor fusion is useful for VR and AR, or for manipulating a 3D object (I use it in my 3D overlay), but I dislike it for using the gyro as a mouse and for gyro aiming generally. I might add the option in the future, but it's a low priority for me.

Thanks again for your feedback and your helpful footage :)