1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

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:
    2,511
    I'd like to announce my new input system for Unity, Rewired.

    If you find it useful, please help me spread the word by Tweeting, sharing with your friends on Facebook, and spreading the word in the forums. Happy gaming!

    Download a free trial now!

    -----

    [​IMG]

    Take input to the next level! Rewired makes joysticks, the keyboard, mouse, and other controllers work as they should. Need something more than Unity's basic input system? Have you tried other solutions only to find they have too many limitations? Check out Rewired...

    [​IMG] [​IMG]




    [​IMG]

    Native Input
    Rewired is not just another Unity input wrapper like other packages. Rewired supports many platforms that Unity supports with extended native support on Windows, OSX, Linux, Windows 8 Store, Windows 10 Universal, Ouya, XBox One, and PS4. Rewired leverages native libraries to access input devices directly, allowing for far more control over input. This makes possible some very powerful features such as full hot-plugging support for joysticks and support for more than 20 buttons per controller. Rewired is the only input system available for Unity with native support for all these platforms and the only one to offer these advanced features. For other platforms, Rewired utilizes Unity's input system so you still get access to all the other features it provides.


    [​IMG]

    Player-Centric
    Rewired features a player-centric input system making it the perfect solution for multi-player games. Instead of getting input from the controller, you get input from the player. So no matter whether the input is coming from the keyboard, mouse, joystick, or touch controller, you always get the result with no hassle. Controllers can be intelligently auto-assigned to players on connect/disconnect, so you don't have to worry about what controllers each player owns. Instead, you simply get input for the action you're looking for and Rewired handles the rest!


    [​IMG]

    Intelligent Hot-Plugging
    If you unplug a joystick or a wireless controller falls asleep, joystick Ids can get reordered making it difficult to get input from the right controller. Not anymore! Rewired is the first and only input system available for Unity that fully supports intelligent controller hot-plugging. Controllers are intelligently auto-assigned to players on connect, so you don't have to worry about Ids. No more guessing which controller is which. It just works. Hot-plugging works with virtually any USB or Bluetooth controller on Windows, OSX, Linux, and many other platforms. [1]


    [​IMG]

    Designed for Multiplayer
    Rewired was made for multiplayer gaming. The player centric nature, the unique and powerful mapping system, and intelligent controller hot-plugging and auto-reassignment make it the ideal input solution for multiplayer games. Of course, it's also great for single player games!


    [​IMG]

    Controller Maps
    Rewired features a powerful controller mapping system that allows you to create highly complex input schemes for any style of game. Maps stack so you can have as many maps as you need for each controller, the keyboard, and mouse. If you have multiple game modes that need different controls such as Menu, Infantry, Tank, Airplane, you can have shared controls on one map, and mode-specific controls each on its own map, then enable/disable maps as needed. Create pre-defined map layouts, allow users to map controls, and save maps to XML.


    [​IMG]

    Control Mapper

    Control Mapper is a customizable, responsive control mapping system included with Rewired that you can use in your games. This system provides a complete controller remapping solution including keyboard, mouse, and joystick support, axis calibration, joystick and mouse sensitivity, single or multiple players, controller maps, and much more. Control Mapper can be fully controlled with keyboard, mouse, joystick, and/or touch controls. Control Mapper uses Unity's new GUI system and therefore requires Unity 4.6+.


    [​IMG]

    A Full-Featured Input Editor
    Create and edit all your Players, Actions, Input Behaviors, Maps, Categories, and more directly in the Rewired Editor. The editor is packed with features and has an intuitive workflow.

    The Editor
    The Rewired Editor was designed to be your one-stop-shop for input configuration. It gives you access to everything you need to create input for your game. Configure global settings such as the update loops, joystick auto-assignment options, and more. Create all your players, actions, and controller maps, assign maps to players, and more from an easy-to-use interface. Organize your input how you want with map and action categories. The editor fully supports Undo and Redo and has complete tool-tip descriptions.

    Categorization
    Do you need to create dozens and dozens of actions? Using Unity's input manager, you create one long list of actions in a fixed-order array. It can quickly become confusing and cumbersome to make changes scrolling through a list of dozens or even hundreds of actions. Other input systems make you create your actions by coding. Rewired solves the problem with action categories. Now you can split up your actions into logical categories for easier editing. And you can reorder, duplicate, insert, and delete actions as you see fit.

    Maps and Layouts
    Create pre-defined controller layouts for various controllers or save time and just create maps for a controller template. Create complex, shared and stacked mapping set-ups easily by assigning the maps you want to each player, then setting the start enabled state on the maps. Even create system-only maps for special actions such as Save, Load, etc. Map the keyboard, mouse, joysticks, and custom controllers all from one interface. You can even create map categories and layouts for organization.

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    Advanced Input

    Rewired is not just another Unity input wrapper like other packages. Rewired supports many platforms that Unity supports with extended native support on Windows, OSX, Linux, Windows 8 Store, Windows 10 Universal, Ouya, XBox One, and PS4. Rewired leverages native libraries to access input devices directly, allowing for far more control over input. This makes possible some very powerful features such as full hot-plugging support for joysticks, and support for more than 20 buttons per controller. Rewired is the only input system available for Unity with native support for all these platforms and the only one to offer these advanced features. For other platforms, Rewired utilizes Unity's input system so you still get access to all the other features it provides.


    [​IMG]

    Cross Platform
    Controller axes and buttons can be mapped completely differently on different platforms in Unity, and the element assignments in Unity's Input Manager are not run-time modifiable. This makes it extremely difficult to create cross-platform games with controller support. In Rewired, supported controllers have been mapped for consistency on more than 10 platforms. Controllers not explicitly mapped can be supported via run-time user control mapping. And you can add new controller definitions to support even more.

    Much More...
    • Supports up to 128 buttons and 32 axes per controller on Windows, OSX, and Linux.
    • Supports advanced controller features such as vibration on Xbox 360, Xbox One, and Dual Shock 4 gamepads, and touchpad, light, and gyro on the DS4.
    • Create user controller remapping screens with named controller elements, select a named controller from a list.
    • Input Behaviors allow you to create actions that share similar properties without having to duplicate information.
    • Double-press/click support with customizable timing.
    • Keyboard modifier support with up to 3 simultaneous modifier keys.
    • Axis calibration (min, max, zero, deadzone).

    Videos





    Full Feature List
    • Works in Unity Free and Pro.
    • Player-centric input system.
    • Full hot-plugging support on Windows, OSX, Linux, Windows 8 Store, Windows 10 Universal, Ouya, Xbox One, and PS4. (Other platforms depend on Unity's input system's support for hot-plugging on that platform.)
    • Extended native input support on several platforms.
    • Optional XInput support for Windows (mandatory for Windows Store).
    • Fallback on Unity input for all other platforms. Most features still work.
    • Intelligent auto assignment and re-assignment of controllers to players on connect/disconnect with configurable options to tune the assignment to your needs.
    • Connect, pre-disconnect, and disconnect events.
    • Get input in Update, Fixed Update, and OnGUI -- you choose which loops update runs in, one or multiple as needed.
    • Customizable and saveable controller maps -- export mappings to XML and save how you choose (example included using PlayerPrefs, but save however you like.)
    • Included Control Mapper system using Unity GUI allows your players to rebind controls at runtime.
    • Unlimited mapping layouts per controller.
    • Controller Templates (see Controllers section).
    • Included on-screen touch controls for mobile platforms. (Unity 5.0+)
    • Editor GUI for creating Actions, Input Behaviors, Joystick/Keyboard/Mouse maps, categories, etc.
    • Editor GUI for creating and editing Joystick Hardware Maps (for adding new fully-supported joysticks).
    • Editor GUI for creating and editing Controller Templates (for adding new templates or adding new joysticks to a template).
    • Extremely versatile -- can be used for simple 1-player games all the way to highly complex multi-player games with complex mapping requirements. Gives the developer a high level of control and doesn't try to force you into a specific one-size-fits-all mold.

    Controllers
    • Functional support for most USB and Bluetooth controllers [1] (see below).
    • Extended support for many game controllers of all types on Windows, OSX, Linux, Windows 8 Store, Windows 10 Universal, Android, iOS, PS4, XBox One, and Webplayers. You can create additional controller definitions to support more, or if you'd like you can mail me your controller and I'll add the definitions and mail it back! :)
    • Supported controllers are recognized on each platform and are fully mapable by element name and have standardized axis directions.
    • For any controller not included, you can map an Unknown controller which includes all possible buttons/axes on the platform (Windows 128 buttons & 32 axes, etc.) Regardless of whether you define a map for this, users will always be able to manually map every element on the controller. This means support for the vast majority of USB and Bluetooth controllers. [1]
    • Controller template system so you can either choose to create default maps for every controller you wish to explicitly support, or save time and just map the template. All controllers that use that template will be mapped automatically. (Comes with a Dual Axis Gamepad template that works for the included gamepads.) User can always map any remaining controller elements even if they're not defined on the template.
    • Named buttons and controller elements for supported controllers (for help messages and config screens).
    • Vibration (Windows, OSX, Linux, Windows 8 Store, Windows 10 Universal, XBox One, PS4 currently)
    • Advanced controller features such as vibration, touchpad, light, and gyro on the Dual Shock 4.
    • Custom Controllers - Any source can be used to drive the controller's element values. Custom Controllers can be used for on-screeen touch controllers and more.
    • Xbox 360 controllers supported on OSX.

    Mapping
    • Powerful controller mapping system that allows you to create highly complex input schemes for any style of game.
    • Unlimited, stackable, maps per controller.
    • Maps stack so you can have as many maps for each controller as you need. For example: If you have multiple game modes such as Infantry, Tank, Airplane, you can have shared controls on one map, and mode-specific controls each on its own map. You can have even more maps as needed: A Menu map for when you're in the menus, a system map for controls like Save/Load and Quit, multiple maps for different players on the keyboard, etc.
    • Enable / disable maps as needed, for example, when changing game modes.
    • Multiple layouts per category. Allows you to have optional controller layouts.
    • A shared controller (the keyboard for example) can be mapped by any number of players with any number of maps.
    • All maps are owned by the player, so changes you make to one player's maps don't affect the others even if it's on the same controller.
    • Map axes to buttons and buttons to axes if you choose.
    • Split axes - allows you to map one pole of an axis to an action and the other pole to another action if you want.
    • Axis Contribution - you can choose how your button or axis affects the final Action's value. A button can generate positive or negative values on an Action's final axis value.
    • Save maps to XML.

    Input
    • Standard Unity lingo: GetButton, GetButtonDown, GetAxis.
    • Poll for input as per Unity standard practice or use event-based input to get input without polling.
    • Input is handled through the Player class:
    • player.GetAxis("actionName").
    • Get input directly from elements by index if necessary.
    • Get Action input by action name or action id.
    • Positive and negative buttons.
    • Double-press/click support with customizable timing.
    • GetButtonDown buffer -- allows you to make GetButtonDown respond for longer than a single frame to help with timing issues when user is pressing the button rapidly.
    • Keyboard modifier support - Map keyboard controls with up to 3 modifiers - Control, Alt, Shift, and Command (mac).
    • Axis calibration (min, max, zero, deadzone, sensitivity)

    Players
    • Unlimited number of players.
    • Supports multiple controllers per player.
    • Convenient System player for handling system actions - Save, Load, etc.
    • Define starting maps for joystick, keyboard, and mouse per-player.

    Actions
    • Define actions in the editor.
    • Create an action once and use it for as many players as you like.
    • Action categories for organizational convenience.
    • Set user-assignable flag on an Action or Action Category to allow or prevent certain actions from showing up in lists (useful for mapping screens.)

    Input Behaviors
    • Input Behaviors allow you to set options for digital axis simulation (sensitivity, gravity, etc.), how to handle mouse axes, a GetButtonDown buffer, button double press speed, button dead zone, and more.
    • Each Action is assigned an Input Behavior, so if you have many actions that need to behave the same way, you don't have to duplicate the information, just set them to use the same Input Behavior.
    • Per-player, and run-time modifiable.
    • Save to XML.

    Map categories
    • Categorize your maps by any criteria you choose. For example: System, Menu, Gameplay Shared, Infantry, Vehicle, Airplane.
    • Set user-assignable flag on a category to allow or prevent user-assignment of certain controls (system controls should be protected from change, for example).
    • Category selective conflict checking - choose to conflict check some categories with other categories, but not necessarily in both directions. (Useful for complex stacked map setups).

    Performance
    • Rewired is fast, written in C#, and tuned for performace.
    • ZERO bytes of memory allocated per-frame during gameplay means no garbage collection overhead.*
    • * Platforms that fallback on Unity input have periodic very small allocations as it polls Input.GetJoystickNames() every second or two to detect joystick changes.
    • The vast majority of code is included in a DLL, so it won't slow down your script compilation during development.

    Misc
    • Input Manager is self-contained so you can actually have separate input managers for different levels if you choose with entirely different mappings, etc. (Not necessary but interesting!)
    • Functions for mapping conflict checking.
    • Identify joysticks by button press in Unity Fallback mode.
    • Included example of mapping screen using Unity GUI (will update when new GUI system comes out) including saving and loading of maps per-player.

    Limitations
    • Hot-plugging in Windows Webplayer is not possible because the Windows Unity Webplayer cannot access outside libraries. However, the rest of the features work just fine in Webplayer.
    • Rewired is not for those who want to make games with zero coding knowledge. Coding is required.

    Requirements
    • Unity 4.3 or later, Free or Pro
    • OSX 10.5 or later is required for the OSX Unity editor and OSX Standalone builds.

    Tested Platforms
    Rewired has been tested on the following platforms. Others may work but have not been tested.
    • Windows Standalone 32-bit/64-bit*
    • Windows Webplayer
    • Windows 8 Store*
    • Windows 10 Universal 32-bit/64-bit (.NET and IL2CPP)*
    • OSX Standalone 32-bit/64-bit/Universal*
    • OSX Webplayer
    • Android
    • iOS
    • Linux
    • Sony PSM (Sony PlayStation Vita)
    • Sony PlayStation 4*
    • Microsoft Xbox One*
    • OUYA*
    • Amazon Fire TV
    • Google Nexus Player
    • Razer Forge TV
    • GameStick
    * Platform features Extended Native Support

    Want more information?

    1 Controller must be compatible with underlying system. On Windows the controller must be compatible with Raw Input, Direct Input, or XInput. On OSX, it must be compatible with I/O Kit. Support for exotic controller types not guaranteed.

    Support all these awesome controllers and more in your game with Rewired!


    RewiredSupportedControllers001f.jpg


     
    Last edited: Mar 30, 2017
    chrisall76 and Alima-Studios like this.
  2. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    163
    I was lucky enough to get an early copy of Rewired to evaluate while the Asset Store submission was being reviewed, and I have to say: Rewired is hands-down the best input management solution I've used bar none.

    I'm constantly impressed by how well thought-out the API is as well as how much of it "just works". If you're coming from Unity's built-in API, you're in for a real treat -- this is how input should work out-of-the-box.

    Being able to hotplug devices is great, but the best part of native DirectInput and XInput support is definitely vibration. Handling pretty much any controller that's thrown at it is an extremely nice feature as well.

    The Rewired API is familiar if you've used Unity's built-in API. It's very little work to actually swap Rewired in to code that's using Unity's API. Rewired's documentation is also very good (although, in all fairness, there are some methods and classes that have no description, so it's a bit like the Wild West once you start going super-deep into the API).

    I'll be honest, I've probably only used 10% of Rewired's feature-set (and that's being generous) -- but that's not because it's hard to use, or difficult to understand. Rewired simply has so much that it's able to do that it's, frankly, staggering at times. Even using that 10%, I still have fully-functioning controller, keyboard and mouse support. Everything else is if you want even more control.

    Rewired is absolutely something that everybody should have if they're interested in having better-than-basic input support. Out of all of the Assets that I've used, Rewired is easily in my top five. The quality is amazing, and the feature set is even better.

    This may sound a bit gushing, but it's honestly 100% true. Rewired has handled everything I've thrown at it (and @guavaman has been great support for the unusual use-cases I've come up with). I have nothing negative to say about Rewired, except maybe that the deeper parts of the documentation could use a little love (but that's par for the course for pretty much all documention I've ever seen).

    Amazing work on this, guavaman -- you've created something truly awesome. :)
     
  3. Neeko

    Neeko

    Joined:
    Mar 9, 2012
    Posts:
    24
    I'm very impressed by the sales pitch. It looks very promising. I can't say I'm going to use Rewired in my current game, Demons with Shotguns, as I'm already using InControl and have everything working and tested with it, but I will absolutely try out Rewired in my next game.

    And this is why I love Unity, such an awesome, proactive community. Something doesn't work? Screw it, I'll make my own. Love it! :D
     
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    @electroflame - Wow, I'm honored Rewired is listed in your top 5 assets! Thanks for all the kind words! :) I'll definitely be fleshing out the API docs more with descriptions, which is why I made the API part online so you'd have the latest updates as soon as I add them.

    @Neeko - Thanks! It's been a real challenge to try to get across all the information about the features in a way that's not just a sea of words (which it still is, but...). I'll be checking out your game!

    Input is something I've been struggling with in Unity for over 5 years waiting for Unity to fix it. It took me longer than it should have to decide to go fix it myself, but I'm really happy now that it's done. Developing Rewired was a really rewarding experience. Many thanks to @aitchest of dees for giving me the push I needed and to @longroadhwy for his incredible level of interest and support during the beta.

    Now the next challenge is to get the word out...
     
    Last edited: Sep 26, 2014
  5. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,152
    Atari coin-op arcade games had some of the best video game input devices ever made. That is what really drove my interest in this topic of Input.

    Rewired an advanced input system for Unity is great choice for input. More importantly it taught me to think differently about input in general. It is more than just a controller it is the entire player input experience.

    It is easy to get lost in the long list of features and it might not be obvious what it can do. The Rewired overview video does a great job of explaining how Rewired works vs the current Unity input system. It really helped me to think differently about input in general. That was part of Rewired Aha moment for me.

    In looking at list of Rewired features you should compare them to the [Official] Input System Improvements summary (msg #109), I think you discover many of those improvements are in Rewired today.

    Having support for some of CH product’s Flight Simulation controllers out of the box was the one of the things that I really like about Rewired.

    http://guavaman.com/projects/rewired/docs/SupportedControllers.html

    EDIT: As of Rewired 1.0.0.110 there is a huge selection of Flight Simulation Controllers that are supported out of the box.So it makes it easy to full support for all of them.

    Short summary:

    9 HOTAS solutions (All of your favorites: ThrustMaster Warthog, Saitek X-55 Rhino, CH Fighter/Pro Throttle, Saitek X-52, Saitek X-52 Pro, and ThrustMaster TWCS Hotas, etc.)
    2 different yokes
    4 different rudder pedals
    several throttle quadrants (useful for multi-engine).
    TPM
    Trim Wheel
    Helicopter Controller (Pro Flight Trainer Puma)

    And if those are not enough controllers to entice you. There are racing wheels, ship console controller, farm simulator controller, train simulation controller, light guns and tons of game pads. A unbeatable combination for input on Unity.

    Check the controller list again ...

    http://guavaman.com/projects/rewired/docs/SupportedControllers.html
     
    Last edited: Jan 18, 2017
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Rewired 1.0.0.4 is released for registered users to download immediately. If you've purchased Rewired on the Unity Asset Store and would like to register for early access downloads, please PM me or contact me here with your email address and I'll give you access to the registered user download page.

    The current version on the Asset Store is 1.0.0.1. 1.0.0.3 is in the process of being approved on the Asset Store. After that goes live, I will submit the latest version. The changes since 1.0.0.1 version are as follows:

     
  7. Balzaque

    Balzaque

    Joined:
    Dec 2, 2013
    Posts:
    6
    Really glad I came across this plugin, best solution ever for input handling and really flexible on the things it can do.

    Fixed all the problems I was having dealing direct with XInput and out of the box support for other platforms and controllers. The only reason I can say with confidence now that my game now supports Mac. =]

    Still need a more complex project to actually go deeper in its functionality but the possibilities looks really great.
     
  8. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    242
    Hi,
    Rewired looks really great. I just wanted to know if this Asset will support Windows Raw Input. From my knowledge the Direct Input is a bit outdated and XInput is only for game pads . Do you plan to integrate Raw Input ?
     
  9. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Hi,

    Thanks!

    EDIT: As of 1.0.0.7, Rewired supports Raw Input

    Rewired was released 1 week ago after 4 months of development. There are no plans to immediately switch from DirectInput to RawInput. You probably know this, but RawInput is not a successor to DirectInput. It is a much lower level API. Being lower level, it provides nothing but raw USB messages for any type of devices other than mouse and keyboards, making it much more difficult to implement than DirectInput for joysticks and game devices, essentially requiring you to rewrite the DirectInput wrapper yourself.

    DirectInput may be "outdated", but only in the sense that Microsoft "replaced" it with XInput, an API that does not provide anywhere near the same features as DirectInput supporting very few input devices and with the serious limitation of a max of 4 controllers and a limited number of buttons and axes. In my view, the move was purely financially motivated in order to push adoption of Xbox 360 peripherals.

    DirectInput provides an excellent way to support hundreds (or maybe thousands) of what Microsoft terms "Legacy" USB devices which Microsoft completely abandoned in Windows 8 apps in favor of XInput. (Now they finally have the Windows.Devices.HumanInterfaces in Windows 8.1 store apps to allow you to use more than just Xbox 360 controllers.)

    While Microsoft recommends against using DirectInput for Keyboard/Mouse input, their documentation still frequently mentions using DirectInput for "Legacy" joysticks, which is exactly what Rewired was designed to support:

    http://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx

    That said, in order to support multiple mice and multiple keyboards, a feature necessary for some more exotic controllers like light guns, and to make mapping of arcade devices like X-Arcade easier, I am planning to add RawInput support at some point in the future for these purposes. However, this won't happen in the extremely near future.
     
    Last edited: Oct 21, 2014
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Rewired 1.0.0.3 is now live on the Unity Asset Store!

    1.0.0.4 will be submitted today and be available within approximately 3-10 days.
     
  11. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Rewired 1.0.0.5 was submitted to the Asset Store and should be live within 3-10 days. For asset store users, the update will cover 1.0.0.4 and 1.0.0.5. See this post the 1.0.0.4 release notes.

    This is a very minor update. Here are the changes in 1.0.0.5:
    There is one property, Player.ControllerHelper.MapHelper.InputBehavoirs, which was changed because of a typo in the spelling. Instead of deprecating it, I chose to change it to the proper spelling. If you've used this property in your code, you will get a compile error. Just fix the spelling on this property in your code.
     
    Last edited: Oct 3, 2014
  12. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,152
    Direct Input is rather critical. Dropping an established standard takes out a large existing market segment. I just think of the Flight Simulator market and all of those wonderful USB devices that would be impacted. Take a look at Precision Flight Controls, Inc ( https://www.flypfc.com/ ) has some great USB components that work with X-plane (http://www.x-plane.com/pro/landing/). Precision Flight Controls makes FAA approved training systems.

    I am thankful that Direct Input is included in Rewired.
     
  13. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    To be fair, you would still be able to achieve the same support for all these devices with Raw Input. It just takes a lot more manual work to do it since you're dealing with nothing but the same raw USB data that Direct Input uses to create its wrapper. And there are likely a lot of edge cases you have to code for when dealing with oddly-behaving devices that "just work" with Direct Input.
     
    sloopidoopi likes this.
  14. bilke

    bilke

    Joined:
    Jul 13, 2012
    Posts:
    50
    First thanks for Rewired, I really like it! Now for a question: You mentioned in the feature list several times that the input configuration can be saved to XML. How to do that? I did not find anything in the docs. Or is it an API-only feature at the moment? Thanks!
     
  15. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Hi and thanks!

    Re: XML

    It's in the docs, and yes it's done through the API, not automated. Rewired doesn't include a system for actually storing the saved XML data. Since every game and platform may have different requirements for data storage, Rewired leaves this task up to you. You will have to save the data in a format most suitable to your game and platform. Possible options are PlayerPrefs, a database, binary or text files, cloud storage, etc.

    The example mapping demo in Rewired/Examples/ControlRemapping1 includes saving and loading of Controller Maps, Axis Calibration Maps, and Input Behaviors. This demo shows how to do all three types of saving/loading through the API.

    Docs on Saving/Loading:
    http://guavaman.com/projects/rewired/docs/HowTos.html#saving-loading-controller-maps
    http://guavaman.com/projects/rewired/docs/HowTos.html#saving-loading-calibration-maps
    http://guavaman.com/projects/rewired/docs/Examples.html (See Controller Remapping 1 section)

    Rewired will be getting some more convenience features added in the future to help with areas that may currently require a lot of coding. This will be done to help those who are not proficient at scripting. The first such addition will be several sample user mapping screens using the new Unity GUI that will target a few types of games. The idea being you may be able to just drop in a user mapping screen for your game and only have to customize the code a bit for your game's needs. Currently the mapping screen is designed to show you all of the API's features in that area so you can learn and take what you need to make your own screen, but this requires a good understanding of scripting.

    Another feature that is planned is a drop-in on-screen touch controller that you will be able to use without setting up your own Custom Controllers as you would do now. This is very powerful because you should be able to take any touch controller out there and use it to feed a CustomController in Rewired, but again it requires some scripting knowledge.

    Another I'm considering is a default save/load and/or player profile system.

    I hope that helps!
     
    Last edited: Oct 7, 2014
  16. bilke

    bilke

    Joined:
    Jul 13, 2012
    Posts:
    50
    Thanks for your comprehensive response. I was just wondering how to bring one input manager configuration to another Unity-project but found out that I just can create a prefab and move this to another scene / project.
     
  17. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    787
    From the full description and some of the feedback I reckon I should get this before you realise $19 is far too little to ask for this asset. :D
     
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    :p

    Believe me, I know it's really too low for the amount of time and effort I put (and continue to put) into it. The price very likely will be going up in the near future.
     
    Last edited: Oct 8, 2014
  19. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    229
    Completely agree with c-Row, this is an amazing asset priced very low for the amount of features it provides and continues to provide. Kudos to the author for creating a very polished and functional plugin :)

    Sam
     
    guavaman likes this.
  20. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Oh, I'm sorry. I didn't realize you were asking about the input configuration, not the map saving. When you said XML, I immediately associated it with map saving/loading. :oops:

    You can just copy and paste the Rewired Input Manager into another project, or like you found out, you can create a prefab out of it.
     
  21. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,152
    After you buy it is even better since you see all of the benefits in time saved in your own projects. It great to have in a single tool (Rewired) with full input support for all Unity platforms and with enhanced input support for Windows and OS/X.

    I am interested in your feedback after you start using it
     
  22. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,152
    Agreed.

    Is this the first time you have heard about Rewired or did you see it mentioned somewhere else on the Unity forums?
     
  23. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,152
    Just curious what controllers are you working with?
     
  24. electroflame

    electroflame

    Joined:
    May 7, 2014
    Posts:
    163
    I'm only regularly test with my wired 360 controller and the usual Keyboard + Mouse, but I needed support (or at least mapping support so I could do it myself) for all of the popular controllers (PS3, PS4, third-party Logitech, etc) and thus far Rewired has handled them all extremely well.
     
    Last edited: Oct 10, 2014
  25. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274
    Would this allow for changing of inputs and control in game?
     
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Definitely, but it will require some work on your part as Rewired doesn't come with a drop-in, one-size-fits-all remapping screen. Instead, Rewired comes with an example user mapping demo designed to show how to implement a complex user mapping screen from the API. It's meant to teach you how to perform the various tasks so you can incorporate it into your own GUI using the GUI system you're familiar with. The demo includes the following features:

    • Creating a list of players.
    • Creating a list of controllers to assign to a player.
    • Assigning the mouse.
    • Calibrating a controller.
    • Creating lists of Actions categorized by Action Categories
    • Designating some categories as not-user-assignable so they are locked (for things like System type actions)
    • Assigning buttons and axes via polling for the next input on a per-controller basis.
    • Conflict checking for assignment conflict warnings using Action category selective conflict checking.
    • Saving and loading Controller Map XML files after making changes so your users' data stays on the next play.
    • Saving and loading axis calibrations and Input Behaviors.
    • Detecting and identifying joysticks on platforms that fall back to Unity input as the input source (Webplayers, Linux, Android, etc.)
    From the docs on Creating a Controller Mapping Screen:

    I have plans to release an update once 4.6 is out of beta which will include several user mapping screen demos using the new GUI in 4.6. These demos will be more suitable as drop-in screens because I plan to make a number of them based on the possible needs of different styles of games. For example, one screen may be designed for a single player game without action categories, so it will omit all the code dealing with multiple players and multiple categories.

    I hope this information helps.
     
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Hi everyone,

    If you have bought Rewired and found it useful, please take a little time to post a review on the Unity Asset Store page and let your fellow developers know what you think. Thanks!
     
  28. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,152
    That is nice to see someone is using all of the Controllers with Rewired.
     
  29. Kathar3D

    Kathar3D

    Joined:
    Aug 24, 2014
    Posts:
    3
    Just bought Rewired last week, and I'm loving it so far, really great work!

    I hope it's not too daft a question, but is there an easy way of using Rewired with the 4.6 GUI? Only I can't seem to figure out how to get the EventSystem to receive input from it, so can't navigate or press buttons, etc.

    If perhaps the EventSystem isn't compatible, I can just create a script to use the inputs from the System player to trigger the navigational commands, which I think should work. But yeah, just wanted to see if there was an easier/quicker method of doing it first. Cheers for any help.
     
  30. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Thanks! I'm really glad you like it!

    By default, Unity 4.6's GUI system uses the Unity Input Manager for its input. However, you can certainly get it to work with Rewired. I don't have an official solution for it yet as it's still in beta, but another user modified the StandaloneInputModule source from here to work with Rewired's Player 0. You should be able to easily modify the attached file to use the System player instead if that's how you want it to work. I've attached the CS file here. You would disable the StandaloneInputModule and attach this instead. Let me know how it works for you.

    Edit: RewiredStandaloneInputModule updated for Unity 4.6.1
     

    Attached Files:

    Last edited: Dec 16, 2014
    Kathar3D likes this.
  31. Kathar3D

    Kathar3D

    Joined:
    Aug 24, 2014
    Posts:
    3
    That's fantastic, thanks so much! Just plugged in that script and it works perfectly!
     
    guavaman likes this.
  32. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Rewired 1.0.0.5 has finally made it up on the asset store!

    Additions since 1.0.0.3 (the last version available on the asset store)
    The current version is 1.0.0.6 available now for registered users on the Rewired website. Contact me with your email address to register if you haven't already.

    The next update, 1.0.0.7 is almost ready to roll out and will include Raw Input support for joysticks as well as Raw Input handling for mouse input in Windows Standalone which will add framerate independent update for the mouse as well as joysticks.
     
    Last edited: Oct 15, 2014
  33. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,152
    Thanks for all of these updates.
     
  34. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    787
    I have recently begun to revisit an older protoype to clean up the code and add some functionality after I finally came up with a theme that goes well with the mechanics already in place, so this is the perfect opportunity to add Rewired and set up touch/swipe controls for a potential mobile release. I will keep you posted about my experiences. :)
     
  35. chrisMary

    chrisMary

    Joined:
    Nov 27, 2013
    Posts:
    11
    Hello, I was wondering if this plugin gives you access to several mice independently ?
    I need to get mouse movement (X and Y) from more than one mouse at the time on the same computer...
     
  36. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Hi,

    Not at present. I just finished up Raw Input integration, and one of the motivations for doing that was for future muti-mouse and multi-keyboard support. This feature will likely be included in a future version of Rewired, but I cannot say when that will be at this time.
     
  37. chrisMary

    chrisMary

    Joined:
    Nov 27, 2013
    Posts:
    11
    Hello, thank you for your response.
    Not even with DirectInput ? I'm building a game that needs several mice, and so far, i'm obligated to use glovepie as an intermediary... I'd love to be able to do everything inside unity...
     
  38. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    No, sorry, it doesn't. Direct Input doesn't allow support for multiple distinct mice or keyboards. It can be done with Raw Input but the changes will take a significant amount of time and require many changes to the editor system and the API. I do plan to do this eventually (for even better support for things like the X-Arcade Tankstick), but I'm unable to spend the resources on adding this feature at present.
     
  39. chrisMary

    chrisMary

    Joined:
    Nov 27, 2013
    Posts:
    11
    Ok, thank you.
    Otherwise, it seems like a great tool, I will keep an eye on it and remember to use it on future projects :)
     
    guavaman likes this.
  40. Computerkid23

    Computerkid23

    Joined:
    Aug 7, 2013
    Posts:
    236
    so whats the differenct really between this plugin and inControl? i was set on it until i seen rewired now im not sure which to pick up
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Hi,

    Thanks for asking!

    There are a ton of differences between Rewired and InControl.

    First, there's a huge amount of information on the Rewired website at http://guavaman.com/projects/rewired. This site can provide you with all the information you could ask for.

    Just on the surface, here's a few of the very important differences:

    Native Input

    Rewired uses native libraries to obtain input on OSX, Windows, and Windows Store. (As of 1.0.0.7, Rewired supports Raw Input, Direct Input, and XInput on Windows and native input on OSX through I/O kit.) This is the major reason why Rewired is different than any other input system available for Unity. This was done to break past all of the limitations of Unity's input system such as poor hot-plugging support, the limit of 20 buttons per joystick, no framerate independent input, poor controller detection ability, and much more. In addition to platforms that support native input, Rewired wraps Unity's input system on all other platforms to provide most features on any platform Unity supports. To be clear, there is no other input system available for Unity that provides native input on all these platforms as Rewired does.

    InControl is, at its base, a wrapper around Unity's input system, so it inherits all of Unity's input system's flaws and issues. However, InControl does incorporate one native library on Windows, XInput, which allows you to use XBox 360 controllers without issues. However, XInput only supports Xbox pads and only 4 at once, so if your players aren't using only Xbox 360 pads, they could have many problems because of Unity's input issues. In contrast, Rewired allows you to use just about any controller without all the bugs and limitations involved in Unity's system because of its native handling.

    Controller Types

    Rewired allows you to map just about any type of controller available, including racing wheels, flight sticks, and much more. Rewired doesn't try to force all devices to fit into a one-size fits all mold. Even complex controllers like a flight yoke will work perfectly with human readable named elements such as Throttle, Left Thumb Hat, etc. Additionally, with native input support, Rewired can map devices like the CH Flight Yoke which has 26 buttons on it.

    InControl was designed around a gamepad layout. All controllers are mapped to generalized named gamepad actions with no real support for other types of devices. If you look at the supported controller list for InControl, there's nothing but gamepads in the list. InControl can't possibly map the flight yoke because it is impeded by Unity's limit of 20 buttons per controller and its gamepad-oriented assignments wouldn't make sense.

    Player Centric

    Rewired is designed around the needs of multi-player games with it's player-centric input system. Controllers are assigned to players and input is retrieved through the player instead of directly through the controller. Additionally, controllers are intelligently auto-assigned when plugged and unplugged so your players have a seamless joystick experience.

    InControl has no concept of players or player/control management. Input is taken from the controllers directly, so if controller IDs shift because of hot-plugging, it's up to you to discover this and correct the situation.

    Saving Maps

    Rewired allows you to save and load controller maps via XML. This means you can create pre-defined layouts for various controllers and even have optional layouts players can choose from. Rewired allows you to have persistent configuration information for different devices from run to run and allow your users to customize and save their controls.

    InControl does not do this and even advises against trying to on their website.

    Controller Mapping

    Rewired's complex controller map system makes possible very complex input schemes that can vary based on various situations such as changing game modes. You can have multiple maps for each controller, enable and disable them at will based on your needs, edit the maps at runtime for user mapping, and much more.

    InControl has no such concept.

    Editor GUI

    Rewired includes a powerful editor to configure all your input.

    InControl requires you edit your input configuration in code.


    That's just some of the basic differences. There's a lot more. Take a look at this comparison chart. Again, the website contains a lot more information about what you get with Rewired so you should take a look.

    [​IMG]
     
    Last edited: Oct 22, 2014
    ZJP likes this.
  42. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    The biggest update yet is ready! Rewired 1.0.0.7 is available for download now for registered users directly from the website. If you have bought Rewired and want to download the update now instead of waiting for it to show up on the Asset Store, contact me with your email address and I'll send you a link where you can always download the latest version immediately upon release.

    What's changed in 1.0.0.7:

    Raw Input

    Rewired now supports Raw Input as the default input source in Windows Standalone. You can now choose between Raw Input and Direct Input as the primary input source easily from the Settings page of the Rewired Editor.

    Raw Input brings the side benefit of allowing for reliable fixed controller ordering at start. This has implications for arcade games or other fixed applications where it's important that specific controllers always be assigned to the same player on start from run to run and reboot to reboot.

    Additionally, if you want to publish a game on Windows without the possible dependency of the Direct X runtimes, this is now possible by choosing Raw Input as your primary input source and disabling XInput. This isn't recommended because XInput does bring some good features to the table such as vibration and independent triggers, but the option is there.

    Native Mouse Support on Windows

    You can now choose to handle mouse input through Raw Input on Windows instead of relying on Unity's mouse input. This brings two important advantages:

    1) Framerate independent input for the mouse on Windows.

    2) Fixing a newly discovered Unity input bug. Native mouse support is an important feature if you expect your users to do much hot plugging of a number joysticks. I discovered a bug in Unity’s mouse with relation to hot plugging of joysticks.

    Unity bug details:
    When unplugging and plugging in joysticks in Unity, occasionally a joystick will begin to register TRUE for all possible buttons on all possible Unity joysticks and the Unity mouse when any button on the joystick is pressed. Testing confirms this is not an issue with Rewired, but rather a bug in Unity. There is no workaround for this issue when using Unity as the mouse input source. Because Rewired does not use Unity's Joystick data when using Direct Input or Raw Input, these errant joystick button values do not cause any issues. However, when the mouse is handled through Unity's mouse input, when this bug is activated, joystick presses will inadvertently activate all the mouse buttons causing any actions mapped to the mouse to fire. Native mouse support through Raw Input was added in order to eliminate this bug. When using Direct Input or Raw Input with Native Mouse Handling enabled in the editor, mouse data will be handled by Raw Input.

    Other additions:

    You can now assign keyboard keys in the Rewired Editor by polling for a key press instead of having to find the key manually in the list box.

    Bug Fixes:

    See the release notes below for a number of bug fixes.

    1.0.0.7 release notes:

     
    Last edited: Oct 21, 2014
  43. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    168
    Just bought this yesterday after following this thread for a while. Going to replace our old solution with this as well as our old normal Unity input mapping. Very excited to see how easy and customizable this will be. Thanks for providing such a well featured solution!
     
    guavaman likes this.
  44. Computerkid23

    Computerkid23

    Joined:
    Aug 7, 2013
    Posts:
    236


    wow man thanks for the breakdown im sold buying right now lol
     
    guavaman likes this.
  45. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Glad to hear it! Feel free to share your experiences here or post back if you need help with anything.
     
  46. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    An important note for anyone using Unity 4.6 beta:

    Unity 4.6's GUI system requires that certain axes exist in the Unity InputManager or else it will throw an error when you try to use the GUI. Unfortunately, Rewired versions before 1.0.0.6 did not include these needed axes in the replacement InputManager that Rewired installs during initial setup. As a result, if you installed Rewired prior to version 1.0.0.6 and you try to use Unity 4.6's GUI, you will get an error.

    The solution is simple. Download the latest version of Rewired and manually re-run the installer from:

    Window -> Rewired -> Setup -> Run Installer

    When prompted to overwrite the InputManager file, allow it to do so. It will replace the InputManager again with a new version that contains the missing axes for 4.6.

    Unfortunately, due to the slow update process on the Unity Asset Store, the latest version available is 1.0.0.5. I uploaded 1.0.0.7 yesterday, but if things continue at the same pace, it probably won't be live on the store for about 2 weeks. Anyone who bought Rewired can contact me with their email address and I will send you a link where you can download the latest version now.
     
  47. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    242
    Wow, fantastic news! This opens up a lot of new options.
    (Now i have no reason for not to buy this ;-)
     
    guavaman likes this.
  48. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,151
    Does this support re-binding keys ingame?

    While that is somehow possible using KeyCode, there seems to be no way to get a useful unicode value to display what key the user just pressed on non-US layouts. For example, if ß or shift+ü is bound to an action, it should show ß or shift+ü to the user.
     
    JoeStrout likes this.
  49. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    Rewired does not include a one-size-fits-all drop-in control remapping screen. What it does include is a full-featured API and an example remapping screen which you can use to learn how to write your own customized to your game's needs.

    To get you started, see the example mapping screen in Rewired/Examples/ControlRemapping1. You should be able to adapt this remapping example to fit the needs of your game. The current version uses Unity's legacy GUI system, but future updates to Rewired will include more examples using the new GUI system scheduled to be released in Unity 4.6.

    Every game's needs are different with regards to user mapping screens. The example project was built for a fairly complex game with a number of players and various game modes and supports saving and loading maps, controller assignment, element remapping, calibration, conflict checking, and more. In the future, a number of example screens may be included for various types of games to help you get started quicker. For now, you should be able to learn what you need to from the example project to customize your own mapping screen.

    As for non-US layouts, Rewired handles uses Unity for the keyboard input source at present so there is no special handling of non-US layouts apart from what Unity may provide. If a key press activates one of Unity's KeyCode values, it will work, otherwise it will not.
     
  50. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    2,511
    1.0.0.8, a minor update is now ready.

    The new version is available for registered users to download immediately on the website. Contact me if you bought Rewired and would like early access.

    Asset Store update will follow in 3-14 days (depending on the store's current review time).