I’ve had a good read of the stuff in here, and it looks pretty good, but I don’t understand how it’s going to extend beyond ‘simple’ devices.
At a high level, my understanding is that you create a ControlScheme which is linked to a number of Device types.
Actions can then be associated to Device specific input.
Sound about right?
So for example, you associate a ButtonAction with a Gamepad input button, and that lets you check if the button is up, down, held, etc.
Superficially this seems very reasonable, but how is it going to work with more complex devices?
Let’s have a look at some concrete examples:
PS4 controller
The PS4 controller has a rotation associated with it (eg. Vector3Action). However, it is a Gamepad.
It also supports Rumble. Neither of these action types are exposed on the Gamepad type.
If the Gamepad device is modified to support these, does that mean you have to query your Gamepad device to see what actions are available on it somehow?
What if someone comes out with a new “3DScanning Gamepad” that yields a stream of point cloud data? Or a gamepad with a keyboard on it (PS4…) (obviously a contrived example, but bear with me…) does Gamepad get modified to support it? Doesn’t that mean that Gamepad becomes a MegaDevice with a million different Actions on it?
Or do you create a new virtual device that is some kind of weird thing where it is actually multiple ‘Devices’ associated with a ControlScheme (eg. keyboard + gamepad) when there is actually only one physical device?
Vive 3d controllers
So here we have both 3d world position and rotation for each input, and there can be multiple physical devices.
You want to do this:
void Start() {
// Bind the actions.
look.Bind(playerInput.handle);
leftHandPos.Bind(playerInput.handle);
leftHandRotation.Bind(playerInput.handle);
leftHandButton.Bind(playerInput.handle);
rightHand.Bind(playerInput.handle);
rightHandRotation.Bind(playerInput.handle)
...
You see the issue I’m sure.
How are leftHand, leftHandButton and rightHand, rightHandButton correctly bound to the right devices?
Or do we get a PositionRotationButtonVector3Input type for this?
More generally, when you have a multiple physical devices that each provide multiple complex input types (Vector3, Button, maybe even say a camera), how do you correctly associate all of the Actions into one group for each input device?
Swapping devices
Perhaps you may have seen this recent GGJ game, where the ‘ghost’ players take one controller each, while the other player where the headset: http://globalgamejam.org/2016/games/hide-spook-steam-vr
In this situation you have three players; each player must be associated with one device; a move controller or a VR headset. How is assignment of physical device to each player handled?
How do players indicate that they have swapped devices if they do?
(I could imagine a reinitialize command → ‘click with your device to select your player’ or something, but technically how would this be handled by the system? All the input bindings would have to be updated to reflect new devices)