Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Possibly Add Separate Squaring Algorithm #738

Closed
MaybeItsEstrogen opened this issue Jun 24, 2019 · 4 comments
Closed

Possibly Add Separate Squaring Algorithm #738

MaybeItsEstrogen opened this issue Jun 24, 2019 · 4 comments

Comments

@MaybeItsEstrogen
Copy link

Hi. I'm new to GitHub so I'm unsure if this is the best place to post this.

I love Ryochan7's DS4Windows for a variety of reasons and am very grateful for its existence. One of my favourite features is its stick-squaring functionality. I play a game which is heavily dependent on analog stick input and the squaring functionality in DS4Windows is a great boon.

I have noticed, however, that the squaring algorithm seems such that the input is only affected once analog input approaches the corners of the input region. This effectively makes input non-linear along the diagonal axes, and causes some inconsistencies with accuracy due to this. Something similar had been implemented in a program called Durazno; however, Durazno suffered from lots of inconsistencies which I can only attribute to input needing to go through both XInput software and the program itself in order to function. This also made Durazno feel unusually slow and unresponsive at times. In Durazno, there was a slider titled "Stick Squareness" which ranged from 0.00 to 1.00; 1.00 simulated the input I'm referring to, and 0.00 simulated input which is effectively the same as which is currently in DS4Windows.

Would it be possible to implement something similar to Durazno: a choice between these two types of squared analog inputs? I would be willing to donate ~£40 for the implementation of this, because I feel quite strongly about it.

Thank you very much for your time, and your continued hard work and dedication.

Note: I believe Steam's controller configuration also offers this sort of input squaring, but I've never been satisfied by Steam's controller configuration for a variety of reasons.

@Ryochan7
Copy link
Owner

The algorithm works for the whole axis range. But yes, it will be more apparent when approaching the corners. A fairly high roundness setting is used to maintain a circle range for most the stick.

Duranzo does not have a slider that directly affects the squaring algorithm from what I have seen. The closest thing is the learning mode that can change the final endpoints. Allowing a custom setting for the roundness factor would mostly do the same thing.

It was hard enough getting the base algorithm running fast after several attempts. Adding another property fetch per gamepad poll was not worth attempting at the time.

@Ryochan7
Copy link
Owner

Here is the original article describing the squaring algorithm that is used; it is shown under "Attempt 5: Epic Win". The actual implementation in DS4Windows is different though. DS4Windows uses an inner roundness setting of 5 and you can see a representation of how the values will be mapped.

http://theinstructionlimit.com/squaring-the-thumbsticks

@MaybeItsEstrogen
Copy link
Author

The algorithm works for the whole axis range. But yes, it will be more apparent when approaching the corners. A fairly high roundness setting is used to maintain a circle range for most the stick.

Duranzo does not have a slider that directly affects the squaring algorithm from what I have seen. The closest thing is the learning mode that can change the final endpoints. Allowing a custom setting for the roundness factor would mostly do the same thing.

It was hard enough getting the base algorithm running fast after several attempts. Adding another property fetch per gamepad poll was not worth attempting at the time.

Perhaps I'm misunderstanding something, then. Can you explain this discrepancy?

I apologise about the axes values not being all the same, but I hope it illustrates my point. In "DS4Windows GUI squared" the affected input is barely different from the raw input, and past this point the affected input accelerates. I've used an input mapper in Rocket League with a tool called BakkesMod and it shows the same thing.

From reading the article you linked, it seems this could be Durazno using a different inner roundness value. If this is the case, would you be able to implement an option to change the inner roundness within DS4Windows, to effectively rectify these discrepancies?

@Ryochan7
Copy link
Owner

Ryochan7 commented Jun 25, 2019

I have not used a version of Durazno with that option; didn't find any screenshots showing that option either. It has been over a year since I last downloaded that app. I will have to download the latest version. Looking at that image, I am wondering it that app is using a different algorithm.

The intention of the algorithm that DS4Windows uses is to maintain a circular region for a large portion of the analog stick. If the inner roundness setting were 0, the output would be linearly mapped to a square. With inner roundness at 5, most of the stick is still represented as circular and the outer region will get ramped up a bit.

Inner roundness = 0
http://theinstructionlimit.com/wp-content/uploads/2009/11/square-small.png

Inner roundness = 5
http://theinstructionlimit.com/wp-content/uploads/2009/11/rounder-small.png

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants