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

Asymmetric compensation of axis #689

Open
Lucashsmello opened this issue Jan 4, 2022 · 0 comments
Open

Asymmetric compensation of axis #689

Lucashsmello opened this issue Jan 4, 2022 · 0 comments

Comments

@Lucashsmello
Copy link

Hi @matlo,

This issue is related to a more precise 1:1 mouse to axis translation.

In DS4, the right stick X has 1 byte of values (-128 to 127). There are more negative values (128) than positive values (127) and the highest negative value is -128 while the highest positive value is 127, making the axis a bit asymmetric with respect to left and right. To compensate for this, some games use the value 0 as an additional positive value, making left and right symmetric. In this way, value 0 corresponds to the same speed (in absolute values) as -1, and 1 corresponds to -2, and 2 corresponds to -3, and so on.
This occurs in the y axis too.

Evidence of this can be collected by just sending a gimx event with a right stick x value around the deadzone. For example, in Overwatch, I found that sending gimx --event "rstick x(13)" --dst IP:PORT moves the aim while sending gimx --event "rstick x(-13)" --dst IP:PORT, the aim does not move. Also, sending rstick x(-14) moves at the same speed as rstick x(13).

This is noticeable only when close to the deadzone and when using some aim response curves such as linear response.
To implement this in gimx, it just needs to add +1 to the axis value, if axis>=0, at the end of the mouse2axis conversion or subtracting 1, if axis<0 (not both!). As I don't know if all games implement this mechanism, I suggest adding an option "symmetric_axis_mode" in the XML config file like this:

<axis id="rel_axis_2" label="Aim horizontal">
          <event type="axis" id="x" symmetric_axis_mode="increment" (...) />
</axis>

At first, the "symmetric_axis_mode" can be only "increment" (the implementation above) or "none" (current implementation). I can think of other ways that game developers may implement a kind of symmetric axis, such as

  • making -127=-128 in speed;
  • making "rstick x(13)" move at 13/127 of the maximum speed, while "rstick x(-13)" moves at 13/128 of the maximum speed.

I am intending to implement this like suggested above and do a pull request. Is it seems good for you?

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

No branches or pull requests

1 participant