MiSTer-devel / Main_MiSTer

Main MiSTer binary and Wiki
GNU General Public License v3.0
3.07k stars 332 forks source link

Feature request: saveable per-game configs for "Button/Key remap" OSD option #538

Closed ArchiveRL closed 2 years ago

ArchiveRL commented 2 years ago

The "Button/Key" remap for game" option in the OSD menu is fantastic, though unfortunately the changes it allows are not permanent. If possible, it'd be extremely convenient if we could save the remaps for each game, and then either load them manually or automatically.

This would benefit greatly gaming on microcomputer cores, where games very often use completely different keybinds for various functions. Eg, when I'm playing Alone in the Dark on ao486 with Dualshock4, I can map cursor keys to the analog stick, Enter to Circle, Space to Cross, Esc to Square, and this makes the game entirely playable with a joypad. But then switching to Bioforge and later to Battlehawks 1942 I will also need to remap many other keys, and even if some are duplicated, eventually run out of joypad buttons. Then after the reboot it's all gone anyway, and has to be redone every session.

birdybro commented 2 years ago

This would be a difficult on ao486 since that core is often just playing a game from an already mounted VHD file, and the core pretty much just sees the name of the VHD file, as far as I'm aware. This functionality already exists with Arcade games implicitly based upon the unmerged MAME rom name. It's possible it could be implemented for console cores and computer cores that load one individual ROM to play that individual game. Check /config/inputs to see what I mean.

It would be pretty difficult for ao486 to do this though I believe. @flynnsbit has a way of sending the information as to what game is loaded and telling ao486 to mount a certain CD, but that's the opposite direction the data would have to travel.

ArchiveRL commented 2 years ago

Thanks. I see what you mean about vhds...bummer. But if it was possible for single-rom/file loading machines it'd still be a great thing to have. The likes of ZX Spectrum, CPC, MSX (new one) and especially Amiga / ST, which have a lot of key-hungry games, would benefit greatly. Consoles perhaps less so, since they mostly have fixed control schemes, tailored for respective controllers, but I'm sure some folks would welcome permanent per-game remaps for them too.

sorgelig commented 2 years ago

It's not possible. Some computer games are made for keyboard. Get a wireless keyboard, that's the only possible way.

flynnsbit commented 2 years ago

@sorgelig Is it not possible to allow a preset "load" into the btn <---> btn or btn <> - key where all it does is pull in a mapping from a file similar to how video presets work now? If that were possible, then the next step, similar to how we use imgset.exe for setting CD mounts and VHDs in the core, have a dos utility that passes a path to that controller/keyboard preset file? If that would be possible I already have the scripts setup to automatically convert every dos game to a controller profile and pass that to an exe/com in any format you would use. This would be useful not only for controllers but also keyboard to keyboard mapping that you might want to remap.

AO486, map F1-F10 keys to other keys that are more appropriate (Mortal Kombat Games)

KeyRah profile for so the user could set it instead of where it is now in input.cpp. Commodore 64 Commodore VIC-20 Commodore 128 Commodore 128D Commodore 16 Commodore 116 Commodore Plus/4 Amiga 12001q

x68000 special key mappings that could be remapped to a standard keyboard key

Just throwing out ideas.

mrchrisster commented 2 years ago

I would love to see "Button/Key remap" OSD option to save when saving settings. Playing through a dos game (LBA) with my gamepad and it works perfectly with a controller. Just everytime I quit the game or the gamepad switches off I have to manually remap all buttons.

It would be great if gamepads could be mapped to keys in general for ao486 (doesn't need to be per game) most games use arrow keys, enter, space, alt and ctrl

Newsdee commented 2 years ago

The ability to load presets would be fantastic. It doesn't work for every game, but it works for many games. Presets would also be an easy way to load a template for small changes.

Some examples:

nanoant commented 1 year ago

I would love to see "Button/Key remap" OSD option to save when saving settings. Playing through a dos game (LBA) with my gamepad and it works perfectly with a controller. Just everytime I quit the game or the gamepad switches off I have to manually remap all buttons.

Same story here, I was also playing LBA today again on AO486. Recently discovered how convenient it is to use gamepad to play this game and I was wondering why Save Settings is not keeping my mapping. Then I read the message in the window that the mapping will be lost on core reload and found this thread. 😢

Ecstatica is another great game that uses funny numpad based controls, while many modern keyboards do not even have numpad anymore 🙄

Storing single mapping would be already enough for LBA, Ecstatica, Prince of Persia, ... I usually try to finish one game to start another. So I don't need many profiles. But indeed imgset informing MiSTer which game (preset) is running could be integrated into Exo300 launcher menu.

I remember we had similar discussion to introduce ability to map ATARI Start, Select, Option, Reset function keys to gamepad, and @sorgelig was also saying back then to forget it as this computer is meant to be operated with keyboard. But in the end he got convinced to do that change that improved ATARI gaming experience a lot.

Maybe with just need enough patrons on Patreon 😄 or someone else implement this. Maybe I will try to do it myself. I started patching AO486 FPGA code recently. So it is possible.

sorgelig commented 1 year ago

In ATARI case it was fixed set of buttons. For ao486 you need basically any key on keyboard. Probably i need to introduce other kind of joystick for some cores like ao486. I have some idea. I will think.

ArchiveRL commented 1 year ago

Thank you, @nanoant for reviving this thread and @sorgelig for considering it again.

However, I do have a feeling that saveable configs (if possible technically) are the only way to truly solve this. Anything else would be just a partial fix. There are simply too many possible permutations of games/keybinds to make templates workable. Eg the famous QAOP+ Space on Spectrum only applies to a fraction of this platforms library, and the abovementioned cursor+CTRL/ALT/ENTER on PC only covers some simple action games, for anything more complex you will still need to reach out to keyboard, thus defeating the idea.

But, perhaps I'm completely wrong and there is another way. And I'm really glad this is talked about again, seeing as for me this issue is the last missing puzzle piece in the MiSTer's overall greatness.

sorgelig commented 1 year ago

I've pushed the change to make button/key remap permanent. Since ao486 suffers from bad joystick emulation and it's hard to solve because of different CPU speeds, so permanent mapping is the only solution for this core.

T0DS commented 1 year ago

With the new cores for n64 and saturn, having controllers that don't always map well to modern ones (depending on the game), or the case of trying to simulate certain special types of controllers (e.g. saturn twinstick -> dual analog+shoulder buttons), it would be really good to have multiple remap files per core, that could be manually saved and loaded. No need for automatic game detection or anything, just the options to save more than one .map per core with the same controller, so we can make custom remaps for certain games, save them, and just load them later without having to rebind everything (or having to juggle files using ftp or something).

sorgelig commented 1 year ago

Sometimes finding a more suitable controller fixes problem better

T0DS commented 1 year ago

Indeed, it would be a solution, however is not always practical, it can also be very expensive (specially when dealing with more exotic controllers like the saturn twinstick). Multiple remaps gives a more versatile QOL solution for people that can't/don't want to afford multiple controllers, sometimes for a just a single core. There are even cases where the proper controller for a particular system might be badly utilized by a specific game or another, and remapping just for that particular game might give a better experience (even if it's less authentic). I have no idea how difficult it would be to implement something like this, but I do think it's worth considering, if it's doable.