berarma / oversteer

Steering Wheel Manager for GNU/Linux
GNU General Public License v3.0
616 stars 59 forks source link

Remapping wheel axis and buttons (cobine accelerator + clutch / brake to diffrent axes) #45

Closed lilongueti closed 2 years ago

lilongueti commented 3 years ago

i don't know if this is the only scenario, but on dethkarz (an old '90s game) the only detected axe is the clutch for both acceleration and braking, so combining accelerator + clutch into accelerator leaves me with no usable pedals, if i could combine accelerator + clutch into clutch it would work flawlessly (almost, braking would still be the clutch, but i can live with that) cheers and happy new year

berarma commented 3 years ago

Happy new year.

The combination of axes is implemented in the driver, Oversteer can't do anything.

This should be fixed in the game by remapping the axis. Which wheel do you have?

lilongueti commented 3 years ago

g29, the problem is that as far as the game settings go the other axes doesn't exist at all, it doesn't detect about half of the buttons either

berarma commented 3 years ago

It's an old game and I guess its controls are hardcoded for some type of gamepad, not even a wheel. I'm sorry but remapping controls is out of the scope of the application. There should be applications for that.

isopix commented 3 years ago

Nooo....don't close it. It's one of my favourite racing games (other are Lotus III Ultimate Challange, Ignition, Top Gear SNES). It's using DirectInput under wine, and I also was unable to map it to g29. For rendering it uses Direct3D or Glide, so it's very versatile and nice-looking game using poper GlideWrapper. And it's freely available abandonware. Strange thing is that it doesn't detect ForceFeedback on G29 (option is greyed out), while it does for old Logitech Cordless Rumblepad (under linux/wine/g29)

BTW, doesn't Dethkarz has separate support for Wheel? (not sure, but if I remember good, there was support for keyboard, joypad and wheel in options, but cannot verify it now).

Joking aside, can we use this bug record to talk and investigate further how to map it under wine. I guess there are plenty ways to do it, there are some uniput remappers for linux, and much more directInput remappers for Windows.

Deathkarz not dead! DeathKarz FTW! But it would be more fun to add support for Lotus III with proper force feedback ;-)

lilongueti commented 3 years ago

It's an old game and I guess it's controls are hardcoded for some type of gamepad, not even a wheel. I'm sorry but remapping controls is out of the scope of the application. There should be applications for that.

it does support wheel, even ffb works fine, but also fair answer its a 22 years old game

Nooo....don't close it. It's one of my favourite racing games (other are Lotus III Ultimate Challange, Ignition, Top Gear SNES). It's using DirectInput under wine, and I also was unable to map it to g29. For rendering it uses Direct3D or Glide, so it's very versatile and nice-looking game using poper GlideWrapper. And it's freely available abandonware. Strange thing is that it doesn't detect ForceFeedback on G29 (option is greyed out), while it does for old Logitech Cordless Rumblepad (under linux/wine/g29)

BTW, doesn't Dethkarz has separate support for Wheel? (not sure, but if I remember good, there was support for keyboard, joypad and wheel in options, but cannot verify it now).

Joking aside, can we use this bug record to talk and investigate further how to map it under wine. I guess there are plenty ways to do it, there are some uniput remappers for linux, and much more directInput remappers for Windows.

Deathkarz not dead! DeathKarz FTW! But it would be more fun to add support for Lotus III with proper force feedback ;-)

i was able to map it to g29 with ffb, also its no longer freely available under my abandonware scince its now on steam and gog.com, for ffb to stop being grayed out you must change controller type to wheel. im using wine-staging 5.22 and kernel 5.10.3-arch it worked fine both with the default module and with new-lg4ff and it's playable even with the whole axes thing

berarma commented 3 years ago

Ok, maybe not the best place but no problem. The outcome of this might be a note in the README that can help others.

Remapping is an interesting topic specially for older games and games without setup options. And it's broad enough to deserve its own dedicated application. It can cover joysticks, gamepads and wheels equally since all are seen as basically the same thing by the system, so this has already been discussed somewhere else for sure.

Some apps that might work but I haven't tried are qjoypad and sc-controller. There's also a SDL2 tool that can produce configuration strings to map any controller to a XBox controller.

berarma commented 3 years ago

These are the websites for every project I've mentioned above. If you could try them and report which ones work best for your cases, then we can recommend them to others. QJoyPad seems more close to what we're looking for.

isopix commented 3 years ago

joydevmap is a small userspace tool to change the axis and button mappings of joysticks and gamepads in Linux.

joydevmap

Tool to read physical joystick devices, create virtual joystick devices and output keyboard presses on a Linux system. wejoy Both are available in Archlinux's AUR

A program that exposes the Razer Hydra controller as a 20 axis virtual joystick on Linux. https://github.com/yomboprime/hydrajoy

lilongueti commented 3 years ago

thanks for the suggestions here's the results of my tests

QJpyPad, SC Controller work nicely for mapping controller input to keyboard/mouse but i couldn't find a way to remap it to other controller input

SDL2 as far as i understood is for games that use SDL as input which doesn't seem to be the case for deathkarz

joydevmap should do, however when i tried it using joydevmap --dev /dev/input/by-id/usb-Logitech_G29_Driving_Force_Racing_Wheel-joystick --set-axismap '17,16,5,2,1,0' this should have switched around all axis but instead it did nothing at all, it might not be playing nicely with new-lg4ff, i haven't tried with the default module and i don't think i will since lg4ff works so nicely with other games

wejoy might just work, but i haven't tested it yet as it requires to write a lua script (i might try latter)

berarma commented 3 years ago

Deathkarz might not use SDL but Wine does. Anyway, using SDL2 Gamepad Tool isn't the easiest or more elegant solution.

joydevmap uses the old joydev API, now deprecated, so it might work with very old software written for it. It's useless nowadays.

By the description in the QJoyPad page, it should be able to map between joysticks/controllers. Wejoy should work too but it's more complex. I'm not sure about SC Controller, @lilongueti might be right about this one.

isopix commented 3 years ago

Mapping Wheel to keyboard is useless, because main advantage of wheel+pedals is very precise proportional steering. In such case any gamepad (or even keyboard) would be advantage, because it would be quicker. It would be also very awkward to have binary output from wheel (I know there were such wheel for NES/Famicom clones)

berarma commented 3 years ago

Indeed QJoyPad and SC Controller don't seem to help at all.

SDL2 Gamepad Tool would be useful to map the wheel and pedals to a standard XBox 360 controller. Games that use that kind of controller could use the wheel and pedals instead.

Wejoy looks very promising. Using LUA it should be possible to implement a virtual input device that does whatever we want. But someone has to learn how to write the code.

Anyway, I still think this is an issue in the game. What we're trying to do here is a workaround.

isopix commented 3 years ago

Yes, it's a workaround. But I guess it's best we can do. Its closed source abandonware.

On 1/3/21, Bernat notifications@github.com wrote:

Indeed QJoyPad and SC Controller don't seem to help at all.

SDL2 Gamepad Tool would be useful to map the wheel and pedals to a standard XBox 360 controller. Games that use that kind of controller could use the wheel and pedals instead.

Wejoy looks very promising. Using LUA it should be possible to implement a virtual input device that does whatever we want. But someone has to learn how to write the code.

Anyway, I still think this is an issue in the game. What we're trying to do here is a workaround.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/berarma/oversteer/issues/45#issuecomment-753608874

berarma commented 3 years ago

Yes, it's a workaround. But I guess it's best we can do. Its closed source abandonware.

It's selling on GOG. Have you tried that version?

Anyway, a remapping tool could be useful for other games too.

finnboost commented 1 year ago

Dethkarz works in Windows 10 with Logitech G920 when using x360ce v.4 remapping tool. May sound odd that xbox 360 pad emulator solves this; default settings set accellerator pedal to left thumb on pad and you get a combined break-acc pedal. Once you learn to use it, you may find it better than separate acc / break because breaking happens "automatic" when you lift gas pedal, just like in new ev cars.

parkerlreed commented 1 year ago

Throwing another one out there

https://github.com/kozec/sc-controller

Has generic controller support and can map to a standard Xbox 360 layout.

The author is very stubborn and refuses to let Python 2 die so there's a fork to keep it going

https://github.com/Ryochan7/sc-controller