Open groud opened 1 month ago
I just want to add that there is people who is able to play PC games by using two controllers, a controller and a keyboard etc to be able to play the game because of physical limitations. As per most games are single player, i would suggest the player 0 to mean "whatever this input comes from" (Like right now) and use the per character approach when set to something else than 0.
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
Dealing with local multiplayer is a bit complex in Godot right now. The common approach is to define several input actions, a set for each player, with a suffix for each player ID. Then you need to assign each actions a dedicated event with a different device ID (if you have several gamepad). Here is an example action list:
It is quite complex to setup, makes it hard to update / remap action for different players.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
To solve the problem, I am thinking about grouping actions and their mapped events per player. So, in the editor UI, you would have a dropdown menu at the top to switch the current user (by default 0). You could then assign for each player different events.
All action-related function (taking an action name as a parameter), should expose an additional, optional argument to select a player different from the player 0. Functions like:
While that solve the problem of having to suffix all action with a player ID, it's still a struggle to copy-paste mappings with a different device ID (for each gamepad), and it would still be complicated to reassign a set of mapping from one player to another. That's why I would like to introduce an
ActionInputMap
resource (name TBD). This resource could be created directly out of the editor, by saving a player's mapping to a file. Then the API / editor could also load such a mapping from a file. Lastly, we should have both an API and and a button in the editor to update anActionInputMap
with a specific device ID for gamepad event.This is an example API for what would be mapping a player as a gamepad:
Here is an editor mockup. I called "sheet" a set of action mapped to a player:
I believe that, probably, all sheet will display all defined actions (event if some have no event assigned I guess). For copy paste, I think that it would be nice to select actions individually, to have freedom to copy past event from one sheet to another. Also, the dropdown could be tabs too, that would work.
Also, I wonder if we could also define a sheet as "a copy of another one but with an automatic remap". This would allow only modifying one sheet for multiple players easily.
Related proposals / PRs:
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes
Is there a reason why this should be core and not an add-on in the asset library?
It's core