Search Unity

Rewired - Advanced Input for Unity

Discussion in 'Assets and Asset Store' started by guavaman, Sep 25, 2014.

  1. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    @Lnoldori Glad to help! I find it interesting that Unity reports that out of resources error when you press a button that falls outside the 20 button limit. I never knew that was logged.

    Apart from a handful of problems (20 button limit and USB controllers whose buttons start at index 15, remotes reporting blank names most of the time), Unity's Android implementation has generally been one of their better implementations. At the very least, it's always been much better than many of the other platforms when it comes to joystick index/id issues and hot-plugging. Because it generally works pretty well (with controllers designed for Android anyway), I haven't seen the need to replace it with a native implementation (which would probably be pretty slow due to the overhead of the native/managed barrier).
     
    Last edited: May 10, 2016
  2. Lnoldori

    Lnoldori

    Joined:
    Jan 19, 2013
    Posts:
    9
    @guavaman Unity reports the error but that doesn't help too much :)

    Either way i decided to go for a very simple controller support for this project. I will have very few premade configurations and for the rest of the controllers where i can not be sure if they will work or not i will ask the user to remap them with a few clicks.

    As for the native support i thought about writing a plugin but i am too lazy to do it and after working with java for the past 10 years i think i need a very big break :)
     
    guavaman likes this.
  3. DOCSKI_GAMES

    DOCSKI_GAMES

    Joined:
    Apr 13, 2012
    Posts:
    139
    @guavaman

    Amazing plugin, we currently use it in our game RumbleArena: http://goo.gl/oFj0rM

    We do have an issue with the Dpad of several controllers, it seems as if the Dpad is not giving digital input.

    Even when I removed Dpad elements from joystick mapping, it still seems to feed axis values?

    I have the issue with Xbox460 and PS3 controllers as well as several bluetooth controllers
     
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    How can you even use Xbox 360 or PS3 controllers on iOS? There's no way to connect these devices and iOS does not support them. Rewired will not recognize them either if you've jailbroken and have some software installed to make them connectable.

    This should not be possible. If an ActionElementMap does not exist that binds the D-Pad direction to an Action, it cannot return value. Use the debug code found on this page to determine what maps are enabled and what Actions are mapped to what elements:

    http://guavaman.com/projects/rewired/docs/Troubleshooting.html#controller-doesnt-work

    Regardless of whether the physical element is an axis or a button, it will return both axis value and a button value depending on how you query the Action.

    player.GetButton will return an on/off value even if the element is a physical axis
    player.GetAxis will return a -1 to 1 value even if the element is a physical button

    If you are actually trying to describe the fact that the player.GetAxis value is slowly ramped over time as opposed to being an instant 1/0 value immediately, see Input Behaviors - Digital Axis Settings: http://guavaman.com/projects/rewired/docs/InputBehaviors.html

    The only possible way that a binding could persist after you've modified the map to remove it is if you are loading outdated XML data. Are you using Control Mapper and if so did you see this important warning about managing XML data when making changes to the defaults: http://guavaman.com/projects/rewired/docs/ControlMapper.html#saving-and-loading

    The only other possibility is if the D-Pad is returning a keyboard keycode like Left Arrow, Right Arrow, etc. and you have an enabled keyboard map assigned that binds those keys to Actions. iOS does not normally send keycodes for joystick elements (Android does), but if you're jailbroken your device and installed some other software to make USB joysticks work, I have no idea if it may also send keycodes when certain elements are pressed.
     
    Last edited: May 11, 2016
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
  6. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
  7. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    I mapped rotation to Look X, so you could look around using the rotation motion. It was okay, but I think it would require some getting used to because it's pretty sensitive. It returns a value of -1 to 1, so it's like pressing a joystick stick to the left or right, but without the physical limiter letting you know you've hit the maximum. Probably once you get used to it, it would be more natural. I don't really know whether it would make sense to map Look Y to anything on the device. It doesn't seem like it. Tilt Forward/Backward I mapped to walk forward/backward and Tilt Left/Right I mapped to sidestep.
     
  8. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    I am running the demo version and I can't get the mouse maps to work. Is this because I an running the latest unity beta or something else. I am definitely doing it correctly (I think :) ) . No problems with gamepad and keyboard. ... Also how would I setup player 0 as gamepad or keyboard but if player 0 uses gamepad player 1 can use the default keyboard layout of player 0?? Thanks!
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    See Troubleshooting: Mouse control doesn't work,.
    1. Did you create one or more Players in the Rewired input manager?
    2. Did you create any Mouse Maps?
    3. Did you assign those Mouse Maps to your Player(s) on start?
    4. Are those Mouse Maps enabled on start in the Player(s)?
    5. Did you check "Assign Mouse on Start" in the Player(s) you want to have access to the mouse or assign the mouse manually to the Player(s) during runtime through scripting?
    6. Please go through the Quick Start guide and ensure you haven't missed any steps.
    7. Read the documentation to learn more about how Controllers and Controller Maps work.

    Most likely you did not assign the mouse to any Player:

    From the Quick Start:

    Step 18: Do the same for mouse maps. Note: For mouse control, ensure the "Assign Mouse on Start" checkbox is checked, otherwise the Player will not be assigned the mouse unless you assign it manually through scripting.
    You would have to manually manage the Keyboard Maps in that case loading the Keyboard Maps in Player 1 when Player 0 is assigned a joystick. Rewired does not automatically handle it when you want to treat the keyboard as a "joystick." The How To's page tells you everything you would need to know about how to work with controller assignment and map manipulation.

    If you want to exclude a Player from joystick auto-assignment because he is using the keyboard:
     
    Last edited: May 14, 2016
  10. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    Thanks a bunch however I did set it up correctly. I went over it many times. I have that enabled otw I have it setup basically like the gamepad and keyboard. Assigning it to the 1st player. Regardless thanks again
     
  11. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Download this unitypackage and install it. Open the Rewired Mouse Test scene and press Play. Move the mouse around and press the buttons and see if it logs anything to the screen.
     

    Attached Files:

  12. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    Thanks! Test scene works. Went back to my scene and deleted and redid the whole scenario and now that works too :) Still not sure what I did wrong but all good now! I think I need to buy this - amazing support there. Or should I wait for a sale price ;)
     
  13. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    One more for you :)
    My input controller script is no longer firing onPointerDown event. (It's implementing IPointerDownHandler) What would cause this?
     
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Glad it works. Rewired is not scheduled to be in any sales. If I were to register for possible inclusion in a sale, it has generally taken about a years time from the date of registration to being chosen to be in a sale.

    Rewired does not modify the functioning of Unity's input system or its UI system in any way. Rewired could not be causing it to behave differently.

    You didn't mention anything about using the RewiredStandaloneInputModule, so I'll assume that's not involved.
     
    Last edited: May 14, 2016
  15. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    Ok thanks again. What would be the "rewired" way to detect a touch event that I can then handle with my script instead of using GetMouseButton (Which is detected as a touch when Android/IOS ) which requires a canvas. ... Sorry
     
  16. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Rewired does not manage touch input directly. All touch input would be handled through UnityEngine.Input and touch joysticks or other touch controls that you want to use the Rewired Action system must be piped into the Rewired system through the use of a Custom Controller. The source input data for touch would always come from UnityEngine.Input's touch methods or through the use of another plugin (like a touch joystick plugin or a gesture recognizer plugin), which almost certainly ultimately gets its touch data from UnityEngine.Input.

    In order to get touch input directly from the device, Rewired would have to implement custom native libraries on every platform. Rewired does not use native input libraries on Android or iOS as shown in the list of supported platforms and rely on UnityEngine.Input for input data. Further, there wouldn't be any benefit as Unity's touch input system works fine and wouldn't benefit from being replaced.

    To answer your question, you do not have to change your script.
     
    Last edited: May 14, 2016
  17. shotoutgames

    shotoutgames

    Joined:
    Dec 29, 2013
    Posts:
    290
    Thank you yet again.
    It turns out in order to allow multiple players in my game I moved my input handler controller script to a child of the players. By doing this I lost my connection with the Canvas UI that is firing the Pointer methods. .. SO yeah not a rewired issue. .... I just purchased the full version :)
     
    guavaman likes this.
  18. soxroxr

    soxroxr

    Joined:
    Jul 17, 2012
    Posts:
    60
    Hello there. I was poking around with the built in input for Unity and I noticed it says it recognizes input from joysticks and whatnot, but it wasn't doing anything for me. I'm actually already a user of InControl - I've had it since it released because it made supporting everything much easier. But out of curiosity, I googled the 'issue' and found your thread from 2011, trying to find help on that same issue.

    The reason I'm commenting is because I'd love to know more about the comparisons between Rewired and InControl. I'm a fan and user of the latter, but I'm always looking to improve my repertoire of assets. If yours does the things I need/want as good or better, I'll gladly switch.

    I saw the table on the first page, but it's from 1.5 years ago, so it's quite outdated given that you've updated Rewired... apparently 80 times. And InControl has been updated too. The very first entry is a bit dishonest though, it would seem. Before you posted the chart, InControl was working well with quite a few controllers across Windows, Mac, and Linux. The chart would seem to suggest that InControl is only capable of manipulating controllers on Windows (via XInput) or Ouya.

    Now, your asset seems very good and capable of a lot - more than InControl, including several interesting things. I'm not certain if Rewired does better the things InControl is capable of, but that's why I'm here. I do however find it puzzling that you would write what you did in the table if you truly believe in your asset. I also don't see a single thing listed that InControl does that Rewired doesn't - I'm not sure if that's because Rewired does everything, or if it was an attempt to make Rewired look better. Is there literally not one thing InControl can do that Rewired can't?

    I remain skeptical.
     
  19. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    It is not dishonest at all. The first entry is "Native Input" -- showing you which platforms implement special libraries native to that platform to get input directly from the operating system instead of being a wrapper for UnityEngine.Input. InControl does not implement native input libraries for any platforms except XInput on Windows (works only with XInput devices natively, all other devices have to be handled through UnityEngine.Input) and Ouya's plugin on Ouya. For every single other platform, all of InControl's input is 100% dependent on UnityEngine.Input with all the limitations that implies. Native input is one of the huge, huge difference between Rewired and all other input systems on the Unity Asset Store. The only reason to go native is because of the plethora of show-stopping bugs and inherent limitations in Unity's input system, especially with regard to joysticks on nearly every platform. Some of these bugs have been fixed in versions since Rewired's release on some platforms but others haven't. Native input was the reason Rewired was written in the first place because of so many issues with Unity input that could not be worked around (quick examples: 20 buttons per joystick limit, identifying joysticks only by a name string, hot-plugging causing joystick ids to shift and resort differently on every platform, having to poll Input.GetJoystickNames every second to detect connect/disconnects, completely non-functioning hot-plugging on Windows builds at the time it was written, etc.). Rewired was a reinvention of input from the ground up, replacing Unity's input system for the most part with native solutions on the major platforms.

    Rewired's Raw Input implementation for example works with many gamepads and joysticks that simply do not work through UnityEngine.Input because Unity's Raw Input implementation doesn't take into account all the variations of possible HID data formats, so some joysticks simply return bad data. Rewired's Raw Input implementation makes Bluetooth devices work far better with more reliable connect/disconnect detection, it has support for the Dual Shock 4 special features such as vibration, touchpad, gyro, lights, etc., specialty controllers such as Rail Driver, support for complex controllers like flight yokes and racing wheels with > 20 buttons, robust and reliable hot-plugging, and many other things that are simple not possible if you have to rely on UnityEngine.Input. Rewired supports pressure-sensitive buttons on MFI gamepads on OSX, which simply don't work with UnityEngine.Input. Native input advantages on Linux are massive because of the huge number of joystick bugs that still exist on that platform (major hot-plugging issues, bad axis calibration, and more). (It would be impossible for me to list all the advantages here, but many are outlined on the Rewired website and documentation.)

    InControl is currently testing native input betas on OSX and Windows. The reason is simple -- there are still too many limitations and bugs with UnityEngine.Input with regards to joystick recognition, hot-plugging, and more and the only way to have complete control over input is to rewrite it from the ground up. That means writing native input libraries specific to each platform/input source.

    It wasn't my purpose to list every feature of both system. Of course a comparison chart made for my program is going to be written based on the features of my program. I also do not list every single feature of Unity's input system.

    I am not an expert on InControl and do not use or own the software, however one feature InControl has that Rewired does not in built-in touch joystick UI controls.
     
    Last edited: May 15, 2016
  20. soxroxr

    soxroxr

    Joined:
    Jul 17, 2012
    Posts:
    60
    I appreciate the reply!

    I see that you were only listing features of Rewired, but as someone who was looking at the chart out of interest, it seemed to me that the chart said InControl couldn't really use controllers outside of Windows (XInput) and Ouya.

    I notice you say things like "No other input package for Unity offers so many options to the developer." (reply to a poor review) If you're not so certain of what other assets do, especially your biggest competitor, can you really make claims like that?

    I do like the sound of Rewired, native input and intelligent hot-plugging seem pretty awesome. I like that you put so much thought and effort into the asset. I don't necessarily like that you're trying to push it so hard as the best for everything, even though I do really believe you're aiming to make it that.

    I have no doubts that you would like to get to the point where there's no reason to buy any other input asset. You seem very passionate about what you're doing and I like that about you. How hard you're trying to lobby against others.. not so much.

    But as I said above, I'm not a fanboy of anything - I go with what seems like the best choice to me, and Rewired seems to be that. I'll most likely pick it up for my next project.
     
  21. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Being skeptical is useful and hopefully we can all use that to make informed decision before purchasing any assets.

    The Rewired trial version is available so you can do your own evaluation. Make sure you download it. This is critical because nothing can really be evaluated until you have in your own environment.

    I have been a Rewired fan since the beta release.

    My main interest is flight simulation. The 20 button limit of Unity Input and all other input solutions currently available is a huge problem. Basically it is a show stopper. All good Flight controllers have more than 20 buttons.

    Rewired supporting native input is critical. Rewired supporting more than 20 buttons is absolutely required. The next problem is what controllers are supported. So we check the list of supported controllers. http://guavaman.com/projects/rewired/docs/SupportedControllers.html. Are you familiar with all of those controllers on that list?

    Having a long list of controllers is a good thing but what does extended support mean?

    The Rewired developer has had his hands on 99% of all of the controllers on his list for mapping on multiple platforms. That gives me confidence that the Rewired developer will be able to answer my support questions since he has probably run into the issue before. The depth of knowledge on huge variety of controllers is important factor.

    Being able to map each individual element on the controllers on the extended controller list by name is critical. This is more important especially for flight controllers or anything that is not a gamepad. How many games by big publishers do that? It is hard to go back to X-plane and when you have 30+ buttons (multiple by 3 for the three modes) and trying to remember the number for each element. Then do that 5 times for all of your controllers. You get really spoiled by Rewired mapping controllers.

    Use case is a cockpit for two pilots. So in my use case need 7 usb controllers per player to handle all of the controllers I would need for each pilot. This is easy to handle in Rewired. So at the bare minimum you need two yokes, two throttle quadrants, and rudder pedals for each pilot.

    Main platform for me is Microsoft Windows but I have been also working with Linux. Rewired supports all of the flight controllers natively on Linux which is great. No 20 button limits for me and it supports the same level of control I have on windows when it comes to input. This is huge since technically almost no flight controller manufacturers support Linux officially. But I do not have to worry about that because Rewired handles that for me.

    The Windows platform is very nice when it comes amazing controllers available to consumers.

    The nice part is my customers benefit greatly because of the great controller support built into Rewired. The specialty controllers supported by Rewired out of the box is awesome. Customers have a great experience because they can use the controllers they own today.

    For train simulation/games most people want to use RailDriver. That is supported in Rewired. For ship/sailing games people want to use Ship Console. That is supported in Rewired. For farming/truck/bus simulation Saitek's Heavy Equipment Wheel and pedals are supported in Rewired. For FPS shooters and customers want to use a light gun (Arcade Guns) is supported.

    Putting it all together for testing is the fun part. Just allow for 20 controllers per player and away you go. UFPS with Rewired integration is another nice use case.You can run around in UFPS's skycity demo with Arcade Guns light guns, gamepads, racing wheel, flight sim controllers and it works great. It make testing use cases inside my game very easy.

    The best thing about making a game/simulation is when you get a support call for a new controller that just came out. Thankfully Rewired's control mapper makes it easy to handle those cases since you can remap your controllers in game. How many game players want to change their default control mappings? Don't we all want to do that? That is where control mapper really shines. It came in really handy recently when I asked another developer to include control mapper so I can map in my controllers that he did not have access to. It makes it very handy for testing purposes also.

    After purchase support is critical. This Rewired thread speaks volumes to how well this product is supported. The reviews in the asset store tell the same story of great support. Also having good documentation of the entire Rewired system is a huge plus.

    Compared to other input systems (as of today)

    (1) Unreal Engine - seen people complain about the input especially for flight controllers regularly. I guess I expected more.
    (2) Unity Input - just search the asset store for the number of alternative input systems available. I think that alone says it all. 20 button limit is a showstopper for me on Windows platform. Also if anything breaks on Unity Input I am immune from those problems because of Rewired's native input.
    (3) All other competing input systems most of which are built on top Unity Input for windows is stuck with 20 button limit. Showstopper.

    I would be interested to know any other input system that supports as many controllers as Rewired does on any platform out of the box.

    (1) Developer who has actually worked with most of the controllers he supports. Controller Knowledge is critical. Hands on the Controllers is what makes Rewired great.
    (2) Provides the Rewired awesome product with so many features.
    (3) Provides amazing support.

    The best way for you to see if Rewired works for you is download the trial version and evaluate it for yourself. Reading about it is one thing but performing a thorough evaluation of the tool is only something you can do.
     
    _met44 and guavaman like this.
  22. soxroxr

    soxroxr

    Joined:
    Jul 17, 2012
    Posts:
    60
    I'm sure that Rewired will work fine for me, as I only target gamepads. But as such, things like supporting more than 20 buttons doesn't matter to me, which was the biggest selling point for you.

    I won't be making simulators of any sort, and probably not FPS games. Side note; I've never heard of anyone wanting to use a light gun on PC, everyone's all about mouse precision. Were I to make an FPS game though it wouldn't be bad to have such support.

    As far as remapping controls go, both can do that. And to answer the question, "Don't we all [want to be able to remap controls]?" - I haven't remapped a single control in 2-3 years, and that was one thing for the keyboard. I've only remapped gamepad controls one time - I use the 360 pad and the game was for Genesis; a completely different button layout. I don't think I'd include remapping in any of my games. For the most part the developer knows best and they made the layout the way it is because it supports the flow of the game. I recall once or twice growing up where I wanted it, but for the 100s of other games I played I was happy with the original setup.

    I've never heard of someone having 10+ controllers connected. The most I've seen a console be able to do is 8, and to be honest that's already crazy. Fitting 8 players on a screen at once is chaos, and rarely in a good way. Games that really utilize that are things like Monopoly, but the way it worked on NES/SNES, you just passed the controller around. Not hard to do, especially with the wireless controllers of today. But I digress, my point is that such a feature also isn't with my realm of interest.

    Since I want to do local multiplayer in the future, I like that Rewired has native input and that hot-swapping works better on the important platforms. That is the biggest selling point for me, followed by frame-independant controls.

    I wouldn't be able to evaluate it right now properly, what limitations does the trial have over the main version? I tend to not use trials for that very reason - I want a full evaluation, not half of a product. It tends to hinder my opinion. But as of now I'm already pretty interested, and if it's on sale anytime between now and my next project, I'll probably pick it up.
     
  23. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    There is ample explanation about the benefits on Native Input and what that means on the website and in the documentation. If the reader misinterprets what Native Input means, I cannot he held responsible for that. I am in no way saying InControl only works on Windows and Ouya. There is no attempt whatsoever to mislead potential customers.

    I said I was no expert on InControl. I did not say I was not familiar with the competition's features. I happen to know that InControl does not include anything like Control Mapper, which is what I was referring to in the review response you mentioned. cInput is essentially a system designed around something like Control Mapper, but isn't nearly as flexible.

    Thank you for your opinion. I have spent over 2 years of full time development and support on Rewired. Even with all the detailed information I've put out there trying to emphasize where and why Rewired is different and better than other systems out there, there are still a huge number of people who do not understand the differences and can see only the surface level details of an input system (ie: Does my gamepad work? Then it's all the same). Why should I have spent 2 years developing this and just be content for potential customers to not understand the differences and think that what I've created is the same as everything else out there? It's not. A car is not a car -- there are different levels and classes of cars with different purposes. A sports car maker does not sit back and let customers think it has the same capabilities as a family sedan. Getting across the differences in a very technical system like this is an extremely difficult task.

    I firmly believe that Rewired is the most powerful, most flexible input manager available for Unity and has been since it was released with a huge number of majorly powerful features built in that no other system had at the time. Since release, other systems have been slowly adding features that were pioneered and battle-tested in Rewired (including Unity's new system). The only reason I developed Rewired in the first place was none of the systems could solve the major problems I was having blocking me from providing a first-class input user experience in my game.
     
    Last edited: May 16, 2016
    _met44 likes this.
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Your use case is the most common and most basic -- gamepad-only, static controls. Rewired was designed to scale up to the needs of a very complex multiplayer-on-one-PC AAA game on the order of Halo or Planetside 2 or a multi-player flight simulator. However, due to your use case, you're likely not to notice many of the under-the-hood features that do make Rewired different. Even if you don't need the extra features, they are there for those that do. In some cases, I would recommend certain users do not use Rewired simply because they have such simple needs and would be better served by a simpler system such as cInput.

    Rewired does not offer framerate-independent input at this time. Can I ask where you saw the information stating that it does?

    http://guavaman.com/projects/rewired/trial.html

    The only limitation is a 2-minute timeout on during runtime. Each time you start the game the timer is reset so you can evaluate as long as you like.
     
    Last edited: May 15, 2016
  25. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I also have InControl but Rewired is definitely the much better solution in my opinion. I am sure I am not only person who has both products. InControl was last updated October 23, 2015. That is a long time ago. I use Rewired for all of my projects since I got the Rewired beta.

    Both Native Input and more than 20 buttons is what originally got my interest. But The entire Rewired product works well. The best part is the little details you discover have already been thought of in the Rewired product.

    It really depends on your customer base and what type of controls they wish to use. My customer base will expect a large number of usb controls as standard. For example MadCatz division Saitek sells a full cockpit with 21 USB devices on it and that was exclusively for the Microsoft Flight Simulator. So the amount of usb controls I have is rather small compared to what is being sold as consumer level devices.

    http://www.saitek.com/uk/blog/index.php/here-comes-the-saitek-cockpit

    This is consumer grade usb devices. If Saitek can afford to sell that to a single market (Microsoft Flight Simulator) there definitely has to be a good level of interest to keep the product in production.

    If people want to spend more money they definitely can when it comes to flight sim. For example precision flight controls will sell you just dual rudder pedals for about $6,000. Mostly for those interested in FAA certification type simulations but customers can definitely get good hardware if they want it.

    https://store.flypfc.com/?/products/rudder-pedals/dual-professional-rudder-pedals-general-aviation/

    The Sim Racing (car racing) environment is not much different. People can have 10 usb devices easily without too much effort.

    Really? You must have a very nice customer base who don't need any input controls remapped.

    In flight sim that is basically a minimum requirement to be able to remap controls. Especially since I will not be able to purchase all possible combinations of hardware the customer has. Elite Dangerous space game it seems like everyone wants to change their controller mapping.

    What about game players who have disabilities? They need to be supported also with remapping capabilities. For example if a person is in a bad car accident they might not be able to use the default controls anymore. So they need to be able to remap controls. Did you consider that issue also in your product? This is a good website for discussion of those type of issues.

    http://www.includification.com/

    The evaluation is fully functional. The only limit on how long executable you build will run.

    >>The only limitation is a 2-minute timeout on during runtime. Each time you start the game the timer is reset so you can evaluate as long as you like.<<

    (1) Make sure you read the Rewired documentation and watch the Rewired Overview video.
    (2) All of this information is available so you can make an informed evaluation of the product.
     
    Last edited: May 15, 2016
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    @longroadhwy The vast differences between your use cases and the gamepad-only use case illustrate how Rewired was designed to be extremely flexible for the vastly different needs of different game genres, classes of games (game jam to AAA), and end-users. Rewired was not designed around the Xbox 360 gamepad. It was designed to accommodate all common types of input controllers, which is a much (much) bigger task than simply supporting gamepads, and it does this cross-platform which meant starting at the native level on each platform because Unity input wasn't sufficient for the task. The design from the ground up was to be able to support just about any controller in existence regardless of whether or not a pre-defined definition was provided for that controller. And it was designed to do all of that for multiple players at once. With editor GUI tools and the addition of Control Mapper, it offers a complete system to developers out of the box without a lot of work or programming skills (even easier if you use PlayMaker / Behavior Designer integrations). At the same time, it also exposes a gigantic API to allow programmers to start from scratch if they so desire.
     
    Last edited: May 15, 2016
  27. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    @soxroxr If another solution works for you, that's cool, but I'll share my experience with input systems.

    Before InControl or Rewired existed, the best option was an asset called cInput. It was the first I know of to do the trick where it replaced the Unity input buttons/axes with several choices so that you could do in-game remapping. It was never a satisfying solution for a few reasons, the most obvious being zero out-of-the-box support for specific controllers. The assumption is that the player would have to map every control themselves. Not cool.

    Then InControl game along and I eagerly snapped it up. I had some nice exchanges with the author and he took some of my suggestions. It was nice for gamepad support, but it always bugged me that it was so tied to gamepads and only gamepads. What about keyboards, mice, and other types of controllers? Also, at the time, it has no remapping capabilities, though it sounds like it does now.

    When Rewired came along, I was like "finally!" I've been happily using it ever since. Even not counting all of the many, many features Rewired has, and the incredible level of support, the fact that you can decouple gameplay actions from specific controls was huge and definitely was what I really wanted.

    With InControl you do this:

    Code (csharp):
    1. if (InputManager.ActiveDevice.Action1.WasPressed)
    2. {
    3.     player.Jump();
    4. }
    Action1 is like the A button on a 360 gamepad, X button on PlayStation, etc. Obviously, if you *only* want to support gamepads, that will work.

    But to me, this is the far superior way to go:

    Code (csharp):
    1. if (rewired.GetButtonDown("Jump"))
    2. {
    3.     player.Jump();
    4. }
    In reality, you likely wouldn't have a hard-coded string in there; that is just to illustrate the difference.

    The action "Jump" could be mapped to "Action Bottom Row 1" (the equivalent of Action1 in InControl) in Rewired's included gamepad template. That automatically gives you default mappings to something like 70 gamepad controllers at last count.

    But you could also have default mappings to a key on the keyboard or a mouse button. Or yes, even more esoteric stuff like a button on a flightstick or a steering wheel. On and on.

    For my current game, I really enjoy being able to not only support a wide array of input devices automatically, but also potentially just about any weird input device somewhat might have.

    In my experience, PC gamers do expect mouse and keyboard support at a minimum.

    The notion that developers "know best", therefore flexible input options aren't needed doesn't match my experience. Even with an Xbox 360 game I did, one of the very first bits of feedback was that they wanted to use different controls for gas and brake. I "knew best" that the left trigger should be the gas and the right trigger should be the brake, but that's not how some players saw it, so I changed it to have different options.

    Even Uncharted 4 allows for alternative input schemes. So even Naughty Dog doesn't think a "one size fits all" solution is appropriate.

    Also, think of someone who is disabled and may need to rearrange the controls to suit their needs or map to a custom device.

    I think of Rewired as just part of Unity now. I pull it in as one of the first things I do in every new project, even if it has basic input needs.

    Rewired is a super flexible and robust system. The less you need a flexible and robust solution, the less value you'll get out of it. The way I look at it: why *not* support a wide array of input devices and control schemes when it's that easy?
     
    guavaman likes this.
  28. Xander-Davis

    Xander-Davis

    Joined:
    Apr 23, 2011
    Posts:
    441
    @guavaman can you make a profile for the Vive controllers (left and right separately) ?

    When running a blank scene with the JoystickElementIdentifier, a default camera, and the Xbox One controller, the text shows up and displays the Xbox One controller. However, when running the same scene with the Vive SteamVR [CameraRig] prefab that also spawns the Vive's controllers, no text shows up, even with the Xbox One controller on.
     
    Last edited: May 16, 2016
  29. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    As was the case with the Oculus remote, these devices are very unlikely standard HID devices and will require a special SDK to use.

    The behavior you describe about the Vive SteamVR plugin causing the Raw Input device to disappear sounds suspiciously similar to Raw Input device problems when using Steam and having a Steam Controller attached. Long story short, Steam places hooks on core Windows DLLs to intercept calls to these DLLs and change the results returned, effectively replacing core Windows systems like Raw Input with Steam's own version (or filtering the results) so they can dictate 100% what devices the game ultimately ends up getting back from Windows. This is done so they can have complete control over what devices server/client sees in Steam Streaming and with Steam Link. The end result of these shenanigans is the software is prevented from getting the input devices from the OS and only sees what Steam wants it to see, which can cause all kinds of havoc. It sounds like SteamVR is doing something similar, because there's no other reason why Rewired would be prevented from seeing that an Xbox One Controller is attached. Rewired is asking Windows directly for a device list and is being told "nope, no devices are attached." For the Steam + Steam Controller issue, I spent a ton of time coming up with a very creative (yet convoluted) workaround that makes Raw Input devices work again when a Steam Controller is attached, but a lot of that was simply luck in finding some holes in their system of trying to hide the controllers from the software. Something similar would probably have to happen here if it's even possible. I do not have a HTC Vive, so I cannot attempt this at this time. Additionally, I do not like the idea of having to keep adding hacks to attempt to untangle and undo bad overreaching decisions made by 3rd party platform developers like Steam.

    In all likelihood, the Xbox One Controller will still work through XInput since that's Steam's "approved" and expected input source on Windows for game controllers. (That and the Steam Controller through the use of Steam's API.)

    Since the Vive controllers aren't appearing to the JoystickElementIdentifier, they cannot be seen by Raw Input (or Steam is blocking them too). If the SteamVR plugin provides an API for accessing the Vive controllers, you would add support for them through the use of the Custom Controller system in Rewired.
     
    Last edited: May 16, 2016
    Xander-Davis likes this.
  30. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    To clarify and to ensure there is no unintentional misinformation, InControl added a PlayerActionSet and PlayerAction binding system in InControl 1.5.0 which came out 6 months after Rewired's initial release on the Asset Store. This also made possible runtime-rebindable controls and savable bindings which were not possible until that time. Now it is possible to get input in InControl in a similar way to Rewired by getting the value for a PlayerAction from a PlayerActionSet instead of directly from the controller.
     
    Last edited: May 16, 2016
  31. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Ah, sounds like there have been some significant improvements.
     
  32. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I have a Vive and can confirm that the wand controllers do not show up in the normal USB Game Controllers list. I imagine if VR takes off, we'll see some standards emerge for that sort of thing.
     
  33. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Thanks for confirming!

    I agree -- it's far too early for any kind of standard to exist for these devices as VR control is still largely experimental. The fact that each device has to ship with its own SDK pretty much says it all.
     
  34. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I thought this was an interesting article on this subject:

    Game Developers Weigh in on VR Input

    http://www.pcgamer.com/game-developers-weigh-in-on-vr-input/1/
     
  35. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
  36. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    You know... Another thought just struck me. You are using the Vive SteamVR camera rig. That changes the camera that's in use when you press Play I assume. The JoystickElementIdentifier uses the GUIText component to write text to the screen. It's very possible that the SteamVR camera isn't compatible with the GUIText component. Reading your post again, they way you phrased -- "no text shows up" -- would indicate that. If the controller were just being not detected, you would still see "Raw Input Joystick Element Identifier" in the lower left corner of the screen.
     
  37. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Glad you found it useful.

    I find it interesting how Elite Dangerous has really driven all of the new joysticks and HOTAS systems coming out too. I did not think that Elite Dangerous would have so much influence on the market. But I cannot complain I am always interested in more flight controllers. :)
     
  38. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    You might be interested in my next update. I will be including controller templates for Racing Wheel, HOTAS, Flight Yoke, and Flight Pedals to make it easier to map once for all, or at least as a backup in case new devices get added in the future so they will be covered also. Obviously mapping for the specific device gives you better control, but the templates are useful if you don't want to map all the devices manually and just want something good enough. HOTAS devices seriously have an unbelievable number of elements and variations though.
     
    Karearea likes this.
  39. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That sounds great. I know that is something @Steve Tack was attempting to do on the HOTAS side back the in the early days of Rewired. I guess that was probably Mar 2015 time frame (i.e. Rewired 1.0.0.34) about 52 updates in the past compared today's current Rewired release of 1.0.0.86.

    This will certainly make flight control that much easier to work with.
     
    Last edited: May 18, 2016
  40. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I did end up creating *four* templates, one each for: combined throttle and stick, stick only, rudder pedals only, and throttle only. It worked out fairly well, but they're kind of game specific. Like, I have a "mini stick X" and "mini stick Y" in my throttle template that I map to lateral and vertical thrusters, specifically because of two throttle controllers supported by Rewired that have a mini joystick.
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    I was also thinking about possibly doing a separate stick only, but mapping for HOTAS would cover those cases too so it may not be necessary to have HOTAS, Throttle, Stick. For example, I've mapped the CH Pro Throttle as a HOTAS device as well as the CH Fighterstick, even though neither have the complete list of elements. The one issue though is the HOTAS has currently 159 mappable elements due to the fact that there are so many variations in HOTAS device configurations. I did also include a mini stick on the throttle and two mini sticks on the joystick to account for Saitek's new X-56. The result is a massive list of elements, many of which will have no effect on some devices, but with the capability of covering every possible element on the current list of HOTAS, throttle, and sticks Rewired supports. Some elements are not specific in terms of placement such as "Stick Button 1-10", "Throttle Button 1-10", etc., but very common ones are like "Trigger" and "Pinky Button," and some are semi-specific like "Stick Base Button 1-10."
     
    Steve-Tack likes this.
  42. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Just wanted to come back and say thanks Guavaman for your detailed explanation to help me get Rewired working with my unknown controllers- I followed your steps and everything is working now :)
     
    guavaman likes this.
  43. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    You should include the farm controller wheel with the racing wheels. People might want to race trucks or a bus or a tractor or something of that variety. Of course anyone with a driving sim of any type would probably perfer to support all wheels and pedals as one group rather than making a special case for racing wheels and all other wheels.
     
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Thanks for the suggestion! I already did include it.
     
  45. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    The 159 number of mappable elements that almost seems like a low number. Maybe I am reading more into that I should be.

    How is the mouse nipple being treated on the ThrustMaster Warthog, Saitek X-55, Saitek X-52, and Saitek X-52 Pro throttles? It is not really in the mini-stick category.
     
  46. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    It is effectively a mini stick. There's no difference in the data returned by the mouse nipple or a mini stick.
     
  47. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,624
    Rewired 1.0.0.87 is available for registered users to download now. If you'd like to register to receive early access to updates, please contact me here. The Unity Asset Store should have the update in 5-10 business days.

    1.0.0.87:

    Changes:
    - Added Racing Wheel controller template.
    - Added HOTAS controller template.
    - Added Flight Yoke controller template.
    - Added Flight Pedals controller template.
    - Added the following controller mappings the Racing Wheel controller template:
    - Logitech G25
    - Logitech G27
    - Logitech G29
    - Thrustmaster F430/T100
    - Thrustmaster T150
    - Thrustmaster T300 RS
    - Thrustmaster TH8A
    - Fanatec Porsche 911 Turbo S
    - Saitek Heavy Equipment Wheel & Pedal
    - Added the following controller mappings to the HOTAS controller template:
    - CH Fighter Stick
    - CH Pro Throttle
    - Saitek X45
    - Saitek X52
    - Saitek X52 Pro
    - Saitek X-55 Rhino Stick
    - Saitek X-55 Rhino Throttle
    - Saitek JI3 Cyborg 3D Gold
    - Mad Catz C.Y.B.O.R.G V1
    - Thrustmaster HOTAS Warthog Joystick
    - Thrustmaster HOTAS Warthog Throttle
    - Thrustmaster T.1600M
    - Thrustmaster T.Flight Hotas X
    - Thrustmaster USB Joystick
    - Logitech Extreme 3D Pro
    - Added the following controller mappings to the Flight Yoke controller template:
    - CH Eclipse Yoke
    - Saitek Pro Flight Yoke
    - Added the following controller mappings to the Flight Pedals controller template:
    - CH Pro Pedals
    - Saitek Pro Flight Rudder Pedals
    - Added inspector warning when editing a Rewired Input Manager prefab instance.
    - Added uFS - Flight Simulation Engine integration pack.

    New Controller Definitions:
    - Logitech G25
    - Fanatec Porsche 911 Turbo S

    Bug Fixes:
    - Added additional PlayerPrefs.Save calls to various public save methods in UserDataStore_PlayerPrefs.

    ----------------

    Note on uFS integration pack:
    This pack consists of a prefab you can use as a starting point for setting up input for uFS with default mappings for gamepad, keyboard, mouse, HOTAS, flight yoke, and flight pedals. The actual integration of controls is handled through Unity Input Override which must also be installed.
     
    Last edited: May 20, 2016
    _met44 and Karearea like this.
  48. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    This is an awesome Rewired update. It will make it so much easier for the flight controllers to have templates especially on with the yokes. Yea! I almost missed that two new wheels G25 and Fanatec Porsche 911 Turbo S were added in this release.

    Thanks for the uFS integration prefab too.

    Hope the asset store can release this tomorrow.
     
    Karearea likes this.
  49. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    guavaman likes this.
  50. pjburnhill

    pjburnhill

    Joined:
    Mar 2, 2016
    Posts:
    27
    @guavaman Does the Unity Input Override work with PlayMaker actions? I.e. if I'm using 'Get Axis Vector' action (requiring Unity Input Horizontal & Vertical axis names as input) should they be routed to ReWired too?