cancel
Showing results for 
Search instead for 
Did you mean: 

Simple experiments with gamepad controls and VR

mrgreen72
Superstar
I thought I'd share some of the small experiments I'm making with gamepad controls. This is a WIP and nothing ground breaking or very exciting but it's I thought it would be as good a starting point as any for a discussion/collaboration on VR and gamepad controls.

*NEW UPDATE 2014-04-27*

This is based on SDK 0.2.5.

Ugly paste of the description from the readme file:

Simple experiments with VR and gamepad controls by Hugo Tremblay aka Mr.Green.

This has been made using the 360 controller on Windows.


*Press the Back button of the 360 controller to see the control options*

1 - Control Modes

You can cycle through the different control modes by using the left and right
D-Pad buttons of the 360 controller or the + and - keys of the keypad.


1.1 - OculusSDK

This is the default mode of the Oculus SDK. You walk in the direction you're
looking at.

Left analog stick: Walk forward/backward. Strafe left/right.
Right analog stick: Turn left/right.
Left analog click: 180° turn.
Left trigger: Run.

1.2 - FreeHead

This mode lets you look and walk in different directions.

Left analog stick: Walk forward/backward. Strafe left/right.
Right analog stick: Turn left/right.
Left analog click: 180° turn.
Left trigger: Run.

1.3 - FreeHeadLS

This mode is like the FreeHead mode with strafing and turning swapped to give full
control to the left stick.

Left analog stick: Walk forward/backward. Turn left/right.
Right analog stick: Strafe left/right.
Left analog click: 180° turn.
Left trigger: Run.

1.4 - HeadStick

This mode lets you turn with your head when you're moving (walking or strafing).

When you turn your head past a configurable angle (default 20°) to either the
left or right, you beging turning at a configurable senstivity, much like an analog
stick.

You can freely look around normally when not moving.

Also, it assumes that if you're looking up 15° or more, you're probably looking
at something and will NOT turn.

This mode is requires good VR legs.

Left analog stick: Walk forward/backward. Strafe left/right.
Right analog stick: Free.
Left analog click: 180° turn.
Left trigger: Run.

1.5 - FixedAngle

This mode is probably very similar to what CloudHead's VR Comfort Mode. You
walk in the direction you're looking at but you can make broader turns using
the left stick, which turns in fixed increments (default 20°). The angle is
configurable.

Left analog stick: Walk forward/backward. Strafe left/right.
Right analog stick: Turn left/right in fixed increments.
Left analog click: 180° turn.
Left trigger: Run.

1.6 - FixedAngleLS

This mode is identical to the FixedAngle mode except that it gives you full control
with the left stick and puts strafing on the right stick.

The strafing could be put as a button modifier or removed altogether, which would
leave the right stick free for a potentialy more useful role like a free gun aiming
mode for instance.

Left analog stick: Walk forward/backward. Turn left/right in fixed increments.
Right analog stick: Strafe left/right.
Left analog click: 180° turn.
Left trigger: Run.

1.7 - FixedAngleHead

This mode is a mix of FixedAngle and HeadStick.

When you turn your head past a configurable angle (default 20°) to either the
left or right, you will turn in that direction by that angle.

Left analog stick: Walk forward/backward. Strafe left/right.
Right analog stick: Free.
Left analog click: 180° turn.
Left trigger: Run.

1.8 - TurnButton

This mode lets the user set his orientation (walking direction) to where he's
looking at with the press of a button. Initiates a rotation by the delta
between the camera orientation and the "body" orientation. Both the camera and
the body rotate by the same angle, which lets the user recenter his head and have
the new orientation facing forward.

Kinda hard to explain, try it for yourself!

Left analog stick: Walk forward/backward. Strafe left/right.
Right analog stick: Turn left/right.
Left analog click: The Turn Button.
Left trigger: Run.


1.9 - TECHNOLUST

This mode has been demanded by Anticleric over at the Oculus forums for his game
TECHNOLUST.

It's meant as a very simple mode for newcomers. It lets you walk forward simply
by pressing the left bumper or X and goes in the direction you look at. Holding the
right trigger lets you look around freely when walking, and turns you to the
direction you're looking at when you release it.

It also has the FixedAngle functions on the analog sticks.

Left analog stick: Walk forward/backward. Strafe left/right.
Right analog stick: Turn left/right in 45° increments.
Left analog click: 180° turn.
Left trigger: Run.
Left bumper/X: Walk backward.
Right bumper/Y: Walk forward.
Right trigger press: Independent walking/looking directions.
Right trigger release: Sets the walking direction to the looking direction.


2 - Options

2.1 - "Blink" turning

Experimental function to alleviate discomfort while turning with a gamepad.

On [default]: The image goes dark while turning. Simulates the user blinking his eyes.
There's a "deadzone" which lets the user make very slight adjustments
without blinking.
Off [stock OVR SDK]: No change in the camera behavior while turning.

You can toggle this feature by pressing the right analog stick button on the 360
controller or by pressing CapsLock on the keyboard.

2.2 - Turn angle

Specifies by how many degrees fixed angle modes will turn.

For head controlled modes, this is also the angle you need to turn your head
to start turning.

Default is 20°. A minimum of 30° is recommended for the FixedAngleHead mode.

Home: Increases turn angle
End: Decreases turn angle.

2.3 - Smooth Turns

This applies to the automatic turning initiated by multiple functions: (Fixed angle
turns, 180° turns, Turn Button).

You can activate smooth turns if instant changes in the point of view when
turning are disorienting to you. Could cause motion sickness though.

On: The camera rotation is fast but perceptible.
Off [default]: Instant point of view change.

B button or ScrollLock: Toggle Smooth Turns.

2.4 - Turn speed

When using Smooth turns, sets the speed of the rotation in degrees/s

PageUp: Increases turn speed
PageDown: Decreases turn speed.

2.5 - Sensitivity

Analog stick and Head turning sensitivity (HeadStick mode).

PageUp: Increases turn speed
PageDown: Decreases turn speed.



Modified Tuscany demo - Windows - 64 bit

Unity package of the modified OVRPlayerController prefab - SDK 0.2.5
68 REPLIES 68

Anticleric
Expert Protege
"mrgreen72" wrote:
Update 2014-04-22

New version up with the control mode you asked for Anticleric, as well as another new control mode and various tweaks.

See the updated OP.


Can't try it out yet. The new SDK preview totally breaks Technolust. I'll have to wait for them to sort it out. Unless there is an easy way to get it into 2.5c

mrgreen72
Superstar
How does it break it?

You can always try the controls using the modified Tuscany download.

Anticleric
Expert Protege
"mrgreen72" wrote:
How does it break it?

You can always try the controls using the modified Tuscany download.


It breaks it in quite a few ways.
viewtopic.php?f=37&t=7866

When I have some more time I'll see if I can hack what you have out of the scripts and adding it to the older sdk.

mrgreen72
Superstar
I wasn't aware it was this bad. Boone seems to say they'll have a new release soon though.

Anyway, most of my stuff is in OVRPlayerController. It shouldn't be too hard to port my new stuff to 0.2.5. I'll see what I can do.

I probably won't have much choice anyway since I'm planing on integrating my stuff to the Stealth game demo from Unity.

It'll make for a more interesting way to test new controls and might get a little more attention. 🙂

Anticleric
Expert Protege
"mrgreen72" wrote:
I wasn't aware it was this bad. Boone seems to say they'll have a new release soon though.

Anyway, most of my stuff is in OVRPlayerController. It shouldn't be too hard to port my new stuff to 0.2.5. I'll see what I can do.

I probably won't have much choice anyway since I'm planing on integrating my stuff to the Stealth game demo from Unity.

It'll make for a more interesting way to test new controls and might get a little more attention. 🙂


Well, I think I got it all hacked into the old version. Can't figure out how to initiate Technolust mode though 😛

I had to delete the turn button definition also. For some reason it broke everything and I couldn't move.
I can turn strafing sucks mode on and I actually like that as well.

mrgreen72
Superstar
"Anticleric" wrote:
Well, I think I got it all hacked into the old version. Can't figure out how to initiate Technolust mode though 😛

I had to delete the turn button definition also. For some reason it broke everything and I couldn't move.
I can turn strafing sucks mode on and I actually like that as well.


Hmmm this doesn't sound good. The Technolust mode actually uses the turn button functionality.

You cycle through control modes either by using +/- on the keypad or left/right on the 360 controller D-Pad. You kinda need the modifications I made to the OVRMainMenu class to see which mode you have selected, but if you don't, the Technolust mode is the last one of the Enum, so one press left (or Keypad minus) and you should be on it.

If you didn't already, you could try the modified Tuscany demo and compare how it behaves.

Anticleric
Expert Protege
If I just use what's in there I get this:

UnityException: Input Button Turn is not setup.
To change the input settings use: Edit -> Project Settings -> Input
OVRPlayerController.UpdateMovement () (at Assets/OVR/Scripts/OVRPlayerController.cs:389)
OVRPlayerController.Update () (at Assets/OVR/Scripts/OVRPlayerController.cs:169)

Do I need to add "Turn" into the input menu somewhere. I don't see know what I'm missing?

EDIT: Ok.. I added "Turn" as an input with "joystick button 4"
Fixed the error.. but I still can't toggle modes.

mrgreen72
Superstar
It doesn't look like you have the new code. I don't use that button definition anymore.

I probably fucked my package export or upload to Google Drive. Let me check this out.

mrgreen72
Superstar
Fucking Hell. :evil:

These are the old files. The stupid Google Drive agent didn't sync it even though I replaced it locally. Both the unity package and the Tuscany demo.

Sorry about that. I'll get to it as soon as I get home.

Anticleric
Expert Protege
"mrgreen72" wrote:
It doesn't look like you have the new code. I don't use that button definition anymore.

I probably fucked my package export or upload to Google Drive. Let me check this out.


Doh.. yep that's it. Just checked the Tuscany demo also. It's the old one.
Wheew. Ok, well at least I know it's not me haha.