Closed Rocky04 closed 3 years ago
Here is a little example how the transformation can be done: https://discordapp.com/channels/167181566978555904/195657629060694016/623581849607733269
_Sometimes Discord has problems to follow the links, it was a comment from 17.09.2019 in the feed_usback channel.
To be clear, not all controller have a circular characteristic, some have a cubical one even when they are only moved within a circle. But the original Xbox controller from Microsoft has a circular characteristic.
"Describtion It's more like a minor problem..."
My take on this as a gamer, I consider this a Major issue.
The way this currently works causes unexpected and unwanted behavior in 2D axis movement such as First-Person movement like Overwatch or Third-Person movement like Warframe.
You expect to move at consistent values depending on how far down you press. But with the way this is implemented this is not the case (For games that expect Joystick values).
For example, if you use the "Instant" analog curve profile, it should make it easier to move at a consistent slow pace. But the moment you try to walk forward and sideways, you end up running no matter how far down you press on the keys.
There is currently no known workaround to this problem, and therefore I insist this to be a Major issue.
I also believe it is a substantial issue.
I think that the scaling factor appropriate for this remapping are the cosine and sine fnc. In other words sin(theta)=y/h and cos(theta)=y/h. We use one or the other based on whether the absolute value of x is greater or smaller than the absolute value of y as we are only interested in specific ranges of each trig fnc. I will call h the sum vector with components x and y. So h = sqrt(x^2+y^2), Now we scale each component to the unit circle if we multiply by abs(y)/h if abs(x) <= abs(y): x_scaled = xabs(y)/h or multiply by abs(x)/h if abs(y) <= abs(x): y_scaled = yabs(x)/h
here it is in desmos where you can control the point labeled keyboard https://www.desmos.com/calculator/awkpp0afrz
I believe this is in the end the same code Rocky04 has written here https://discordapp.com/channels/167181566978555904/195657629060694016/623581849607733269 but I don't see Rocky04 taking the taking the absolute value. Also i don't understand what a cubic input vector is.
Yes, if I understand you right the principle from you is the same that I have recommended. I don't get why you mentioned the sin and cos function because they have nothing to do with it. Thanks, indeed it seems that I have forgotten to use the absolute values. I updated my code example.
With cubical I meant quadratic, so that all the valid input data is within a square. Where with a cicular input data all the valid points are within a circle.
PS: I also fixed a possible 0 / 0
bug... The code was just a quick example, hasn't actually tested it.
Edit: The question is more that should happen to the DirectInput compatible analog type, for it there isn't a commom type, some are quadratic some are circular.
Edit 2: The probem with your approach is that you only scale both if they are equal, but you always need to scale both parts otherwise you get a different direction vector.
Describtion It's more like a minor problem... The original Xbox controller has a circular characteristic for each axis but the Wootings are quadratically. This can lead into weird behaviour in games because the movement vector can be around 41% (
(1² + 1²)^0,5
~ 1,41...) faster than expected. This needs to be applied for all axis which belongs together, like for both joysticks (left and right). I think it would be good to have an option to let the user choose which characteristic he want, but the circle one should be the default.Reproduction Steps to reproduce the behavior:
Screenshots / Video Short video from DarrenVs: https://imgur.com/OfLrLUb
Desktop (please complete the following information): all systems
Wootility and Firmware version all versions
Keyboard Type all types