rafikel / diyps3controller

Automatically exported from code.google.com/p/diyps3controller
0 stars 2 forks source link

Stick intensity control #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 reported on code.google.com by zkummer2...@gmail.com on 27 Apr 2011 at 11:19

GoogleCodeExporter commented 9 years ago

Original comment by mathieu....@gmail.com on 27 Apr 2011 at 11:48

GoogleCodeExporter commented 9 years ago

Original comment by mathieu....@gmail.com on 27 Apr 2011 at 11:48

GoogleCodeExporter commented 9 years ago

Original comment by mathieu....@gmail.com on 27 Apr 2011 at 11:48

GoogleCodeExporter commented 9 years ago
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!

Original comment by mathieu....@gmail.com on 27 Apr 2011 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by mathieu....@gmail.com on 5 May 2011 at 10:00

GoogleCodeExporter commented 9 years ago

Original comment by mathieu....@gmail.com on 6 May 2011 at 6:52

GoogleCodeExporter commented 9 years ago
"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).

Original comment by zkummer2...@gmail.com on 6 May 2011 at 7:47

GoogleCodeExporter commented 9 years ago
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.

Original comment by mathieu....@gmail.com on 6 May 2011 at 8:13

GoogleCodeExporter commented 9 years ago
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.

Original comment by zkummer2...@gmail.com on 6 May 2011 at 8:36

GoogleCodeExporter commented 9 years ago
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.

Original comment by mathieu....@gmail.com on 6 May 2011 at 9:01

GoogleCodeExporter commented 9 years ago
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.

Original comment by mathieu....@gmail.com on 6 May 2011 at 3:41

GoogleCodeExporter commented 9 years ago
Same behavior for BF:BC2 => this will be default enabled.

Original comment by mathieu....@gmail.com on 6 May 2011 at 3:57

GoogleCodeExporter commented 9 years ago
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.

Original comment by mathieu....@gmail.com on 6 May 2011 at 6:23

Attachments:

GoogleCodeExporter commented 9 years ago
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.

Original comment by zkummer2...@gmail.com on 6 May 2011 at 6:52

GoogleCodeExporter commented 9 years ago
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 :)

Original comment by mathieu....@gmail.com on 6 May 2011 at 7:07

GoogleCodeExporter commented 9 years ago
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.

Original comment by zkummer2...@gmail.com on 6 May 2011 at 7:35

GoogleCodeExporter commented 9 years ago
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.

Original comment by mathieu....@gmail.com on 7 May 2011 at 9:25

Attachments:

GoogleCodeExporter commented 9 years ago
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.

Original comment by zkummer2...@gmail.com on 7 May 2011 at 9:51

GoogleCodeExporter commented 9 years ago
Done.

Original comment by mathieu....@gmail.com on 7 May 2011 at 1:30

GoogleCodeExporter commented 9 years ago

Original comment by mathieu....@gmail.com on 19 Dec 2011 at 5:14