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

XInput mode #59

Open
dawerecat opened this issue Nov 11, 2020 · 12 comments
Open

XInput mode #59

dawerecat opened this issue Nov 11, 2020 · 12 comments

Comments

@dawerecat
Copy link

dawerecat commented Nov 11, 2020

Wiring a regular gamepad through this plugin may not be what it was designed for, but I think it has a use case. Steering feels more responsive and allows for very shallow turning angles without jerking the stick, and all it takes is a quick setup of linearity and dead zone. Maybe it's possible to approximate it with LilyPad and/or other software, but I'm tired of trying.

It would've already worked great if not for the infamous conjoined triggers of Microsoft controllers in DInput mode. Normally, I'd fix it with "Enable DirectInput Output" in XInputPlus, but in this case it only works until the game is booted, then the emulator stops reacting to any input from the controller, including the plugin's settings (it is possible to set up bindings before launching the game).

I thought I had an ingenious solution of only using USBqemu-wheel for steering, while the rest of the controls are set up through LilyPad, but Gran Turismo 3 stops reading buttons as pressure-sensitive when it detects a steering wheel. Doesn't happen in Gran Turismo 4, by the way, so it must be the game's fault.

I don't know if it would be easier to resolve the conflict with XInputPlus or add native XInput support to the plugin, but either one would be nice. Emulating a wheel also gives the advantage of not having to come up with awkward remapping schemes whenever a game doesn't allow moving throttle and braking onto R2 and L2.

@dawerecat
Copy link
Author

FWIW, I devised a perverse solution to my GT3 problem. Throttle on right stick UP, brake on right stick LEFT, thus giving me two separate axes, and steering is still handled by USBqemu-wheel. Handles about right in-game, but thinking about it makes me feel dirty.

@jackun
Copy link
Owner

jackun commented Nov 13, 2020

Oh god, XInput just lets you query arbitrary controller 0 to 3. I love button remapping! :killme:

@jackun
Copy link
Owner

jackun commented Nov 14, 2020

Can test with https://ci.appveyor.com/project/jackun/usbqemu-wheel/builds/36309374
Use DInput api, triggers get translated to sliders instead single Z axis.
Probably only works correctly with one XInput controller plugged in at once.
Maybe I can get some rumble action going too

@dawerecat
Copy link
Author

dawerecat commented Nov 15, 2020

That was fast, thanks. Tried Win32 on 1.6.0 and everything seems to work as well as before, but with separated triggers. Some of the buttons appear to be marked wrong: L1 is swapped with L2, R1 with R2 (L3 and R3 are fine). I remember noticing some of it even before this build. The wheel is set to Driving Force.

Another quality of life thing would be to have a (bigger?) built-in dead zone when the plugin is listening to input in the settings. This is to account for a stick being slightly off-center, specifically when trying to bind stick presses, since it can be hard (though not impossible) not to trigger an axis while doing that.

I'll keep using this to see how it goes.

@jackun
Copy link
Owner

jackun commented Nov 15, 2020

L1 is swapped with L2, R1 with R2

Have to recheck. There was something with Gran Turismo games that DF and DFPro have them swapped. Maybe not then.

L3/R3

What game uses these? I vaguely remember something but....

Lol, also if the throttle axis isn't bit-exactly 100% "pressed", GT3/4 just don't upshift :( Or lilypad/onepad interferes.

@jackun
Copy link
Owner

jackun commented Nov 15, 2020

built-in dead zone when the plugin is listening to input in the settings.

Thought detection range already got changed to ~50% but apparently not, just 2000 of 65535.
If math is correct, it should be 25% of "single direction" axis now: https://ci.appveyor.com/project/jackun/usbqemu-wheel/builds/36320666

@dawerecat
Copy link
Author

GT3 allows binding L3/R3 to actions, so I checked them just in case.

Hot Pursuit 2 has L1/R1 and L2/R2 swapped as well, they don't behave like the input sheet in the menu would suggest. Then again, I've been having some serious issues with steering in that one, in-game calibration doesn't help.

Unrelated: when I'm setting the dead zone for axes, the preview curve is affected from both sides. Does that mean negative dead zone would cut off the maximum input? Speaking of that, I can't seem to reduce the throttle/brake dead zone in GT3 no matter what I do with the slider.

@jackun
Copy link
Owner

jackun commented Nov 15, 2020

Iirc, up/y axis is the output value so it gets maxed faster, I think.

@dawerecat
Copy link
Author

I set up positive dead zone for steering, so it indeed seems to max out earlier, if the curve is to be trusted. In the game itself, looking at the wheels seems to confirm it, though the difference is very small.

@jackun
Copy link
Owner

jackun commented Nov 15, 2020

@ tocaedit came up with the formula but it might be possible to separate start/end dead zones

@dawerecat
Copy link
Author

dawerecat commented Nov 15, 2020

I'm more worried about a situation when the maximum can't be reached at all, i.e. due to a negative dead zone. But it doesn't seem to be a thing right now, because I either see no difference or very little difference between -50 and 50 dead zone for throttle and braking, though it's a problem in itself.

I do remember having an issue with upshifting on AT (it simply didn't work) when I used a very old version of the plugin from a forum thread. Unfortunately, I don't remember the circumstances, and I never figured out what I did to make it go away.

Right now it appears to be working even when I don't floor it.

@jackun
Copy link
Owner

jackun commented Nov 17, 2020

L1 is swapped with L2, R1 with R2

Doh, GT4 maps gear shift itself to L2/R2 for DForce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants