Outfits Feature Lets You Save Your Unique Getups

September

27, 2013

by Merely


Archive

Character CollageCustomizing your character has become a significant part of the ROBLOX experience. The catalog is overflowing with hats, clothing and other accessories, all of which you can combine in your own way to add a personal touch to your character. But let’s say you have a group uniform, a nice suit, casual Friday attire and battle armor, and you want to switch between your vastly different looks on a whim.

Our new outfits feature makes it a breeze.

You might be familiar with the Outfit Saver extension I wrote for Chrome. The extension enhances the Character page by allowing you to save combinations of ROBLOX apparel and quickly grab them from your virtual closet. Having seen the demand for this functionality in the thousands of installs, I approached my internship at ROBLOX with the goal of making outfits an official and secure feature of the website. Now, after wrapping up my summer at HQ, the feature is live on ROBLOX.com.

Outfits

From an outside perspective, the outfits feature is simple. We’ve added a tab to the top of the Character page that lets you swap between viewing your current wardrobe and your outfits. To create an outfit, swap to the Outfits tab and click “Create New”. This will create a new outfit based on whatever you’re wearing at that time. You can save up to 50 outfits.

To change outfits, simply click the thumbnail of the one you want under the Outfits tab. You can use the drop-down gear to update, rename or delete an outfit. If you sell a hat (or remove any piece of inventory) from an outfit you’ve created, it simply won’t appear on your character when you wear that outfit.

Designing the interface of this feature – what you see and interact with – was the easy part. But far more work happened behind the scenes, particularly in regard to saving outfits, which consist of hats, clothing, gear and body colors, to the database.

In the past, ROBLOX saved your character’s body colors in XML format. Whenever you changed your body colors, we grabbed the XML file, edited the relevant information, then saved it back to the cloud. This was resource-intensive, but it worked because at any given time, we only needed to store one record of your character’s particular combination of colors. Originally, I planned to use this approach for saving outfits, but was encouraged to take the engineer’s path instead and find a more efficient solution.

Outfits include body colors, and we store a thumbnail (generated via a database, as you may recall) of your character wearing each one, meaning without a change we’d potentially end up storing many XML files per user. That’s not especially scalable. Instead of relying on XML, we’ve transitioned to storing body colors in a database. On top of that, each combination of colors has a unique record and, in the case that multiple people have the same combination, we draw on that same record. Scale!

Fun fact: there are 64 shades of colors available for ROBLOX characters. There are six body parts that can be colored individually. That means there is a total of 68,719,476,736 (64^6 or more than 68 billion) unique combinations of body colors.

Body Color XML

An example BodyColors XML file.

Coming up with a scalable database design to support this feature was the hard part. I entered my summer at ROBLOX with no database experience other than reading one or two books, and left with real insight into the process of creating something that works on a website with millions of daily hits.

From myself and the Web Team, enjoy the outfits feature. There’s more we’d like to do with outfits – for instance, making them visible in the inventory, sharable among users and changeable in-game. As it stands, we hope the feature makes it easier for you to save the combinations of attire that make your character unique.

Character Collage