Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput  (Read 6161 times)

0 Members and 1 Guest are viewing this topic.

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Hi all,

I recently was able to get Mario Kart 8 Deluxe linked via Yuzu LAN, and Sonic All-Stars Racing Transformed via Goldberg on my offline racing machines. While the games themselves are great, they are designed for controllers, not wheels (side note: Ryujinx doesn't even support wheels and requires something like XInput for controls). There were loads of improvements that I could think of that would make these games work better, including changing key bindings (with a many -> many mapping, and lots of options for them) and translating rumble to sinewave FFB effects. For those with different shifters, handbrakes, etc - this tool does allow and differentiate between different game controllers, and also allows for keyboard keybinds as well. In theory, you can run multiple copies of the software for multiple players. This is not something I have tested, nor do I intend to pursue, as my machines are all 1p-wheeled machines. I won't reiterate what is in the readme, which I will paste below, but some things that I've been able to do using this software:

- Adjust a multitude of settings for analog -> analog controls, such as deadzone, antiDeadzone, linearity, low, & high values (low and high can be scaled past -100/0/100 if you want to reach 100% earlier), and "threshold" when mapping analog -> digital. The analog -> analog adjustments are KEY for trying to make your wheels control games designed for thumbsticks. Supports half, inverted, & half+inverted axes.
- Set minimum feedback levels for FFB so that rumble that may have been to weak for the wheel originally would now at least give some impactful sine event
- Make one button perform multiple actions (i.e. the big honky GT button on my DFGT wheel will push L+R+LStick in Yuzu so nobody needs to remember how to trigger "LAN Play" instead of Wireless)
- Make one axis perform multiple actions (i.e. brake axis for Mario Kart is actually mapped to RB from 0-90%; from 91%-100% it maps to both RB + B, which means if you push hard you will get auto-breaking while drifting).

I have only tried to find good values for a Logitech DFGT wheel for these games, and the results have been phenomenal. I've also tried an Xbox One controller -> virtual 360 controller, and it works too. I've included example configs with the attached zip.

Run the tool as "wheel2xinput.exe --trace" to have a dialog box pop up that shows you your devices' GUIDs and which axis outputs which values, which buttons are assigned which #, etc.
The best way I have found to test the output is to use something like http://www.gamepad-tester.com to look at the 360.

Note you will need to install the VigEm Driver software to make this program work. Newer versions only support W10, older versions support W7 as well. Grab the latest release that is labeled "Stable" here: https://github.com/ViGEm/ViGEmBus/releases . Software should work with W7 versions as well, but I haven't thoroughly tested.

Most of the config.json is case-sensitive, so please be mindful when editing it. Unfortunately, this has met all of my needs and nice-to-haves at this point, so bugs aside, I don't have plans to make a config-generator with a GUI. If there is a parsing error the program will let you know though.

Readme:
Code: [Select]
-------------------------------------------------------------------------------
| WHEEL2XINPUT by nugarp @ http://forum.arcadecontrols.com             v0.1.5 |
-------------------------------------------------------------------------------

v0.1.5: Added config flag for detectControllerReconnects. It may not work if you are trying to use an xbox 360 controller as an input.
        Fixed bug where software would crash with --trace off when guid was set but device was not connected, or device was disconnected.
v0.1.4.1: Minor revisions - change default for enableRumble to be 0; do not allow both enableForceFeedback and enableRumble to be set to 1.
v0.1.4: Added support for effectThreshold, FFB values under this % are treated as 0 strength. Also added FFB settings to ReadMe, which were missing beforehand.
v0.1.3: Support multiple identical controllers via instance flags at the end of guids: controller #1 would be "guid.1", #2 would be "guid.2", etc.
        Also fixed bug where rumble was not getting forwarded (FFB was not affected).
        Removed support for joystick reattachment during software's lifecycle as it would also pick up the virtual 360 controller.
v0.1.2: Added support for "weighting" values on analog targets when calculating final values - allowing you to override wheel axis with the dpad for certain games.
v0.1.1: Added check for joystick reattachment during software's lifecycle.

This program will take a series of inputs from (a) device(s) and remap them to a virtual x360 device. It supports DirectInput and XInput controllers, and a keyboard. The software requires that the VigEm drivers be installed ( https://github.com/ViGEm/ViGEmBus/releases ). It allows for ultimate flexibility with mappings, allowing you to map not only buttons->buttons, but also buttons->set axis values, axis thresholds->buttons, axis->axis, and axis->sliders. Axes can also be customized for deadzone settings, anti-deadzone settings, adjusting min/max ranges and setting scaling factors, and changing linearity. Please note that linearity (if specified) is applied differently between (regular axes) and between (half-axis axes and triggers). You can specify guids for individual sources (or for the overall mapper) by setting guid appropriately.

You may choose to map multiple inputs to the same output. In this case, the outputs will be processed in such a way:
- Virtual buttons will be pushed as long as ANY button is pushed
- Virtual sliders' values will be calculated by averaging all inputs that have a value > 0.
- Virtual axes values will be calculated by averaging all inputs that have a value NOT 0.

This software will also translate rumble to wheel force feedback effects (sine effect), which can be customized in config.json. You may turn on or off a centering effect and adjust magnitudes and periods of small and large rumbles. There is also an antideadzone if you want to set all effects to output at a minimum power level (e.g. 1 may be too low to really feel it in the wheel). All FFB effects are specified as an integer percentage, so range from 0 - 100. The magnitude params are in terms of milliseconds.

If you have worked with JSON files before to configure things...you will recall that json files are case sensitive. This is no exception with this software. Pay careful attention to case in the example config.json and the documentation below!

Note, you can run the software with any config file (default is config.json) by specifying which file you would like to load it against: wheel2xinput.exe custom.json

-------------------------------------------------------------------------------
|                           HOW TO RUN THE SOFTWARE                           |
-------------------------------------------------------------------------------

wheel2xinput.exe <config file> <--trace>
config file specifies which JSON file to use to load the configuration desired
--trace will show you a window, device guids, and buttons/axes/keys that are hit for your config file

Examples:
wheel2xinput config.json
wheel2xinput --trace
wheel2xinput config.json --trace
wheel2xinput --trace config.json

-------------------------------------------------------------------------------
|                       CONFIG.JSON CONFIGURATION GUIDE                       |
-------------------------------------------------------------------------------

The following API parameters are used for the configuration of the software --

Misc Configuration
------------------

+ guid : string if specified, software will use this guid for all input/ffb/rumble. if not specified, it will pick the first guid it sees.
+ enableForceFeedback {0,1} : default to 1. if set to 0, the software will not initialize the FFB engine and no FFB will occur. You should not set both enableRumble and enableForceFeedback to 1 - they will conflict.
+ enableRumble {0,1} : default to 0. If set to 0, no rumble will be sent to the controller. You should not set both enableRumble and enableForceFeedback to 1 - they will conflict.
+ blockKeys {0,1} : defaults to 1. any mapped keyboard keys will be intercepted and blocked if set to 1.
+ detectControllerReconnects {0,1} : defaults to 0. If any of your input controllers are disconnected during use, the software will seek to re-establish a connection to them if set to true. This setting is likely not compatible if you are using an xbox 360 controller as an input device.

Force Feedback Settings
-----------------------

+ centeringForce [0, 100] : defaults to 50. Strength of centering spring.
+ largeRumblePeriod [0, N] : defaults to 90. millisecond period of the sine-wave effect for effects sent to "large motor."
+ largeRumbleMagnitude [0, 100] : defaults to 70. large rumble strength, as a %.
+ smallRumblePeriod [0, N] : defaults to 45. millisecond period of the sine-wave effect for effects sent to "small motor."
+ smallRumbleMagnitude [0, 100] : defaults to 40. small rumble strength, as a %.
+ effectDuration [0, N] : defaults to 2000. duration of effects to apply in milliseconds. Effects may end earlier if overridden by newer feedback data.
+ effectAntiDeadzone [0, 100] : defaults to 0. If an effect is above the effect threshold, set the minimum force to this value.
+ effectThreshold [0, 100] : defaults to 0. Any effect with a strength less than or equal to this value is treated as "no effect."

Source Types
------------

button
+ button : int
+ targetButtons : List<targetButton>
+ targetDpads : List<targetDpad>
+ targetAxes : List<targetAxes>
+ targetSliders : List<targetSlider>
+ guid (optional) : if specified, this takes precedence over the overall guid set for the mapper

dpad
+ dpad : text
+ targetButtons : List<targetButton>
+ targetDpads : List<targetDpad>
+ targetAxes : List<targetAxes>
+ targetSliders : List<targetSlider>
+ guid (optional) : if specified, this takes precedence over the overall guid set for the mapper

axis
+ axis : int
+ config : { inverted : 0, half: 0 }
+ targetButtons : List<targetButton>
+ targetDpads : List<targetDpad>
+ targetAxes : List<targetAxes>
+ targetSliders : List<targetSlider>
+ guid (optional) : if specified, this takes precedence over the overall guid set for the mapper

key
+ key : text
+ targetButtons : List<targetButton>
+ targetDpads : List<targetDpad>
+ targetAxes : List<targetAxes>
+ targetSliders : List<targetSlider>

Target Types
------------

targetButton
+ button : Xbox360ButtonString
+ threshold [0-100] : defaults to 50. percent at which point the button is triggered. only relevant if your input is an axis.
+ low {0,1} : default to 0...don't press this button unless the source button is down.
+ high {0,1} : default to 1...press this button only when the source button is down.

targetDpad
+ dpad : Xbox360ButtonString
+ threshold [0-100] : defaults to 50. percent at which point the button is triggered. only relevant if your input is an axis.
+ low {0,1} : default to 0...don't press this button unless the source button is down.
+ high {0,1} : default to 1...press this button only when the source button is down.

targetAxis
+ axis : Xbox360AxisString
+ threshold [0-100] : not set by default. percent at which point the axis is triggered. Uncommon but if you want to use an axis as a 2-state variable, use this.
+ low [-100-+100] : defaults to -100. % scaling factor for the lowest value. Abs values less than 100 will mean you won't reach the max or min value of the axis.
+ high [-100-+100] : defaults to +100. % scaling factor for the highest value.
+ deadzone [0-100] : % for which you want no output to occur given the input.
+ antiDeadzone [0-100] : %. Basically, once you are out of the deadzone, what is the minimum % you want to be possible on the axis?
+ linearity [-100-+100] : default is 0. -100 means most sensitive towards the center. +100 means most sensitive towards the edges. For half-axes: -100 means most sensitive towards the 0% value. +100 means most sensitive towards the 100% value.
+ weight [0-100+]: default is 100. % weight to give the value from this source. All weights are added up among non-zero-value sources for the target axis and a weighted average is used for output.

targetSlider
+ slider: Xbox360SliderString
+ threshold [0-100] : not set by default. percent at which point the axis is triggered. Uncommon but if you want to use an axis as a 2-state variable, use this.
+ low [0-100] : defaults to 0. % scaling factor for the lowest value. Abs values less than 100 will mean you won't reach the max or min value of the axis.
+ high [0-100] : defaults to 100. % scaling factor for the highest value.
+ deadzone [0-100] : % for which you want no output to occur given the input.
+ antiDeadzone [0-100] : %. Basically, once you are out of the deadzone, what is the minimum % you want to be possible on the axis?
+ linearity [-100-+100] : default is 0. -100 means most sensitive towards the 0% value. +100 means most sensitive towards the 100% value.
+ weight [0-100+]: default is 100. % weight to give the value from this source. All weights are added up among non-zero-value sources for the target slider and a weighted average is used for output.

List of Xbox 360 Input Types. These are case sensitive!
-------------------------------------------------------

Xbox360ButtonString:
- A
- B
- X
- Y
- LeftThumb (Clicking the left thumbstick)
- RightThumb (Clicking the right thumbstick)
- LeftShoulder
- RightShoulder
- Back
- Start
- Guide
- Up (DPAD)
- Down (DPAD)
- Left (DPAD)
- Right (DPAD)

Xbox360AxisString:
- LeftThumbX
- LeftThumbY
- RightThumbX
- RightThumbY

Xbox360SliderString:
- LeftTrigger
- RightTrigger

List of Keys that are supported (should you want to use keyboard inputs)
------------------------------------------------------------------------

The "Keys" Enum as part of System.Windows.Forms namespace can be used as reference...
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.keys?view=windowsdesktop-6.0

However, I would urge you to instead just check which key is mapped to which key name by just running
the program with the --trace parameter and seeing what it says next to "key." Remember these keys
are case sensitive! Some listed keys (such as Alt) are actually registered as LAlt and RAlt, etc.[/font]

And here is an example config.json:
Code: [Select]
[font=courier]{
  "guid": "00000003-046d-0000-9ac2-000000000000",

  "enableForceFeedback": 1,
  "enableRumble": 1,
  "centeringForce": 50,
  "largeRumbleMagnitude": 60,
  "largeRumblePeriod": 90,
  "smallRumbleMagnitude": 30,
  "smallRumblePeriod": 45,
  "effectDuration": 2000,
  "effectAntiDeadzone": 0,

  "blockKeys": 1,
  "pollInterval": 16,

  "buttons": [
    {
      "button": 0,
      "targetButtons": [ { "button": "A" } ]
    },
    {
      "button": 1,
      "targetButtons": [ { "button": "X" } ]
    },
    {
      "button": 2,
      "targetButtons": [ { "button": "B" } ]
    },
    {
      "button": 3,
      "targetButtons": [ { "button": "Y" } ]
    },
    {
      "button": 4,
      "targetButtons": [ { "button": "RightShoulder" } ]
    },
    {
      "button": 5,
      "targetButtons": [ { "button": "LeftShoulder" } ]
    },
    {
      "button": 6,
      "targetButtons": [ { "button": "RightShoulder" } ]
    },
    {
      "button": 7,
      "targetButtons": [ { "button": "LeftShoulder" } ]
    },
    {
      "button": 8,
      "targetButtons": [ { "button": "Back" } ]
    },
    {
      "button": 9,
      "targetButtons": [ { "button": "Start" } ]
    },
    {
      "button": 10,
      "targetButtons": [ { "button": "RightThumb" } ]
    },
    {
      "button": 11,
      "targetButtons": [ { "button": "LeftThumb" } ]
    },
    {
      "button": 12,
      "targetButtons": [ { "button": "RightShoulder" } ]
    },
    {
      "button": 13,
      "targetButtons": [ { "button": "LeftShoulder" } ]
    },
    {
      "button": 14,
      "targetButtons": [ { "button": "Start" } ]
    },
    {
      "button": 19,
      "targetButtons": [ { "button": "Start" } ]
    }
  ],
  "dpads": [
    {
      "dpad": "up",
      "targetDpads": [ { "dpad": "Up" } ]
    },
    {
      "dpad": "right",
      "targetDpads": [ { "dpad": "Right" } ]
    },
    {
      "dpad": "down",
      "targetDpads": [ { "dpad": "Down" } ]
    },
    {
      "dpad": "left",
      "targetDpads": [ { "dpad": "Left" } ]
    }
  ],
  "axes": [
    {
      "axis": 0,
      "config": {
        "inverted": 0
      },
      "targetAxes": [ { "axis": "LeftThumbX", "deadzone": 2, "linearity": -66, "antiDeadzone": 15 } ]
    },
    {
      "axis": 1,
      "config": {
        "inverted": 1
      },
      "targetSliders": [ { "slider": "RightTrigger", "deadzone": 5 } ],
      "targetButtons": [ { "button": "A", "threshold": 10 } ]
    },
    {
      "axis": 2,
      "config": {
        "inverted": 1
      },
      "targetSliders": [ { "slider": "LeftTrigger", "deadzone": 5 } ],
      "targetButtons": [ { "button": "B", "threshold": 95 } ]
    }
  ],
  "keys": [
    {
      "key": "Left",
      "targetAxes": [ { "axis": "LeftThumbX", "high": -100, "low": 0 } ],
      "targetDpads":  [ { "dpad":  "Left" } ]
    },
    {
      "key": "Right",
      "targetAxes": [ { "axis": "LeftThumbX", "high": 100, "low": 0 } ],
      "targetDpads":  [ { "dpad":  "Right" } ]
    },
    {
      "key": "Up",
      "targetAxes": [ { "axis": "LeftThumbY", "high": 100, "low": 0 } ],
      "targetDpads":  [ { "dpad":  "Up" } ]
    },
    {
      "key": "Down",
      "targetAxes": [ { "axis": "LeftThumbY", "high": -100, "low": 0 } ],
      "targetDpads":  [ { "dpad":  "Down" } ]
    },
    {
      "key": "Z",
      "targetButtons": [ { "button": "A" } ]
    },
    {
      "key": "X",
      "targetButtons": [ { "button": "B" } ]
    },
    {
      "key": "C",
      "targetButtons": [ { "button": "X" } ]
    },
    {
      "key": "V",
      "targetButtons": [ { "button": "Y" } ]
    },
    {
      "key": "5",
      "targetButtons": [ { "button": "Back" } ]
    },
    {
      "key": "1",
      "targetButtons": [ { "button": "Start" } ]
    },
    {
      "key": "A",
      "targetSliders": [ { "slider": "LeftTrigger", "high":  100, "low": 0 } ]
    },
    {
      "key": "S",
      "targetSliders": [ { "slider": "RightTrigger", "high":  100, "low": 0 } ]
    }
  ]
}[/font]

Here are some examples of unique ways and parameters that I have used for various games:

Mario Kart 8

Use one button to toggle LAN mode:

Code: [Select]
"buttons": [
...
    {
      "button": 19,
      "targetButtons": [
        { "button": "RightShoulder" },
        { "button": "LeftShoulder" },
        { "button": "LeftThumb" }
      ]
    }
...
]

Wheel Sensitivity Settings:

Code: [Select]
"axes": [
...
  {
    "axis": 0,
    "targetAxes": [
      {
        "axis": "LeftThumbX",
        "deadzone": 2,
        "antiDeadzone": 0,
        "linearity": -40,
        "low": -110,
        "high": 110
      }
    ]
  }
...
]

Trigger Accelerator via pedal @ 8% (keep in mind Switch A/B is backwards from Xbox A/B):

Code: [Select]
"axes": [
...
  {
    "axis": 1,
    "config": {
      "inverted": 1
    },
    "targetButtons": [ { "button": "B", "threshold": 8 } ]
  }
...
]

Trigger Drift via brake pedal @ 8%-89%, then trigger Drift+Brake at 90%+:
Code: [Select]
"axes": [
...
  {
    "axis": 2,
    "config": {
      "inverted": 1
    },
    "targetButtons": [ { "button": "RightShoulder", "threshold": 8 }, { "button": "A", "threshold": 90 } ]
  }
...
]

Hotshot Racing

Wheel Sensitivity Settings:
Code: [Select]
"targetAxes": [ { "axis": "LeftThumbX", "deadzone": 1, "antiDeadzone": 25, "linearity": -25, "low": -100, "high": 100 } ]

Riptide GP2 This game heavily relies on the left thumbstick for both steering and doing tricks...but when you are in the middle of a turn (i.e. turning right), you can't easily do a trick facing left, up, or down since the right side would dominate. So I've added "weights" that basically say that DPAD buttons get much higher priority for the LStick axis values when competing with the wheel axis. I'm also including my wheel sensitivity settings that seem to work great.

Also, note that the way the logic works, only values that are NOT 0 are taken into calculations when calculating axis averages. So, when you hit either DPAD up or DPAD down, we set the "X" axis to between [-1] and [1] with "weight" 100 (this is the default value for all assignments); this is basically within the deadzone of a thumbstick. (The true range would be [-100,+100]). This works great because no tricks are a mix of L/R and U/D -- they are either L/R for both thumbsticks, or U/D for both thumbsticks. The left and right DPAD values of course appropriately set the LeftThumbstickX value to -100 or +100. Meanwhile, the wheel axis has full range of motion, but since it only has a weight of 1 versus the dpad mappings, the dpads will always trump the wheel axis values.

Code: [Select]
"dpads": [
  {
    "dpad": "up",
    "targetAxes": [ { "axis": "LeftThumbY", "high": 100, "low": 0 },
        { "axis": "LeftThumbX", "high": 1, "low": 0 }
        ]
  },
  {
    "dpad": "right",
    "targetAxes": [ { "axis": "LeftThumbX", "high": 100, "low": 0 } ]
  },
  {
    "dpad": "down",
    "targetAxes": [ { "axis": "LeftThumbY", "high": -100, "low": 0 },
        { "axis": "LeftThumbX", "high": -1, "low": 0 }
        ]
  },
  {
    "dpad": "left",
    "targetAxes": [ { "axis": "LeftThumbX", "high": -100, "low": 0 } ]
  }
],
"axes": [
...
    {
      "axis": 0,
      "targetAxes": [ { "axis": "LeftThumbX", "deadzone": 1, "antiDeadzone": 51, "linearity": -55, "low": -100, "high": 100, "weight": 1 } ]
    }
...
]

Sonic & Sega All-Stars Racing Transformed

Wheel Sensitivity Settings

Code: [Select]
"axes": [
...
  {
    "axis": 0,
    "targetAxes": [ { "axis": "LeftThumbX", "deadzone": 2, "antiDeadzone": 12, "linearity": -60, "low": -110, "high": 110 } ]
  }
...
]

Team Sonic Racing

Wheel Sensitivity Settings:

Code: [Select]
"axes": [
...
  {
    "axis": 0,
    "targetAxes": [ { "axis": "LeftThumbX", "deadzone": 1, "antiDeadzone": 35, "linearity": -66, "low": -115, "high": 115 } ]
  }
...
]

Hope this helps others. Big thanks to Schwing for the inspiration with his wonderful Keyboard2Xinput: http://forum.arcadecontrols.com/index.php/topic,158047.0.html

Edit 9/12/22: Updated to v0.1.3, which includes support for multiple identical input controllers, fixed rumble forwarding, and added support for "weighting" analog axes since v0.1.0.

Edit 9/14/22: Updated to v0.1.4, which adds support for an effectThreshold (effectively a deadzone)..maybe I should have called it that? Updated ReadMe to include all FFB parameters as well.

Edit 10/18/22: Updated to v0.1.5, which adds the ability to detect controller re-connects (non-360 controllers). Also fixed a bug where software would crash if your input device guid was specified, but the device wasn't connected or the device disconnected during use. Updated example files for Logitech DFGT/Team Sonic Racing
« Last Edit: October 19, 2022, 04:39:19 pm by nugarp »
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 44
  • Last login:April 14, 2024, 03:28:26 am
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #1 on: September 10, 2022, 06:10:57 am »
Hey, this looks really nice :)
Didn't know about Goldberg either, that's interesting.
Don't have the need for this at the moment, but I'll keep this in mind in case I make a driving cab one day ;)
Thanks for sharing !

holmes

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:March 28, 2024, 05:42:06 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #2 on: September 11, 2022, 02:08:38 pm »
Cool!
Especially since I am about to start a twin racing arcade cabinet project.
I intended to try to fiddle with x360ce but would be happy to try your application.
For a twin racer cab, besides LAN capable games to be player on both computers, there is also the possibility for some games to use a single computer and display in split screen modes on 2 monitors in ultrawide settings. For example, Hotwheels unleashed can be displayed on 2 monitors with a single computer. Maybe your application can be used in this situation to support wheels? Cruis'blast for switch would be nice to have as well, especially since controls are not wheel-friendly (A button to accelerate). In both cases, can you application support 2 wheels on the same computer?
I am not able to test your application right now but hope to be in a few weeks.
Thanks,
« Last Edit: September 11, 2022, 04:45:00 pm by holmes »

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #3 on: September 11, 2022, 11:32:50 pm »
Thanks Schwing!

Cool!
Especially since I am about to start a twin racing arcade cabinet project.
I intended to try to fiddle with x360ce but would be happy to try your application.
For a twin racer cab, besides LAN capable games to be player on both computers, there is also the possibility for some games to use a single computer and display in split screen modes on 2 monitors in ultrawide settings. For example, Hotwheels unleashed can be displayed on 2 monitors with a single computer. Maybe your application can be used in this situation to support wheels? Cruis'blast for switch would be nice to have as well, especially since controls are not wheel-friendly (A button to accelerate). In both cases, can you application support 2 wheels on the same computer?
I am not able to test your application right now but hope to be in a few weeks.
Thanks,

Thanks for the info. The uploaded software (v0.1) will not be able to distinguish between two identical controllers. The limitation would be on SDL's ability to distinguish each controller with a different GUID. In theory, there is nothing stopping you from having two config files and running two instances of the application, as long as the two controllers are different. From prior testing of generating VigEm 360 virtual controllers, I would recommend waiting ~3s before running the 2nd instance of the application to ensure that the player order stays constant between launches.

However, your feedback intrigued me, and since the time I started typing this reply, and before I am hitting post, I've gotten a proof-of-concept to support multiple identical controllers. It requires further testing, but in theory you would be able to specify whether you want to use the first instance of a specific guid or a second instance in the config file, etc.
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #4 on: September 12, 2022, 06:02:48 pm »
I have updated the original post with version v0.1.3, which includes support for multiple identical input controllers, fixed rumble forwarding, and added support for "weighting" analog axes since v0.1.0. You should be able to run multiple instances for multiple xinput virtual controllers...just run a diff config file for each instance (i.e. they should reference different device GUIDs).

Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #5 on: October 18, 2022, 10:59:26 pm »
Added uploads for version 0.1.4 and 0.1.5:

v0.1.5: Added config flag for detectControllerReconnects. It may not work if you are trying to use an xbox 360 controller as an input.
        Fixed bug where software would crash with --trace off when guid was set but device was not connected, or device was disconnected.

v0.1.4.1: Minor revisions - change default for enableRumble to be 0; do not allow both enableForceFeedback and enableRumble to be set to 1. -- this was causing all sorts of issues with rumble interfering with feedback, which, in hindsight, made sense with the implementation that I had.


Also v0.1.5 has a better default config for Team Sonic Racing (Logitech DFGT).
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

Yagami-kun

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:November 02, 2022, 12:45:31 am
  • Ore ga kowai no ka??????
    • Iori Yagami
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #6 on: October 18, 2022, 11:30:36 pm »
Very thx,this is P2P or needs any specific config??????

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #7 on: October 19, 2022, 12:53:47 am »
Very thx,this is P2P or needs any specific config??????
What do you mean p2p? This tool is only for mapping device inputs to a virtual xinput device. You will need to edit the config.json or examples/*.json files to match your desired behavior. I have some examples all in there for a logitech DFGT wheel and for a generic xbox one controller.

Judging by your post history, and assuming your g920 is similar to my dfgt...(1) download v0.1.5 and also install vigem drivers (link in readme), (2) go to examples/dfgt-tsr.json and delete the line that has "guid" at the top. Then (3) run as "wheel2xinput.exe examples/dfgt-tsr.json" and then run team sonic racing (maybe need to turn off steam input emulation if it still doesnt work...mine is off whenever possible).

Sent from my SM-G950U using Tapatalk
« Last Edit: October 19, 2022, 12:57:17 am by nugarp »
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

holmes

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:March 28, 2024, 05:42:06 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #8 on: November 08, 2022, 04:34:57 pm »
Hi,

I have finished the 1st half of my twin racer prototype. I have tested your application and it works nicely. I have tried it with Hotshot racing and Cemu+MK8. Very cool (although as I feared, control is not as good with a wheel than with a gamepad).
My wheel is a G29. I will test it with a second controller in a few weeks.

Many thanks for your work and for sharing it!

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #9 on: November 08, 2022, 04:43:15 pm »
Hi,

I have finished the 1st half of my twin racer prototype. I have tested your application and it works nicely. I have tried it with Hotshot racing and Cemu+MK8. Very cool (although as I feared, control is not as good with a wheel than with a gamepad).
My wheel is a G29. I will test it with a second controller in a few weeks.

Many thanks for your work and for sharing it!

Nice! Glad you got to try it out. Try adjusting the x-axis parameters to see what feels right for you in the config file...I've added a few extra comments below. It will never be 100% but if you can describe what about the controls "doesn't feel right" then I can point you in which direction to adjust the vars...

Quote
+ low [-100-+100] : defaults to -100. % scaling factor for the lowest value. Abs values less than 100 will mean you won't reach the max or min value of the axis. You can technically set this above 100% or below 100% and you will reach 100% before the physical wheel reaches its maximum.
+ high [-100-+100] : defaults to +100. % scaling factor for the highest value. You can technically set this above 100% or below 100% and you will reach 100% before the physical wheel reaches its maximum.
+ deadzone [0-100] : % for which you want no output to occur given the input. If you have a good wheel, you can try this as low as 1%.
+ antiDeadzone [0-100] : %. Basically, once you are out of the deadzone, what is the minimum % you want to be possible on the axis? For games that expect joysticks, you may need a higher value to trigger any movement.
+ linearity [-100-+100] : default is 0. -100 means most sensitive towards the center. +100 means most sensitive towards the edges. For half-axes: -100 means most sensitive towards the 0% value. +100 means most sensitive towards the 100% value.
« Last Edit: November 08, 2022, 04:45:07 pm by nugarp »
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

holmes

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:March 28, 2024, 05:42:06 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #10 on: November 08, 2022, 05:37:14 pm »
Thanks for your reply and advice. I need to experiment a bit.

On a side note, I have tried Yuzu + Virtua Racing. I figured out how to get analog pedals. The only issue is that vibrations do not work in the game though I have them in the Yuzu control settings window.
Any idea?
Edit: stupid question. I have no vibration with a gamepad either... Seems to be a limitation of Yuzu. A pity....
« Last Edit: November 08, 2022, 05:48:40 pm by holmes »

holmes

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:March 28, 2024, 05:42:06 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #11 on: November 10, 2022, 05:42:11 pm »
I just coud not wait so I plugged 2 g29 wheels to the same computer. I had initially some troubles due to the buggy Logitech settings manager (G Hub). I reverted to an older version (Logitech Gaming Software 9.00.42 64bits) and the troubles are gone. The wheels ids are identical except at the end there is .1 and .2.
I tested with Yuzu and Cruis'n Blast and could successively drive 2 cars in a splitscreen game.

Thanks a lot! This is exactly what I needed!

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #12 on: November 27, 2022, 03:08:15 am »
Edit: stupid question. I have no vibration with a gamepad either... Seems to be a limitation of Yuzu. A pity....
Yuzu vibration works. It does vibrate by DFGT. However, G29 drivers are a pain. I did pull out an old G29 on my pc without internet and I can't get any feedback from it.


The wheels ids are identical except at the end there is .1 and .2.

Yes, the IDs will be the same for the same wheel. x.1 is the first detected instance and x.2 is the second detected instance.

Perfect, glad you were able to get these things to work. Happy to help!
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

saban12

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:May 21, 2023, 12:14:30 am
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #13 on: February 23, 2023, 10:39:26 am »
This is so f... great, please dont abandon this project... but if you do please give us a source code ;)

Would you mind elaborating a bit more on how did you translate rumble to FFB... what tools did you use.. and thank you for this wonderful piece of software :applaud: :notworthy:
« Last Edit: February 23, 2023, 10:45:12 am by saban12 »

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #14 on: February 28, 2023, 11:32:57 am »
Thank you! No plans to abandon it; I just haven't needed any more functionality. I can elaborate later on the how the rumble -> ffb works. Also, I plan to open source it eventually; I actually tried to a while ago and github was on my case about multiple free accounts so it just never made it.

Sent from my SM-G950U using Tapatalk

Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

saban12

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:May 21, 2023, 12:14:30 am
  • I want to build my own arcade controls!
wonderful, thank you very much  :)

bill55

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 21
  • Last login:April 17, 2024, 07:25:04 pm
  • I'm a llama!
Thanks so much for this! Can't wait to set it up on my racing setup! I'm using the G923 as well. I'm going to try and get it working with Cruisn'n Blast. Are there any other recommended settings for other games than what is in the original post?

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Thanks so much for this! Can't wait to set it up on my racing setup! I'm using the G923 as well. I'm going to try and get it working with Cruisn'n Blast. Are there any other recommended settings for other games than what is in the original post?

Yeah I've actually changed my recommendations over time but I never updated the first post. I like this for Mario Kart 8 (assuming your wheel is set to 270deg):
Code: [Select]
    {
      "axis": 0,
      "config": {
        "inverted": 0
      },
      "targetAxes": [
        {
          "axis": "LeftThumbX",
          "deadzone": 1,
          "antiDeadzone": 0,
          "linearity": -40,
          "low": -145,
          "high": 145
        }
      ]
    }

And this for Cruis'n Blast:
Code: [Select]
    {
      "axis": 0,
      "config": {
        "inverted": 0
      },
      "targetAxes": [
        {
          "axis": "LeftThumbX",
          "deadzone": 1,
          "antiDeadzone": 0,
          "linearity": -40,
          "low": -120,
          "high": 120
        }
      ]
    }

And here are two more I set up for myself just because I love the games --

Hydro Thunder Hurricane in Xenia:
Code: [Select]
    {
      "axis": 0,
      "config": {
        "inverted": 0
      },
      "targetAxes": [
        {
          "axis": "LeftThumbX",
          "deadzone": 1,
          "antiDeadzone": 0,
          "linearity": -85,
          "low": -125,
          "high": 125
        }
      ]
    }

Ridge Racer 7 in RPCS3:
Code: [Select]
    {
      "axis": 0,
      "config": {
        "inverted": 0
      },
      "targetAxes": [
        {
          "axis": "LeftThumbX",
          "deadzone": 1,
          "antiDeadzone": 0,
          "linearity": -40,
          "low": -110,
          "high": 110
        }
      ]
    }
« Last Edit: April 30, 2023, 04:00:47 pm by nugarp »
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

bill55

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 21
  • Last login:April 17, 2024, 07:25:04 pm
  • I'm a llama!
Thanks for those! Late reply, but have not been able to mess with it lately. Also working on multiple configs so my default is 270 for all the emulated stuff, but newer PC games will use the full rotation.

If you end up doing any more configs for anything it would be great if you post them here. You have much more experience configuring than I do at this point. What about any of the Motorstorm games for PS3?

Thanks!

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
I haven't done MotorStorm but I have done Ridge Racer 7 for RPCS3 and Hydro Thunder Hurricane for Xenia with the DFGT, as above.

I am attaching all of my latest DFGT configs (x1-yuzu to use xbox one controller with yuzu, team sonic racing steam/yuzu, sonic all stars racing transformed steam, ridge racer 7 rpcs3, riptidge gp2 steam, mario kart 8 yuzu, hydro thunder hurricane xenia, hotshot racing steam, cruis'n blast yuzu) here. Haven't done any more...for most racing games it's really just figuring out settings for the x-axis more than anything.
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Hey, I'm starting to look into getting my G29 to work with Yuzu and I found your post. I have a friend who uses x360ce and he says it works great with Yuzu and his G29 and supports rumble. I was wondering if you ever tried x360ce and if there are any advantages to using your program instead of x360ce? Thanks!

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Hey, I'm starting to look into getting my G29 to work with Yuzu and I found your post. I have a friend who uses x360ce and he says it works great with Yuzu and his G29 and supports rumble. I was wondering if you ever tried x360ce and if there are any advantages to using your program instead of x360ce? Thanks!

Of course, x360ce is a classic and gem.

This software provides much more granularity and control. You can combine any number of input devices as well, but I think the latest x360ce lets you do that part too.

- Many-to-many inputs - so you can map one button or axis etc to multiple 360 buttons/axes/triggers. I use this in MK8 for example to have one button to push L+R+LStick to swap to LAN play. You can also map multiple inputs to the same button - so for example, paddle shifters and the stick shifter on my DFGT both map so the player can use either during play. Another thing is you can map the dpad and wheel axis to the same thing so menus can be easier to navigate.

- Granularity - you can specify a lot more advanced things such as if the value of an axis is between X and Y, do Z. But if it is greater than Y, do A. For example, I do if the brake pedal is less than mostly-all-pressed, treat it as a drift button, but if it is fully pressed, treat it as brake. From memory, for axes, x360ce does provide linearity/deadzone/anti-deadzone I believe (I leveraged their code for this), but I'm also not sure if x360ce provides a scaling setting..it's been a while since I looked. Also, you can apply "weights" to inputs. For example, in racing games that require stunts with the dpad, I have the dpad's weight to be 100x stronger than the wheel's contribute to the left thumb, so that the stunts can still be performed even while the wheel is turning. I leverage this for (IIRC) Sonic all-stars racing transformed and Riptide GP2. Otherwise you will run into issues trying to stunt left while your wheel is turned right.

- No need to fiddle with rumble settings, but the options are there if you need to. It should "just work."

- No DLLs in the game directory to fiddle around with, although I think x360ce v4 doesn't need that anymore either.

- I am also a fan of text-based editing as it is much faster for me, instead of going through a clunky interface to set assignments.
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!

Of course, x360ce is a classic and gem.

This software provides much more granularity and control. You can combine any number of input devices as well, but I think the latest x360ce lets you do that part too.

- Many-to-many inputs - so you can map one button or axis etc to multiple 360 buttons/axes/triggers. I use this in MK8 for example to have one button to push L+R+LStick to swap to LAN play. You can also map multiple inputs to the same button - so for example, paddle shifters and the stick shifter on my DFGT both map so the player can use either during play. Another thing is you can map the dpad and wheel axis to the same thing so menus can be easier to navigate.

- Granularity - you can specify a lot more advanced things such as if the value of an axis is between X and Y, do Z. But if it is greater than Y, do A. For example, I do if the brake pedal is less than mostly-all-pressed, treat it as a drift button, but if it is fully pressed, treat it as brake. From memory, for axes, x360ce does provide linearity/deadzone/anti-deadzone I believe (I leveraged their code for this), but I'm also not sure if x360ce provides a scaling setting..it's been a while since I looked. Also, you can apply "weights" to inputs. For example, in racing games that require stunts with the dpad, I have the dpad's weight to be 100x stronger than the wheel's contribute to the left thumb, so that the stunts can still be performed even while the wheel is turning. I leverage this for (IIRC) Sonic all-stars racing transformed and Riptide GP2. Otherwise you will run into issues trying to stunt left while your wheel is turned right.

- No need to fiddle with rumble settings, but the options are there if you need to. It should "just work."

- No DLLs in the game directory to fiddle around with, although I think x360ce v4 doesn't need that anymore either.

- I am also a fan of text-based editing as it is much faster for me, instead of going through a clunky interface to set assignments.

Thanks so much for the in-depth explanation. Would you mind sharing your G29 configs?

nugarp

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 281
  • Last login:Today at 04:10:11 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #23 on: August 03, 2023, 11:48:08 pm »
From my discord --
there are my g29 settings and my dfgt settings. if an axis doesnt feel good in the g29 settings you can just copy over the dfgt axis linearity/scaling/etc.
my wheels are set to 270deg
Wheel2XInput | HDRecoil | LeaderLamps | NetLauncher | Discord | Youtube

lirogames

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:March 07, 2024, 10:00:44 am
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #24 on: August 12, 2023, 07:37:39 am »
hello, this change was simply amazing, could you make the source available to us or on github? i would like to learn about ffb.. thanks

holmes

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:March 28, 2024, 05:42:06 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #25 on: November 16, 2023, 02:11:37 pm »
Hi Nugarp,
I am still progressing in the set-up of games on my twin racer prototype: MK8, Hotshot racing and cruis n blast work well. Thanks again for this great piece of software. I have not yet tested your new settings but will do it.
I have difficulties with Blur on my G29, I would like to simulate a left stick up and down with the G29 dpad. This is used in the game to send projectiles forward or backward. Could you have a look on my file?
Thanks!


holmes

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 39
  • Last login:March 28, 2024, 05:42:06 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #26 on: November 19, 2023, 05:45:37 am »
Still trying to simulate analog left stick for Blur. I made some tests with gamepad tester and theoretically have my dpad conneced to the stick. However on Blur, it is not recognized. Could it be that Blur ignores the stick because not all the buttons and axes are simulated?
[Edit] Finally found a solution mixing Wheel2xinput and the Wheel configuration software. I simply generate the keyboard commands related to forward and backward shooting. Would be curious to know however how to do this only with wheel2xinput.
« Last Edit: November 21, 2023, 01:38:07 am by holmes »

Drakkorcia

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 55
  • Last login:Today at 03:45:35 pm
  • I want to build my own arcade controls!
Re: Wheel2XInput, designed for mapping wheel and wheel accessories to XInput
« Reply #27 on: January 07, 2024, 11:08:50 am »
This tool works great when launching wheel2xinput.exe directly but whenever I try to start the program with an ahk for use in a front end it says it cannot find config.json and says "exiting". Paths are correct and the configs are present. I even tested my ahk to start the emulator/rom and notepad.exe and they both fired up and closed properly. For whatever reason wheel2xinput gives this error when I use an ahk to call it.
« Last Edit: January 07, 2024, 03:09:17 pm by Drakkorcia »

jbc79612

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:March 27, 2024, 06:12:14 pm
  • I want to build my own arcade controls!
Thank you very much for this tool. I tried it with my DFGT and it worked perfectly with one of the json files you provided.