Welcome, Guest! Login | Register

The Making of Dukowski [Print this Article]
Posted by: Spider
Date posted: Feb 08 2003
User Rating: N/A
Number of views: 5921
Number of comments: 0
This article will explain how Pred and I created Dukowski, a multiplayer model for Half-Life. I've used 3D Studio Max 2.5 with Character Studio 2.1 to make the model and Pred used Photoshop 5.0 to make the skin. From this article you can become familiar with the process, and learn to avoid some problems. Learning the steps and planning out your own model will help save time and frustration. This is for experienced 3DsMax users, but it doesn't get much easier so new users are encouraged to read this too.

I'll be covering all the components of making a multiplayer model; from the mesh and it's skin, all the way to compiling it for the game. I'll have links to material that's already been covered, and since this won't be a thorough tutorial, more detail will be covered in upcoming tutorials.

Here's Dukowski in different stages. There are 10 detailed stages to making a player model and getting it in the game. Make the mesh, apply smoothing groups, create a template for the skin, paint the skin, set up a Biped, use Physique to attach the mesh to the Biped, modify animations, export it then compile it. It'll run in the game, but you'll also want to make a multiplayer picture for it.

Here's Dukowski in different stages. There are 10 detailed stages to making a player model and getting it in the game. Make the mesh, apply smoothing groups, create a template for the skin, paint the skin, set up a Biped, use Physique to attach the mesh to the Biped, modify animations, export it then compile it. It'll run in the game, but you'll also want to make a multiplayer picture for it.

user posted image

Download the Dukowski multiplayer model

user posted image user posted image user posted image user posted image

wireframe, smoothing groups, textured, Physique

1> Modeling: Models are segmented at the shoulders and wrists because of the severe twisting. You can choose to do this if you want. Some models still look ok when they twist that much, but others don't so I've segmented the pieces of my model. Valve has set multiplayer models up to have a high-res and a low-res version of each model. Again, you can choose whether you'd like to do this or not. I just made a high-res version.

The first step is to make your mesh. Check my tutorials covering Basic Modeling Techniques and Character Modeling, and for a more complete advanced guide see Valve's Modeling Tutorial. The maximum polygon count for multiplayer models should be around 650. I've gone a little over with Dukowski at 712 polygons, although even Valve's high-res scientist has 710. I recommend 650 though to keep gameplay faster. When making your model, use Valve's biped as a reference for height. It will have to fit this anyway, so it's a good idea to have it visible while modeling. Get it in one of the SDK folders such as ...\Highcount\Barney\barney_reference.max. Try to stay close to this skeleton's shape. If you make a model without legs, then you will still be able to shoot below your new model, where it's legs should be, and hurt the player. If you have a model with a tail or wings, they will be outside the bounding boxes and may clip into walls. It's very important to have hands where they're supposed to be because weapons are attached to them by the game engine.

2> Smoothing Groups: After modeling, make sure you've collapsed the Modifier Stack to Editable Mesh, then apply smoothing groups. If you start making a model in barney_reference.max then lights will be set up already, and you'll have a better idea of how the smoothing groups will appear in the game.

At the Sub-Object Selection Level, choose Face then look in the Edit Surface bar in Smoothing Groups for 32 buttons. Assign these to different sections of the model to contrast the way faces smooth or curve into each other. If you have an area such as where clothing meets skin, then having a sharp edge would be appropriate. Each area would be set to a different smoothing group. So work your way through the model, selecting sections of faces and clicking on one of the 32 buttons to assign them to different smoothing groups. I recommend hiding the selected faces after you've assigned them because it helps to keep track of what you've done. When you're finished, unhide them all. At the right, I've color-coded each smoothing group. There is one barely noticeable for the rim of the helmet.

user posted image
Smoothing Groups in color

3> Setting up the template: To get an idea of how skins are generally done, see Valve's player skins in my Skin Tutorial. Yours don't have to be 128x128 or 256x256. For 3D accelerator cards it's important that each dimension is a power of 2, such as 64, 128, 256, and that the total texture file size is less than 150k.

Plan out how you want the skins done. We made Dukowski similar to how Valve did theirs, with separate files for the body and face. This is good for having more detail in the face since it has it's own palette. Or you could just use one file for the whole skin. It comes down to how many colors you are going to use. If you want to have colorful clothing, flesh tones, chrome, plus team colors, it would be best to divide it all up into different files. Keep in mind though, that you'll want to use the least number of files for optimization reasons with 3D accelerator cards.

First set up blank skin files (dm_base.bmp, dm_face.bmp) with Multi/Sub-Object mapping in the Materials Editor, putting each .bmp file in each map's Diffuse channel as a Bitmap. Most of the settings for materials will be ignored, so don't even worry about them. If you want to use two skin files then you'll have two separate textures with Material I.D. numbers 1 and 2.

Creating a template is just an additional step to mapping the model. Select a group of faces in Edit Mesh, assign a Material I.D. to them, and applying UVW mapping. Then for the template, use an Unwrap UVW Modifier or just simply planar map it and take a printscreen shot from the front, side or top view. Save these temporarily. Work your way through the whole mesh, mapping it and saving shots of the mesh for your template. I'd recommend hiding the group of faces after you've saved it out for the template to help keep track of what you've done. When you're finished you can combine all the pieces and resize them to fit efficiently. You'll have to go back after you paint the skin and adjust the UVW Mapping to line up all the pieces. Be sure to use Bitmap Fit and select your skin file to make sure the aspect ratio is set up correctly. Then use the gizmo at the Sub-Object Selection Level, rescaling and moving it to fit the correct part of the skin onto the selected faces.

user posted imageuser posted image
Edit Mesh Modifier (Left) Skin Template (Right)

4> Paint the skin: This is where I turned it over to Pred so he could do the skin. All skins in Half-Life are 256 color .bmp files and each has it's own palette. If you want to have team colors then your main skin file needs to be called DM_Base.bmp, otherwise it won't change the team colors. Start out in RGB mode in Photoshop or 24 million colors in Paint Shop Pro to do the painting. When you're finished, index or reduce it down to 256 colors. Team colors are put in rows 11-14 of the palette and are 32 colors each. The team colors need to go in the right area or they won't work. We didn't use them for Dukowski so these areas are black. But for you to be able to do them, I'd recommend using Palette Merge. It's an easy way to put together a correct palette with team colors and includes a tutorial on how to use it. You separate out one area of team colors and create a 32 color palette for it. Then separate out the other area of team colors and make another 32 color palette. Create a 192 color palette for the rest, then combine them with Palette Merge.

5> Set up skeleton (biped): All multiplayer models use the same skeleton. It's recommended to use Valve's biped, but if you create your own, yours will need to have the same bones. There are extra bones in the head, but they're not used for multiplayer models and can be ignored. Make sure all corresponding bones are named the same as Valve's, or you will get compiler errors.

6> Attach mesh to biped: Select the mesh and choose the Physique Modifier. Assign it to the biped's pelvis. Don't use Blending Between Links, don't create Envelopes and set the Vertex - Link Assignment to Rigid. Physique will assign the vertices of the mesh to the skeleton, but it always needs adjusting. Go to the Sub-Object level and choose Vertex. Start from the head and work your way down to the feet. Choose 'Select by Link' and select a yellow skeleton link. The vertices that are assigned to this bone will highlight. If any are missing or assigned to the wrong bones, then choose 'Select' and select those vertices. Now choose 'Assign to Link', choose the middle green button for Rigid Vertices and select the yellow skeleton link that you want them assigned to. Trouble spots will be where arms get too close to the torso, the head and neck area, and the fingers. I'd recommend after everything is assigned, move the biped around to test it. If vertices are assigned wrong here, they will be wrong in the game.

7>Modifying the animations: If you're making a human figure you can use Valve's animations. Otherwise you'll need to make adjustments or totally redo them, although it's not recommended to change the number of frames for each sequence. I modified the rpg animations for Dukowski. Be aware that the engine blends different animations together, so what you see in the mdlviewer may not be the same as in the game. One example is that the lower half of the walk and run animations are blended with the upper half of the ref_aim and ref_shoot weapon animations so that the player can be walking or running while shooting any of the weapons. Dmplayers.html has a listing of all the animations.

Export and Compile:
For this part you'll need some files from Valve's SDK. The simplest way to do this though, is to use the skins.zip that I put together for my Skin Tutorial.
8> Export the model: Make sure the Smdlexp.dle plugin is in 3DsMax's plugins folder then go to File... Export, and choose Valve SMD (*.SMD). It will bring up a prompt and choose Reference Frame. Name it something like NewModel.smd. If you don't type in .smd then it may give you an error message. If you've changed any animations, those need to be exported as .smd files, but with the Skeletal Animation option.

9> Compile the model: This is done from the \Models folder where studiomdl.exe is. Notice there are \DMatch and \Player subfolders of \Models. You'll set up folders just like they have them set up for their models. For example, if you have a model called NewModel, then set up folders \Models\DMatch\NewModel and put the skin .bmp files and the NewModel.smd in here, then also create \Models\player\NewModel which will be where the final model is compiled to. Your animation .smd files get copied to the \Models\Player folder, overwriting the ones in there. Now you need .qc and .bat files for your model. Copy ones from here \Models\hgrunt.qc and hgrunt.bat, and rename them to NewModel.qc and NewModel.bat. You have to edit each file. The command line in the .bat file is simply changed to: studiomdl.exe NewModel.qc
In the .qc file change these lines:
$modelname player/Hgrunt/Hgrunt.mdl - this is where your final model goes, change it to
$modelname player/NewModel/NewModel.mdl
$cdtexture dmatch/hgrunt - this is where the skins are, change it to
$cdtexture dmatch/NewModel
studio "../dmatch/hgrunt/grunt(reference)"- this is the .smd, change it to
studio "../dmatch/NewModel/NewModel"

Here's Dukowski's .qc file:


$modelname player/Dukowski/Dukowski.mdl
$cd player
$cdtexture dmatch/Dukowski

$scale 1.0
$origin 0 0 36

// whole body
$bodygroup body
studio "../dmatch/Dukowski/Dukowski"

$include "player/player_shared.qc"

Then double-click your .bat file and it should run studiomdl.exe. You'll see it listing all the files it's grabbing to compile. When it's done, it'll stop and say 'Finished' at the top. Your .mdl will be in here: \Models\player\NewModel. Put it in the Half-Life folder: \SIERRA\Half-Life\valve\models\player\NewModel. If you have problems compiling check my FAQ.

Multiplayer Bitmap:
The Multiplayer Bitmap is a 256 color screenshot of the model which will be viewed from the game's Multiplayer Menu. If you have team colors, they need to be reversed in the palette compared to the dm_base.bmp.

user posted image user posted image
Dukowski.bmp Dukowski Palette

10> Create a multiplayer bitmap: You can either use a rendering from 3DsMax or take a screenshot of the model in the game. Console.html has commands to look at the model from a chase cam in the game. F5 takes screenshots. This picture needs to be a 256 color .bmp, 164 pixels wide x 200 tall. Crop it around the model and work on the palette. If you've put in team colors then they need to go in here also. See Dmplayers.html to compare the rows that are switched in each palette. Use the same technique as in the Skins section above to separate the team colors and create the palette. I didn't use them for Dukowski so I left those areas black. Put the bitmap in: \SIERRA\Half-Life\valve\models\player\NewModel with the .mdl and you're done.

The main objective of this article was to cover all the steps it takes to make a multiplayer model for Half-Life. I used my own model as an example and purposely left out some things that would either be confusing or irrelevant for you making your own model, or were of a sensitive nature. Obviously I left out Pred's skin so I'll address that now. We're both professional artists with experience in the game industry, working on published titles. We do professional quality work and there's a reluctance to give it away so freely. Believe me, Valve's artists know exactly what I mean; to spend a considerable amount of time on artwork only to have someone draw a mustache (and a very poor one at that) on it and release it as a model. Nonetheless, I do know how much fun it is to do editing. I got in the business because it's much more fun than any other job I've had, plus I freely volunteer my extra time helping with Wavelength to teach others how to do it. As soon as a model editor comes out, Dukowski's skin and mesh will be accessible to everyone. Maybe someone will implement team colors by having changeable beard and mustache colors. user posted image

We really appreciate the popularity of Dukowski in the Half-Life community. From the time of release to the writing of this article we've had over 7,500 downloads just from Wavelength, and we got a great review on Cold Fusion. Mods have contacted us wanting to use our model, but again, we're reluctant about this and want to consider more appropriate mods for it, and ones that are most likely to be finished. Do keep in mind that Dukowski is copyrighted, so contact me about commercial projects.

Good luck with your own models and have fun editing.

Rate This Article
This article has not yet been rated.

You have to register to rate this article.
User Comments

No User Comments

You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005

Latest Comments
knock knock
General | News
By: MIFUNE | Dec 31 2017
knock knock
General | News
By: omega | Dec 22 2016
knock knock
General | News
By: MIFUNE | Oct 10 2015
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
knock knock
General | News
By: Whistler | Nov 05 2011
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (9 guests)
About - Credits - Contact Us

Wavelength version:
Valid XHTML 1.0! Valid CSS!