libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.8k stars 1.78k forks source link

[REQUEST/SUGGESTION] Dummy button #6718

Open barbudreadmon opened 6 years ago

barbudreadmon commented 6 years ago

Description

So i noticed the Controls section in Quick Menu changed a lot in recent Retroarch, and it seems really convenient to do what i mentioned a few months ago : having some kind of dummy button. If we could somehow use a dummy value (# RETRO_DEVICE_ID_DUMMY INT_MAX ?) as id for a retro_input_descriptor, use it for buttons which are currently hard to map (autofire, macro, coleco, ...), then let the final user assign those "dummy" retro_input_descriptor to actual buttons though the Controls menu, it would be a kick-ass feature for fbalpha. I'm tagging @radius "the input guy" and @fr500 because he was already aware of my issue.

Something can be done about this with recent improvements ?

Ferk commented 6 years ago

As I understand, all buttons in the retropad are "dummy", aren't they? Even though the core hardcodes the mappings, the Controls menu allows switching those mappings to use different buttons, so in theory you can redefine which button does what, if the core is properly configured (and that has to be done by the core, since it's the only one knowing which actions need mapping).

Or at least that was my impression, please someone correct me if I'm wrong.

Are you asking to add additional buttons to the retropad so they can be mapped? is it not enough for fbalpha 12 buttons and 2 triggers? It's very rare to find a controller with more buttons than that, I would not know where to map any extra ones to my controllers.

barbudreadmon commented 6 years ago

Are you asking to add additional buttons to the retropad so they can be mapped? is it not enough for fbalpha 12 buttons and 2 triggers?

It's not enough (coleco is 14 buttons + dpad, neogeo/pgm fighting games are 6 buttons + dpad + up to 10 usable macros, ...), and to have those actions appear as a choice in the Controls menu, i need to first declare them and assign them to a retropad button.

Edit : that's up to 11 macros for pgm/neogeo actually (any combination of several of the 4 buttons used for gameplay)

Ferk commented 6 years ago

EDIT: For a moment I thought retropad did have 14 buttons with the triggers... but you are right, they are actually 12:

+4 face buttons +2 central buttons (start/select) +2 shoulder buttons +2 joystick buttons +2 triggers = 12

If you use one of the analog sticks for the coleco joystick you have the dpad free for extra buttons. Although that might be too much of a stretch.

Maybe it would make sense to add 2 more buttons for such cases, (L4/R4 back plates like the Steam controller?) though I'm not sure if there would be that many people using real world controllers that they can use for coleco emulation, the layout is quite different from the reference design of the retropad too.

Do you actually use a gamepad or do you use the keyboard? Maybe the core should support keyboard control with the numeric pad for coleco, so you just switch to keyboard input in the Controls menu.

barbudreadmon commented 6 years ago

Ok, i guess i could solve the coleco issue by mapping them in a really weird way, or by mapping them to the keyboard. Even if not mapping them to any button and letting the user decide where he wants to map a specific button for a specific game seems a lot better to me, especially since the layouts are different for every game and some game won't use button 1,2,3,4 while other won't use button 9,10,11,12.

What about fighting games using up to 17 buttons + dpad ?

Ferk commented 6 years ago

If you don't map them to any button then for every single combination of core+controller people would have to go through the hassle of setting mappings and testing what works and what doesn't. This way you have a default already set up and you can just tweak it.. or entirely remake it if you want to.

I think the intention is to have the user map things only once per controller (and ideally not even once when there are good mappings uploaded to the database). So that if you have a physical controller specifically designed to emulate the coleco controller, you just plug it, set it up once and maybe share the setting with the community so those who get the same controller don't even need to set it up themselves.

The problem with unusual configurations for games with 17 buttons and up is that they are so uncommon (in terms of finding those physical controllers) that I'm guessing support for such control schemes is not a high priority for the team. On top of that, this is likely gonna be troublesome to implement in a nice way that does not conflict or makes things confusing for the people who do not use it.

barbudreadmon commented 6 years ago

If you don't map them to any button then for every single combination of core+controller people would have to go through the hassle of setting mappings and testing what works and what doesn't.

Whatever i do, they will have, it's only a matter of forcing a unusable random mapping from the beginning, or letting it blank and ask the user to decide himself. I still think the later is better.

I'm guessing support for such control schemes is not a high priority for the team, considering that it's likely gonna be troublesome to implement this in a nice way that does not conflict or makes things confusing for the people who do not use it.

Ok, still this is something possible with mame osd and fbalpha standalone ui, so i hope the libretro team will consider it at some point.

Edit: as a side note, at the moment i'm forced to use core options to handle the mapping of the macros, which i heard can cause issues with netplay if different settings are used by players. Moving all mapping stuff to Controls to avoid this was actually a recommendation from @fr500.

barbudreadmon commented 6 years ago

It didn't show up :/

So let's say we need different id for the extra buttons, could we use the following macros : #define RETRO_DEVICE_DUMMY_SHIFT 8 #define RETRO_DEVICE_ID_JOYPAD_DUMMY(id) (((id + 1) << RETRO_DEVICE_DUMMY_SHIFT)) then have retroarch detect it's a dummy value since it was shifted by RETRO_DEVICE_DUMMY_SHIFT, so it should show the descriptor without mapping it to a button ?

yukichigai commented 4 years ago

This is probably needed for Virtual Jaguar, since the full controller layout includes a 12 button number pad on top of a D-pad plus five other buttons. Right now the UI for mapping just stops at Numpad 6, making some games literally unplayable due to key functions being bound to the second half of the numpad. With the current system the only way to address the problem is to make a very awkward default binding that involves both Analog sticks or something similar.

(Link to the referenced issue with Virtual Jaguar is here)