Feedback from real world game.
See original GitHub issueHey guys. First I cant test the new SDK to the fullest because I get the blank screen bug #154 so maybe some feedback is not valid. Here comes a LOOONG wall of text, but I hope you guys value feedback from a released and out in the world game that as seen some polish passes over the years (And alot of that is interaction).
First let me show you guys how our own abstraction and binding works. We have two kinds of abstraction, Interaction abstraction and Command abstraction.
Interaction abstraction binding view
This is the Vive Wands default bindings. We have 4 interaction classes (Called ItemType below), the last one here configured for using Toggle behavior which means when using trigger that you use the Grip button to let go of the item. I guess this could be mimicked with the new SDK by creating 4 Actions, GrabInteractible, GrabItem, GrabFrontgrip and GrabWeapon. I hope the toggle behavior can be abstracted into the binding, havent been able to test because of above mentioned binding bug.
Though, our code has some smart logic to it. If you use Trigger for Weapons you cant select Hold, only Toggle (Since you use the trigger to fire the weapon), I guess if the user creates a faulty bindings that they should blame themself, but its a lot less snappy than that the game validates bindings like our current solution. Also when using trigger for weapons you need to wait until he releases the trigger until the trigger can be used to fire the weapon. This is pretty elegant handled by our abstraction.
if (!AttachedHand.InteractionUsesTrigger(ItemType) || AttachedHand.TriggerReleasedSincePickup) {
if (AttachedHand.Trigger.PressUp) {
firstShot = true;
}
SetTriggerAnimationRatio(AttachedHand.Trigger);
if (CanFireNextShot(AttachedHand.Trigger)) {
this.Fire ();
firstShot = false;
}
}
We check if current ItemType uses trigger to grab it using the AttachedHand.InteractionUsesTrigger
method or if trigger was released since pickup.
The InteractionUsesTrigger
method could be replaced by a SDK method something like
SteamVR_Input.ActionsConflict(SteamVR_Input._default.inActions.TriggerPressed, SteamVR_Input._default.inActions.GrabWeapon)
The TriggerReleasedSincePickup
property is harder to replece I guess, maybe a TriggerReleased action that sets the TriggerReleasedSincePickup
bool. It would be cool with something built in here, but I just cant see how that would happen.
Moving on to Command abstractions. Here is the default bindings for Vive Wand
Here the user can select which button to use for a specific command. We also have Command groups as we call them, and if a user tries to use the same button twice within a command group he gets a error and cant proceed.
This is how we define command groups today, and it would be awesome if we can do the same for Actions.
private static readonly Command[][] commandGroups = new []
{
new[] { Command.BoltRelease, Command.ChangeFireMode, Command.MagRelease },
new[] { Command.ReleaseDrum, Command.CockHammer }
};
On the same subject, the Rift does not have a Application Menu button like the Vive wand. So to get into the in game menu we have some clever logic. Either the menu button is used distinct only for the Menu or you cant have a item in the hand while pressing the menu button to bring up the menu (It will instead be used to control the function on the firearm for example).
if (hand.CheckForPlayerCommand(Command.ShowMenu) && (!hand.IsInteracting || !hand.ItemInHand.HasCommands || NVRPlayer.InputStrategy.ButtonIsUsedDistinct(Command.ShowMenu)))
So above code checks if the command for show menu is issued. Then it looks if the hand is not interacting or if the item has no commands or if the menu button is used distinct. This means even if the menu button is not used for this current item you still cant use the menu, a trade of we made at the time not making our domain too complex.
I can see a more elegant solution for this if we name above Command groups (Action groups). You could test if a action will conflict with a action group. Something like SteamVR_Input.ActionConflictsWithActionGroup(SteamVR_Input._default.inActions.ShowMenu, "FirearmGroup");
Another cool and useful feature we have is a method for checking if a Command is Touched. Like
if (AttachedHand.CheckForPlayerCommandTouched(Command.CockHammer))
AttachedHand.SetFingerIKState(Fingers.Thumb, true, 0.25f);
Here it is in action (click for youtube)
I guess this could be mimicked with the new SDK by creating two Actions, one CockHammer and one HammerTouched. But it would be cool if the Action could have multiple states somehow, just a side point.
Lastly in game tutorials. I see that you have some Hint example in the demo but it seems todo nothing when I press the buttons, plus I cant really understand the code. I tried GetDeviceComponentName
but it just returns some gibberish numbers. Our in game tutorials are pretty advanced. Here is a example of a interaction text screen
Its completely dynamic and reacts to your settings. Here same screen when using Grip/Hold binding
[CreateAssetMenu(menuName = "Tutorial/Interact")]
public class InteractStep : TutorialStep
{
public string ItemType;
public override IEnumerator Execute()
{
ShowPopup(Item.ColliderParent.transform, string.Format("Grab the {0} by {1}.", ItemType, GetInteractionCaption(Item.ItemType)));
while (Item && !Item.IsAttached)
{
yield return null;
}
}
}
I call the GetInteractionCaption
to get the text, same for Commands
I call GetCommandCaption
to get the text
[CreateAssetMenu(menuName = "Tutorial/ChangeFireModeStep")]
public class ChangeFireModeStep : TutorialStep
{
public FireModes Firemode;
public override IEnumerator Execute()
{
var firearm = Get<Firearm>();
ShowPopup(firearm.FireSelector.transform, string.Format("Press {0} to change fire mode to {1} auto.", GetCommandCaption(Command.ChangeFireMode), Firemode.ToString().ToLower()));
while (firearm.FireSelector.Mode != Firemode)
yield return null;
}
}
I hope we can have a discussion on howto get these features into the SDK, thanks!
edit: Added command touch section.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Hello @AndersMalmgren, multi-issue issue reports aren’t good for any issue tracker and separate issue reports, one issue per issue report is the better option.
@kisak-valve Alright, I created 3 new issues