Blog

Creating a real-time game character.

I wanted to show how I go about creating characters for computer games, so I created a bust of a fictional character to show you how it can be done. In this example I use 3ds Max, ZBrush and Photoshop, but the workflow is pretty universal and would work for most game engines and 3D software.

I have worked with real-time rendering for the past 10 years, but it have always been inside some in-house developed engine, like IO Interactive’s Glacier engine. So I thought I would try to play around with the real-time DirectX® 9.0 viewport render options within 3ds Max, just for fun.

Step 1: Getting Started

Gather as much reference material as possible, find pictures online of the clothing you need to model, take your own pictures if possible. Gather ideas and inspiration, great reference is priceless.

The idea for this character was to create the result of an Army experiment creating low cost amphibious mutants soldiers. Original eh? 😉

Step 2: Modeling

One of the more fundamental parts of current generation games is normal mapping.
To create normal maps we need the character to be built in a high polygon and a low polygon version for rendering in-game. I prefer to start by creating a somewhat detailed model in 3ds Max of the various parts that make up the character.

In 3ds Max I define the basic proportions and I model the parts that I find are more difficult to do in ZBrush like seams and non-organic parts. I try to keep the polygons evenly distributed across the model and avoid triangles. At this stage I don’t bother with UV mapping.

Once I’ve modeled all the parts I put them together in Zbrush and start sculpting.

Sometimes it’s a good idea to exaggerate the details in ZBrush to make sure they stand out. Subsurface scattering shaders and normal maps tend to washout the detail a bit, so don’t be afraid to really go for extremes.

Result of the sculpting:

Turntable Video:

Once I’m happy with the ZBrush sculpture I will then export the lowest subdivided version from ZBrush into Max and use that as a base for my low polygon in-game model. This way I will get a low-poly model that have the exact same proportions of my high polygon model which will help a great deal when generating normal maps.

I then reduce the number of polygons; how low you have to go depends on the game you are developing for, in this case I have reduced to about 13K triangles. I always keep in mind that the model needs to be animated, so I make sure to have a good edge flow and keep detail where it’s needed.

Step 3: Creating UV coordinates

Unwrapping a character is usually a bit of a chore for game characters because you want to make sure you make best use of the texture space available. When unwrapping you also need to think about where your seams are, certain shaders and normal maps can be a bit temperamental so put UV seams where you can hide them. Use the natural seams in the model and for organic parts put the seams where they are least likely to be seen.

Keep a little bit of space for edge padding/extrusion between all elements, otherwise the parts will start to bleed together when the texture is displayed in lower resolution with mipmapping.

Further more, try to keep all the UV coordinates same relative size to avoid parts of the character looks more low-res than others.

To make UV mapping easy there are a bunch of tools and plugins out there, personally I make good use of UV Master plugin for Zbrush when I Unwrap and just tweak using the tools that comes with 3ds Max.

Step 4: Creating and baking textures

When you have a high polygon model there is a bunch of ways to help get great textures for your character. I will usually start by painting basic color map inside ZBrush directly on the high polygon model.

You might also want bake out Cavity, Ambient Occlusion maps to help you create your texture. You can bake these maps out from inside ZBrush using Multi Map Exporter Plugin, or do it inside 3ds Max using the Render To Texture option.

Here is a examples of maps I baked out to create the skin texture… color, ambient occlusion and cavity map.

These maps can be a great help to get started on the textures, and once your normal map have been generated it can sometimes be useful to multiply a little bit of the the green or red channel into your diffuse map to further enhance the details. Be careful though, baking in too much information will work against the in-game lighting and shadow.

Step 5: Generating normal maps

In this example I generated the normal maps using 3ds Max’s Render to Texture option. The most important when generating normal maps is that your renderer uses the same tangent space as your normal maps were created for. With Hotfix 4 for 3ds Max 2011, normal maps created with Render to Texture now renders correctly within the viewport using DirectX shaders.

It’s not always easy to get great normal maps in the first try, so be prepared to go back and forth tweaking the low polygon model, UV coordinates until you get the result you want.

Some fine details like rough fabric I don’t paint into the ZBrush model, so to get that detail into the normal map I use Photoshop. I simply create the fabric detail as a 2D map and use NVIDIA Normal Map filter to convert that to normals and overlay that into my final normal map. Other tools like ShaderMap and xNormal have similar options.

Here you can see the final maps I created for the Shirt and vest:

Step 6: Viewport render setup

Using DirectX shaders in 3ds Max is very easy, you simply assign a DirectX shader to your model instead of a regular material and it’s renders real-time in your viewport. However, getting it to look good is a completely different task all together.

First of all, DirectX shaders don’t work with the Scanline or Mental Ray renderer. They only work directly in your viewport. They are also highly dependent on your graphics card, particular if you want to render with hardware shading.

The shaders that come with 3ds Max are not very good… instead you should look for some of the 3rd party tools and shaders out there designed specifically for this. Like the 3point Shader, Shader FX or if you feel adventurous and know a bit of programming FX Composer. This way you can build a shader to match your needs. It’s hard to find one shader that does it all, so be prepared to create several different ones.

Final words

Once you you’re happy with the result, it’s time to setup a skeleton, face animation, blending normal maps, LOD and all the other stuff that makes it actually work inside a game… But I’ll save that for another time.

Thanks for reading, and please leave a comment below if you have questions or remarks.

Awesome stuff. The character looks fantastic. I’ve played a ton of video games and he looks great. If I can ever complete Step 2 and make a decent model, then I would use the rest of your tutorial. But the modeling is very difficult

Hi!
You write that you take the lowest subdivided version of the sculpted character back into 3ds Max. Do you then just reduce the unneeded polys from the ZBrush model you imported to Max or do you build a new mesh on top of the ZBrush model and trace the from of the ZBrush model? I believe this is called re-topology? It has always confused me a bit.
Thanks!

Hi… Good question… both answers can be correct… sometimes the lowest subdivided mesh from Zbrush is no good… and then I’d do a re-topology ish solution where I build a new mesh on top of the ZBrush model, a bit like I did in this Jedi video here: http://youtu.be/N-bBYscPnJk

However, if the lowest subdivided ZBrush mesh is good, I simply do as you say and bring it in to Max and remove or add polygons where needed

Ok, I think I got it now. Thanks. When I first heard about re-topology and such I thought the process sounded long: create a base mesh in Max, then use it to sculpt the high-poly and then again do another version of the mesh back in Max once the sculpting is done. It’s logical process but sounds a bit funny that you basically need to do 3 different versions of the mesh, a low-low poly, a high poly and then a regular “low” poly before the character is done.

Thanks for the quick reply! Hope to see more great tutorials and tricks here.