Character Customization

The votes are in. The Council have passed a unanimous motion - you are to wishlist KING OF THE CASTLE, effective immediately. Do not risk their wrath!

Today we’re going to talk about the character customization system.

Normally, when you join another player’s game as a Noble, you get automatically assigned a randomly-generated Noble. However, a player who has bought the game is able to uniquely customize each of their Nobles for the five different regions. 

Now your unique character can show up as a guest star in streamers’ stories!

(By buying the game, you will also unlock extra hair colours, accessories and outfits.)

…And why not customize your family shield, while you’re at it?

And of course, any player who owns the game can customize their Monarch as much as they like.

Technical Details

To get some insight into the work that’s gone into our character customization, I rode out into the programmer paddock and lassoed one of our finest coders, Dave Lewis.

Let’s see what he has to say!

“The customization system in KoTC is made up of hundreds of pieces of artwork with dozens of color options; the Monarch alone has nearly two trillion customization combinations!

Each piece of art needs to be positioned correctly on the x and y axis, but also needs to be assigned a layer in order to appear above or below certain other pieces. Hands need to appear above outfits, eyes need to be above the face, eyebrows need to be above the eyes, hats need... Well, hats cause problems.

Hats often need to appear partially in front of the hair, partially behind the hair, and also need to affect how the hair appears. We can't have hair peeking out the top of the hat, and hair below the hat should flow differently. Early on in development, we had a lot of hairstyles that didn't obey the laws of hat physics!

The solution to this is simple yet effective: we group our hats into hat-shapes, and then assign each hat-shape a mask. This mask defines not only the outline of the hat, but also the shape the hair should take below the hat. Masks can be placed on any type of customisation in KoTC and each mask can define what layers should and shouldn’t be masked by them. Once the mask is applied to the hat, we get the following much more preferable result:

To enable our amazing art team to create (and iterate on) all of these avatar customizations without worrying about a difficult and timely integration process, we needed a way to efficiently take their artwork and get it into the game without any manual data entry. 

But to turn each piece of art into a customization, there's a lot of data we need to infer;

For starters, there's the layer, masking, and positioning information for each piece as mentioned above. But also the art must be grouped up into customizations such as eyes, hairstyles, and hats. Each customization is often made up of multiple pieces of artwork.

Once grouped, a customization must be assigned further data - should it be locked to a specific region, or is it a premium customization? Is it masculine or feminine, what is its default color, how should it appear in the customization screen? What type of customization is it? 

All of these behaviors and rules are defined using a naming convention the artists apply to each texture in photoshop when creating them. This is then decoded during the import process and all the necessary rules are applied automagically. This is absolutely necessary - nobody wants to come in after the import and start manually tweaking things. That just leads to errors and inconsistencies.

The naming convention includes all of the following information:

⦁ The Layer the asset should appear on. 

⦁ The type of customization.

⦁ The id for the specific customisation.

⦁ Whether the texture should be shared across multiple customisations.

⦁ What region the customization should belong to,

⦁ Whether the item is premium

⦁ The associated gender of the customization

Our final and unwieldy naming convention: type[-commonLabels]_[region]group[-p/h/s]_layer

Once all the customizations are in the game, positioned nicely, colored correctly, locked to the correct regions, and displayed on a character, we want to apply an outline around the outer edge of the character.

Obviously we don't want this outline around each individual customization piece (or we’d see all the constituent parts, destroying the overall illusion!). So first we position all the customizations on a separate canvas with its own camera, we then take a snapshot, and apply that snapshot to a render texture - finally we apply our outline shader to this render texture and display this final image in the game.”

Thanks Dave!

Looking the Part

But obviously, all this technical implementation would be useless if we didn’t have any art to smash together. Luckily, we have two of the best artists in the biz - Emily Cheeseman and Mark Skinner!

I’ve delved into the depths of the art cave and tempted Em out into the light with some new paintbrushes. Listen closely to her wisdom, for she will soon be forced to hide once more from the eye of God:

“One of the first things we established about the game’s general aesthetic was the character art. A colorful, geometric style with bold graphic details and a modern, minimalist take on fantasy fashion became the hallmarks of the game’s visual design with the goal of establishing an art style that was instantly recognizable as ‘KOTC.’ Each of the Kingdom’s regions have their own visual tropes, fantasy clichés, and historical inspiration (maybe you can guess them!) as well as their signature color palette; from there it was about adding variety.

For randomly generated characters and NPCs, we wanted to create enough of an assortment of hairstyles, clothing, and features to make each character look interesting and different, as any eclectic Noble should. For players customizing their own characters, we wanted to represent a spectrum of shapes, sizes, gender expressions, fashion sensibilities, and taste in weaponry. We embrace the whimsical anachronism of having an axe-wielding Chief in furs appear alongside a dour-looking Count in a dramatic opera cape; Celest Ath is a land of many quirks, but it is nothing if not well dressed.”

Thank you Em! That concludes our look into the character customization side of King of the Castle - but expect to hear more at some point in the future, because we have big plans for expanding this system!

Previous
Previous

The Evolution of KING OF THE CASTLE

Next
Next

Schemes and Rebellions