Search Unity

Official Control Remapping System

Discussion in 'Open Projects' started by luisquid, Sep 30, 2020.

  1. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    38
    Hi, I want to work on the control remapping system. Would we be using the new Unity's Input System?
    Would anyone like to join? :D
     
    michaelgrilo and L4ZZA like this.
  2. jodyruben

    jodyruben

    Joined:
    May 25, 2015
    Posts:
    5
    Hi luis! I would love to help on the control system!
     
    michaelgrilo and luisquid like this.
  3. jodyruben

    jodyruben

    Joined:
    May 25, 2015
    Posts:
    5
    just saying for faster communication, is we allow to use another platform to communicate? since from what i see to get faster feedback we used something like discord or slack.
    I guess unity discord can have another section for project contributor(?)
     
    Jirushi likes this.
  4. MileyUnity

    MileyUnity

    Joined:
    Jan 3, 2020
    Posts:
    92
    @jodyruben this is being thought about already by @cirocontinisio :), we'll let the community know once we know more about that
     
    Pritte likes this.
  5. luisquid

    luisquid

    Joined:
    Mar 21, 2015
    Posts:
    38
    MileyUnity likes this.
  6. crypticax

    crypticax

    Joined:
    Nov 1, 2016
    Posts:
    1
    Hi there!
    I was checking out the roadmap, and I'd like to work on creating remappable controls (card https://open.codecks.io/unity-open-project-1/decks/15/card/14j-control-remapping-system)

    Since no UI is up yet, so far as I can see, I think I can just create the backend code for this. The best way I can think of is using InputAction.PerformInteractiveRebinding()... This can be wrapped in a public function that accepts an InputActionReference , so later any UI button can just call this and pass the relevant ScriptableObject

    I'm open to suggestions on any better ways to do this. If this is acceptable, can I send a Pull Request?

    Note: I tried using inline code, but for some reason it was not formatting correctly and wrapping each segment with line breaks
     
  7. MileyUnity

    MileyUnity

    Joined:
    Jan 3, 2020
    Posts:
    92
    Hi @aayushsabharwal and @luisquid, I think that at this point in time it’s still to early to start working on remappable controles as we barely have our controls in place. @cirocontinisio feel free to correct me here :)
     
  8. Megatank58

    Megatank58

    Joined:
    Jul 20, 2020
    Posts:
    44
    We are still making the Game settings system and Control Remapping System is just a part of it so i would suggest that we should complete that first before starting on this.
     
  9. Barigamb738

    Barigamb738

    Joined:
    May 30, 2020
    Posts:
    3
    I would like to make the controll remapping.
    I have experience with makeing controller remapping and i even made my own input system at some point.
     
    Last edited: Oct 4, 2020
  10. crypticax

    crypticax

    Joined:
    Nov 1, 2016
    Posts:
    1
    I understand. This makes sense. I'll find somewhere else I can lend a hand. Jumped on this since most other things seemed to be taken.
     
  11. MileyUnity

    MileyUnity

    Joined:
    Jan 3, 2020
    Posts:
    92
    Yeah a lot of tasks have already been taken atm, don't worry though, this project will take months so there will be more than enough opportunities for everyone to contribute to the project :)
     
    cirocontinisio likes this.
  12. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    481
    Totally agree. I've already implemented some basic implementation of controls remapping setting (or if we are talking using new input system terminology - input binding overrides).

    Here you can look at InputBindingsSetting.cs:
    https://github.com/UnityTechnologies/open-project-1/pull/60/files

    It just saves/loads binding overrides of the current InputActionAsset. It's very generic. There are no requirements on how to implement the UI etc.
     
  13. Megatank58

    Megatank58

    Joined:
    Jul 20, 2020
    Posts:
    44
    I'll definitely be taking a look we might be able to merge it with the current PR
     
  14. anuragupa

    anuragupa

    Joined:
    Apr 13, 2020
    Posts:
    0
  15. dave_st

    dave_st

    Joined:
    Feb 28, 2020
    Posts:
    4
    Card: https://open.codecks.io/unity-open-project-1/decks/15/card/14j-control-remapping-system

    I'd like to start working on this system.
    I'm thinking of a settings page which lists all in-game controls and allows the player to freely remap them. The player will also have the ability to save an unlimited (or limited? I'm undecided) number of presets (different presets for keyboard&mouse and gamepad), while a few default ones already account for different keyboard layouts. The game will automatically pick the best fitting default preset based on locale.

    Below is a rough sketch of a possible layout for such a page ("left stick" and "south" to be replaced with icons).
     

    Attached Files:

  16. dave_st

    dave_st

    Joined:
    Feb 28, 2020
    Posts:
    4
    Sorry I just now noticed that there's already another thread. I was looking for a thread tagged "official", so I missed it.
     
  17. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Yes, and my fault, I tagged it now. I merged your message with the pre-existing thread (aka this one :))
     
  18. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    As a programmer I love everything you are talking about, but it's probably good to keep in mind that if the Input rebinding will be complex, nobody will use it, and that's just a waste of effort. Adding new bindings and saving presets goes too far I think, but I'm a huge fan of default presets! And, get this: what if we automatically assign it not based on locale, but on the players' keyboard layout?

    And yes, I want to work on this as well, if only that it's something small and standalone I can do pretty stress-free over the weekend. I would love to see to the default presets myself if we're going that way!
     
    cirocontinisio likes this.
  19. jason_skillman

    jason_skillman

    Joined:
    Feb 1, 2020
    Posts:
    11
    I do like this feature, but I also agree that it might be too early in the development process to start working on it. Hopefully soon we will have a final list of the controls. Also, not sure if you knew this already but Unity has a great button remapping sample using the new Input System in the package manager.
     
    cirocontinisio and MUGIK like this.
  20. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    224
    Also see this: https://docs.unity3d.com/Packages/c...I.html#create-a-ui-to-rebind-input-in-my-game which mentions InputAction.PerformInteractiveRebinding, as well as the Tanks Demo.

    I didn't try the Tanks Demo but I imported the Rebinding UI which was another Sample in the Input System package. It is indeed using PerformInteractiveRebinding, but I get bugs like

    > NullReferenceException while executing 'onActionChange' callbacks
    UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr) (at /home/bokken/buildslave/unity/build/Modules/Input/Private/Input.cs:120)

    and the buttons don't seem to update with my custom bindings. Maybe the scripts are old? When I need a binding system, I'll try to make my own scripts using PerformInteractiveRebinding if the samples still don't work.
     
    cirocontinisio likes this.
  21. Blepius

    Blepius

    Joined:
    Mar 9, 2021
    Posts:
    68
    andreiagmu likes this.