Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

[Official] Input System Improvements

Discussion in 'General Discussion' started by bibbinator, May 26, 2014.

  1. Jacksendary

    Jacksendary

    Joined:
    Jan 31, 2012
    Posts:
    407
    My main reason for open source development is that I'm first of all a fan of open source. I think open source development gives the needed resources to advances in the computer world and I'm a strong believer in that open source development have opened for many ways of "new-thinking".

    Secondly I'm a fan of the "pay what you want" model (Donations). It may not be as profitable as commercially selling your assets or programs but some users may not have money to buy high end solutions, or don't think it's worth the amount they pay, so whether then forcing them to pay, they can simply pay what they though the program/assets is worth for themselves.

    Third, I don't really have much experience with asset store and customer support and at the current state I don't feel like I would have a system that is functional enough to commercially sell, as said, "it do the job, but it's probably far from better than any high end solution".

    Fourth, everyone can help improving and make new versions! - this is possibly one of those I really like, if there is a problem or missing feature in a commercial program you can't always just add it and share it with other without some sort of permission, or you must wait to the developer(s) have fixed/implemented it. For the most part open source licenses allow modifications and sharing of the new source without any legal problems so that the community can add missing features or fix bugs for all at once.

    I'm not trying to say everyone should use opensource solutions, we do need food on the table after all. Both commercial and opensource have advantages. :)
     
  2. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,519
    Agreed open source does have it some very useful benefits.

    It seems that open source can be large effort to administer especially from the legal point of view if you take contributions to your open source code and not a pure GPL only type of license. Take for example sqlite (database software) where they need a statement from each person who contributes code (patches or changes) that gives them specific legal rights. Also if you work for a company you have to have something written that your company allows you to contribute to the project also. Even though sqlite is public domain source code they still need those statements on file.

    See sqlite URL in the contributing code section for details.

    http://www.sqlite.org/copyright.html

    Just wondering about how many individual developers are doing that level of legal tracking on their open source code projects?
     
  3. Apiweb

    Apiweb

    Joined:
    Nov 26, 2011
    Posts:
    57
    Hi @bibbinator and @Rene Damm

    I would suggest that the Input Manager screen was also redone:
    • Making it simple to add/remove new mappings;
    • Simplify combination with control keys (Ctrl, Alt, Shift).
    • Where it is not necessary to remove some options. For example not all mappings using Axis, then where is not required, then hide this information.
    • And I think it would be interesting too, that all mappings stay hierarchically ordered by Mapping. Currently have 3 mappings for Fire1. So on my Input Manager is Fire1 on the top of list, another Fire1 in the middle of the list and the last Fire1 end of the list, so I have to be looking for all occurrences. If at least we could to sort these occurrences.
    For example, the other engine, the screen is greatly simplified and direct to the point (piece that does not treat as "Copy that," or "They did better," but as a workflow suggestion for the Input Manager).


    That is, everything is organized inside every Binding, is very simple I add or remove an input to a mapping.

    I believe that the team of Unity can do an exceptional job, making this screen (Input Manager) more simple, direct and easy to use, greatly improving the UX.
     
  4. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,519
    Have you looked at Rewired in the asset store (https://www.assetstore.unity3d.com/en/#!/content/21676)? I believe that input manager does much of what you would like already.

    In your screen shot does cmd (stand for the command-key on a MAC) or is it for running a script to do something. I am thinking of a script in a similar manner as CH products Control Manager works.
     
  5. LunaArgenteus

    LunaArgenteus

    Joined:
    Sep 16, 2012
    Posts:
    17
    Related to these points, perhaps it's also worth considering providing devs with a separate update thread that is guaranteed to run at fixed intervals a specified number of times per second (Or perhaps a change in the way Fixed Update works would be all that is required, and is (hopefully) what you mean by "FixedUpdate doesn't lag behind Update").

    This would be extremely useful for situations where a developer doesn't mind graphics running at a variable frame rate, but it is necessary to have inputs and game logic that are strictly deterministic. The most prominent genre of games that need this are fighting games, but it could be useful for other kinds of games as well.
     
  6. winxalex

    winxalex

    Joined:
    Jun 29, 2014
    Posts:
    166
    Automatical vs Hardcoded.
    Expand your 2D views from "Vertical" and "Horizontal" into 3D.
    New controllers doesn't have just AXES and BUTTONS!!!
    Current IM is GREAT if used 4 PAD gaming. :D
    Hope in Unity 6.0 or else you wouldn't have GetJoysticksNames the smartest API function ever.
     
    Last edited: Jan 30, 2015
  7. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,573
    Any news?
     
  8. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,689
    Yes. Now that 5.0 has shipped (which turned things upside down for quite a bit), we've restarted work on the input system. Development-wise we want to do some things a little different this time to make sure we're not repeating mistakes that we did with some other subsystems (like, for example, having a subsystem that lies dormant after it first ships), so that's also being sorted. I expect us to be full steam ahead soon.

    I'd say that from a low-level perspective (mainly event pumping), we have a pretty good grasp of things. On the high-level side (state and device management, etc) there's still a number of things to figure out. There's a lot of good feedback in this thread.

    Timing-wise it's too early to say anything with certainty but we're not looking at another GUI system :)
     
    Kiwasi, -chris, Apiweb and 10 others like this.
  9. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Make sure to build it in a way that supports this from the beginning! I assume adding it in later would be problematic/impossible, like with the current system.
     
  10. knr_

    knr_

    Joined:
    Nov 17, 2012
    Posts:
    258
    I didn't catch anything in the list (a few pages back) about being able to set up contextual bindings; that is, developers would be able to push a new binding onto a binding stack per se, when a particular button or key is pressed and pop it when the button or key is released. Kind of like using the shift key to get capital letters.

    Apologies in advance if I missed it.

    Thanks!
     
  11. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    302
    Thanks for the update :)
     
  12. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    14,230
    I just want to say it's fantastic to hear things like this being said.
     
    landon912 likes this.
  13. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Now that there is a 5.1 beta already,
    I assume this won't get in 5.1 anymore. Will it be in 5.2?
     
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,364
    Afaik it's a WIP with no firm release date.
     
  15. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    They really need to publish that roadmap already...
     
  16. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,364
    They do publish roadmaps. These are on the blog embedded within the blog postings themselves. Check out the recent networking ones for example. They give a rough idea what to expect and roughtly when ie after 5.2 or whenever.

    Unity AFAIK will never put dates on things again.
     
  17. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,796
    It's probably in here already, but I need two things that are currently difficult to get.

    The ability to modify key bindings at runtime.

    The ability to listen for any key being pressed, and then get the key code of that key when it is pressed.
     
    Last edited: Apr 18, 2015
    angrypenguin likes this.
  18. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,689
    Unfortunately, it won't be 5.2 either (which will actually go into feature freeze pretty soon). Not fixed release yet.

    Yes, we need better visibility into what's being worked on. It's in the works and will happen. One of the difficulties is that Unity has so far been a rather decentralized operation with many autonomous units so quite frankly even we ourselves often didn't have a complete picture of what was brewing where and when it'd hit release.

    Yup, these are two of the shortcomings of the current system that we are addressing.
     
  19. dittytwo

    dittytwo

    Joined:
    Apr 30, 2015
    Posts:
    12
    Ok First post...
    I am really surprised that this wasn't included in the test tools and such. This is normally one of the key things that a test will go for a click and record approach and then delve deeper under the hood as they get more complicated.
    Having to learn the inner workings of the engine requires developer knowledge, I am slowly getting there as i am sure that my colleges will attest.
    When looking at testing The project we are working requires the use of particles as kind of game objects (think really big data, I mean really Big as in we can't have that many game objects on the screen even with the Nvidia K2 grid we are working against) anyway, trying to assert that these are in the correct place is proving tricky with the ability being talked about here (without hacking into the OS current method) that you set where a click would occur you can then test that the object clicked is the one expected. This all of a sudden becomes a testers dream application to write tests for.

    I guess what I am trying to ask is that for every get you create please can you create a set, it may not be needed right now but you can guarantee that in 15 minutes after you guys release it that it will be asked for.
     
  20. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    14,230
    If you know where the click was meant to go why do you have to be able to put the mouse there? Separate your input code from your picking code, and have your test routines use the picking code with the expected positions rather than the mouse position. Right?
     
  21. orionburcham

    orionburcham

    Joined:
    Jan 31, 2010
    Posts:
    488
    Hi Rene. Now that it's 2016, anything new to report on the input front?

    Input updates don't appear on the Roadmap for this year, unless I missed something.
     
    Last edited: Jan 11, 2016
    Ferazel likes this.
  22. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,689
    Things have been going slower than we wanted but we're moving and have an incremental rollout plan for this year. End of last year we sent a prototype around to several parties to solicit feedback and based on the feedback and our own evaluation, have continued tweaking and adjusting the design.

    Our plan for this year is to start with shipping a minimal, event-based native runtime API with limited platform support and then roll out incremental updates of an open-source managed API sitting on top of that. This is to exist alongside the existing input system. After some iteration, we then want to switch to full platform support for the new runtime API and transition from use of the old system to the new system.

    We're currently at the transition point of starting with the new low-level and transitioning from the prototype high-level API to the "real" thing.

    Biggest and least surprising discovery so far is that an input system that is both reasonably simple yet spans the full breadth of different needs and a reasonable future-proof openness to extension does have its tricky bits.
     
  23. winxalex

    winxalex

    Joined:
    Jun 29, 2014
    Posts:
    166
    Could you send the prototype to me to. I think I could provide good feedback
     
  24. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,698
    Now well over a year later... any news?

    For my $0.02, please keep in mind that Unity's #1 strength is abstracting away platform differences. I honestly don't care how low-level the new API is, as long as it works solidly (and identically) on all platforms. I can build my own control-mapping code on top of that as needed. But I can't dig down in the bowels of platform-specific APIs for every platform I might want to run on.

    So, give us something that reports (1) here are the controllers plugged in, (2) here's a list of input elements for each controller, and (3) here's the state of the input elements, for any controller on any platform, and I'll be a happy camper!
     
    Kiwasi and Samuel411 like this.
  25. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,689
    Yes, things are moving.

    We had/have a first rollout of the native API with backends for Windows and Mac in 5.6 with a plan to open-source the high-level API after release and then go from there. Reality being messy, we had to roll that plan over to the next release. So, native will receive another round of updates in 2017.1 including some VR-related things that are using the new input system. Then we expect to roll out the open-source component in the 2017.1 timeframe with wider platform support to follow right after that. The new input stuff for VR will already be used on some other platforms (Android, iOS, PS4) but ATM we're still lacking full backend support for those.

    I think that we align with that pretty well. We do have a higher-level control mapping system (ActionMaps) as well, but it sits on top of a system that pretty much goes exactly for the three elements you describe.

    As in...

    Code (CSharp):
    1.  
    2. var allDevices = InputSystem.devices; // Gimme all the input stuff you got (1).
    3.  
    4. var gamepadControls = Gamepad.current.controls; // Gimme all the controls of the current gamepad (2).
    5.  
    6. var horizontal = Gamepad.current.leftStickX.value; // Gimme the state of the horizontal axis on the left thumbstick (3).
    7.  
    8. // Can have arbitrary amounts and types of this stuff...
    9. var allGamepads = InputSystem.devices.Where(x => x is Gamepad);
    10. var leftHandPosition = TrackedController.leftHand.position.value; // VR says hi.
    11.  
    There's a lot that's finally solved. It works in fixed and dynamic update and we even have an extra round of special updates for tracking data that needs to be as fresh as possible right before rendering. It's usable even in edit mode -- i.e. it's possible to drive a scene view with a gamepad, for example. Touch is integrated into the same device system rather than being its own separate API. Lots of other things that have been requested.

    There's still a mountain of stuff to do (currently output -- as in all kinds haptics -- on the input devices is giving me serious headaches) but I think we're fast approaching a point where users can actually start building things and help smooth out any kinks and problems in the design.

    Thanks guys for bearing with us and for the patience you guys have shown. Believe me, there's no one more anxious to get this shipped done and ready than me :)
     
    Last edited: Mar 11, 2017
unityunity