Wednesday, April 25, 2018

Customizing Radical Heights - Part 1

My work on Boss Key Productions most recent project, Radical Heights, focused a lot on character customization. In this post I'm going to discuss the process and creation of a customizable character for Radical Heights.

Having previously worked on Lawbreakers and the Saints Row franchise, much of my time has been focused on creating processes for constructing customization for game characters. The methods described below were no doubt influenced by my past experiences and lessons learned working on these titles.

For customization purposes it is important that your visual goals are outlined initially and the "known" technicalities are addressed before jumping in and creating clothing assets. If you change any of the base character assets during production, you will lose a great deal of time re-working any of the existing clothing assets you may have already created. Understanding the problems up front is key to defining the customization process. You want to minimize the work on the art team and maximize the quality and quantity of assets that can be created.

Character Scale

First and foremost the Character Artist and the Character TD will need to work with the level and environment team to ensure you character height will work properly in the scale of the world. In most cases it is a good idea to keep close to real world units for scale. It's likely easier to create real world weapons that work correctly with your character, if you follow this rule as well.

Play-testing your character in game running around, even early in a rough state will help you identify issues with character and world scale. It's important to nail this down early in your process.

Character Mesh Topology

We started with a fairly standard male mesh until we fully determined how we wanted to approach the semi-stylistic look we wanted the characters to have. Here you can see some stages the proportions of the character went through before we came to our current version. The overall height and proportions didn't have to change drastically from our initial construction. However, some aspects changed enough for us to have to modify the skeleton and in turn adjust and re-export animations.You can also see some of the topology was reduced to minimize the work that it would take to project onto future clothing assets and to lower the polycount overall.

From my past experiences, I found its best to have the character mesh topology to be created in a uniform manner. As you can see here, it's almost a grid-like pattern. This actually makes it easy to define notable landmarks, where clothing assets will generally start and end. If you know the type of clothing and outfits the character may wear, its usually a good idea to make sure edge loops can border these common areas. This will be necessary for hiding the geo of the underlying character mesh at run-time, using a technique I will describe below.

When optimizing the mesh, it's important to remove unnecessary edge loops where the detail doesn't need to project onto clothing assets or the detail doesn't support deformation. You may notice the nipples were removed from the topology as they may only be seen in very few assets and projecting that topology onto most of the clothing would just be too time consuming and wasteful. Only add edge loops to areas that need to support deformation and where the silhouettes of clothing would benefit from that detail.

Character model by Chris Wells

Customization Asset Topology

In the following image you will see how the clothing topology mimics that of the body mesh. This is important for deformation consistency. If the body can deform fine with the existing skeleton then the overlapping clothing assets with the same edge loops, will usually deform the same. You don't want to have issues with the body tearing through the clothing and sticking out. If the topology was different between the meshes then you would likely have to add bones to correct for the tearing and intersecting issues as a result. This is not ideal when you are creating a game that needs to run as optimal as possible and extra bones increases processing time. Fixing visual issues with solutions that would hinder performance is not the best route to take.

Clothing meshes mimic the body topology

Character UVs & Mesh Hiding

The first uv channel is fairly standard as you can see here. The second uv channel is what we use to hide the faces of the body mesh. We first identified the common clothing areas and broke them down into subsections depending on the types of clothing. Next we generated uv shells based on those subsections and smashed the coordinates of those uvs to a singular value in the UV space. This coordinate can then be mapped to a game-side data file and referenced to hide when marked up with corresponding clothing assets. The material on the body skeletal mesh will have a technique that can then hide the triangles, or set them to not render when the coordinates have been flagged to be hidden.

For example, if the character is wearing a shirt, we would flag the first couple of coordinates being selected below to hide, ( U 0.1, 0.2, 0.3 ) Keep in mind the mesh assets need to be created so that the overlying mesh crosses over the edge boundaries, so that holes in the body will not be visible, when the body mesh faces are hidden.

UV Channel 1
UV channel 2 coordinates used to hide body mesh faces in game.

Customization Parts

When determining how complex you want your customization system to be you have to understand the amount of work you will be taking on. In Lawbreakers we did full mesh customization. This is essentially a mesh swap for each version of customization you want to have for the character. The creation is straight-forward to build as long as the meshes follow the conventions of the original character. The in game system is not complex at all, as it is just a mesh reference change, so the programming effort to implement this system was minimal.

For Radical Heights we decided to do a relatively basic "Paper Doll" setup. We researched the type of clothing we expected the character to wear and defined the most notable areas that we want to be able to customize so we could plan our asset creation accordingly. On the surface this looks easy to create for but it can spiral out of control very quickly from asset creation to in game implementation.

Clothing Boundaries

The things to be aware when creating the clothing, are asset parts that cross the boundaries of other parts and the volume/thickness of those assets. For example, if you create a shirt and pants with the same thickness and the shirt crosses over the boundary of the top of the pants, you will get an unwanted intersection. Determining how to create these assets consistently while avoiding these issues need to be decided up front.

Clothing Layers

Layered clothing, such as the UpperBodyArmor here, has to work relative to varying levels of volume/thickness of the upperbody assets. To correct for this instance, we have a morph target on the bulletproof vest mesh, that can be adjusted per upperbody asset at run-time. Addressing a singular asset in this case to correct an issue, works out far better than generating morph targets for each and every shirt asset. Always look for the cheapest way to solve a problem.

Clothing Materials & Draw Calls

Radical Heights can have up to 100 characters and the body mesh for the character already has three draw calls ( head, body and the eyes). For customization purposes we have separated out the clothing to specific parts, and each part on its own becomes a singular draw call, this means by default a character can be upwards of ten draw calls. This is not a great start, which means we need to keep the material count low for each clothing asset. We try to make sure they sure each asset has only a single material and two in the worst case.

Customization Fixes

When you have assets crossing boundaries or overlapping other parts you also have to handle how you want to deal with other crashing issues. In extreme cases we will hide the offending assets, large helmets will hide the hair parts. In other situations, in which we identify a common issue, we will create named morph targets to fix problems. Similar to what we did with the armor we will create a common morph target for each hair asset when a standard hat is enabled. This morph target will scrunch the hair down to work better with the hat. We cannot create a custom morph target for every hat asset, that amount of work and data loading would be ridiculous. Therefore, when we create the hat model, they fit to a predefined location on the head, so that a singular hair morph will work with every hat.

We did later determine that we wanted to have headbands for our characters to customize, as they fit the time period and aesthetic we were going for. This meant we had to circle back and create new morph targets for each of the hair assets to accommodate the headband location. This was an unknown initially but it was important for us to implement this specific data fix for each asset.

These rules for how hats, headbands and every other customization part can work together are important in defining creation guidelines. These guidelines are necessary to prevent data correction bloat from permutation issues. Understanding the volumes and boundaries for each asset is helpful to reducing these data fixes and ensuring compatibility with future assets.

  Character Skeleton

Radical Heights is an online Multiplayer game with up to 100 players. This means the character itself has to be fairly simplistic in terms of run-time complexity. The number of processing skeleton joints should be fairly small even at the lowest Level of Detail (LOD). The deforming corrective deforming joints start to drop off quickly as the character starts to LOD out. The twist and corrective joints are usually the first to go, ultimately leaving only the primary body joints, when deforming characters in the furthest distances on screen.

The supplemental joints here are comprised of joints used for IK hands and feet as well as joints only used when the character is in First Person/Aim Down Sights (ADS) mode.

  Character Rig

We continued to use Epic's ART tools, created by Jeremy Ernst, to construct the player character rig for animation. The tool set allows you team to hit the ground running with a fully animation friendly rig and accompanying animation tools. I use most of the rig construction out of the box with additional custom rigging on top to satisfy our specific needs for animation and deformation.

Shared Skeletal Mesh

On Lawbreakers we chose to have two separate skeletons for First and Third Person. This required us to duplicate the customization assets work done by the character artists and double the amount of data that needed to be loaded by a character in game. The fidelity of the assets had also changed enough to necessitate this choice for that project. However, the speed at which we needed to create assets and the bandwidth we had on Radical Heights, meant we needed to be a bit more conservative and efficient with our time in asset creation. By having a single skeleton for first and third person it meant we should only have to create the clothing assets once and the same assets could be visible for both perspectives in game.
I modified the rig and skeleton hierarchy to be able to handle both aspects for animation purposes. The core of the third person skeleton remains untouched aside from various supplemental joints for controlling the camera and upperbody pitching in first person. This is handled by the rig using a single switch that modifies the visibility of various animation controls and changes multiple constraints that affect the behavior of the rig.

  Character Animation

In First Person, the camera is positioned relative to the head location, so we need to move the head out of the way for animation purposes. In the animation file we just rotate it backwards. In game we also hide the faces on the head and parts of the torso, using the UV method mentioned above, to prevent the them from rendering in the players view.

Animation by Ryan Palser

Checking Animation with Clothing Assets

The pipeline and tool set I created to work with all of the assets on Radical Heights, allows the animator to view customization items in their scene and correct poses where needed. Not every item will work perfectly with every pose, but this gives the animators the opportunity to easily address some of the worst cases scenarios as they are bugged by our QA team.

Animation by Nick Maw-Naing

Coming up Next

In the next post I will be going over the customization tool used by the character artists to setup assets for export and implementation in game.

Part 2

No comments:

Post a Comment