Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rewired - Advanced Input for Unity

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

  1. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Thanks for pointing that out. It worked!

    So cool though.

    I have a different problem. Actually it is more of an implementation. What would be the best way to steer a car using sensors? You are using accelerometer in the tilt example right? How does say, Wii Mario Kart work?

    So glad I chose Rewired though!

    Thanks

     
  2. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    I suggest you upgrade from the 5.0.1p3 patch version to at least 5.0.2 or greater. Unity patch versions are hard to support because there is no way to have conditionals that check for a patch version.

    The issues you are having seem to be related to data serialization. (Both issues you've reported.) Serialization is handled 100% by Unity's built-in serialization system so there isn't anything I can do to fix this. Unless you are using a 3rd party data serialization system (which could be causing the issue), the recommended course of action would be to update Unity. You may need to reinstall Rewired again after the update. Another thing you could try is to install Rewired in a new project and see if you get the same errors.
     
  3. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    Hey guavaman. What can you tell me about frame-rate independent input in Rewired?
     
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Glad it works. Actually, I can't really give advice on how to control your car like Mario Kart. I haven't studied how their control system works/feels, nor have I really done much with accelerometer/gyro control. I'm sure there must be some resource on that can give you advice on how to program air steering. But since you know how to pipe accelerometer and gyro data into Rewired, you should be able to implement any design you find.
     
  5. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    It does not support framerate independent input. There are many reasons:

    1. You would have to gather input in a separate thread.
    2. You would not be able to use the results of this input in any code that calls Unity's API because it's single threaded and will throw an error if anything is called from a separate thread.
    3. The best you could do is view a queue of input that shows a history of actions so you could decide on taking actions after they've taken place. This wouldn't be terribly useful for many types of games.
    4. It would require custom native input libraries on every single platform Unity supports.
    5. It would require native input handling of mouse and keyboard also on all platforms.
    6. It would require native input handling of gyros/accelerometers on phones.
    7. Any implementation that exposed input events on the thread directly would be subject to hard crashes (not try/catchable) if the user didn't handle them properly. (All you could really do is store data and handle it later if dealing with any part of the Unity API -- ie: Moving the camera.).
    8. Any implementation that tried to keep input values as fresh as possible at all times would need to update the current state during the main thread processing. This would mean the entire Rewired API would have to be written to be thread safe. It is not currently.
    9. #8 would make GetButtonDown non functiontional as well as double click detection and other features that currently exist. It would also cause issues with digital axis simulation calculations.
    10. #8 would increase CPU usage dramatically because each Action would have to be re-evaluated every single CPU cycle on the input thread, not just every Update. (Though if you used a fixed input thread update frequency, this would mitigate this somewhat.)
     
    Last edited: Sep 25, 2015
  6. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Wow, thanks @longroadhwy!

    I didn't realize it was the 1 year anniversary. :oops: Thanks so much for your interest in Rewired, your ideas and advice, and your support over the past year. You and everyone else here have been a huge part of growing Rewired into the system it is today and what it will continue to become in the future. There are some exciting additions coming (soon). I can't wait to see more of the games everyone is making with Rewired!
     
  7. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    Ah, that explains why I didn't get the expected result. You might want to consider removing that feature from your forum signature though.

    One of my use-cases is to capture the accurate time of input, ie. to simulate hitting a baseball which in real life has a 7 ms margin of error, which is smaller than the typical 16.7 ms resolution a 60 fps game gives. Let alone 30 fps. My intention is to store the input into a Queue and process the input in the next frame.

    Anyway thanks for your list, I will take that into account when looking into an alternative solution.
     
  8. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Wow, I wasn't aware that was in my sig. It was removed everywhere shortly after release because of a misunderstanding on how Fixed Update worked. I removed it from the website, the store page, videos, all forum posts, other websites, and docs. I can't believe I missed that one. :oops:

    Is your baseball controller HID?

    (I do have preliminary frame-rate independent code on Windows that does work at the low level (not using Actions yet), but it was just in testing and isn't close to ready for release since I haven't worked on it for a while and am focusing on other requests that have been piling up.)
     
    Last edited: Sep 25, 2015
  9. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    I didn't have a specific baseball bat controller in mind, if that's what you mean. I'm targeting just regular mouse, keyboard joystick input. Do you think there are technical limitations to the hardware that make for example a 1 ms accuracy impossible?

    Then again it's interesting to think about VR inputs such as inertial sensors. I've ordered a Perception Neuron which advertises 120 fps with 18 sensors, but it probably has considerable latency in practice considering they shifted focus on content creators rather than VR players.
     
  10. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Accuracy would depend mostly on A) the input thread update frequency B) the hardware in use (gaming mouse would do more updates per second than a regular mouse). Joysticks and keyboards would be more of a challenge since basically no two are the same and update rates aren't published. For joysticks, you also have to be aware of the fact that some allow polling for input and others do not (and can crash if you try). Different operating systems and input APIs have different ways of working. For example, XInput uses polling, Raw Input can either be polled (if the device supports it) or use Windows messaging system, OSX uses messages when element values change, etc. On Windows, you wouldn't be able to use the standard Windows Keyboard/Mouse messaging system as it probably wouldn't be high-resolution enough (or may potentially eat messages if more data comes in than can be processed by your thread in one frame) and would have to implement your own direct HID handling of keyboard and mouse. (Same would be required for multiple distinct kb/mouse setups.) Bluetooth devices may also have more latency (depending on your BT receiver, distance from the receiver, etc.)

    It's a complex topic, for sure.
     
  11. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    Yes it is. Especially when you consider that a tiny variation in timing has a big effect on the trajectory of a baseball in real life.

    So what I take away from your explanation is, because of all the uncertainty of the variables between the player and the final render, the margin of error is a lot higher and a guaranteed accuracy in the order of 1 to 10 ms is unattainable. So it's not possible to accurately simulate a real-life sport such a baseball or tennis in a game. I think it's fascinating how such technical limitations affect game play.

    Actually I just found a baseball game that was recently released on Steam, Super Mega Baseball. The devs have written a post about how a steady 60 fps framerate is essential for the experience. http://supermegabaseball.com/making-a-60fps-indie-sports-title/ A 16.7 ms latency is more than the window to hit the ball, but I guess real-life baseball is too hard anyway for the untrained individual, with an estimated 2% hit probability versus a typical baseball batting average of 25%. Because of the lower input accuracy Super Mega Baseball must be quite a bit easier and therefore less realistic, but perhaps also more enjoyable. I'll have to drop them a mail to ask for their opinion.
     
  12. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    I wouldn't say it's unattainable in controlled circumstances. I'm just saying it would be fraught with technical challenges when trying to do it cross-platform and cross-device and have it "just work" on every system and input device. You could probably achieve something realistic enough on a fixed set of approved hardware on specific platforms without a huge amount of trouble (Windows, XInput, etc.). And input, with timing being so important to your game, would need to be prioritized with a very high frequency thread to handle it. But when you start throwing random devices into the mix, there are so many variables you cannot be guaranteed such a level of accuracy.

    Very interesting. I'd be interested to know how what they say.

    For the single-threaded route, you could also consider targeting 100fps or something like that which would be 10 ms, not quite the 7ms you were looking for but not too far off.
     
  13. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    If you hit 7 ms too early the ball is a foul in one direction, if you hit 7 ms too late it's a foul in the other direction. Within these 15 ms I reckon there's a whole arc of directions. So even if I got 7 ms precision it would still not be granular enough.

    Maybe I approach it from the wrong perspective. Maybe it's not so bad to sacrifice a bit of realism and nuance even though I'd worry the game would lose some of its magic. I've sent an email to the Super Mega Baseball asking for their thoughts.
     
  14. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    I see. Yeah, I don't think it's realistic to try to create a game that requires 1 ms input accuracy that isn't an arcade with a fixed set of hardware you have complete control over. To even get a 1000 hz polling rate on a mouse requires a specialized gaming mouse and the update frequency setting set to max. The default USB polling rate is 125 hz.

    No gamepads that I know of publish this information, so you could never know the capabilities of the joysticks/keyboards your players are using. And Bluetooth devices will not give you this kind of low latency either. (DS4 tends to run between 6ms and 30ms depending on the distance from the BT receiver according to my testing.)

    Here are a couple of articles that might help:
    https://wiki.archlinux.org/index.php/Mouse_polling_rate
    http://www.howtogeek.com/182702/mouse-dpi-and-polling-rates-explained-do-they-matter-for-gaming/
     
  15. movra

    movra

    Joined:
    Feb 16, 2013
    Posts:
    566
    8 ms for USB and 30 ms for BT... And then there's another problem, the display lag. The monitor runs a couple of ms behind the game simulation. I guess the solution is to adapt the game mechanics to account for a reasonable minimum amount of total latency. The lowest amount in the list of console games on that site is 81 ms.

    So time to rethink my approach. Thanks for your input! ;)
     
  16. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318

    In the new project does not have an error. =(
    I migrated my project from 4 to 5 Unity
    In version 4, the error is also available.
     
  17. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    I found the reason!
    If the platform Web - error occurs.
    If the PC platform - the error disappears.
    (In the new project is also true - the error appears)
     
  18. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    I see. Good find. I do not understand why this would happen in the editor. Unity must be using a different version of mono even in editor script code when the platform is set to Webplayer. That seems like a big oversight. The error is coming from the Rotorz reorderable list used to make sorting easier on the array in ControllerDataFile. The error looks like it's related to an error with certain types of class inheritance I reported to Unity in Webplayer over a year ago that has never been fixed. That this would affect editor scripts is kind of ridiculous since Unity cannot even run an editor script in Webplayer mode.

    Ignore the error and do not try to edit the ControllerDataFiles when you're in Webplayer mode and you will have no issues.
     
    Last edited: Sep 26, 2015
    hopeful likes this.
  19. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    OK thanks! :)
     
  20. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Rewired 1.0.0.68 is now available for download for registered users on the Rewired website. If you have purchased Rewired and would like early access to the latest releases, contact me here with your email address. The new version should be live on the Unity Asset Store in 7-15 days.

    1.0.0.68:

    New Controller Definitions:
    - Samsung Smartphone Game Pad (EI-GP20)
    - Mayflash Wireless PS3 Adapter
    - Mayflash Wireless WiiU Pro Controller Adapter

    API Changes:
    - Added ReInput.Reset method
    - Added ReInput.configuration property
    - Added ReInput.ConfigHelper class
    - Added Joystick.vibrationMotorCount property
    - Added IControllerVibrator.GetVibration method
    - Added RewiredStandaloneInputModule.UseAllRewiredGamePlayers property.
    - Added RewiredStandaloneInputModule.UseRewiredSystemPlayer property.
    - Added RewiredStandaloneInputModule.RewiredPlayerIds property.
    - Added RewiredStandaloneInputModule.MoveOneElementPerAxisPress property.
    - Added DualShock4ControllerExtension class.
    - Added DualShock4MotorType enum.

    Changes:
    - Input source settings can now be changed at runtime through ReInput.configuration object.
    - Added option to RewiredUFPSInputHelper to stabilize joystick look sensitivity in UFPS regardless of framerate.
    - Reduced axis deadzones on Saitek P990.
    - Added Repeat Delay option to RewiredStandaloneInputModue.
    - RewiredStandaloneInputModule detects mobile device platforms more accurately.
    - Xbox One controller vibration continues until manually stopped on Windows Standalone (XInput)
    - Sony DualShock 4 controller now supports vibration, light control, accelerometer, gyroscope, and battery level in Windows Standalone (Raw Input only) (preliminary implementation)
    - Added Enhanced Device Support option to Rewired Input Manager -> Settings

    Bug Fixes:
    - Fixed issue in Digital Axis Snap handling when pressing opposing axes simultaneously.
    - Filters out joysticks named "Empty" on PS4 platform.
    - Fixed controller matching issue on Ouya platform.
    - Fixed issue on Xbox One platform where controllers could be connected with invalid identifying information from Unity causing the controller to show up as an Unknown Controller.
     
    Last edited: Sep 26, 2015
  21. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    That is surprising that the WiiU Pro Controller works on the Android and Windows store platforms too based on your controller list. I would have expected there would be problems on those platforms. http://guavaman.com/projects/rewired/docs/SupportedControllers.html.

    I did not know that the Sony DualShock 4 controller had so many additional features available.
     
  22. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Checking in to see if there was any updates on this.

    Specifically for mouse (and keyboard) input on win/osx/linux.
     
  23. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    It only works with the Mayflash WiiU Pro Controller Adapter in XInput mode. With this adapter, the OS sees the devices as an XInput device and therefore it works as normal. The adapter only allows 1 XInput device per adapter however. In Direct Input mode, the adapter supports up to 4, but this mode does not work on these platforms.

    The Mayflash PS3 adapter does not work even in XInput mode however on Android or Amazon Fire TV.

    There is also another feature it has -- a touchpad that supports 2-finger multi-touch. This hasn't been exposed yet. There also needs to be some work done to expose these new features in a generic way and/or be able to map actions to some of them where applicable. (For example, accelerometer.) The implementation at present is preliminary and requires the use of the DualShock4ControllerExtension to access these features.
     
  24. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    No updates, unfortunately. This will be announced in the release notes if/when it becomes available.

    Adding mutli-threaded, frame-rate independent input to Rewired is a massive task. At present, Linux isn't even a native input source platform so that will necessarily have to come before mutli-threaded input is possible. Keyboards are not native on any platform and Mouse is only native on Windows (but requires different handling for multi-threaded input). This all has to be done first on all 3 platforms before I can even begin on framerate-independent input.

    I had done some preliminary work on this back around 1.0.0.15, but all that work was made obsolete by the huge number of other changes since then and it will have to be re-done from the ground up.
     
    Last edited: Sep 27, 2015
  25. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    So even if I wrote the threading stuff myself, I wouldn't be able to poll the native windows mouse input in a separate thread?
     
  26. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    It depends on how you implement it. Generally you don't poll the mouse. You receive a queue of messages for the thread in question.

    These articles might prove interesting:
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms645601(v=vs.85).aspx?f=255&MSPPError=-2147217396#_win32_Mouse_Messages
    https://msdn.microsoft.com/en-us/library/windows/desktop/ee418864(v=vs.85).aspx
     
  27. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    I guess my question is: does Rewired use WM_INPUT when set to native mouse on windows? And if so, is there a way to read new values from native windows mouse input in rewired in another thread or threaded timer?

    Rewired.ReInput.controllers.Mouse.GetAxis(0) only seems to update the values during Unity's Update() -- I assume it's tied to the Rewired Update Loop setting
     
    Last edited: Sep 27, 2015
  28. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Yes it uses WM_INPUT, but no there is no way to force Rewired to become multi-threaded in any way or run on a separate thread. It will require extensive restructuring of the low level systems and an even more extensive restructuring of the high-level interfaces to make Rewired compatible with multi-threading at all.
     
    Last edited: Sep 28, 2015
  29. obsidian1269

    obsidian1269

    Joined:
    May 12, 2011
    Posts:
    24
    No worries Guavaman! Went this route and all is well. :)
     
  30. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Glad to hear it.
     
  31. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Rewired 1.0.0.69 is now available for download for registered users on the Rewired website. If you have purchased Rewired and would like early access to the latest releases, contact me here with your email address. The new version will be submitted to the Unity Asset Store when the previous submitted version is approved.

    1.0.0.69:

    New Controller Definitions:
    - Moga Hero Power (HID)
    - Moga Pro Power (HID)

    New Integrations:
    - PlayMaker
    - Behavior Designer
     
    Karearea likes this.
  32. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    This is great to have official PlayerMaker and Behavior Designer support. Keep up the good work.
     
    Karearea and guavaman like this.
  33. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Yes! Thank you for these integrations!
     
    guavaman likes this.
  34. AlexThunderLotus

    AlexThunderLotus

    Joined:
    Jun 15, 2015
    Posts:
    11
    Hi! We are using Rewired for our game (very excellent plugin by the way!). Recently one of our player mentioned the xbone controller does not work on Linux. From your doc

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

    it is currently not supported. I was only wondering if it was in your plan to support it eventually or not. Thanks!
     
  35. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Thanks!

    Rewired's Linux implementation is dependent on Unity's input system at present. There is no way to support a device that doesn't show up in Unity's input system, therefore I cannot support it.

    It may require a special driver to work, in which case that may be supportable once it shows up in the system, but I would have to know which driver to support. As far as I am aware, there isn't an official driver.
     
  36. AlexThunderLotus

    AlexThunderLotus

    Joined:
    Jun 15, 2015
    Posts:
    11
    Thanks for your quick answer! The user in question mentioned me some games made with Unity where it works for him. This is why I was asking. Maybe there was something I didn't setup properly...
     
  37. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Does your game provide a user control remapping screen such as Control Mapper for your players to remap their controls? If the player has installed a custom driver (or is using the a newer Linux kernel that has support for the Xbox One controller), he should be able to manually assign his controls without issue. One of the most powerful features of Rewired is that is can support any controller it can detect through user mapping. You don't have to wait for me to create a controller profile for a controller to be supported.
     
  38. AlexThunderLotus

    AlexThunderLotus

    Joined:
    Jun 15, 2015
    Posts:
    11
    Thanks for your answer. I must admit that being short in time I only setup the UI for keyboard/mouse remapping, assuming most would be fine with preset controller mapping. I suppose this might have been helpful in this particular case. Thanks again for your support and congratulation for your awesome plugin!
     
  39. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Do you use Behavior Designer with Rewired currently?
     
  40. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Are you using a Linux distro with 4.1 kernel or only 3.x?
     
  41. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    Hi, no I don't, but thought it was churlish to say thanks just for the Playmaker integration :D
     
  42. AlexThunderLotus

    AlexThunderLotus

    Joined:
    Jun 15, 2015
    Posts:
    11
    The user having the problem is using kernel version 3.19.
     
  43. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    I'm going to try to get a mapping for it (if I can ever get Virtual Box to let me install Ubuntu again...) since it seems it was added after 3.17.

    Edit: It was Hyper-V. After uninstalling that I'm back in business. How did that ever get re-installed anyway?

    Edit 2: Well doesn't matter anyway. Unity doesn't run under VBox. Time to repartition my external Linux drive so I can install 10 more distros/versions.
     
    Last edited: Oct 2, 2015
  44. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Rewired 1.0.0.68 is now live on the Unity Asset Store! I'm currently working on 1.0.0.71 and may wait until that is ready to submit again to the UAS if I can get it finished soon enough. If not, I'll push 1.0.0.70 out to the UAS which has the PM and BD integrations.

    1.0.0.68:

    New Controller Definitions:
    - Samsung Smartphone Game Pad (EI-GP20)
    - Mayflash Wireless PS3 Adapter
    - Mayflash Wireless WiiU Pro Controller Adapter

    API Changes:
    - Added ReInput.Reset method
    - Added ReInput.configuration property
    - Added ReInput.ConfigHelper class
    - Added Joystick.vibrationMotorCount property
    - Added IControllerVibrator.GetVibration method
    - Added RewiredStandaloneInputModule.UseAllRewiredGamePlayers property.
    - Added RewiredStandaloneInputModule.UseRewiredSystemPlayer property.
    - Added RewiredStandaloneInputModule.RewiredPlayerIds property.
    - Added RewiredStandaloneInputModule.MoveOneElementPerAxisPress property.
    - Added DualShock4ControllerExtension class.
    - Added DualShock4MotorType enum.

    Changes:
    - Input source settings can now be changed at runtime through ReInput.configuration object.
    - Added option to RewiredUFPSInputHelper to stabilize joystick look sensitivity in UFPS regardless of framerate.
    - Reduced axis deadzones on Saitek P990.
    - Added Repeat Delay option to RewiredStandaloneInputModue.
    - RewiredStandaloneInputModule detects mobile device platforms more accurately.
    - Xbox One controller vibration continues until manually stopped on Windows Standalone (XInput)
    - Sony DualShock 4 controller now supports vibration, light control, accelerometer, gyroscope, and battery level in Windows Standalone (Raw Input only) (preliminary implementation)
    - Added Enhanced Device Support option to Rewired Input Manager -> Settings

    Bug Fixes:
    - Fixed issue in Digital Axis Snap handling when pressing opposing axes simultaneously.
    - Filters out joysticks named "Empty" on PS4 platform.
    - Fixed controller matching issue on Ouya platform.
    - Fixed issue on Xbox One platform where controllers could be connected with invalid identifying information from Unity causing the controller to show up as an Unknown Controller.
     
  45. AlexThunderLotus

    AlexThunderLotus

    Joined:
    Jun 15, 2015
    Posts:
    11
    Thanks you for your help!
     
  46. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    You get a two for one deal in this case.

    Have you been integrating anything else with Rewired these days? I have seen you mention UnityFS and UFPS but I thought you had integrated another asset with Rewired?
     
  47. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Wow, I didn't even know you could get to that stuff from Windows. REALLY cool feature.
     
  48. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    Yeah it is pretty fun to play with. I do also have the multi-touch touchpad data but I haven't come up with the classes/structs to expose that yet.

    Current usage is through the DualShock4ControllerExtension. I will probably expose each new element type in a generic way through the Joystick class in the future. Ex: List of standardized Accelerometer, Gyro, Light, and Touchpad objects one can access like Axes and Buttons. (Battery level could also be expose there too.) If I can devise a way to map any of this data to Player Actions, I'll do so, but for now I haven't come up with one.

    One immediate benefit of this addition that doesn't require any changes to your code is that vibration will work for the DS4 using the same calls used for X360 controllers. (Joystick.SetVibration, etc.)

    I plan to do it for OSX also at some point.
     
    Last edited: Oct 2, 2015
  49. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,609
    By the way, Opsive's Third Person Controller includes Rewired integration in the latest release.
     
  50. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Oh wow, nice.