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

Stick intensity control #75

Closed
matlo opened this issue Nov 27, 2013 · 20 comments
Closed

Stick intensity control #75

matlo opened this issue Nov 27, 2013 · 20 comments

Comments

@matlo
Copy link
Owner

@matlo matlo commented Nov 27, 2013

From zkummer2...@gmail.com on April 27, 2011 13:19:21

What steps will reproduce the problem? 1. Run new vegas
2. Tie the WSAD keyboard keys to the left stick
3. Attempt to sneak (partial stick press) after running (full stick press) What is the expected output? What do you see instead? N/A What version of the product are you using? On what operating system? 0.20 Please provide any additional information below. I would like to be able to set one key as a hot key to switch between two modes. The first mode is the current mode; digital; a keyboard key press is like pressing the stick or trigger as hard as it can be pressed. The second mode would switch to an analog output; based on a percentage specified by the user. This could be vital for games like Fallout New Vegas...in such games, the "Sneak", "Walk", and "Run" are all integrated into the movement stick, and are controlled by the pressure used on the stick.

Original issue: http://code.google.com/p/diyps3controller/issues/detail?id=73

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on April 27, 2011 04:48:13

Status: Accepted
Owner: mathieu....@gmail.com

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on April 27, 2011 04:48:26

Labels: -Type-Defect Type-Enhancement

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on April 27, 2011 04:48:37

Labels: -Priority-Medium Priority-High

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on April 27, 2011 10:45:40

The better idea I have for that is to use a key (for ex shift) to modify the norm of the "stick vector":

S (step) is a parameter in [0..127]
ex: S=3
initial state: norm=1_127/S=42
press shift: norm=2_127/S=84
press shift: norm=3_127/S=127
press shift: norm=1_127/S=42

If the speed is the same for a same radius, we have to apply the same norm in case 2 keys are pressed at the same time (diagonal stick position).

ex:
only W pressed => x=0, y=42 => norm=42
press A+W => x=y=sqrt(42²/2)=~29 => norm=42

Please let me know if you think this responds to your problem!

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 05, 2011 15:00:05

Status: Started

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 05, 2011 23:52:24

Summary: Stick intensity control

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From zkummer2...@gmail.com on May 06, 2011 00:47:15

"only W pressed => x=0, y=42 => norm=42
press A+W => x=y=sqrt(42²/2)=~29 => norm=42"

I have to ask a question about how the stock sixaxis works to answer that...when I press the stick as far left-forward as it will go, which of the following signals does it send?
"X=Y=256"
-or-
"x=y=sqrt(256²/2)=~181"

...and at half-press, does it send:
"X=Y=128"
-or-
"x=y=sqrt(128²/2)=~90"

I think that whatever the stock controller sends should be the target, as all games are written to work correctly like this, and some games might work incorrectly with the other method.

Also, if the stock sixaxis uses the "x=y=sqrt(256²/2)=~181" formula, and diyPS3controller uses the "X=Y=256" formula, this could potentially be used for cheating in some games, as it could theoretically allow the player to move forward 30% faster than normal simply by strafing (and they would be strafing 30% faster too).

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 06, 2011 01:13:32

In my example, x and y are in [-127, +127] with 0 as the center.
For a sixaxis, all positions of this square are reachable, even along diagonals.

Each value is coded as a byte (8-bit precision, value in [0, 255] with 127 as the center) which means there is no way to go out of the boundaries.

Even if we can code x and y on larger values (like 10-bit precision, value in [0, 1023] with 511 as the center) with a custom usb device, my guess is that it will only give more speed positions over the same speed definition (same max speed).

The user will be able to choose between a (same radius=same speed) or (max radius=same speed) behavior, as the best choice may depend on the game.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From zkummer2...@gmail.com on May 06, 2011 01:36:35

If the whole square is reachable with a stock sixaxis, then I believe it would be logical to do the same with the diyPS3controller, otherwise using the diyPS3controller would give the user a disadvantage against other (a reverse cheat) in some scenarios.

I sure hope that you are correct on your guess...a controller that gives 8x more movement in one direction than the other wouldn't be an improvement.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 06, 2011 02:01:54

My intention was to make it configurable, i.e. the user can enable/disable this stuff.

Well, I don't know if it's useful, and it probably depends on the game behavior.

I will not code that in a first step.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 06, 2011 08:41:11

I tested with COD:BO, and if you go outside the largest circle (i.e. the circle with radius=127), there is no extra speed. I get the same speed with (89,89) and (127,127).

And acceleration along diagonals is very noticeable.

I changed my mind, I will code this speed adjustment.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 06, 2011 08:57:06

Same behavior for BF:BC2 => this will be default enabled.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 06, 2011 11:23:22

In attachment, the new look and feel of the first panel of sixemuconf.

Left and right stick intensity will be configurable.

Two buttons may be defined: one to increase the stick intensity, and the other to decrease it. If only one button is defined, the values will be changed in a circle (max pos + increase gives min pos or min pos + decrease gives max pos). If two buttons are defined (for ex wheel up/down), the values are changed with min and max boundaries.

The dead zone is useful to skip all the null-movement positions.

The shape allows to tweak the dead zone and diagonal positions.

The steps are the number of reachable positions.

This could also be useful for other axis (a pressure sensitive button is an axis) but it adds some complexity. I won't work on that until someone asks.

Attachment: Stick intensity.png

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From zkummer2...@gmail.com on May 06, 2011 11:52:06

Looks great...I wouldn't have asked for so much, but I am very happy to see it...I think I have a use for those two pointless buttons on the side of my G5R2 mouse now...although the wheel is tempting; I bet it would make sniping a lot more precise.

Not 100% sure what you mean by "dead zone"...but it looks great even if that doesn't do what I think it does.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 06, 2011 12:07:39

This only tweaks the button-to-axis mapping.

=> this is not very useful for snipping, unless you want to control the right stick with buttons :)

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From zkummer2...@gmail.com on May 06, 2011 12:35:13

I was thinking it would allow me to drop the strafe/forward/back movement speeds so that I could use them in addition to the mouse aiming to quickly dial in the shot...I used that all the time back when I was playing PC games. I was really only asking for sneaking...but the option to drop it even lower is nice...once the PS3 has watertight keyboard/mouse/joystick/misc controller support, it will be on a whole other level...I might even pick up a used netbook to serve as a dedicated controls adapter.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 07, 2011 02:25:03

In attachment, an example with:

  • dead zone = 31 (null-movement positions = black zone)
  • shape = circle
  • steps = 3

The circle radius are 127, 95, 63.

Each red dot is a position we can reach with 4 direction buttons (ex WASD) + at least 1 modifier button.

With shape = rectangle, the red dots are aligned as squares.

Attachment: button-to-stick.png

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From zkummer2...@gmail.com on May 07, 2011 02:51:11

Wonderfull! If it were not such a poor paying field, I would say you should be a teacher.

I can't wait for the next beta...I might even buy a cod game now that the controls will work.

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on May 07, 2011 06:30:30

Done.

Status: Fixed

@matlo
Copy link
Owner Author

@matlo matlo commented Nov 27, 2013

From mathieu....@gmail.com on December 19, 2011 09:14:56

Status: Verified

@matlo matlo closed this Nov 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant