question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feedback from real world game.

See original GitHub issue

Hey 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

image

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 image

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.

image

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) image

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

image

Its completely dynamic and reacts to your settings. Here same screen when using Grip/Hold binding image

    [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

image

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:closed
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kisak-valvecommented, Oct 28, 2018

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.

0reactions
AndersMalmgrencommented, Oct 28, 2018

@kisak-valve Alright, I created 3 new issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Real World Golf
The game gives you a repeatable exercise that helps you with your posture and keeping the club face square. I was very impressed....
Read more >
If real life was a video game, what would the critics say ...
If real life was a video game, what would the critics say about it? ... It is an unfair pay to win and...
Read more >
If life was a videogame, what would your review be?
If real life was a video game, what would the critics say about it? Good graphics, solid physics engine, solid free to play...
Read more >
Budget: A Real World Math Game Review - Homeschool
The game is set up to be pretty true to life. Sometimes you do have a fire and it costs you a lot...
Read more >
Real World Golf Review
The gimmicky gameplay is honestly curious enough in and of itself to hook you into Real World Golf. It's probably not going to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found