steamvr_unity_plugin icon indicating copy to clipboard operation
steamvr_unity_plugin copied to clipboard

critical APIs removed with no migration path?

Open rms80 opened this issue 8 years ago • 10 comments

As far as I can tell, SteamVR_Controller and many related core objects were removed from SteamVR 2.0 Unity Component, with no way to reproduce this functionality?!? I have a stock Vive Headset with two controllers and all I want to do is programmatically access their positions and button states.

I have googled extensively for some kind of migration path for my existing code and all I have found are people asking for help. There appears to be no documentation explaining what to do in this situation.

I don't understand how this could possibly be the case? This is a core component that I would assume hundreds of VR apps are built against, and it is simply deleted with no way to easily port existing code?

My VR prosthetics design app is completely broken because of this: https://orthovrproject.org/

rms80 avatar Oct 07 '18 00:10 rms80

Hi @rms80, sorry this upgrade is causing issues for you. This is a significant change from the old style of thinking about input. Instead of accessing buttons directly the idea is you access "actions" that then map to buttons. That mapping can be changed by users to account for preference, new controllers, and accessibility.

That said, we recognize we can do more to educate developers on this new concept and system. If you haven't seen it already please check out this overview post here: https://steamcommunity.com/games/250820/announcements/detail/1696059027982397407

and the tutorial here: https://steamcommunity.com/sharedfiles/filedetails/?id=1416820276

If you prefer, you're welcome to continue using the old SteamVR 1.2.3 unity plugin. It's on our releases page here: https://github.com/ValveSoftware/steamvr_unity_plugin/releases/tag/1.2.3

keithbradner avatar Oct 08 '18 17:10 keithbradner

I can see how this system is nice for prototyping VR UI. But it looks like a disaster for any kind of re-usable VR user interface code libraries / components.

For example, I make an open-source interface framework for Unity "3D-app" projects that provides a reasonably consistent 3DUI across VR/desktop/mobile: https://github.com/gradientspace/frame3Sharp, including a bunch of tools for 3D manipulation, 3D drawing, etc.

This kind of component only works if the VR UI happens at the C# code level. I need an API that lets me access VR devices in a consistent way, so that I can implement the interaction in code. With your new system it appears that the client of this component would have to manually set up untold numbers of "Actions" and somehow hook them up to my framework.

Fundamentally the problem with this system is that you're assuming you are better at implementing "actions" than I am, and that your visual editor provides me everything I need. As far as I can tell looking through the tutorials, it's mostly about clicking on things. The Rift and Vive controllers have many more complex capabilities and there is no way you can anticipate every possible use case. But without a lower-level API, implementing novel interactions is impossible.

"using an old version" is not an option long-term. The page says it is deprecated. If it is not maintained, it will deteriorate, and so will my user experience for people with Vive headsets. So now my alternative is to use Unity's XR system for Vives, and ignore any potential novel Vive capabilities I might have accessed through SteamVR.

(I guess you can close this issue)

rms80 avatar Oct 08 '18 18:10 rms80

For frameworks and plugins you can have actions that get automatically assigned on generation, if you check out the interaction system you'll see a few examples of this. Hand has a grabPinchAction member that has a property defined: [SteamVR_DefaultAction("GrabPinch")]. On generation this searches for an action by the name and assigns it to the slot in the component.

If you'd prefer a more custom tailored way of creating actions and bindings you're welcome to implement your own interface for that. We have a standard way of reading those actions and bindings in through json and then letting the user rebind things once in there but the files themselves can be generated how you like.

I'm not sure what you mean by "it's mostly about clicking on things". We give access to all the states of the inputs available, the touchpad for example has touch, click, and position that are bindable inputs. With trigger you get touch, click, and pull. Click being a configurable threshold.

keithbradner avatar Oct 09 '18 18:10 keithbradner

I can see how this system is nice for prototyping VR UI. But it looks like a disaster for any kind of re-usable VR user interface code libraries / components.

This is exactly the case I have - most of the users of my framework are pretty low skilled. They want a drop-in solution that just works. I don't want to spend hours with every one talking them through creating actions and solving why the automatically assigned action I've made as a part of my framework causes conflicts with how they set up their project.

Kindly consider bringing back a simple button state read as an alternative.

chisely avatar Oct 10 '18 16:10 chisely

@chisely how would you feel about a system that let you create an action manifest / binding subset to be included with plugins? Maybe you create an action set called myplugin_gunStuff so there's no collisions and the user gets a dialog asking if they want to just use your action manifest or combine it with their own on import?

keithbradner avatar Oct 10 '18 18:10 keithbradner

We have a need for a plugin specific action manifest / binding in our project, I develop our character controller separately from our other projects. So having a manifest / binding paired with our character controller makes sense. As we move our character controller to a new project it would make it super portable. I was already looking at building a solution for this.

jcrapsey avatar Oct 10 '18 19:10 jcrapsey

@keithbradner

I'm not sure what you mean by "it's mostly about clicking on things". We give access to all the states of the inputs available, the touchpad for example has touch, click, and position that are bindable inputs. With trigger you get touch, click, and pull. Click being a configurable threshold.

I've been poking around the system myself and got a similar impression from it so far. The reason for me isn't that you can't technically get the states you need, but more that the abstraction of dividing it into discrete actions gets in a way for more complex interactions.

For example, I have a different locomotion scheme for Vive and different for Touch, because what works well with touchpad doesn't work well with joystick and vice versa. Vive uses combination of touchpad position and touchpad click, while Oculus just uses joystick tilt and they both process the axes a bit differently.

I'm not really sure how to decompose this kind of setup into actions in a clean, generalized way. The actions seem to work well when the interactions are "singular" in a way, but I'm not sure how to map them for more complicated things, while allowing for per-controller input style optimization.

Maybe there's something I'm missing on this new input system (I admit I don't fully grasp its design principles yet), but this is the kind of mental roadblock that I've ran into so far.

Frooxius avatar Oct 14 '18 14:10 Frooxius

I think generally if you have different styles of optional input then you can have different actions for that. For example if you had teleporting with the vive wand you may want it to just be press to teleport, with no directionality. But if you're on Oculus touch you could push the stick to teleport AND reorient the direction of the player to the direction you're pressing. These would be separate actions: Teleport and TeleportDirection. All actions are not required to be bound. You can check if they're bound through GetActive.

keithbradner avatar Oct 25 '18 17:10 keithbradner

Seems like this has been answered but there is also now online documentation on the github here: https://valvesoftware.github.io/steamvr_unity_plugin/articles/SteamVR-Input.html

keithbradner avatar Jan 31 '19 01:01 keithbradner

I want to stress that this... "mapping can be changed by users to account for preference, new controllers, and accessibility"

... was not asked for by anyone, as far as I can tell, and it's caused nothing but problems since then. It straight up killed a number of projects, for months. Please don't make decisions like this in the future without consulting your users first, or at least offering a migration path or documentation.

chilton avatar Apr 04 '19 00:04 chilton