Saturday, 15 March 2014

VRChat: Now with Custom Avatars

UPDATE!

VRChat has moved from this custom avatar solution to using an SDK that has custom rooms, avatars, animations and even interactive elements.  I'll leave this article here for now, but the links are obsolete. You can download the full SDK from http://www.vrchat.net/download and the updated directions are included.

Cheers
Jesse

=========================================================

Howdy All

VrChat is a great VR application (http://www.vrchat.net).  Many enthusiasts and developers meet up in there after Cymatic Bruce's Sunday afternoon stream.  This last week I've had the priviledge of working with it's creator Graham Gaylor on a new feature.  It's one of the corner stones of virtual reality and any cyberpunk offshoot... Customization.

I don't want any limit on who or what I can be in virtual reality.  I like skiing (check out http://snowdrift.jespionage.com) and so I want to look like a down hill skier. Maybe I'd even put my game's logo on my back.  I've used a bunch of character creation schemes in the past but none have the level of customization I want.  Sure, City of Heroes came close but it still had limitations imposed by the developers on what I could look like.

You might say "that sounds good Jesse, but short of a full model importer that's as good as you're going to get!", to which I would reply "Challenge Accepted!".

You now have the ability to use any existing model you like as your avatar in VRChat.

For the first version of this tool you need to have Unity Pro, or a friend with Unity Pro. Hopefully there will be enough interest to expand this feature to other formats in the future.  You'll also need somewhere to host your file so it can be downloaded by the other people who connect to VRChat who can see you.  This should be any normal web hosting environment.

Here's how you make it work...

======================================================================
Reminder, this document is obsolete, download the SDK from http://www.vrchat.net/download and follow the included directions.
======================================================================

Building your Custom Model Package
  1. Load your model into the latest version of unity.  Make sure the import scale and settings are such that the model is the correct height in meters.  It should be about 1.5 to 2 game units tall.  1.5m is pretty short and 2.0m is pretty tall.  For most models your import scale will be 0.01.

  2. In your model import settings, set the rig type to "humanoid".
  3. Instantiate your model into your scene.
  4. Add the VRC_AvatarDescriptor object from the SDK by dragging it onto your player.
  5. Change the view position field until the little sphere is hovering about 15cm in front of your model's eyes.
  6. ===================================================================
    Reminder, this document is obsolete, download the SDK from http://www.vrchat.net/download and follow the included directions.
    =================================================================== 

  7. Now for the technical part, setting up the AvatarDescriptor object.
    1. Add three bones from your player's spine to spine 1, 2 and 3 in order from bottom to top to the Avatar Descriptor (see pic). 
    2. Also add the character's neck.
    3. And the left and right arm.  The arms should be the bones that have a pivot at the character's shoulder.  
    4. Fill in a name for your character and leave the URL blank and you're done.  Here's what the Avatar Descriptor should look like.
  8. Create a blank prefab to hold your model, name it as you wish and drag your model (and the attached script) onto it, creating a prefab of the whole package.
  9. Select the prefab in your asset hierarchy. Select the menu item "Assets/Build AssetBundle from Selection" and save the *.unity3d file onto your computer.

Using your Custom Model

  1. ===================================================================
    Reminder, this document is obsolete, download the SDK from http://www.vrchat.net/download and follow the included directions.
    ===================================================================
  2. Upload your model to a web site that's visible from the internet. 
  3. Launch VRChat.
  4. bring up the console (` key) and type "/setavatar http://<url>/<package name>.unity3d"
  5. After a little download time you should be wearing your new avatar.
  6. You may share the URL of your avatar if you'd like to make it available to other people to use.

FAQ:
  • ===================================================================
    Reminder, this document is obsolete, download the SDK from http://www.vrchat.net/download and follow the included directions.
    ===================================================================
  • Can you please host my model?
    • Probably not. That would likely open us up to legal responsibilities associated with distributing this material.
  • Why Unity Pro?
    • Unity pro is required to build the asset bundles that models are distributed in.
  • Can't you just import my model at run-time?
    • Hopefully soon, but not yet, no.
  • I can see my model on my body, but it's not animating.
    • You probably forgot to set the avatar type to humanoid, or perhaps you're not using the latest version of unity.
  • I'm in the chat room but my body is invisible to other people
    • The other people in the chat may be still downloading your avatar file, or perhaps they are having problems with the link.
  • My model is live and the url is correct but no-one can download it in the app.
    • Make sure you have a valid crossdomain.xml file.
  • Can I make my avatar a naked man or woman?
    • Yes, but please don't. Virtual Reality is in it's early stages and we need to be accepting and tolerant of cultures, genders, sexes, races and orientations.  We're trying to grow a community and everything we do that reduces the speed of that growth will hurt us all. 
  • All those directions look difficult. I only understood half of it. I really want to have a custom avatar though.
    • Find someone with Unity Pro, give them a link to these instructions, your model and $10.
  • Can I host my character on dropbox or google drive?
    • I haven't tested it, but I'm pretty sure the answer is no.
  • Where can I find a model to use if I'm not an artist
    • Try http://tf3dm.com/3d-models/characters or http://3dmodel.domawe.com/ There's a wide selection there.  But let's keep it PG people.  Also some hobbyist models are just technically bad.  Try them out in the default world before you commit to using it in a chat.
  • Isn't the barrier to entry kinda high?
    • Yes, for now.  Hopefully we'll be able to relax some of these restrictions in the near future.