Creating Models in Quake 4

This document will attempt to explain the process that the artists and modelers of Raven Software used to create their world models, creatures and characters for Quake4. It begins at the concept stage, on through to creating the high and low poly models, creating the UVs, setting up the shaders, rendering out the normal, and then painting the diffuse, specular, and height maps to create a finished skin. While this document is focused on creating a creature, the model you make could be anything in your imagination. We have tried to simplify some of the directions and descriptions for those inspired individuals that don’t have a lot of experience creating assets for a game.

Concept Drawing:

Try to think ahead when creating your concept drawing of your character for Quake4. There are some technical limits to the Doom3 engine and you need to take those limits into account when modeling and painting your character. At the concept stage, it is smart to try and incorporate fixes to those limits into your design. Tubes and hoses that hang off or stick out from the character may look great, but they not only cause occasional modeling headaches, but might also increase your poly count on your lo-poly model unnecessarily. Those hanging or jutting tubes may also throw too many shadow volumes in the engine which could drop the frame-rate of the game dramatically. They will also require the rigger/animator to create a skeleton for them that he or she will then need to animate to add realism. When drawing up your ultimate character design try to take into account poly limits or lighting issues that your creation may unwittingly create.

With the Strogg Grunt we created for Quake4, the concept artist originally created a creature with four arms, two smaller ones along with the two large ones, and had drawn pipes and hoses jutting out from its forearms and going into its back. To lessen the possible issues the original design would have created, the artist removed the jutting hoses on a revised concept drawing that the modeler used to create his model of the Grunt. The two smaller arms were eventually removed from the design at a later date. See examples below…

The concept artist also created a Front, Back, Side-View drawing to help the modeler visualize what the creature looked like from all angles and to simplify the modeler’s job. See the Strogg Grunt’s Front/Back/Side-View drawing below…

Modeling Your Character:

After coming up with a viable concept design for your character, you’ll want to model it using one of the many 3D modeling packages out there. Our hi-poly modelers used Maya and Lightwave to do all of their high poly modeling for Quake4. You can use most any modeling software, but in the end, we used Maya and Lightwave because we wanted to follow the same tool path that our friends down at Id Software used for Doom3. We chose to go with that tool set because we were using their revolutionary new engine and if we had any problems or questions concerning the process it would be easier for them to help us.

You are going to need to model your character in both high poly and in low poly. For the low poly, our creatures ranged from 500 polys on some of the lower range creatures on up to 5000 to 6000 polys for some of the bosses. The high poly models ranged anywhere from a few thousand polys on up to millions of polys. The high poly model does not go into the final game. It is used to render out a normal map that makes the low poly model that does go into the game look like a higher poly model. The reason the high poly model does not go into the game is because there are far too many polys in the model for the engine to run smoothly without chugging, etc. The low poly with its normal map is much cheaper memory-wise and makes the low poly look like it’s much higher in poly count when it’s not. Going with this process allows the game to run at a much higher frame-rate.

Some tips to take into consideration when modeling your high and low poly models:

Examples:

Bad! The white represents the low poly model and the black is the high. The number of sides (6) on the low poly model is too low compared to the very nicely rounded high poly model to get a nice render without lots of warping at the edges of the cylinder. From a distance it will look fine, but up close there will be very noticeable warping.

OK! The low is white the high is black. This version would yield much better rendering results with much less warping. Why? The number of sides (12) on the low poly model more closely matches the roundness of the high poly model and will yield a much cleaner render with less warping. The model will look better up close or at a distance.

The hard part is determining the number of polys you want to spend on the cylinder. Putting more into the low poly cylinder means you may have to put less into other areas of your model to still have the game run smoothly. Throwing unlimited amounts of polys into your model is not the answer.

This is a screenshot of the knee and thigh section of the Strogg Grunt high poly model used to render out the normal map. The triangular indent above his knee looks like it’s integrated right into the thigh mesh, but it’s not. It’s floating above the thigh mesh.

The second screenshot below shows a wireframe shot of the same triangular indent as the above screenshot, but from the side. Notice that the triangular indent is actually floating above the main thigh mesh. It’s not indented into the thigh and it doesn’t need to be for the renderer to think it is. This makes modeling your high poly so much easier and also lessens the number of polys needed for the high poly.

Ripping, Shaders and Paths, and Rendering Out Your Model

After you have finished modeling your creature, you’ll need to rip your lo-poly model to create your UV coordinates for your model’s skin. You’ll need to use some kind of UV creation software, like U-View, to create your model’s UVs. Most modeling packages come with the tools necessary to create UVs. Some are pretty basic, others are pretty good. Some come with only the ability to create quick atlas UVs, where the software lays out the UVs in a haphazard conglomeration with no thought to seams, ease of painting, etc. Maya’s UV tools are really quite nice and allow manipulation by the artist in creating their UVs. Lightwave’s built-in UV creation tools aren’t the best, but as far as rendering goes, Lightwave is great. There are also sites online that provide user-created plug-ins for several different software packages that will allow you to manipulate your UVs even more. At Raven, one of our tool guys created a really great proprietary UV tool for us artists to use in Lightwave.

Things to check for before beginning your UV coordinates:

  1. Make sure both the high and low poly models are tripled.

  2. Make sure both the lo-poly and hi-poly models share the same origin space since the texture coordinates on the lo-poly will use the hi-poly as a glorified bump-map. If they don’t line them up the normal map could be distorted or misaligned when rendered.

Cutting your model into sections for ripping & rendering: The high poly model may require you to break it up into smaller groupings or sections to overcome possible distortion or over-draw problems during the rendering process. This can be very time-consuming, but is worth it when you get a nice, clean render. You may need to do this on both the hi-poly and lo-poly models.

How to rip a model: Although every UV coordinate creator is different, here are several basic tips that will help you to create the best UVs possible.

  1. Try to place seams in inconspicuous places that aren’t easily seen. Place then on the inside of the arms and legs, down the sides of the torso, etc. This way they’ll not be as noticeable to the player and will make your model’s skin look even better.
  2. When ripping difficult parts, like arms, hands, and legs, take them apart in strips, like peeling a banana, and then knit them back together when they are flattened and weld them back together. IMPORTANT! Make sure you weld the correct points to their corresponding sister point. Otherwise, you’ll end up with screwy looking UVs.

  3. For symmetrical parts like the arms, legs, the head, and the torso, you can delete one side of the model and just rip and flatten out one half. After ripping those pieces, you can copy and mirror them onto the other side of your model. You’ll then need to reweld the points along the central seam. Make sure the model is actually symmetrical, though.
  4. If you have an asymmetrical item, like a head with a piece of machinery on one side only or a face that has a scar over only one eye, you can do more of a global rip and flatten out the entire head. Have the seam run up the middle of the back of the neck and up into the top of the head. The painted hair on your skin will help cover the seam.
  5. Make sure to set a path on your low poly model in the ripping or modeling program. This path allows the engine to be able find and access your model for the rendering process. In Lightwave, hitting “Q” will bring up the Change Surface window. In the “Name” section, type in your path. The model will be placed into the q4base directory, so the engine will look there for your low poly model. But, it is not necessary to put q4base at the beginning of the path. The engine already knows that that is where the model will be, but you’d have to include the rest of the path in order for the engine to find your model. The Strogg Grunt’s body low poly model’s path is like this: model/monsters/grunt/grunt_body2. It is not necessary to add the file extension designation (.lwo, .ma, .mb, etc) after the name of the low poly model in your path. The engine will find it without it. Every modeling and UV creation program is different and setting up the path is done differently in each. Check your software’s manual for the correct process in creating paths for your UVs.

Paths and Material Shaders:

For a full understanding of paths and shaders and how to set them up please read the Quake 4 Shaders document.

Rendering Out Your Normal Map:

Below is a step-by-step guide to rendering out your normal map. Included are how to prep your model for rendering, how to set up your shaders, and some tips and troubleshooting. This how-to occasionally refers to Lightwave, which we used as our UV creation software.

Step 1: Preliminary set up The first steps are always essential; the basics are always the first thing we overlook.

Step 2: Prepping UVs UV definition: UVs are sectors or coordinates that projects the shader. This is not a direct part of the mesh; it serves as a way to read the .tga files. Sometimes the UV’s may become unwelded in transfers from .obj files or Maya files.

By merging points you assure a smoother normal map. If you didn’t merge your points the models would have strange seams all over it, and light wouldn’t move over the surface correctly in game.

Step 3: Setting up material shaders This is the clincher, and the thing that most people get wrong. Let’s face facts; it’s easy to mess this up, so in this stage it’s essential to be patient and not to panic.

Some definitions: Materials: the actual file format.

Here’s a typical shader for a model, and we’ll be using it as an example:

models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low
{
        noselfShadow
        unsmoothedtangents

renderbump  -size 256 256 -trace .05 -aa 2 -mergehigh models/mapobjects/strogg/barrels_and_containers/barrels/barrel1_low_local.tga work/models/mapobjects/strogg/barrels_and_containers/barrels/barrel1_high.lwo

diffusemap              models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_d.tga
bumpmap addnormals ( models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_local.tga, heightmap ( models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_h.tga, 1 ) )
specularmap             models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_s.tga
}

  The top line: models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low is the Shader title: this is what the game looks for when you activate a render. Think of it as an alias or a chapter title.

  noselfShadow: This command tells the engine that the model is to generate no self shadows that might slow down the engine even more.

  unsmoothedtangents: Unsmoothed tangents are for animated models. If the model isn’t animated DO NOT use unsmoothed tangents.

  renderbump: This is the command the game looks for when you ask for a renderbump. If the shader doesn’t have this command in it, it won’t render.

  -size 256 256: This is the size that the final rendered normal will render out at. You can alter the size of the rendered out normal by decreasing or increasing the two numbers. The numbers have to be at a power of two, such as 32 X 32, 64 X 64, 128 X 128, 256 X 256, 512 X 512, or 1024 X 1024, etc. You can also set it with one number larger than the other, such as 512 X 1024.

  -trace .05: Trace is the height in which the model renders. Think of the low poly model as the surface in which the high poly is being drawn onto. If the high poly has a lot of floating geometry, you may need to render the model multiple times at different trace heights.

  -aa 2: This is an anti-alias function. If this is set to 1 it renders your UV map 1 to 1 whereas if it’s set at 2 its 2 to 1. A setting of 2 renders faster.

  -mergehigh: You need this to merge the high poly model so it will render as one model. If you don’t have this in, it will render a partial model.

  models/mapobjects/barrel/barrel1_low_local.tga: This is telling the game to write a targa named barrel1_low_local.tga to models/mapobjects/strogg/barrels_and_containers/barrels directory (remember these are path names, so each slash is a folder).

  work/models/mapobjects/strogg/barrels_and_containers/barrels/barrel1_high.lwo: This tells the game to use this high poly model to create the normal map. You can keep your high poly models in art/work. A high poly model should NEVER be on Q4base.

  Remember to open and close the shader using { and } so that the game recognizes it. See the Quake 4 Shaders document for a better explanation.

Creature, Characters, and Other Involved Model Shaders: Shaders for creatures, characters, and other involved models are much more complicated and confusing. Eventually, we built up a pretty big library of shaders and could just copy and paste ones and then change out the paths and model and skin map names as needed. We recommend doing the same…copy and paste.

Here’s an example of a creature’s shader set-up… the Makron. Creatures are much more involved than textures or simple, unanimated world models since you have to include shaders for the eyes, weapons, the clipping hull, the glow map, and the teleport fade-out.

//Makron--------------------------------------------------------------------------------

models/monsters/makron/makron_lo
{
    noselfshadow
    unsmoothedtangents
        renderbump  -size 1024 1024 -trace 0.07 -aa 2 models/monsters/makron/makron_lo_local.tga work/models/monsters/makron/makrontorso_hi.lwo

        materialImage   models/monsters/makron/makron_lo_hit.tga

        bumpMap addnormals ( models/monsters/makron/makron_lo_local.tga, heightmap ( models/monsters/makron/makron_lo_h.tga, 4 ))
        specularmap     downsize( models/monsters/makron/makron_lo_s.tga, 1 )

        {
                blend diffusemap
                map     downsize( models/monsters/makron/makron_lo_d.tga, 1 )
                alphatest .5
        }
        {
                blend add
                map downsize( models/monsters/makron/makron_lo_gl.tga, 1 )
                rgb grunttable [ time * 1.3 ]
        }

        inlineGuide corpseBurnEffect(models/monsters/makron/makron_tport.tga)
}

models/monsters/makron/makron_torso
{
    noselfshadow
    unsmoothedtangents
        renderbump  -size 1024 1024 -trace 0.07 -aa 2 models/monsters/makron/makron_lo_local.tga work/models/monsters/makron/makrontorso_hi.lwo

        materialImage   models/monsters/makron/makron_lo_hit.tga

        bumpMap addnormals ( models/monsters/makron/makron_lo_local.tga, heightmap ( models/monsters/makron/makron_lo_h.tga, 4 ))
        specularmap     downsize( models/monsters/makron/makron_lo_s.tga, 1 )

        {
                if Parm7 == 0
                blend diffusemap
                map     downsize( models/monsters/makron/makron_lo_d.tga, 1 )
                alphatest .5
        }
        {
                blend add
                map downsize( models/monsters/makron/makron_lo_gl.tga, 1 )
                rgb grunttable [ time * 1.3 ]
        }
        inlineGuide corpseBurnEffect(models/monsters/makron/makron_tport.tga)


}

models/monsters/makron/makron_torso_collision
{
        noShadows
        collision
        materialImage   models/monsters/makron/makron_lo_hit.tga
}


models/monsters/makron/makron_legs
{
    noselfshadow
    unsmoothedtangents
        renderbump  -size 1024 1024 -trace 0.07 -aa 2 models/monsters/makron/makron_lo_local.tga work/models/monsters/makron/makrontorso_hi.lwo

        materialImage   models/monsters/makron/makron_lo_hit.tga

        bumpMap addnormals ( models/monsters/makron/makron_lo_local.tga, heightmap ( models/monsters/makron/makron_lo_h.tga, 4 ))
        specularmap     downsize( models/monsters/makron/makron_lo_s.tga, 1 )

        {
                blend diffusemap
                map     downsize( models/monsters/makron/makron_lo_d.tga, 1 )
//              alphatest .5
        }
        {
                blend add
                map downsize( models/monsters/makron/makron_lo_gl.tga, 1 )
                rgb grunttable [ time * 1.3 ]
        }
        inlineGuide corpseBurnEffect(models/monsters/makron/makron_tport.tga)

}

models/monsters/makron/makron_legs_collision
{
        noShadows
        collision
        materialImage   models/monsters/makron/makron_lo_hit.tga
}

models/monsters/makron/makron_eye
{
    noselfshadow
    unsmoothedtangents
        renderbump  -size 128 128 -trace 0.05 -aa 2 models/monsters/failed_transfer/ft_eye_local.tga work/models/monsters/failed_transfer/ft_eye_hi.lwo

        materialType    flesh

        diffusemap      models/monsters/failed_transfer/ft_eye_d.tga
        bumpmap         models/monsters/failed_transfer/ft_eye_local.tga
        specularmap     models/monsters/failed_transfer/ft_eye_s.tga

        inlineGuide corpseBurnEffect(models/monsters/corpseBurnEffect_sm.tga)
}

Step 4: Setting up shaders for your model In this stage, you’ll go back into the low poly model and assign the shader you wrote to make your normal map.

You’ve now prepped the low poly model to be rendered. When you activate the low poly to be rendered, the game will load the model, and see that it has an active shader. It will then find the shader and use the renderbump line to write a targa based on the high poly model using the parameters you’ve set.

Step 5: Rendering

Other Tips for Rendering:

models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low
{
        noselfShadow
        unsmoothedtangents

renderbump  -size 256 256 -trace .05 -aa 2 -mergehigh models/mapobjects/strogg/barrels_and_containers/barrels/barrel1_low_local.tga work/models/mapobjects/strogg/barrels_and_containers/barrels/barrel1_high.lwo

diffusemap              models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_d.tga
bumpmap addnormals ( models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_local.tga, heightmap ( models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_h.tga, 1 ) )
specularmap             models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low_s.tga
}

If all went well, you rendered out your normal map for your creature or character. In the next section, we’re going to look into tips, tricks and troubleshooting for potential problems that may occur.

Step 6: Tips and Tricks In this section, we’ll go over some tips and tools that have been added to the render code to make it easier to render complex geometry.

Example:
In Lightwave you’d assign the following to a model in the surface parameters:

Here’s your base shader from the above example
models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low

Select out a pesky bit of geometry and hit Q enter this
models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low.1

While the model is rendering, it will render the top shader first and then render the .1 shader separately afterwards. All in the same render and the same file.

If you really want to get tricky, lets say only one area of the model isn’t rendering properly, and you know you need a higher trace value for one section. Instead of cutting and pasting into the local map select the geometry and add
models/mapobjects/strogg/barrels_and_containers/barrels/medium1_low.2 –trace .09

This will render that area at a higher trace. The only drawback to this is it can make for some weird lighting. The best thing to do for this is to select whole sections of geometry…select a whole side verses part of a side.

Step 7: Trouble shooting There will occasionally be problems that arise with the renderbumping system. Some of the problems can be solved pretty easily while others may take time to figure out. Refer to this listing when you have a problem…

IMPORTANT! If something isn’t working right wait until the render is done and look through the errors. When the render has finished look at the print-out that pops up afterwards. Nine times out of ten, if it’s a shader or a model issue it will show up there.

Problems and possible fixes:

Painting Your Diffuse, Specular, and Height Maps:

After you have rendered out the normal map, you can then start painting the diffuse, specular, and height maps for your creature or character. Any painting program can be used to create your skin, but we at Raven use Photoshop, as do most computer and console game studios.

Diffuse Map: The diffuse map is the color portion of your skin. It determines the colors of the creature’s flesh, paint job, decals, blood, etc. Since your creature or character is somewhat realistic looking in the game, we recommend using photo reference for your diffuse. Photo reference are digital photos of rusty metal, different types of metals, chipped paint, blood, wounds, flesh, etc that are used to create realistic looking skins. You can use a digital camera and go out and shoot lots of real asset photos to use for your diffuse map. There is still plenty of “real” painting to do on the skin, even with using photo reference.

For the Makron’s diffuse map, the artist used photos of the scratched up paint on a bulldozer that he took for the painted and scratched areas of the skin. The artist altered the color slightly and adjusted and added additional scratches, dirt, and rust. He also used several different photos of differing types of metals, etc to vary up the detail on the Makron. For the Makron’s exposed flesh, he used photos of pig flesh and added in the veins, bruising, and ripped open wounds and blood. See examples of the bulldozer photo reference and the final diffuse below:

Specular Map: The specular map is used to add sheen to areas of your creature’s skin, highlights to edges, and can help determine different types of metals, chipped paint, etc. I believe the specular map is the hardest part of the skin to paint and the most time-consuming of the three maps. Do a really nice job on the specular and it’ll really make your skin sing.

I have included a sample of the Makron’s specular map with areas of flesh, blood, metal, etc pointed out. You can use this as a basis to determine how to do your specular. Also, look at some of the other Q4 creature’s speculars to gain a better understanding and read our Specular Maps write up. It’s very basic, but informative as to how we created specular maps for Quake4.

Tips to painting nice specular maps:

  1. When doing flesh, rubber, and other not too reflective surfaces make those areas on your specular map the darkest areas in relation to the other more reflective parts. Flesh and rubber don’t usually reflect a lot of light and therefore would be darker on your specular than some shiny metal, etc.
  2. You can define chrome, stainless steel, and other very reflective metals by upping the highlights or brightness on those areas of the specular.
  3. Adding little “hotspots” of light to highlighted edges can really help sell the realism of your skin.
  4. Make painted areas slightly less reflective than the metal underneath. If the metal showing though the chipped areas is a tad brighter than the painted parts, the skin will look more realistic.
  5. On cylinders and other rounded areas on your skin, adding a highlighted section or horizon line will make that area read much more realistically as the light rolls across/over it.
  6. You can add percentages of color to your specular map to intensify particular colors on your creature’s or character’s skin. A good example would be the Nexus Protector (Stream Protector). His body’s paint job is white, but has a greenish pallor to it. Making his specular map a purplish color created a pearlescent white color to his skin.
  7. Creating realistic looking blood on your specular: On your diffuse, paint your blood the normal reddish color on a layer, and then for your specular map slide a copy of the blood over and invert it. In Photoshop, hit Image, then Adjustments, then Invert. That will invert the color information of your blood. After being inverted, the blood will be blue green in color. You can adjust the brightness and intensity and flatten it onto your specular map. Once that is in place and saved out, the blood will look so much more realistic and wet. See example above.

Height Map: The height map compliments the normal map. It is used to add dings, dents, scratches, indented wounds to flesh, etc. It is just a grey-scaled image. The way the height map works is that white equates to height and black equals depth. By varying the intensities of white and black, it creates differing height and depth information to the height map. The brighter or more intense the white, the greater the height indicated on your height map. The darker or more intense the black, the deeper the depth on your height map. The height map can only indicate height and depth on a 90 degree up and down angle. It can’t indicate angled information like the normal map can.

Tips to doing height maps correctly:

  1. DO NOT just grayscale the normal map and invert it to create your height map! Doing so will only cause the height map to fight the light vectoring information of the normal and nullify its effectiveness.

  2. Start out your height map out with a 50% gray as its base background color. Consider 50% gray as being totally flat and anything lighter in value as being raised above it and anything darker than 50% as being lower or beneath it.
  3. Avoid adding tons of noise to create height. Too much noise will only muddy your height and normal maps and destroy the effectiveness of both.
  4. The height map doesn’t need to be overly detailed or very busy looking to do its job. It is meant to compliment the normal, not override it. If you look at the Makron’s height map, you’ll notice that it’s pretty simple. All that are on it are indications of scratches in the paint job of the Makron’s metal body parts and the flesh areas with the wounds. Notice that the veins and wrinkles on the flesh are raised with pretty intense white and that the wounds are pushed in with some very dark grays. The scratches in the metal parts of the Makron’s body are a very light gray color since paint is usually only microns thick and the scratches wouldn’t be very deep when the paint is on top of metal.

Glow Map: The glow map indicates areas on the skin that glow or look like lights. The glow map usually has a 100% black as its base background and snippets of color that indicate the lights, etc. Through the shader, you can have the glow map flicker, etc. As an example, we have provided the Makron’s glow map below. On some of the glow maps we created for Quake4, you’ll notice that some of the lights are painted to look like headlight-like lamps. Indicating the little lines and boxes that you see in a headlamp, make your lights look a lot more realistic. You get a better understanding, go out and look at your car’s headlights or find a picture of some and look at how the glass covering is etched to refract and concentrate the light emitted from the bulb.

Hit Map: The hit map indicates to the engine what kind of material parts of your creature or character are made of, such as solid metal, hollow metal, rubber, etc. Effects are also tied to it and fire when that particular area is shot. Flesh will squirt blood when shot. Metal will emit sparks when shot. Concrete will spout puffs of dust and pebbles. We created a material detection system based on the RGB setting numbers of particular colors. We have included our material detection color guide and an example of the Makron’s hit map below. Since pixel density isn’t as important on the hit map, we usually decrease the size of it by one or two times to save on texture memory.

Viewing your model in ModView: The Quake4 game comes with a nifty little addition called ModView that allows you to see the skin on your model as you are painting and updating it. ModView is a model viewer. You can see your model in wireframe mode, rotate the model on all axes, update your skin, view animations on your model, change lighting, and access alternate skins and models. It’s a wonderful little tool.

ArtReference CreatingModels (last edited 2005-11-04 18:56:57 by EricBiessman)