Making a model for Half - Page 1

Making a model for Half-Life

By

RatLogo.gif (7996 bytes)

Well first off, as I was preparing to write a tutorial on modeling, I scoured the net for what was all ready out there on modeling a character for use in a game. What I came up with, was a truck load of information on the benefits of using this or that method, and not a whole lot on telling you how to create a model. Oh I am sure there are some really good ones out there, but you want it now, right?

This tutorial will hopefully be the first of a series, starting with the basis of what is involved in the process of creating a model, it's skin, skeleton and animation, all in this order. As a final installment we will be showing you how, by a step by step detail, to get the model into Half-Life.
For this Tutorial, we will be using the popular Milkshape 3d by Mete Ciragan. I plan on making a Max 3d tutorial as well.

A download of this entire Tutorial in HTML is available at: http://www.drawcad.com/upload/HL-World-model-Tutorial.zip

What is needed to complete your model

You will first off have to get the Milkshape 3D program by Mete Ciragan. This can be found at the following web site: http://www.swissquake.ch/chumbalum-soft/index.html Another program that we will be using for the extraction of Valves and other add on packs and Modifications models is called Qped. You can find this at: http://www.planetquake.com/qped/. Also, you will need a paint program to make the "skin" of your model. There are several out there that you can use. Some use Photoshop as a basis for their creation of a "skin." These tutorials will be using the popular Paint Shop Pro for it creation of a "skin." You can find an evaluation of this program at: http://www.jasc.com/. Another program that will be useful in your creation of models is the Half-Life Model Viewer that can be found at: http://www.swissquake.ch/chumbalum-soft/hlmv/

Although it is not required it is sometime done among modelers to hand sketch the model, (some even go as far as fully illustrating the model on paper first), then scan this into the computer for a background to create the model by.

Below you will see and example of what I did for a mod for a health rune, that was to be as detailed as most player models. I sketched out my idea and then scanned it into my comp and used it for a background to create her.

mt-fig1.jpg (63115 bytes)

Figure 1.1 Screen shot of completed model in Milkshape 3D

In this first tutorial, we will be learning how to flesh out a low polygon world model. I feel this is a good basis to eventually come to a point to be able to do character animation. You must be able to learn the basics before being able to create fantastic warrior models that you see in 3d games like HL. A world model does not do much, and its associated compiling is relatively simple using its qc file. A qc file stand for Quake Compile, and in this file, all the necessary information is kept to instruct the compiler on how to create the model for use in a game. We will be discussing this after we get our model ready for compilation!

Figure 1.2 Example of a QC file

You can download the completed file to view how this knife was made at: http://www.drawcad.com/upload/knife2.zip You will need Milkshape Version 1.4.0 to open the Ms3d file that is contained in the zip, even though some of the figures show a lower version of Milkshape. (Hey I am to lazy to retake some screen shots in the newer version!) If you are reading this and a new Milkshape comes out since the writing of this tutorial there is a menu selection to convert an old msd3 file

Page 2->


Making a World Model for Half-Life - Page 2

Preparations for making a model

You will be able to save a lot of time if in advance, if you research and perhaps sketch out what you are trying to accomplish for a model. If you are working with a team, you will need to write down all that is expected of the model. It can be frustrating if you get the usual, "I don't care, just make a <insert model here>!

If you are not going to be the artist of the model you will need to get with him on the creation of what you think the shadow outlines, (the flat or 2d edges of the model), are going to look like. Once you think that you have what is what the team wants you will have to submit it to them so they can decide if that is what is meant by the description they have given you.

Lets say the team has decided on having a knife for use ingame. And they told you that it should not be real elaborate, so as to keep the lag in game play down. This would require that you have a model that would be a low poly count. Well with that said and done, you or your 2d artist set out to come up with something. You need to decide:

  • will it have a hand shield?
  • how elaborate is the blades design going to be, (curves, saw blade edge, holes, etc.)?
  • how elaborate is the handle going to look, (do you really want that brass screw)?

Once you have decided, you may want to do some research to see what is already in some games, so as to original. Then you might want to look in some magazines or on the web for something that you have in mind. If you find a photo of one out there, then you have already won half the battle of design!

The photo below was the one pick to best suit our model design of the knife. We will be using it to make our model by using it in the background.

Figure 1.3 Proposed photo of knife

Below is what our finished model will look like once it is completed.

Figure 1.4 Finished model of knife

Fleshing the model out

At this point you will be starting Milkshape 3d up and setting the background image to one of the windows with its view set to left, as the above picture has its view set. In the "Left" viewport, right click and click on the Choose Background Image... on the menu selection. In the "Open" dialog box, navigate to the directory that you have set up to receive all the files to make your model by clicking on the drop down list button on the "Look in:" section. I made mine in a "C:\WINDOWS\Desktop\models\knife2" as you can see from the directory structure of my QC file.(See Figure 1.5a). You now should see the background image in the "Left" viewport, as Figure 1.6 has it in its viewport. Once you set the background image, you will be able to start creating the knife. If you wish to turn off the background image, just repeat the steps outlined above, but click the "Cancel" button on the "Open" dialog box, and it will disappear.

mt-fig5a.gif (15797 bytes)

Figure 1.5a Setting up a Background picture

Page 3->


Making a World model for Half-Life - Page 3

You are going to set vertices along all the distinct paths of the knife in the order of perceived depth. I start with the least or what would be paper thin, and work my way to a 3d plane that would be coming towards me. If you look at the knife, you should be able to tell by it, and this would represent the real worlds view of a knife, its cutting edge would be paper thin. This is where I would start my vertex path. Click on the button that says "Vertex."

Figure 1.5 Vertex tool selection

Now using the tool, click and set vertices along the knifes edge.

Figure 1.6 Vertex creation path

We will now be making a new path that will will have to be pulled a bit towards you, as the knife does get thicker at its back edge.

Figure 1.7 2nd Vertex creation path

You will have to click on the "Selection" tool and also click on the "Vertex" button below to select only vertices.

Figure 1.8 Selection tool set to Vertex selection

Now you will select only the 3 vertices that we just have created as in Figure 1.7 shows. Go to the "Front" or "Back" viewport so that you can move these vertices out a bit. You will have to keep in mind which direction you will be looking at the polygon faces. So if you were creating your model from the left view as I have you would probably want to use the "Front" viewport and pull the vertices to the right with only x axis free to move. You can lock down axis movement by clicking on the any of the "X", "Y", or "Z" buttons when you have the "Move" tool selected.

So this is the next step: click on the "Move" tool button and lock down the "Y," and "Z" axis. (See Figure 1.9).

Figure 1.9 Move tool with Y and Z locked

Once you have these locked, go to the "Front" viewport and pull the vertices to the left. Move the 3 vertices that we just have created as in Figure 1.7 to the left a bit until you have something that looks like in Figure 1.10.

mt-fig10.gif (6088 bytes)

Figure 1.10 Moving the vertices in the Front viewport

Page 4->


Making a World model for Half-Life - Page 4

Now you are about to create the faces of the knife edge. A face is a 3 sided polygon, which takes 3 vertices to make up. Traditionally a face is only one sided, meaning if you look at it from its backside, you will not be able to see it on the video screen. Now you know why some models seem to have parts missing! They really are there but you are looking at their back faces.

Click on the "Face" button. Go to the "Left" viewport. In order to create a face properly so that you can see it when you are looking at it from this view, you will click on 3 vertices in a counter-clockwise motion. (See Figure 1.12).

mt-fig11.gif (4789 bytes)

Figure 1.11 Selecting the Face tool

mt-fig12.gif (15336 bytes)

Figure 1.12 Creating the 1st "Face"

Continue to create the faces in this fashion. You should pay attention to the way you are creating them as well for a 3 sided face may look a little strange if you do not put some thought in the arrangement. For example if you are to come to an corner of a box and you chose a vertex for the third face that was not on the plane as the top edge where the other two were chosen, it would look as though someone smashed in your square box or dented it! If you look at Figure 1.13 you will see an example of this. The author of the box should have selected vertices that should not be used and used the"Edit->Hide" Selection command on the menu selections.

Figure 1.13 Bad "Face" creation of a square box

At this point you need to save and name your file, which will be a reference file, as we are not going to create animations yet. You will name it: "knife2(ref).ms3d." Just select the "File->Save" on the menu selections.

Once you have created all the faces necessary to get the knife blades sharp edge we will proceed with a 3rd path of vertices that will be parallel to the 2nd path that we created. (See Figure1.14).

Figure 1.14 3rd Vertex creation path

You will have to select the 3 vertices that form this 3rd path as we have done before. Move them as before to the left to match up with the 2nd paths x-position.

mt-fig15.gif (8567 bytes)

Figure 1.15 3rd Vertex path alignment to 2nd Vertex path

Page 5->


Making a World model for Half-Life - Page 5

Our next step will be to create the necessary "Faces" to the knifes left edge. Figure 1.15 shows all the faces completed.

Figure 1.16 Completed faces for the 3rd path

Are you ready for the 4th vertices path yet? This path will follow the left most edge of the knife blade and will not quite be pulled out as far as the 2nd and 3rd paths, but will go a bit further out than the knifes cutting edge. (See Figure 1.17). My guess would be a halfway point between the cutting edge and the thickest part of the blade.

mt-fig17.gif (31073 bytes)

Figure 1.17 Completed 4th path and alignment

Again create the faces necessary. Once you have done this you are ready to create the part that has the name stamped in metal. These vertices should line up with the thickest part of the knifes blade.

Now you should be proud of yourself! you have almost one half of the knife blade done. It will be a simple matter to make the right side of the blade by duplicating it and mirroring this to the Left<->Right. But before we do this to make our task even easier, we will now texture this side of the blade so that when we make the duplicate and mirror it, we will not have to tediously texture map the duplicate.

First you will have to change to the "Material" rollout by clicking on the "Material" tab as shown in figure 1.18. Next you will click on the "New" button as shown on figure 1.19.

Figure 1.18 Changing to the Materials rollout

Figure 1.19 Creating a "New" material

Page 6->


Making a World model for Half-Life - Page 6

Now you will rename the material to something that will fit what we are trying to model.Double click in the text box area that presently says "Material01" and type in what will make more sense: "Knife2.bmp". (See figure 1.20). This will be the material that we will be getting next.

mt-fig20.gif (7188 bytes)

Figure 1.20 Renaming the material

We will have to find where our bmp of the knife2 is. You should put them in the directory where the model is being built or in a subdirectory of the models directory that you have chosen to use. Another thing you will have to keep in mind if you are going to make the skin yourself, is that HL models have to be a 256, 8 bit indexed color bmp format, and it has to be a power of 16. So the smallest bmp you can have would be a 16x16 bmp file. The largest file would be a 256x256 bmp for the reasons that most video cards work in powers of 2 up to 256x256 memory blocks. This was inherited by the Quake engine that Half Life licensed and highly modified for the game play.

To get the material, I have put it in the same directory as the Ms3d file that I am working with. Oh! did I save it as often as you can because of freaking things that happen when your working on a computer, such as Fido coming along and chomping on your power cord to the computer and dying, then you have to take time to bury him and then you lost the blankity blank file! Make backups as well, especially when you are getting ready to make a major change to your work, so you will have something to go back to, in case of a mess!

Nuff said about that. click the first "None" button in the Material section of the "Material" rollout. (See figure 1.21).

mt-fig21.gif (18996 bytes)

Figure 1.21 Importing the material

Select the knife2.bmp file and it will put it into the knife2.bmp material. If you want to have some fun, click and hold the mouse button on the Material sphere and drag it around to see it as it would be applied to a sphere!

We are now going to apply this material to the knife blade that we have just made, or rather one side of it. You will have to switch back to the "Model" rollout, and click on the "Select" button and click on the "Face" button in the "Select Options" portion of the rollout. Drag your mouse across all the faces to select them all, or you can use the "Edit->Select All" on the menu selections.

Now we need to make a group of the selected faces so that it will be easier to select when we start to make other portions of the knife. We do this so we can hide portions of a model so that we can best work with a area of a model such as in the case of "Skinning" a model or texture mapping the faces in a group. Click on the "Groups" tab of the rollouts and click the "Regroup" Button to create or regroup all the selected faces. (See figure 1.22). You will notice in Figure 1.22 that we have the "Auto Smooth" option checked, as it should be. Smoothing a Group will make the rough edges of the poly "faces" appear to blend instead of being razor sharp. Something a character model does not need or most weapons, e.g. a gun barrel or a persons face. You will be renaming this new group to "Blade-Left" the same way that you renamed the material in the "Material" rollout section.

mt-fig22.gif (6947 bytes)

Figure 1.22 Regrouping and Renaming the Group

To do this you will now have to switch back to the "Material" rollout. Next make sure that the "Knife2.bmp" is highlighted in the material list box and click on the "Assign" button as show in Figure 1.23.

mt-fig23.gif (7091 bytes)

Figure 1.23 Assigning a Material to the Group

Page 7->


Making a World model for Half-Life - Page 7

Again you will have to switch back to the "Groups" rollout to see if this did indeed assign the material, due to many unexplainable reasons, sometimes the first click doesn't do it. Don't ask me the reasons for this, it just happens that way sometimes.

At this time we will have to do some bit twiddling of the texture coordinates so that the material that we have chosen to assign to this side of the blade is going to align to the faces of our left side of the knife blade.

To do this click on "Window->Texture Coordinate Editor" on the menu selections. Here you will have to chose the group that is presently selected. Next you will click the "Region" button on the dialog box and click and drag a box around only the blade portion as shown in Figure 1.24. Also you will now turn on your "Textured" option in the "3D" viewport by right clicking in it and clicking on the menu option "Textured" also shown in Figure 1.24.

mt-fig24.gif (48849 bytes)

Figure 1.24 Adjusting the Material to the Group and setting 3D viewport to Textured

Now it is starting to look like a knife! We will now make a duplicate of this and mirror this duplicate. To do this you must still have all the faces of the "Blade-Left" group selected. If you do not you can switch to the "Groups" rollout and highlight the "Blade-Left" group and click the "Select" button. You will need to switch to the "Model" rollout. Here we will chose the "Edit->Duplicate Selection" on the menu selections to make a copy of the group. After this is done we will chose the "Vertex->Mirror Left<->Right" on the menu selections. it should perfectly align with the "Blade-Left" group. You should rename this new group by switching to the "Groups" rollout and renaming it to "Blade-Right" to avoid future confusion.

Now this duplicate does not have a material assigned to it. First to see a bit of texture magic, spin the view of the knife blades around in the "3D" viewport, by click and holding you mouse button down and dragging it to the left or to the right in the view port window. Spin it until you can see the backside that has no material. Now click on the Material" rollout and click the assign button. Now you duplicate will assume the texture material and place it perfectly as you have on the "Blade-Left" group. Now takes some bows for your magic act!

The next thing we need to do is weld the halves together, that's right! Get out your blow torch and lets weld this puppy! You do this by selecting the vertices that appear in this case to be already joined on the knifes cutting edge. Look at figure 1.25 to see all off the ones that are selected that need to be welded. We will have to do this one by one to insure that they will be done right.

mt-fig25.gif (15427 bytes)

Figure 1.25 The 4 vertices to be welded

Now switch to the "Model" rollout if you haven't already done so and select one of the four to be welded with the "Select" tool set to the "Vertex" mode. Next, click on the "Vertex->Snap Together" menu selection. Now comes the welding part we were discussing. Fire up that Acetylene Torch and, lets do this! Click on the Vertex->Weld Together" menu selection. If you watch in the "3D" viewport, you may see it go into action, depending on how your looking at it. You might see the faces look like they are fitting together better and change their looks a bit.

At this point we will have to fill the gaps on the back side of the blade. We will first be selecting all the vertices that might get in the way of our creating faces as mentioned earlier about the dented box syndrome. Deselect any vertices that may still be selected from the previous operation, by clicking in a blank area in the "Left" viewport. Next, you will be selecting all of the vertices except the ones on the left outer most edges in the "Left" viewport as Figure 1.26 shows.

mt-fig26.gif (10585 bytes)

Figure 1.26 Selected vertices to be hidden

Page 8->


Making a World model for Half-Life - Page 8

In order for us not to be able to accidentally chose a wrong vertex in our face creation, we will hide these selected vertices by clicking on "Edit->Hide Selection" on the menu selections.

Its time we sew up this back side of the knife blade by selecting the "Face" tool once again. We will be working in the "Back" viewport for this operation. Remember to use a counter-clockwise motion to make the faces to be appearing to face us and not turned inside out, so it would appear as if they are missing if we were to view it on the backside.

The vertices at the bottom may be a little tricky to complete as there are 4 of them close enough together that might cause some problems. You might avoid some of this by zooming in closer to see them. This is done by clicking on the "Selection" button to turn off the selection tool and first holding down the "Ctrl" key on your keyboard and dragging in the "Back" viewport to center the area to zoom in on. Then you will hold down the "Shift" key and drag in the "Back" viewport to zoom in. As you can see this is good for fine tuning those hard to get at vertices!

Now we will finish the back portion by clicking on the "Face" button to turn on the tool, then carefully creating the two final faces that sew the bottom of the blade to the left and right sides. (See the faces at the bottom of Figure 1.27).

The Texture mapping is going to be usually way off as new faces are added to the existing groups. The new faces will add themselves to an existing group, usually to the groups vertex that you first click on. We will have to select all of the faces we wish to put into a new group which we will name "Blade-back" group. (See Figure 1.27). Switch to the "Select" tool and turn on the "Faces" option. We will also be using the "Ignore Backfaces" option by clicking in the check box. It should have a check mark to indicate that it will not select backfaces to make our selection of these faces easier. Move to the "Front" viewport so that we can select the faces that we just have created. Now this is a bit odd that we should have to move to the "Front" viewport, when the faces we want to select are on the back with their faces towards us. Don't ask, I don't know why it was programmed this way.

mt-fig27.gif (9402 bytes)

Figure 1.27 Selected Faces to be regrouped

Switch to the "Groups" rollout and click the "Regroup" button. Rename this group to "Blade-back" group.

This group will have to have its texture aligned to it. The "Back" viewport is where we will be working to align the texture. If your "Texture Coordinate Editor" dialog box is still hanging around, perhaps you have minimized it, get it to show up so you can work with it. There is a drop down list box that contains all the names of the groups in it, click on the down arrow and select the "Blade-back" group. Chose the "Back" from the viewport drop down list, as we want it to apply the texture in the back 2d dimension. If you select the wrong 2d view of applying a texture, it may stretch the texture in a manner that will look deformed or like someone took a spray paint can and just streaked the paint on the sides. We want or model to appear as if looks real from all sides. This is the toughest part of what is called "Skinning" a model.

Click the "Region" button, and click and drag your mouse over the back area of the blade where it is dark. (See Figure 1.28).

mt-fig28.gif (34090 bytes)

Figure 1.28 Remapping the back side of the blade

Our job is not quite yet complete to move on to the handle as we need to finish our sewing work. We will have to unhide all the vertices that we have hidden from a a previous operation. Click "Edit->Unhide All" in the menu selections. Again, click on the "Selection" tool button in the "Model" rollout, and make sure it is set to "Vertex." We will also have to uncheck the "Ignore Backfaces" check box in the "Selection Options" portion. If you look at Figure 1.29, it will show you which ones need to be selected and hidden.Click on "Edit->Hide Selection" on the menu selections.

mt-fig29.gif (10451 bytes)

Figure 1.29 More Selected vertices to be hidden

We need to start working in the "Left" viewport to get at some of the vertices on this backside. The tiny areas will have to be zoomed in on to see how to make the faces. (See Figure 1.30). Again, click on the "Face" button and start to sew up this area.

mt-fig30.gif (9658 bytes)

Figure 1.30 Zoomed in area to create face

Page 9->


Making a World model for Half-Life - Page 9

If you use the drop down list on the viewport interface, you can select the "Right" viewport. Do the same as before in creating this face. We need to hide the 2 vertices that will interfere with our face creation in the "Back" viewport by switching to the "Select" tool and have the "Vertex" turned on in the "Selection Options." In the "Right" viewport select the vertices as shown in Figure 1.31. Again, click on "Edit->Hide Selection" on the menu selections.

mt-fig31.gif (8453 bytes)

Figure 1.31 Selecting the vertices to be hidden

Switch to the "Back" viewport and sew this up to complete the back blade portion of the knife. You will need to chose the "Face" tool once again. Now it should be easy to create these 2 remaining faces of the back of the blade as Figure 1.32 illustrates.

mt-fig32.gif (10376 bytes)

Figure 1.32 Creating the back face to finish the back blade portion

At this point you may notice that your top portion of the blade overlaps that of the lower portion. We can correct this by clicking the"Edit->Unhide All" in the menu selections first. Next, you will switch to the "Select" tool and have the "Vertex" turned on in the "Selection Options," and using the "Right" viewport, you will select the vertices pictured in Figure 1.33. Then you will click on the "Move" tool button and lock down the "X, and "Y" axis. (Refer to Figure 1.9 for an example of locking the axis). Move the vertices to the left to align with the rest of the vertices that appear to be in a straight vertical line.

mt-fig33.gif (11622 bytes)

Figure 1.33 Moving the back vertices to align with the top portion

Now you may want to fix the texture coordinates. To do this refer to Figures 1.27 and 1.28. The only difference here will be the viewport you will be looking at to apply the texture.Remember to reassign these new faces to a group and you should have at least 2 groups. You can leave the "Ignore Backfaces" check box uncheck and select both the right and left faces of the two faces that we created as Figure 1.30 show the faces to be selected. You should "Regroup" these and rename them to something that makes sense such as: "Blade-Union-LR" and "Blade-Union-Back." Pick the "Blade-Union-LR" first. Then you will choose the "Left" viewport in the "Texture Coordinate Editor" and do a "Region" box in such as illustrated in Figure 1.34. Why did I do this? First we have no long area that has dark metal on it, so we are going to pretend that we do and then "Rotate" and "Move" it to fit in the dark metal area to the right. The procedure will be the same for the Blade-Union-Back" group, except you will be using the "Top" viewport in the "Texture Coordinate Editor."

mt-fig34.gif (28104 bytes)

Figure 1.34 Drawing a simulated region area to map the texture to the faces

Click the "Remap" button. Next, Click the "Rotate" button, and rotate the faces to be in a vertical fashion, rather than a horizontal fashion. Click and drag in the window. It will take some practice to achieve the direction that you want to rotate it in. As you are doing this you may see some distortion that will have to be corrected by the "Scale" feature of the "Texture Coordinate Editor." Click on this button and click and drag in the window. Like the rotate feature it will take some practice to achieve the directions to move in to scale it properly. Finally, click the "Move" button and move it to the dark metal are of the blade.

Page 10->


Making a World model for Half-Life - Page 10

The knife blade is still not complete as we have to move to the front to sew it up. You might have noticed, that in the textured view of our 3D Window, that the cutting edge of the knife blade looks like it has a black part that would indicate that we are looking at from the backside. This looks the case on both sides of the knifes cutting edge on the lower portion. What happened here? When we created this section, we did not drag it out slightly to simulate the smooth tapering of a real knife. We will now fix this. (Good thing we didn't weld that spot! Or did you?) We will be closing the "Texture Coordinate Editor" at this point as it just is getting in the way. This time we need to check the "Ignore Backfaces" option by clicking in the check box. This will allow us to only select on vertex at a time that are align to each other. Select the vetex as pictured in Figure 1.35.

mt-fig35.gif (18647 bytes)

Figure 1.35 Single vertex selection to be moved

Now switching to the "Move" tool, you will lock down the "X, and "Y" axis. (Refer to Figure 1.9 for an example of locking the axis). Now in the "Front" viewport move this vertex to the left a bit. Switch the tool to "Select" again and in the "Left" viewport click in a blank area to unselect the last vertex and then select the opposite side of the same area vertex. Chose the "Move" tool once again and in the "Front" viewport move the vertex to the right. Look at Figure 1.36 to see the final positions of these 2 vertices.

mt-fig36.gif (10164 bytes)

Figure 1.36 Final position of the 2 vertices

Its time to hide the unwanted vertices again.They are shown in Figure 1.37. I will leave it up to hide them as you should now be used to this feature.

mt-fig37.gif (10948 bytes)

Figure 1.37 Selection of vertices to be hidden

I am going to let you have at the final sewing up of the front part of the blade. Other than it being tricky in some areas, it should be about the same steps involved as we did before. If you have forgotten, refer to Figures 1.30 - 1.34 and the accompanying text.

Very good! You have suffered through the tough part. Now it should be all down hill! You should have something that looks like in Figure 1.38 by now.

mt-fig38.gif (17193 bytes)

Figure 1.38 Completed knife blade

Now comes the time that we will make the handle portion of the knife. We will be creating what is called a primitive for the joining of the blade to the handle of the knife. First click the "Box" tool on the "Model" rollout. Check the "Redraw all Viewports" check box in the tools options to make all viewports to show the creation of the box to get a feel for the size needed as you creating it.(See figure 1.39).

mt-fig39.gif (4608 bytes)

Figure 1.39 Box tool selected with Redraw All Viewports option on

In the "Left" viewport, try to drag a box out in it like Figure 1.40 illustrates. This illustration shows all 4 viewports as it should appear you have finished with the creation of the box.

mt-fig40.gif (61343 bytes)

Figure 1.40 Box creation in all viewports

It should extend outwards a bit to the right and the left as the "Front" viewport shows. If its necessary, use the "Scale" tool and lock down the "Y," and "Z" axis and drag to the left or right to adjust it as necessary. (Refer to Figure 1.9 and the accompanying text).

Page 11->


Making a World model for Half-Life - Page 11

We will be deleting the bottom of this "box" so that we can continue the handle and not have extra faces in out knife. Select the "Bottom" viewport selection in a viewport from its viewport selections drop down list. You might have to right click in this viewport window and select "Reset View" from the menu selection to get the wireframe to show up in this view, and also zoom in a bit. In the the "Left" viewport you will be using the "Select" tool set to the "Face" option and selecting all but the "box" that you just created. Hide these faces. Next, turn on the "Ignore Backfaces" option by clicking in the check box. Click in a blank area to unselect all faces or vertices. Click inside of the box in the "Bottom" viewport of the "box" so that only two of the bottom "faces" are selected. Press the "Delete" button on your keyboard, and those unwanted faces disappear magically!

In order to help us to create the handle portion better, we are going to make the viewport bigger. Right click in the "Left" viewport window and click on the "Maximize" menu selection as shown in Figure 1.41. Your viewport will resize to full screen to you client window of Milkshape3D. This works as a toggle, which means that in order to see all your viewports again, you just do the same step as before.

mt-fig41.gif (23842 bytes)

Figure 1.41 Selecting the Maximize viewport selection

Zoom the viewport window in until you can see the extremities of the knife handle for better creation of the vertices. The creation process will be exactly the same as when we first made one side of the knife blade, only this time it will be totally flat. I told you it would be easier now! You may want to review the procedures in for the creation of the faces. I am going to get you started by telling you that you will create the outline of vertices. I will also give you a tip: 4 of the vertices on each side of the knife handle have also been created for us from the box that we created earlier. So you will have to align the vertices that you have created to complete the outline to the left side of the "box" in the "Front" viewport. Figure 1.42 illustrates what you should have when done. Again review the steps from the knife blades creation to accomplish this step.

mt-fig42.gif (15787 bytes)

Figure 1.42 Completed faces of knife handle

The next step is to Texture this side. Your on your own here as well as you can review the steps that was involved in the the texturing of the knife blade. You will also have to remember to make a new "group" of faces in the "Group" rollout. Figure 1.43 illustrates what it will look like when you have completed this operation.

mt-fig43.gif (20751 bytes)

Figure 1.43 Textured "Group"

Wow! Looking good! Do you remember the trick of duplicating one side and mirroring it to the other side. Also remember to weld the puppy to the other side and texture it in the same way we did the left and right blade mirror. You will then sew it up just like we did on the knife blade. Please review these steps if necessary to refresh your memory. I would like to explain that you will have to delete two faces on the other side of the knife handle that formed part of the "box," as they will get in the way of our duplication. Please refer to Figure 1.44 to see the selected faces to be deleted. Make sure you have the "Right" viewport available to work in to do this and have the

mt-fig44.gif (16070 bytes)

Figure 1.44 Selected faces for deletion

The last thing that should be done is to fix the textures of you handle. You might not realize this, but the top portion of the "box" that you created earlier, has no texture assigned to it and the new groups that you have created will need texture added to them. First select the "box" top, and fake a texture for it by making a region in the "Top" view of the "Texture Coordinate Editor" like we did before. It should have a metal look. The knife handle's "Front" and "Back" texture groups can be faked as well. (Some of the more particular texture artist may take extra time to "paint" the sides of the weapon, but we are just going to fake because we can!) When your finished with the creation of the handle and textured it, unhide everything by clicking the"Edit->Unhide All" in the menu selections.

Page 12->


Making a World model for Half-Life - Page 12

Good work! Maybe some big game company is start to take notice of our work! I can see the paychecks now! *Ahem* ..., well seriously folks, take a look at Figure 1.45 to see what we should have at this point.

mt-fig45.gif (14011 bytes)

Figure 1.45 Completed handle with knife blade unhidden

The final thing we need to do is to make it so that we can view it ingame as a world model. But we will first have to check its size and position to be correct for ingame use. Chances are that it will be of monstrous dimensions. The first world model of a Pipe bomb I made was big as a house, and the team laughed so hard when we went into a DM MP game with it in the map that it took weeks of therapy to calm us down! One of the comments about it is shown in Figure 1.46

mt-fig46.jpg (35042 bytes)

Figure 1.46 Disaster strikes in the hearts of Swarm players!

Before we compare the what size we need, first we have to save our file. For us to compare its size to a human or another weapon is that you should open up a v_weapon.mdl file and make a box to fit around the weapon. Then you should delete all the groups and the joints or bones in it so that just your box remains. (See Figures 1.47 and 1.48).

mt-fig47.gif (8435 bytes)

Figure 1.47 Exporting the op4 v_knife.mdl

mt-fig48.gif (27377 bytes)

Figure 1.48 Creating a box to use as a guide

We will next delete all the joints by going to the "Joint" rollout and selecting the first bone in the list as shown in figure 1.49, then deleting it by using the "Delete" key on the keyboard.

mt-fig49.gif (31631 bytes)

Figure 1.49 Selecting the main joint of the biped for deletion

You will next switch to the "Groups" rollout and select and delete one by one all the "groups," except of course the "box" group that you just created. Next go to the "Materials" rollout and delete all the materials, as we do not want any unwanted references to materials that are not used in our knife file. Then you will save this in the directory that you created your knife. You should name it something like "Box-Scale.ms3d," so as to remind you what this file is.

At this point you will open the "knife2(ref).ms3d." You need to merge the box into this file now. Select "File->Merge..." on the menu selections, and choose the "Box-Scale.ms3d" file. You may find it hard to find this new item, if you do not first zoom out in all viewports before the merge. You might want to rotate this box so that it will be easier to scale the knife to about the same size. In Figure 1.50 you can see that my knife creation was a bit to large, and will need to be scaled down. Refer back to the reference on how to scale and do this now. Here is a tip to help: set the scales of the "X," "Y," and "Z" axis to .9 in the scale text boxes and keep clicking the "Scale" button in the "Scale Options" section until the desired size is achieved.

mt-fig50.gif (15598 bytes)

Figure 1.50 Checking the scale of the knife model to a know size

Page 13->


Making a World model for Half-Life - Page 13

The box can be deleted from the "Groups" rollout, as it has served its purpose. Save your file at this point. Another thing to note is that you will have to move it to match the axis bottom as this is the point that model use for his feet placement. Look at our favorite character in HL Barney and notice his position in the "Front" and the "3D" viewports in Figure 1.51 for an example of this.

mt-fig51.gif (38813 bytes)

Figure 1.51 Example of proper placement of a model

You will now need to rotate this knife so that your looking at in the "Front" viewport laying on its side with the knife edge facing you. This is how it will be viewed in the HL world. Look at Figure 1.52 for the final position of the knife.

mt-fig52.gif (20640 bytes)

Figure 1.52 Final position of the knife

Lets look at this beauty one more time. You will notice in Figure 1.52 that I have adjust the width of the knife to make it look a bit more realistic, by moving vetices in nudges. I set the "Move" tools "X" axis to ".03" in the move axis text box and clicked on the "Move" button in the "Move Options."

You may have noticed some of the faces not showing up at this point. You should right click on the "3D" viewport and uncheck the Draw Backfaces option of the viewport window. This is a toggle, so you can turn it on and off by right clicking and choosing it again. Spin the model around and look carefully to see if any "faces" have their faces flipped. If this is the case you will have to select on the faces that appear as they are not showing, or have their "faces" flipped. To correct this you must select "Face->Reverse Vertex Order" in the menu selections.

To get it compiled as a HL world model we will have to add a joint for our knife.Click on the "Joints" tab rollout and check the "Show Skeleton" check box so there is a check mark in it to show the joint that we will create. Click on the "Model" tab rollout to switch back to create the actual "joint."

mt-fig53.gif (22192 bytes)

Figure 1.53 Creating a joint for the knife

The final thing we need to do to our model, is to assign all the vertices to this "joint" that we just have created. If you have lots of joints, you would first go to the "Joints" rollout and select the proper joint that you want to assign vertices to. In this case our "joint" is presently selected and we want to assign all the vertices to this "joint." Select "Edit->Select All" on the menu selections.

Switch to the "Joints" rollout and click on the "Assign" button to assign all vertices to this joint as Figure 1.54 depicts.

mt-fig54.gif (4530 bytes)

Figure 1.54 Assigning a joint to the vertices

Our model is now ready to be exported to be used in the compilation of a Half-Life world model. Select "File->Export->Half-Life SMD..." and in the "Save As" dialog box "File name" text box, type "knife2(ref)" for our smd file. Click the "Save" button. You will have a new dialog box appear with 2 choices, "Reference," and "Sequence." We will choose "Reference" as we do not have any animations that require the saving of "Sequence" frames. We can reuse this "Reference" smd file to fake an "Sequence" or animation frame. This is quite acceptable in a world model. We will discuss animation creation in a later tutorial. Look at Figure 1.55 to see an example of choosing a "Reference" smd file.

mt-fig55.gif (15182 bytes)

Figure 1.55 Saving a Reference smd file

Sometimes errors will occur at this stage, as you may not have all the "vertices" assigned to a "joint." this is easily corrected in our world model case as all the "vertices" will only be assigned to one "joint." You might think that you have assigned all the "vertices" to the "joint," but in reality you may have not have had them all selected in the step where we choose all in the window. You may have inadvertently have had some "faces" or "vertices" hidden from view when you used the "Edit->Select All" operation. To fix this you would click the"Edit->Unhide All" in the menu selections. Then you would use the "Joints" rollout and click on the only "joint" in the list and then use the "Edit->Select All" on the menu selections. Finally, you once again click on the "Assign" button to assign all vertices to this joint as Figure 1.54 gives an example of doing this.

Page 14->


Making a World model for Half-Life - Page 14

If you have made it this far, your are doing great! The final thing to get this model into a Half-Life, will be to create a QC file. Milkshape 3D has made the job easier for us. Select "Tools->Half-Life->Generate QC file..." and type in the "File name:" text box "w_knife2" for a file name. What will result in this will not be perfect, so we will have to open it for editing. Select "Tools->Half-Life->Edit QC file..." and select the "w_knife2.smd" file. You will see the text as shown in Figure 1.56 in "Notepad" window. You should alter it to like like the text in Figure 1.57.

mt-fig56.gif (12778 bytes)

Figure 1.56 Generated QC file

mt-fig2.gif (13573 bytes)

Figure 1.57 Corrected QC file

Some of the differences may not be obvious. One of the most important things to change is the $scale command to read: "$scale 1.3" as world models should appear larger as they will not be held close to the screen like the perspective view of the first persons models. You probably also want to correct the models name. You can call it whatever you like, but it is best to keep the naming convention the same as the rest of the Half-Life models. That is to say put a "w_" in front of the model name. It makes it easier for the coders to figure out what is going on, especially since usually you need 3 models to represent one weapon. You will need a "v_" and a "p_" and a "w_" model for each weapon that you design. Some thought should go into this. A lot of times modelers will strip down a "v_" model to make it into a "w_" model as you will not usually be looking at this model as closely as the "v_" model. The "v_" suffix implies that it will be a "view" model or seen up close in you hands as a player. The "p_" models are usually stripped down versions of the "v_" model as well as these are seen in the 3rd person models or what you see another player hanging onto in battle.

Well lets rap up this model and get it compiled! Select "Tools->Half-Life->Compile QC file..." to start the magic show! If all goes well, (you didn't have doubts did you?), you will have you world model called "w_knife2.mdl" in your directory. To view it you should use "Half-Life Model Viewer" to look at your handy work.

Hopefully this tutorial has been helpful to you in the creation of world model and I will get enough response to continue the series of tutorials. If all goes well we will be taking the model that we just made into a "p_" model next, then move on to a "v_" model, which will require animation. Then I hope to help you make a character model.

All material in this tutorial is copyrighted © 2000 by Rick J. Kelley and is not to be copied without the express permission of Rick J. Kelley. Half-Life® is Registered Trademark by Valve. Opposing Force® is a Registered Trademark of GearBox Software. Use of the pseudo name Rat is a referral to the author Rick J. Kelley.