Pipeline and Workflow for Creating a Next-Gen Game Asset (Shotgun)

November 9, 2010 in 3D, AutoDesk 3DSMax, Featured, Game Artwork Design, Photoshop by admin

Pipeline and Workflow for Creating a Next-Gen Game Asset

In this tutorial will be exploring one of many production pipeline methods used for creating a next-gen game weapon. This process can easily be adapted to be used for any type of game asset, such as props, characters and environments.

This tutorial is designed for intermediate to advanced users and assumes that you have at least a fair understanding of each of the programs used. We will cover the entire process of creating a next-gen game asset, but I will not be going into a lot of detail for each specific step, just giving a general overview of the workflow involved. So let’s get started.

Author: Angel Trudeau – AngelTrudeau.com

Angel is an experienced and award winning 3D artist with over 7 years of industry experience. He specializes in hard-surface and environment models, with textures, for use in next-gen, current-gen and casual games. After graduating from the Art Institute of Colorado, Angel has been working as a freelance artist producing many illustrations and game assets for over 9 titles. Some of his most recent game releases were ARB Studio’s SteamPunk MMO and Buck Hunter for the iPhone.

Tutorial Details

  • Program: 3DS Max 2011, Zbrush 4.0, Xnormal 3.17.3, Photoshop CS3
  • Difficulty: Intermediate to Advanced

Scripts and resource files:

Step 1: Concepts and Modeling

I generally start with research and concepts, but for this weapon, the client wants a next-gen weapon that is similar to the Browning automatic shotgun, but only 5k triangles or less. Its to be used in an iPhone game, so it doesnt have to be super detailed but have enough detail that it will look realistic in-game. To avoid any copyright infringement for the weapon we will need to make some small changes to the body of the gun, but nothing to drastic.

Since this model is going to be based of a real-world weapon I don’t really feel the need to do concepts but I did do a quite of bit of extensive research to ensure I had good references of the shotgun. I have included the reference images I used for this in the zip file, so have a look.

Once you have had time to look over the references and get a good understanding of the direction we need to go, then you can start the modeling process. Over the course of this tutorial we will actually make several meshes. The first mesh we will create is the game model, followed by the base mesh model and then the sculpted high-rez model.

On the game model the mesh will appear without any smoothing and the mesh will be highly optimized for use in a game engine. The game model will also have all the UVs, whereas the base mesh doesn’t need to be UV’d.

On a base mesh you have to consider a few things: One of which is the fact that the base mesh will be smoothed to high degrees, so any hard edges we want to keep hard, needed to be preserved. It is also extremely important that the base mesh has an even poly distribution because this insures that during sculpting all of the mesh will have even resolution. If the poly distribution is uneven, with some areas having a high density of polys and other areas with low density, then sculpted strokes and details will not appear uniformly smooth. (more on this later)

– Basic Form

We start the basic form using primitives, then convert them to editable polys and adjust the shape further.

– Creating the Game Model

After creating the basic form, we can begin adding in details, starting with the largest details first and working our way to the smaller details. Once the main details are modeled in we can then optimize the mesh, meaning that we remove all unnecessary edges, vertexes and faces. Some edges may appear as if they could be removed at this stage, but when dealing with a normal map it is important to have a few extra edge loops around tight edges. This will ensure that the normal map displays correctly in the end. If after applying the normal map to the model you have dark areas around some of the edges, you will need to add in some extra edge loops to clear them up. Eventually we should come up with something like this:

– Creating the Base Mesh for Sculpting

For the base mesh, we will start by cloning the game model. It is important to ensure you don’t move either the game or base meshes at this point, as they will need to be aligned in order to get a proper projection for the bake later on. You will see why this is when we get to baking the normal and using a cage.

Once you have cloned the mesh we can start redoing the topology. The goal here is to ensure that there is a fairly even distribution of polys so that we maintain our edges and get a uniform sculpting mesh.

– Exporting Base Mesh Pieces

When exporting it is important to break the model up into as many separate pieces as possible and export each of those pieces individually. This serves two purposes; first is that we will then be able to import each individual piece into Zbrush and assemble the weapon again using sub-tools. This gives the ability to work with and edit each piece individually, so we have a lot more control. The second reason for doing this has to do with the baking process later. If you were to try and bake the whole weapon by itself, without breaking it up, then you would get many different errors on the normal map due to overlapping mesh pieces and lighting of those pieces. To ensure that you get a good clean bake it is vital to break up any mesh into as many separate pieces as possible.

In total I had 7 pieces to export for this mesh, which were all exported as Obj’s and using the ZBrush preset within the exporter.

Step 2: ZBrush Sculpting

This part is fairly simple because we don’t need to do much, we mainly just need to add in the grip and wood patterning with a little bit of damage.

– Importing, Sub-dividing and SubTools

Import each of the pieces that you previously exported from max. Then draw the main body mesh onto the canvas. Open the sub-tools menu and append all of the other pieces you just imported. All the pieces should appear in their proper position and now you have total control over each piece.

Now we go through and subdivide each individual sub-tool. For pieces that I need to add a lot of detail to, such as the wood stock and grip, I will subdivide up to a level of 6, whereas I will set all the other sub-tools to 4. You can always add more levels later if needed.

-Sculpt in Details

A few things to keep in mind when doing these kinds of details is that a normal map won’t pickup really fine details, so it is important to over exaggerate the details you do want to come through on the normal. For all those finer details we will use the specular map to draw them out.

Now we can start on sculpting. We use masks, a little bit of projection master and some free hand sculpting to get the look we are after. I start by adding the wood grain and build up from there.

We then do the stock and grip detail using projection master again.

Add in any other detail you want. You take the details as far as you want at this stage, down to the finest detail. Just remeber that the normal map won’t pick up really fine detail and you must exagerate any detail you do put in for them to show up reasonably. For this model I just threw in a few basic details like some screws and finsihed the front grips detail, but you could also add in things like lettering on the barrel, some etching details
on the sides, wear and tear on the barrel end, etc…

– Export Pieces

Export each sub-tool individually and at their highest sub-division level. Although if some pieces are just has too many polys to export, then you may need to use decimation master to lower the poly count without losing detail. Decimation master is a great way to get a super high poly model down to a reasonable and workable file size, but once an object has been decimated it can no longer be edited, or sculpted on, so only use it once you are sure that you are finished with the sculpting stage.

Step 3: UV the Game Model

– Textools – http://renderhjs.net/textools/

I use textools by Renderhj for several reasons, but mainly because it helps simplify the UV process quite a bit. I won’t go into much detail on all the options of textools, but you can get plenty more info on them if you go to Renderhj’s website. I do highly recommend looking it all over though as it is a great help with the entire UV process.

– Flatten

First you will need to break up the UVs and there are a variety of different ways to do this. I like to do it one element at a time so that I don’t get cluttered up. I also always make sure that Normalize map in not selected in the Unwrap modifier, so that all faces stay their true dimensions. Of course this means that the UVs will be very large and will need to be scaled down at the end, but it makes reassembling them a lot easier in the end

– Stitch and Align

Once the element(s) have been flattened you can go about stitching together all the faces. I use the Textool Linear align tool to straighten a lot of edges after stitching. You want to ensure that all straight edges on the mesh stay straight in the UVs. To align any uneven edges, select the edge(s) or vertices and click the linear align button. All the selected should snap into a straight line.

– Pack

Once all the elements have been flattened and stitched back together it is time to pack them and we want to pack them in such a way that we maximize the UV space and use as much as possible. We also have to consider that some of the pieces of the model may be a lot more visible then others when in-game, so it may be prudent to give those pieces more texture space.

Textools has several features in it that allows you to set texel and pixel density for specific UVs, which is very handy for larger projects, but for this particular weapon I just visually note which pieces I want to get more texture space and scale them up accordingly. You can find more about how to set the texel density by going to RenderHjs homepage

I then select various pieces and click the pack button. I then manually move and arrange each of the pieces to fit them into a square region. Once I am happy with that, I select them all, uniformly scale all of them down, and move them into place within the UV area.

If you have any mirrored UVs you will need to offset one of the mirrors by exactly 1 unit to avoid any baking problems.

Step 4 – Baking Normals and AO

– xNormal – http://www.xnormal.net/1.aspx

xNormal is by far the best when it comes to baking your normal maps. It produces much better quality bakes then even max or Zbrush can do, so that is why I use it and recommend that you do to as well. It is free to download and use, so there is no reason not to. You can do the bakes in Max and Zbrush if you don’t wish to download it, it is a similar process to baking AO maps, which I will go over later, but xNormal is less prone to baking errors and has several tools that aid in cleaning up any errors that do occur.

– Importing and Baking Individual Pieces.

This part is pretty simple and repetitive as we will use the same process for each piece of the mesh. I will go over it in a little more detail, but feel free to explore xNormal more thoroughly on your own.

Start by loading the high definition mesh first. Click the High definition button on the right. Right click anywhere in the left screen area and choose Add Meshes. Locate and select your high poly mesh. Now scroll over to the far left and select Averaged normals from the drop down menu.

Now click the Low definition button to the right and load the low-rez mesh the same way as the high-rez. Scroll to the left and change the smoothing to Averaged again, and also be sure to select Cage. The cage is important for getting a nice smooth normal map. It tells the program exactly how and where the high- rez details will be projected onto the low-rez. We can create a cage in 3ds max and import it in if we wanted to, but xNormal gives plenty of controls for creating and editing the cage.

To access the cage we need to use xNormals 3d viewer. Click the 3d viewer button on the right and then click Launch Viewer.

The controls in the viewer are much like a FPS game and uses the same keys to move forward, back and side to side etc…You should see your object(s), but you may have to orient the camera a bit to find them.

Turn on Show cage and then Edit cage. Several sliders will appear which will enable you to push and pull the cage mesh so that it fully encloses the other meshes. You want to make sure that the cage does not penetrate the high or low-rez meshes so that it can project the details properly. When you have finished, click the close button.

Now go to baking options. Set your output file and make sure normal map is selected on the left. Set your desired map size and edge padding to 2 with a bucket size of 16. Click generate map. If there are any glaring errors you may have to adjust the cage more to get a better bake. In the end you should get something like this:

– Compile in Photoshop

Repeat the same process for all the other pieces and once you completed them you will need to assemble them in photoshop.

Some people like to just copy over each piece into one file and set them all to overlay, but I prefer to cut out the excess blue areas using the saved alpha because then I avoid the possibility of losing some of the detail in the normal map. To do that you need to copy the image and the alpha over to the master file, then use the alpha to cutout any excess. By copying it over like this you ensure that the image is exactly lined up in its position. If you were to cutout the excess blue before copying over then you would have to manually place the piece which can lead to various headaches later.

Once all the pieces are assembled, merge them into one layer. Now go to the green channel for the layer and select it. Press crtl-I to invert it. You do this because otherwise the normals will display funny in max. You can invert the green channel in Max as well but its just better for the development team later if it is done in Photoshop.

The last thing to do here is to normalize the map. This makes sure that the normals of each of the pieces is cohesive. xNormal makes this pretty easy and installs a Photoshop plugin for doing just that and the plugin should have installed along with it. Just go to Filters>xNormal>Normalize normal map. You can also use the NVidia tools plugin as well if you have it.

Now apply the normal map to the game model and turn the bump value to 100. Click render and you should get something like this:

– Baking the AO

We will bake the Ambient Occlusion (AO) map in max using the render to texture feature. There are several ways to bake AO maps and some of those ways a fairly involved, but for our purposes we will stick to the quick and dirty method.

First we set up a very simple lighting rig. Basically you just want enough light to tell the renderer where the dark and light spots are, as well as bring out the normal map. Do a few viewport renders to ensure you got the shading the way you want it.

Next go to the Render to Texture menu. Add the AO map and set the paremeters to your liking. Then click render to get something like this:

Step 5 – Textures

– Base Metal Texture

You can use a pre-made base metal if you wish but I prefer to start from scratch to give me more control of the texture as a whole. I start by choosing two similar colors of gray in the color picker, then go to Filters>Render> Difference Clouds. Now add a little bit of noise, between 10-15%, and then use a Gaussian blur of about 2-4 pixels. You should get something like this:

– Add in More Detail and Texture.

First add in the AO map we generated earlier. Paste into the image and set it to multiply. Adjust the opacity to your liking.

I then hand-paint most of the damage on the weapons using my tablet and a 1-5 pixel brush. I also turn on pressure sensitivity and jitter to give the paint stroke a more natural look. I then paint in damage where I would expect to find it, like edges of the body, the barrel iron-sights, butt of the stock, etc…

I then use a soft square brush to paint highlights on a new layer.

We can use layer masks and dirt maps to add in a final bit of detail.

– Specular

To make the specular we need to copy the base metal, the wood grain, and the scratches layer so that we can desaturate them and then adjust their levels to suit the specular map. Adjust each layer individually to get the desired look.

6. Variations

Once the main model is done it is pretty easy to make some variations of it. For this job the client wanted 3 versions of the weapon. The one we just completed is the first version and from it we can quickly make a double-barrel, and sawed-off version of the weapon.

Being mindful to not destroy the UVs, I cut and copied different pieces of the mesh to get the two versions. I then did a little bit of texture variation to complete the package.

7. Final

When all is said and done, you should have 3 different versions of the same model. Each should have a Diffuse, Specular and Normal map and all are 1500 polys or less.