Search Unity

Rewired - Advanced Input for Unity

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

  1. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Yeah, I think what happened is that only the first hat showed up in the element identifier thing as an actual "hat", so that was the only one I set up as 8-way. But anyway, definitely the only hat switches that could be used as regular 8-way switches would be the two on the flight stick that actually look like hat switches (Hat 1 and Hat 2). The NewEgg photo looks identical to what I have.

    What I had labeled "Hat 4" is labeled "Mouse cursor control" on the throttle base. It's the little orange nub on the throttle in the NewEgg photo. I think you can set it up to act as a mouse in Windows if you want; otherwise it acts a 4-position switch. At the time, I didn't know what to call it. I *just now* noticed that everything is labeled on the base. Not sure how I missed that! What I had labeled "Hat 4 Select" is actually "Mouse fire button."

    What doesn't show in the NewEgg photo is "Hat 3", which is a four-way switch on the back of the throttle. I got lucky with that one, since that *is* actually "Hat button 3":
    https://www.dropbox.com/s/ujen770wsirg9c4/X45_throttle.jpg?dl=0

    I fired up the Mac Mini, pulled down the latest Rewired, and plugged in the X45. It looks like all of the buttons and axes are recognized. In Windows, I had to run the game controller calibration to get it work right, but on Mac it seems to just work. I didn't see a calibration utility on the Mac anyway. So yeah, send me your tweaked X45 file when it's ready and I'll try to get the Mac settings in there.
     
  2. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Rewired 1.0.0.33 is available in the asset store.
     
    Last edited: Feb 21, 2015
  3. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Yes it is!
     
    Last edited: Mar 7, 2015
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Okay, thanks for the explanation. I will modify the definition a bit and email it to you.

    Interesting. Can you explain a bit what you had to do in the calibration utility? Did you use the standard Windows Control Panel game controller utility or something from Saitek? Were the elements not showing up or just calibrated wrong? I ask because for me to include the profile, it needs to be mapped for a stock device either with no driver or the manufacturer's official driver.

    One thing to note: Windows' calibration tool will affect calibration in Direct Input but not Raw Input. If you're using Raw Input, you'll need to calibrate it in Rewired instead. This may be one reason a separate Raw Input mapping might be required.

    Thanks for your help!
     
  5. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    As I recall, the axis values for the flight stick X and Y were pretty far off, but everything showed up without calibrating. Like one direction had little range and the other had more, but not the full range. I used the standard Windows Control Panel utility. I plugged the X-45 into my Windows machine just now and it was perfect - either it remembers the calibration, is inconsistent, or my memory is off. :)
     
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Okay, I see. Thanks!

    It probably does remember it. There is an option to clear it here -- "Reset to default". Were you testing in Raw Input or Direct Input just now?

    ClearCalibration.jpg
     
  7. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi,

    I've tried both methods you suggested for implementing Rewired polling for UnityFS, but I get the error `Rewired.ReInput' does not contain a definition for `GetPlayer' in each case.

    I've looked at getting the player as per the documentation too but to no avail. Would love a bit of assistance, thanks. I don't really mind editing the source code as the changes are simple enough to make each time.

    Thanks,
    Nick
     
  8. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    That's because I made a typo in my sample code above. It's ReInput.players.GetPlayer(0). The docs do show this correctly.
     
  9. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Thanks, appreciate your help
     
  10. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    I've got Rewired working as an extra source case, I'll flick Chris the two applicable scripts and see if he wants to add the change in the next release
     
  11. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    What two scripts did you end up changing in UnityFS?
     
  12. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    I edited the InputController as Guavaman showed above, you need to add the extra case for both buttons and axis, as well as adding an extra line at the top for the new source (I'm away from my laptop right now so can't give you specifics).

    Also need to adjust the InputEditor script, I just duplicated the Unity Input settings parts and renamed the applicable values to Rewired- I'm no coder but it was easy enough to do- it even keeps the input string name for you when you change input source on the component.

    I didn't bother with any changes to the camera scripts as I don't use them.

    Hope this helps!
     
  13. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Great! Glad you got it working!
     
  14. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Thanks!

    I've now fully replaced all the old input references and it's working beautifully. Really love the overall approach to mapping and action behaviours, I had a lot of really silly workarounds earlier due to different input gravity needs. Thanks again for your help earlier.
     
  15. Katarak

    Katarak

    Joined:
    Feb 19, 2013
    Posts:
    13
    Hey guavaman,

    You're system looks quite interesting. The only issue I have right now is... what happens on consoles?
    You speak quickly about Linux, mostly about windows and Mac.
    Your plugin is released as a Dll (Editor_Core, Runtime_Core) and I'm wondering if this will create problems in a release for consoles?

    Thank you
     
  16. bsterling250DI

    bsterling250DI

    Joined:
    Sep 25, 2014
    Posts:
    78
    Any plans to support WebGL?
     
  17. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    There is no system that supports all the consoles. Rewired is not an exception.

    Console support is limited because most consoles require their own specific API. Rewired doesn't not implement any special API's on console platforms at this point and acts as a wrapper around Unity input on platforms that are not explicitly supported. On many console platforms, Unity input is not suitable for use.

    These platforms require special APIs for optimal results:
    • XBox One - Input does work through Unity input, but multi-controller identification is very difficult without the XBox One input API
    • Playstation 4 - Basic gamepad controls work without the Sony API. Vibration, touchpad, gyro, and lights require the PS4 API which is not currently integrated.
    • WiiU - Input is handled very poorly through Unity input with no access to most features of the Wiimote and other devices. Nintendo input API is required.
    Further complicating this is the fact that all console APIs are very different from each other and the capabilities of the console's input systems vary widely. For example, the WiiU supports a huge amount of data in various formats through the input devices including video, audio (speaker and mic), rotation, acceleration, weight measurement, and much more. There is currently no interface available in Rewired to deal with all this special data (these are not buttons and axes and include output as well as input.)

    The current list of tested platforms is:
    • Windows Standalone 32-bit/64-bit
    • Windows Webplayer
    • Windows App Store
    • OSX Standalone 32-bit/64-bit/Universal
    • OSX Webplayer
    • Android
    • iOS
    • Linux
    • PSM (PS Vita)
    • PlayStation 4 (basic gamepad support)
    And various platforms based on Android:
    • Nvidia Shield
    • Amazon Fire TV
    • Google Nexus Player
    • GameStick
    • Ouya
    This should not create a problem being included in the project even if Rewired isn't used for the input. The Editor dll is never included in a build, and the Runtime dll makes use of a limited set of .Net classes for maximum compatibility. It has been tested on many platforms and compiles even on AOT platforms like iOS and WiiU.
     
    Last edited: Apr 19, 2015
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Unity 5 support will come first once its out of beta, then WebGL will be evaluated.
     
  19. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    NP! Glad to help.
     
  20. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Rewired 1.0.0.34 is available for download for registered users now on the website. If you've bought Rewired and want to get access to the latest downloads immediately, contact me with your email address. The update should be live on the Asset Store in 3-7 days.

    @Arkade - You might be interested to know that this release includes Ouya support. See the docs on how to use it.

    @Steve Tack Thanks for doing all the work to get the X45 map set up for OSX! :)

    1.0.0.34:
    New Platform Support:
    - Added OUYA platform support. (Requires OUYA Everywhere SDK Unity plugin.)

    New Controller Definitions:
    - Saitek X45 Digital Joystick & Throttle

    Changes:
    - Raw Input now filters out devices with no elements.
    - OSX Native now filters out devices with no elements.
    - OSX Native now filters out multiple redundant devices being returned for a single device.

    Controller Definition Changes:
    - Removed Sabrent 12-button Gamepad / DR Gamepad definition from ControllerDataFiles. Reason: The identifying information returned by this controller matches dozens of gamepads made by Dragon Rise, Inc., each with varying controller layouts and elements. To fully support all these devices, the definition has been removed so as to prevent incorrect controller identification. The user may still map these controllers through manual user mapping.
    - Added Google Nexus Player Gamepad mappings for OSX Native, OSX Fallback, and Linux.
    - Added Power button mapping to Google Nexus Player Gamepad on Android platform.
    - Added Back button mapping to Google Nexus Player Gamepad in Dual Analog Gamepad Template.
     
  21. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That makes 4 HOTAS systems now! Thanks @Steve Tack and @guavaman
     
    guavaman likes this.
  22. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That is great to hear! Are you using any specific flight controller with UnityFS?
     
  23. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    @Arkade

    By the way, the center Ouya button does work on the Ouya platform. It's able to catch the single frame event reliably so you can go ahead and map Actions to it. In the Dual Analog Gamepad template, I mapped the Ouya button to Center 2, which is the equivalent to "Start" on most gamepads.
     
  24. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Just an Xbox 360 controller for now, but even that's benefitted from Rewired- the notorious trigger axis' are now very user friendly to set up, and I can have one for each (progressive) rudder direction, i.e. left trigger for rudder from neutral to full left, and vice versa for right.
     
  25. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    I'm looking to create a list of games made with Rewired on my website. If you've made a game (or are making one that has some promo materials/screenshots) with Rewired that you would like to see included on my website, please post it here. Also, if you feel inclined to include a testimonial/quote that I could also put on the site, that would be great. Feel free to post here, PM me, or contact me on the support form on the website. I'll be contacting some individually who have posted reviews and comments here about using their quotes on the site.
     
    Last edited: Feb 27, 2015
  27. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Rewired 1.0.0.35 is available for download for registered users now on the website. If you've bought Rewired and want to get access to the latest downloads immediately, contact me with your email address. The update should be live on the Asset Store in 3-7 days.

    1.0.0.35:
    New Controller Definitions:
    - ípega Multi-Media Bluetooth Controller
    - Thrustmaster T.16000M
    - Saitek Pro Flight Throttle Quadrant

    Changes:
    - When enabling the first controller map that contains an Action mapped to a button that is currently being held down, GetButtonDown will no longer return TRUE during the frame the map is enabled.
    - When disabling the last controller map that contains an Action mapped to a button that is currently being held down, GetButtonUp will no longer return TRUE during the frame the map is disabled.

    Bug Fixes:
    - Double-click and GetButtonDown buffer timers now use unscaled time.
     
  28. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Can you please tell me if i can use this asset together with easy touch from hedgehog team on mobiles?
    I want to use this on a multiplayer, cross platform device game and would like to have one source and build from it to all platforms.
     
  29. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Hi,

    I haven't tried Easy Touch before, but Rewired's CustomController system was designed to take any arbitrary float/bool sources and allow you to use them to drive input in Rewired and was designed with touch-screen controls as the initial use case. As long as Easy Touch exposes some axis/button values that you can feed into Rewired, there's no reason it shouldn't work.

    One thing that you will have to watch out for is if Easy Touch has to overwrite Unity's input manager. Rewired overwrites it to get access to all joystick and mouse axes and buttons when you're on a platform that falls back to Unity input (Webplayer, Android, iOS, Linux). If Easy Touch also does this, you'll have to merge the two modified input managers in a text editor.

    If you want to try Rewired, let me know and I'll send you a free trial.
     
  30. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Thank you for your fast answer and offering me a free trial.
    I send you a pm.

    Edit:
    I have to read if easy touch will do this too and hope not. My coding skill is not so adwanced ;)
     
  31. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Sent you the trial. Hope you like it!

    Merging the input manager settings isn't difficult and doesn't require coding. You just have to enable text-based asset serialization so you can edit the Unity /ProjectSettings/InputManager.asset file in your project and copy and paste the values in from one or the other modified InputManager.asset files.

    An entry looks something like this:
    Code (csharp):
    1.   - serializedVersion: 3
    2.   m_Name: Joy1Axis1
    3.   descriptiveName:
    4.   descriptiveNegativeName:
    5.   negativeButton:
    6.   positiveButton:
    7.   altNegativeButton:
    8.   altPositiveButton:
    9.   gravity: 0
    10.   dead: 0
    11.   sensitivity: 1
    12.   snap: 0
    13.   invert: 0
    14.   type: 2
    15.   axis: 0
    16.   joyNum: 1
    But you do have to be careful not to use the incorrect number of spaces or add any newlines.
     
  32. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    So easy touch have it´s own input manager so there should be no big problems i hope.
     
  33. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Two more flight simulation controllers. So now Saitek Multi-Engine is complete with the standalone Throttle Quadrant. And the T.1600 M joystick which is a useful mid-range joystick. Good work.

    I like this new pattern for every gamepad you add you need to add two flight simulation controllers. :) :) :)
     
  34. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Don't worry, I've got 3 more gamepads and some more platform mappings for existing ones coming soon. :p
     
  35. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Hi guavaman, I may have run into an obscure bug. I may be the only other person besides yourself to use the template editor, so I realize this is a bit "in the weeds." I'm on the latest version, 1.0.0.34.

    I want to create a template for HOTAS devices, to avoid some work with mapping lots of actions to each specific device.

    In the Hardware Joystick Template Map Editor, I can set up the element identifiers and joysticks, but when I add the maps, it uses the first element in the list for each entry, no matter which item I choose. In my case, the first element in the list is "Flight Stick X", and that's the only value I can set for Template Element.

    UPDATE: I just noticed the source of the issue. Every Element Identifier I add has an Id of zero and there's no way to set that manually in the UI.
     
    Last edited: Mar 1, 2015
  36. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That is good news.
     
  37. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I have asked Gauvaman for a flight simulation template in the past but I thought I was the only one interested in that topic.

    But a common HOTAS template would be cool. What items are you expecting in your HOTAS template?

    I did find some blank PDF templates which someone has for HOTAS setups. The main objective for him was mapping various HOTAS setups (CH Fighterstick and CH Pro-Throttle) and Saitek X-52 (stick and throttle) for various gaming setups. He does have a filled out PDF where he uses the CH products mapped for Elite Dangerous.

    http://drewscanlon.tumblr.com/post/111123931205/joystick-button-layouts
     
  38. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Of course the problem with trying to make a generic HOTAS template is that flight sticks just aren't that standardized. So my thought process was to make a simplified one that wouldn't necessarily work for all games, but could be good enough.

    Like my space game is really geared toward using a gamepad, but I figure I might as well support flight sticks since I'm using Rewired, and people do seem to be dusting those off with recent games like Elite Dangerous.

    I'm thinking these may be standard enough to make a template worth it:

    Stick X/Y
    Throttle
    Rudder
    Hat 1, Hat 2
    Primary/secondary/tertiary fire buttons. I'd like to assume a fourth fire button, but I doubt that's super common.
    One throttle button (or just call it "Alt" or something)
    Possibly a mode switch, only to be used for non-critical functions, since I don't think that's common
    Same with a pinkie switch (call it something generic?)

    So just two hats, no knobs, no aux 1/2/3, and no cursor controls.

    In my game, I've got Hat 1 acting like a D-Pad for menu navigation and weapon selection.
    Hat 2 is like the four "face" buttons on a gamepad.
    The rudder controls yaw in flight, or next/previous page in menus. The others are more straightforward.

    I don't know how it works when the flight stick and throttle are two separate joysticks though. I only have an X45, which acts as one joystick.
     
  39. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Hi,

    You're right. The editor isn't assigning a new ID to each element. I'll fix that in the next release. In the mean time, just switch the inspector to Debug and you can manually edit them.

    I've only made one template map up until now so I never saw that issue. I probably made the template before I made the editor. Sorry about that.
     
  40. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    I've also wanted to make a template for these but the devices can be very different from each other. You'd likely have a lot of missing elements on many joysticks. I may try to make one at some point, but I think I'd need a larger sampling of devices to really be able to do it properly. Or at least do more research on the capabilities of the devices out there to find commonalities.

    That would be an issue. You'd probably have to make a separate Flight Stick template, Throttle Template, and combined HOTAS template to really cover the bases.
     
  41. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Rewired 1.0.0.36 is available for download for registered users now on the website. If you've bought Rewired and want to get access to the latest downloads immediately, contact me with your email address. The update should be live on the Asset Store in 3-7 days.

    1.0.0.36:
    New Controller Definitions:
    - Nyko Playpad
    - Nyko Playpad Pro
    - SteelSeries FREE

    Changed Controller Definitions:
    - Added Windows Raw Input, Direct Input, OSX Native, and Linux mappings to Amazon Fire Game Controller definition.
    - Added Game Circle button to Amazon Fire Game Controller definition.
    - Added Back, Menu, and Game Circle to Amazon Fire Game Controller in Dual Analog Gamepad Template.
    - Removed Windows Fallback mapping for Mad Catz C.T.R.L.R due to non-specific device name string causing possible incorrect device identification.
    - Removed Windows Fallback mapping for 8bitdo NES30 due to non-specific device name string causing possible incorrect device identification.
    - Modified Raw Input handling of axes that return invalid min/max data in the HID report.
    - Modified OSX Native handling of axes that return invalid min/max data in the HID report.

    Bug Fixes:
    - HardwareJoystickTemplateMap editor now increments Element Identifier ids correctly when created new entries.



     
  42. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    The Saitek X-55 throttle and stick are separate USB devices and same with CH Fighter Stick and CH Pro Throttle. ThrustMaster HOTAS T.Flight Hotas.X is one USB device like your Saitek X-45. CH products do not have a twist for rudder on any of their products since they expect users to use PRO pedals. As far as I remember from my discussion with @guavaman a template only handles one physical USB device.

    I was thinking of just creating ACTIONS to match what you listed in a HOTAS setup. Then I could map everything regardless if it was of type and to some degree even gamepads (e.g. XBOX-360) into some of these things. For the gamepads I was looking at what some users were mapping the XBOX-360 in X-plane as a guide. There are some pictures at this URL which I found useful to thinking about how they map things for a gamepad.

    http://forums.x-plane.org/index.php?showtopic=44684&page=2

    Based on the some of the actions I think the first three are straight forward.

    HOTAS_STICK_X
    HOTAS_STICK_Y
    HOTAS_THROTTLE

    The Rudder is very interesting case because not all sticks have a twist option or some people just prefer pedals.

    HOTAS_RUDDER I would map CH Pro Pedals, Saitek PRO FLIGHT Pedals, Saitek X-55 Twist, Thrustmaster T.Flight HOTAS.X Twist and I am guessing the Saitek X-45 has a Twist option also.

    The four fire buttons should not be that hard to get on a HOTAS system. Between the joystick and throttle there should be enough to get 4 fire buttons. On CH FighterStick since it has a mode button (which gives you 3 different modes) you can get 3 fire buttons just off of the trigger just by switching modes.

    HOTAS_FIRE1
    HOTAS_FIRE2
    HOTAS_FIRE3
    HOTAS_FIRE4

    This seems like these two should not hard to find a throttle "alt" button and pinky switch might be harder unless you want to just pick any arbitrary button for a generic button.

    HOTAS_THROTTLE_BUTTON

    HOTAS_GENERIC_PINKY_SWITCH

    A button you can designate as a mode switch. I am guessing that you are just cycling through multiple modes and not picking a mode individually? That is not pressing 1 for mode1, press2 for mode2 type of functionality.

    HOTAS_MODE

    The fun part starts with the number of HATS and then picking which ones to use.

    ThrustMaster HOTAS T.Flight Hotas.X only has one hat but you might be able to tie that to mode "switch" to get around that. But everything else (Saitek X-55, CH Fighter Stick, Saitek X-45) has at least two HATS.

    HOTAS_HAT1
    HOTAS_HAT2
     
    Last edited: Mar 2, 2015
  43. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Yeah, I wouldn't necessarily expect an "official" HOTAS template, since the devices (and games that use them) are so different. I may be able to get away with it for the type of games I'd be doing, since a lot of the crazy aux, knobs, hat 3 type stuff I just wouldn't need.

    Hmm, my first reaction was "forget it." But that actually might be worth it.
     
  44. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Thanks!! I hope you didn't spend much time on it; it wasn't exactly a high priority item. :D
     
  45. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    No, but it has a dedicated rudder control embedded into the throttle. Same difference I suppose.

    Actually I have it mapped on X45 so that I can directly select Mode 1 for "auto-braking thrusters" (that is, drag and angular drag values) or Mode 2 for no drag mode. The X45 has a three-position slider switch for mode 1/2/3. I think normally the intent for that is to overload the throttle controls with more stuff, but it should work for that purpose too. It's something that if a device has some extra buttons you could map to.

    That function is not a critical function to have on the HOTAS. You can just use the keyboard to toggle that mode. That's sort of my philosophy on the template. Map what you can. Hard core flight sims have way too many controls to put everything on the joystick anyway, so it's not that unusual.

    Same thing goes with "hat 2". I see that many HOTAS devices don't have that. Which is fine, since the functions I have for that are easily accessed via keyboard.

    So I suppose you could informally treat certain controls in the template(s) as "required" and the others as optional.

    Required elements would be:

    Stick X/Y
    Throttle
    Hat 1
    Fire 1, 2, 3
    At least one "alt" button

    And that's it. Everything else would be "gravy."
     
  46. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    NP! It was a 2 minute fix. I knew what and where the problem would be.

    That's how the Dual Analog Template works as well. Nothing is 100% required, but so far all gamepads support what is the equivalent of:
    • Left Stick X/Y
    • Action Top Row 1 - 2
    • Action Bottom Row 1 - 2
    • Left/Right Shoulder
    But some gamepads currently mapped are be physically missing one or more of:
    • Right Stick X/Y (in the case of 8Bitdo NES30)
    • Action Top Row 3 and Action Bottom Row 3 (option 5th and 6th button on a 6-button gamepad -- only Saitek P880 & P990 currently have these.)
    • Center 1-3 (Select, Start, 3rd button)
    • Left/Right Trigger / L2/R2
    • Left/Right Stick Button
    • D-Pad
    I know the 8Bitdo isn't really a dual analog, but it fit well enough with the template to work. In this case, I mapped the D-Pad as the Left Stick so it would just work with most games where Left Stick is mapped as basic movement. Of course the developer can always override the template by creating a specific map for the device.

    So, yes, the template is meant to make things easier to map but doesn't have to match 100%. For an official template, ideally I would like for no element to be left out on any joystick that it supports, so the more extras the better. But again, it becomes an issue of identifying all possible elements on all HOTAS setups to cover everything. But at that point, it's also questionable whether the template is even useful anymore if it contains 25 elements that don't map to anything on your joystick and just becomes confusing to map. Something acceptable may be possible.

    That's correct. Each separate HID is treated as a separate joystick because that's what it is.

    Unless you want to treat the data differently somehow because it's coming from a HOTAS device, there's no real reason to label your actions as HOTAS_. You could just have a STICK_X, or probably more appropriately the name of the in-game Action such as Tilt, Pitch, Yaw, etc. and when you create a gamepad mapping, just assign that to Stick X/Y, when you create a HOTAS mapping do the same. Same with the Rudder Action.

    Just to be clear, Actions are not part of or referenced by the Template which just maps Element Identifiers in the template to Element Identifiers in the Action Element Map.
     
  47. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Right, I don't think an official HOTAS template would necessarily make sense. I'll share whatever I come up with, but it's going to be somewhat game specific, or at least specific to action-oriented games that don't need truckloads of buttons and knobs.
     
  48. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    Awesome, thanks!
     
  49. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,631
    With Unity 5's public release almost here, I am preparing to release a Unity 5 branch of Rewired. In doing testing with Unity 5 RC3 I have discovered some very serious bugs in Unity 5, some of which affect Rewired.

    1. Unity 5 breaks OSX controller hot-plugging in the editor, builds, and webplayers (when using Unity input) -- Unity on OSX is now unable to detect when controllers are attached or detached on all 3 platforms. Rewired's native solution remains unaffected by this bug, so unless you disable it, Rewired maintains perfect hot-plugging support on OSX in the editor and builds. However, because Webplayer falls back on Unity's input system, hot-plugging is now broken in Unity 5 OSX webplayer. Recommendation: If you require Webplayer controller support, do not upgrade to Unity 5 at this time.
    2. Unity 5 breaks Linux builds. 32-but builds simply no longer launch. This is unrelated to Rewired. Even a blank project will not launch.
    3. Unity 5 breaks joysticks in 64-bit builds. Prior to Unity 5, hot-plugging was not supported at all in Linux. However, now the 64-bit build of Linux does detect when a joystick is attached. However, instead of removing the joystick entry when the joystick is detached, it exists forever. When you plug the joystick back in, a brand new entry for that same joystick is added to the list. If you keep unplugging and replugging joysticks, you can make more and more phantom controller entries appear in the list. Because Rewired uses Unity input as the input source in Linux, this bug affects Rewired.
    4. Unity 5 breaks Windows App Store support in Rewired. (UPDATE: Fixed in Unity 5.0.1) Due to a new bug introduced in Unity 5, Rewired is unable to be compiled in this version of Unity. The bug relates to classes that inherit from other classes contained within a DLL that contain serialized data. I have made Unity aware of this bug, but there is no possible workaround for Rewired without major structural changes to the Rewired Input Manager data storage system that would result in data loss for all users. This is unacceptable, so as of Unity 5, until Unity fixes their bug, Rewired no longer supports Windows app store. Unity 4.x branch is unaffected and will work as usual. Recommendation: If you require Windows App Store support, do not upgrade to Unity 5 at this time.
     
    Last edited: Apr 6, 2015
  50. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    OK, here's my first cut at a simple HOTAS template, for combined stick/throttle devices only. I think it's worth it for my game, since I overload several functions and I can focus on just mapping unique controls per device. It may not be applicable to anyone else's games though.

    To make sense of it (for myself), I made a little spreadsheet that describes how I'm planning on using it in my game (the working title is "Full Burn"):
    https://docs.google.com/spreadsheets/d/1_PvAJk09NgA5rux3HjfYwhV6sWVCW38Kh84JtnFvNGs/edit?usp=sharing

    I only mapped Saitek X45, Thrustmaster T.Flight HOTAS X, and Logitech Extreme 3D Pro in the template. Those are the "combined" ones Rewired supports right now as far as I can tell.

    I may go ahead and do stick only, throttle only, and rudder only templates too.
     

    Attached Files: