How to add a custom VR controller to the Steam WorkshopI had...

20 June 2016, 6:49 pm

How to add a custom VR controller to the Steam Workshop

I had some serious trouble getting the Steam Workshop stuff working for VR, and I’m likely not the only one.

Install Steam VR on your system (even if that computer won’t be running your VR rig) It’s OK. It will allow you to edit your workshop content.
I found it easiest to start with a controller that was already built, so download one like the horned controller and ‘Browse Model Directory’ and search the folders until you find it. I then copied this folder elsewhere and overwrote the content.

Run Steam VR and right click on the label to get the menu, then go to either ‘Upload New’ or ‘Modify Existing’

The trickiest bit here is where it asks you to specify which model.
I mean I’ve got a bunch!
What it actually wants is for you to pick an ‘.obj’ file which shares the same name as the ‘.json’ file which in turn specifies all the model names that are actually loaded.

The Thumbnail File should just be an image prepared to show what whatever you’re making will look like to those that might want to download it. This is what people browsing the workshop will see.

This is a similar process for lighthouse and environment models.

Some gotchas I’ve encountered:
Don’t miss that comma in the json after ‘thumbnail:”thumbnail.jpg”,”
Bad ’.json’s are bad.

Material (.mtl) files with no texture don’t seem to work.
All textures have to be in 0-1 uv space. mtl -clamp off seems to just break. Since there’s not lighting anyways, environments need to have all the textures and lighting etc all baked in. This is what’s messing me up from getting the contraption stuff done right now as we have so much custom shader stuff, setting up a bake in Maya is a bit tricky.

I’m sure I’ve broken and failed to get models working in 20 more ways, but this is the majority of how I’ve dealt with this so far.

Our VR Development Setup

2 May 2016, 2:06 pm

We’ve had a lot of people writing in asking what we stream with and how we’ve setup our room for VR development. Let’s do this with a nice cellphone shaky-cam video!

The room is approximately 4m x 5m large, with a playable space of around 3m x 3m. 

Parts list:

Red “3rd Hand” poles
- C-clamps for mounting
- Lumix DZ1000 camera
- Battery-door clearance plate for camera
- DC power adaptor for camera
- HDMI to Display Port adaptor
- AVerMedia Capture Card
- Rode swing-mount microphone arm
- Studio Lighting (not pictured in video)

Follow-up video coming soon will show the room in green-screen mode.

How we made a stretchy goo ball.What should you do in a game...

24 March 2016, 1:01 pm

Stretchy ball in action (editor)

My hierarchy setup

Script interface

hang time curve

How we made a stretchy goo ball.

What should you do in a game when you have a ‘ball’ that you can’t allow the player to throw away? 
Well the obvious thing is don’t let the player throw it.
Everybody ‘wants’ to throw it, so all our solutions to avoid doing that were unsatisfying.
What we need is to let the player think they’ve thrown it, without letting them actually do so.
What we decided to try was to make the ball stretch out and snap back to where you released it.

How do I program the physics of that though???
Well, you don’t. Lie cheat and steal. That’s what tech-artists do best! We only want to do this on the art, note the collision, snaps and greater part of the object don’t actually move.

-Cheat :
So we’re going to point the ball in the direction of the throw. You should be able to convince your friendly local programmer to feed you a vector indicating the magnitude and direction of the throw.  Hint: In unity you can ‘set’ the `.transform.forward` parameter of any object!

-Lie :
So a big advantage in implementing this is that we’re using a  uniformly coloured ball. If you aren’t, then you could always do some uv-fakery, but that’s tougher.

In Fantastic Contraption, objects only throw when you’re above a certain velocity, so that’s going to be our min throw. We’ve somewhat arbitrarily set that to ‘25’ and I also arbitrarily set max throw strength to be 4X the min.

Steal : pretty simple code to get the values from the Animation curve and settings. (ditto for throw distance)
protected float GetThrowTime(float magnitude) {
 float normalizedMagnitude =  (magnitude - Globals.settings.throwStrengthTrigger) / (maxThrowStrengthForTime - Globals.settings.throwStrengthTrigger);
 float throwTime = Mathf.Lerp(minThrowTime, maxThrowTime, throwStrengthTimeFalloff.Evaluate(normalizedMagnitude));
 return throwTime;

AnimationCurves are awesome for adjusting interpolations for anything and everything. I’m adjusting the time the stretch takes, and the distance it travels based off these curves and min and max values set below them.

My tween uses the curve shown above, and my custom tween system to move the joint furthest out on the edge of the ball. You can see there’s a good ‘hang time’ section in the middle there, and a nice little ‘wiggle/ settle’ at the end.
There’s also a scale tween on the second joint that mostly does stuff during that big bump which is the major part of the throw.
You could use a Unity animation I think, but setting the far value and making sure scaling sets it to be the right time length might be a bit of work.

I also have an adjustment based on the size of the ball so that giant goo balls barely stretch out when thrown.

It’s a pretty ‘special case’ solution, but it might spark an idea or be useful to you somehow!
Any questions or comments, hit me up here, or on twitter @mrlinds

For more news see the Radial Games development blog.