Firstly you’ll need to download GUIStudioMDL, which you can get here:

GUIStudioMDL

We’ll be using this later!

Ok, so your model is skinned and looking yummy! Now we need to export it so we can compile it for use in Hammer and your mod!

Go back to XSI and select your cube. Go to the Transform menu and select “Freeze all Transforms”. This is important. If you don’t do this each time you change your model from now on, it will go horribly wrong. So remember, if you decide to scale your model or change it, Freeze all Transforms before exporting.

Now, right at the bottom of the screen, on the left hand side is a textbox with “1″ inside. Change this to “0″. Also important!

Next… Go to the ValveSource menu at the top and click Export SMD. Click the three dots on the right hand side to browse your harddisk. Go to the following directory:

1
SteamApps/username/sourcesdk_content/hl2mp/model_src/

Then name your file “cube” and click “OK”. You will be back onto the original screen now. So to start with we need to export the actual model. So make sure “File Type” is set to “Model .smd”. Lastly, uncheck “Remove all unused bones (use on character rig only)”. Now click “OK”.

You’re not done yet! Again, go to the ValveSource Menu and click Export SMD. This time change “File Type” to “Physbox .smd”. Next change the name of your file to “cube_phys.smd”. Click OK.

Last one! Do it again, and change “File Type” to “Skeletel Animation .smd”. Change the filename to “cube_idle.smd”.

Good! You’ve exported your model!

Now you need to create a QC File! Go to the directory where you save your SMD files.

1
SteamApps/username/sourcesdk_content/hl2mp/model_src/

Open up notepad and paste the following code inside:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Output .MDL
$modelname cube/cube.mdl

// Directory of materials that the model uses
$cdmaterials models/cube

//Defines model and static of physics
//$static

// Material properties
$surfaceprop "metal"

// Scale all units by a factor of 40
$scale 40.0

// Base or Reference .SMD
$body studio "./cube"

// sequences: all sequences are in $cd
$sequence idle "cube_idle" loop fps 15

// Physics data
$collisionmodel "cube_phys.smd" {
$Mass 5
$concave}

Save your file as “cube.qc” in the same way as before to create this file as a .qc file. Make sure it’s in the same directory as your SMD files.

Now open up GUIStudioMDL. Change the “Target Mod or Gamepath Info” dropdown box to Half-Life 2 DeathMatch. Then click Load QC from the File menu. Browse to the directory above and load your “cube.qc” file. Then click “Compile”.

Once it’s finished your model is ready to use in Hammer… but first, you need to put the VTF and VMT files in the right directory.

In the QC file we told the model to look for the skin in the directory “models/cube”. Copy your VTF and VMT file and browse to the following directory:

1
SteamApps/username/half-life 2 deathmatch/hl2mp/materials/models/

Create the directory “cube” inside this folder, and place both your VTF and VMT in here.

Now load up Hammer! Once loaded, create a prop_physics multiplayer entity and press ALT-ENTER to view the KeyValues. Select World Model and browse for your model… Type “Cube” to filter it out. If all has gone well, you should see your skinned model in the model browser! Just click OK to place it in your map!

At this point, you might discover your model is WAAAY too big. Don’t panic. Just open up your QC File again and change this line:

1
$scale 40.0

To a smaller number, relative to the size it appears in Hammer. Then recompile it using GUIStudioMDL… Once you’ve got it to the right size. Compile your map and chuck your cube about!

To export your skin you will need the VTF Plug in for Photoshop, so grab it here and install it as per the instructions:

Photoshop VTF Plugin

Don’t close XSI! You can preview your skin on the model by flicking between photoshop and XSI as you play with the design.

Skinning your model is really easy, and depends entirely on your own artistic talents. So to start with open up Photoshop and then open up cube.psd. You will see a blank grey skin with a yellow line around the edges.

Each side of your model is projected onto the same 2D space, so all you need to do is paint one side, and all six sides will appear the same.

Create a nice metal or wood texture and save your PSD file. Now flick over to XSI and take a look! Spin the model round, and you’ll see that all six sides are identical!

Once you’re happy with the skin, save it as a VTF file. Go to “Save as” and choose VTF from the drop down menu, name your file “cube.vtf” and press “Save”. A window will appear with various options. Change the Template drop down menu to “Compressed Texture” and change the “Sharpen Filter” menu to “None”. Click OK!

Make sure to save it somewhere sensible so you can find it later and put it in the right directory.

Now open notepad and paste the following code into the open document:

1
2
3
4
5
"VertexLitGeneric"
{
   "$basetexture" "models/cube/cube"
   "$model" "1"
}

Save the notepad file as cube.vmt… To do this, when saving place quotation marks around the cube.vmt name… e.g. “cube.vmt”. Save it in the same place as your VTF file.

Read on in the next post to find out how to compile your model.

Ok, you now have a lovely cube. But the first thing you need to do is create a blank skin as a base to skin the model. So open up Photoshop or GIMP and create a 1024 x 1024 canvas filled with 50% grey, and save it as skin_base.psd. I personally prefer PSD files as you don’t have to flatten these prior to saving.

Once you have your blank skin, open up XSI again and load up your cube model. Select the model and go to the left hand side menu, select Material and then Phong.

A new window appears with some colourful bars. Underneath the tick box on the first menu is a button which looks like a magnet, click it and select Image. Yet another window opens with an even more colourful image. On the right of this image is a button labelled New, click this and select New From File… Find your skin_base.psd and double click it.

Now you will see your black, grey skin in place of the previous colourful skin. Down below in the same window, is a section titled “Texture Projection”… on the right again, is a button labelled New. Click it and select Planer XY. A green line will appear around your cube in the 3D view. Close this window now.

Select your model and press Freeze in the right hand toolbar near the bottom. Select your model again, and now press ALT + 7 together. Another new window will open. This is the UV Map. Phew… this stuff is complicated!

So, this window is for creating your UV Map. Just to add to the fun, all the controls for zooming in and out and moving around are different here! Instead of using S, you now use Z. The right mouse button zooms out, the middle mouse button zooms in, and the left mouse button moves around. Got that?

Now… you’ll see LOADS of little buttons at the top of the screen. You only need a few though, so don’t panic. Press the one labelled “X-”… This will select all the negative facing X polygons. Go along a bit and press the the cube shaped button called “Planar Subprojection”, and click “Best Fit” from the menu it brings up. Do this for each of the buttons. So X+, Y-, Y+, Z- and Z+. Each time, click “Planer Subprojection” and then “Best Fit”.

Each side of the polygon has now been flattened into 2D as a UV Map for you to skin. Before you close this window, go to the “Edit” menu on the toolbar and click “Stamp UV Mesh”. Name the file “cube” and save it as a PSD. Remember the name you give your UV map at this point, as this will be the filename the model looks for ingame. You will name your VTF and VMT files the same name later on.

Make sure to Stamp the UV Mesh as a PSD file, just select PSD from the drop down menu on the save screen. If you don’t have photoshop, save the file as something you can access in your own paint program, preferable with layers.

Now close this window and look at your cube in the 3D view. It will have green lines all round it. Select it again and press Freeze again. The green lines will disappear. Go to the 3D view window and select the menu now called “Hidden Line Removal” and change this to “Textured Decal”. You should now see yellow pixelated lines around your model, on the edges!

Well done, you have UV mapped your cube!

UV map for each side of the cube

If you wanted to make each side of your cube different, skin-wise, at the UV Mapping Stage, do the following at this stage of the tutorial:

Now… you’ll see LOADS of little buttons at the top of the screen. You only need a few though, so don’t panic.

Select each side individually by pressing X+, X-, Y+ etc, each time pressing “Planar Subprojection” and “Best Fit”. Except instead of allowing each side to stay in the same place on the UV Map and create a single sided cube UV, every time you press “Best Fit”, press V on your keyboard and move the selection out of the area to the left or right. The idea is, instead of having one single cube as your UV Map, you end up with 6 faces.

Once you’ve seperated all six faces, you need to scale them down and fit them back (like a puzzle) into the slightly lighter grey box in the center, which is the extents of your UV Map. So, select them all and press X to scale them down, then press V again to place them in the correct positions inside your grey box. Once done, you should have all 6 lined up inside.

Now just carry on with the tutorial by Stamping your UV Mesh.

Hope this makes sense!

Ok, I’m going to try to write up a very basic modelling tutorial so you guys can get to grips with creating stuff like dynamic, physics and static props for use in your mods.

This tutorial is based on XSI 4.2 Mod Tool, which you can get below. This isn’t a pirate or limited version, it’s a full version of XSI for mod makers:
- XSI 4.2 Download (202mb)

Once you’ve installed it you need an activation key which you can get from here:
- Registration Key

Finally you will need the Valve Plugin, for exporting your models in smd format:
- XSI Valve Plugin

Tutorial Part One: Making the Model

Load up XSI. Once it’s loaded you will see four viewports, X, Y, Z and 3D. This is the area you build your model in. XSI 4.2 Users ONLY: Before you do anything, click on “Select” at the top of the right hand side toolbar and a menu will appear, go to the bottom and uncheck “Extended Component Selection”. You will need to do this everytime you load XSI. You don’t need it, because it’s a pain in the ass.

OK! We’re going to start by making a really simple physics box. On the left hand side menu click on Primitive, then Polygon Mesh, then Cube. A cube will appear in your viewports.

Move your mouse over the 3D view port and hold down S on your keyboard and the middle mouse button to zoom in and out. Hold down the right mouse button to move around, and the left mouse button to move left, right, up and down. What a lovely cube!

Let’s make the cube look solid. In the top right of the 3D viewport is a button labelled “Wireframe”. Click this and change it to “Hidden Line Removal”.

Now, let’s make the cube more interesting. With the cube still selected, go to the top menu and you will see several selection options, each with a mouse pointer. Select the fourth one called “Select Polygon Tool”, alternatively, press U.

Now, click one side of the cube and it will turn red. With this side selected, press CTRL-D. Nothing seems to happen, but what you’ve done is doubled the polygons on this side.

With the polygon still selected, press X and move your mouse pointer near the center of the polygon until it says XYZ just above it. Now press the left mouse button and move the mouse in toward the center of the polygon… In doing this your scaling the new polygon in all three dimensions. Looks better? Do it for each side if you like! Once you’re finished, we’re ready to UV Map the model.

Come back soon to find out how to UV Map your model.

When Jailbreak: Source 0.3 was released, it came with two completely new maps, one of which was called Woodneck. It was a non-symetrical map, with a U shape layout, inspired by dm_runoff. During the construction of the map, I happened to sit down and watch Resident Evil, and one scene in particular was rather inspirational… thus became the infamous laser escape.

lasers1

Finding the Balance:

In the year and half that has followed since the first version of the Woodneck was released, I have tweaked this escape more so than any other, and it has been quite possibly, the hardest one to perfect in terms of balance. I must have altered the speed, angle, height, strength and frequency of the lasers over one hundred times, taking hundreds of different view points into account.

The trouble is, the escape itself is inherently difficult. You have to dodge multiple moving lasers, with only one relatively safe and linear path through. You must do this whilst trying to navigate other players, and you have to open two doors, by pressing two different buttons. After several weeks of testing and tweaking with our beta testers, they could all make it through nine times out of ten. Perfect!

Wrong! In our complacency, we simply didn’t realise that the testers had simply become GOOD at the laser escape, through weeks of practice. So when we unleashed it upon the public, the bodies piled up and players cried foul. “It’s too hard! It’s unbalanced! The other team have it too easy!” They were right, evidenced by the piles and piles of dead bodies to be found inside the laser escape room.

It was a massacre.

lasers2

Fixing the Lasers:

We went into beta testing overdrive. First we counter-balanced by ramping up the difficulty level of the other escape route, ensuring a similar level of players met a grisly end, but this didn’t solve the piles of bodies issue, so tweak by tweak we reduced the difficulty levels, and this time, learning from our mistakes we asked Blink from Interlopers to attempt the laser escape, for the first time, without guidance to see if he could make it through.

F**K YOU LASERS!

We needed a completely objective player to prove that our tweaks had worked, and on his forth attempt, Blink made it! Safely through the door on the opposite side he yelled “FUCK YOU LASERS!!” over his headset, causing us to fall about laughing in happiness!

lasers3

These legendary words became the decal written in blood on the wall as you exit the lasers… we felt the occasion needed marking for it was possibly one of the longest and hardest tweaks we’d ever worked through… Balance is the key to a great team deathmatch style game, without it, you’re players will not be happy.

And finally… after more than six months! I bring you… the Weapon Modeling Tutorial! PART FIVE! UV Mapping!

Now UV Mapping is a bitch. You WILL hate it. It will haunt your nightmares. It takes months to master, so at the end of this tutorial, I’ll be providing a cheaters download for those of you who want to skip straight to Part 6 when I post it, and spend more time learning the intricacies of UV Mapping without missing out on the animation side of things. So without further adieu, let’s get started!

Before we begin, you’ll need to make a 1024px by 1024px PSD file, filled with a 50% grey colour, name it xsi_base.psd for now, as you’ll use it again and again for all sorts of models, later on we’ll rename it within XSI and save it as a seperate file.

Here’s how we left things last time, with a complete polygon based weapon, but with no UV Map and no skin.

env_cubemap

So to get things started, we need to apply a basic material to the model, that we can work from to create our UV and skin later on. So click on Material under the Get toolbar and select Phong, to bring up a new window.

env_cubemap

Then click the little plug shown below, and select Image from the drop down menu.

env_cubemap

In the next window select New and from File, then find your xsi_base.psd file and select that.

env_cubemap

The image window will update, removing the multi coloured rainbow image, and replacing it with a nice flat grey one! Now under Texture Projection, select New; Planer YZ. Then close the window and return to the main view.

env_cubemap

Select your main model (not the clip), and press Alt+7 together to bring up the Texture Editor window. Now hopefully, it looks a little like the image below. If it doesn’t, don’t panic. Just carry on with the tutorial, it’s a not a huge issue!

env_cubemap

So what you’re seeing is a flat representation of your 3D model, except currently, you’re seeing it from only one side. What you need to do, is separate out all the sides you can’t see, onto a flat 2D plane, which you’ll then paint! So, within the Texture Editor window, you’ll see a group of six icons, labeled X+, X-, Y+, Y-, Z+ and Z. These buttons allow you to select only the parts of the model visible from those angles. Click X+ to begin with, then select the Planar Projection button (shown in the image below), and select Best Fit from the drop down menu.

env_cubemap

You’ll see that it has selected all the points on the X+ axis, and separated them from the rest of your projection. Now hit the V (move) key, and move those points away from the rest, off to the side whereever you like. Use the S key to move around, zoom in and out etc, if you need to.

Repeat this process until all the view angles are separated into different parts. You should end up with six main sections of your weapon: Left, Right, Top, Bottom, Front and Back. Make sure to keep them grouped so you know which part is which, and if you get confused, select a section and refer to the 3D view to be sure.

Now, what you need to do here, is the hard part. UV mapping is like doing a puzzle… except none of the pieces fit together and there’s no picture to work from. Argh. The principle is, to create a UV Map that uses all the available space of the 1024 image, but ensuring that high detail areas get more space than low detail areas that the player wont see. It’s the ultimate in optimisation. You need to find ways to rotate, fit, scale and move all the different pieces, so they fill up as much of the image as you can, whilst still being able to understand what the hell you’ve done when it comes to painting it!

There’s some useful tools in the Texture Editor you can use to make this easier though. For starters, you can rotate and scale selected points using C and X respectively. You can also turn on Island Select, by clicking the ISL button, as well as tearing, which allows you to separate joined vertices. There’s also Snap, which you access from Tools; Enable Snapping.

env_cubemap

Now, once you’re happy with the UV Map, from within the Texture Editor window, select Edit; Stamp. Now this is VERY IMPORTANT. Make absolutely sure, you select PSD as your file type from the drop down menu, before naming your file. Name it something like assault_rifle.psd. Now change the 3D view to Textured Decal mode, and you’ll see a bunch of yellow lines around the parts of your weapon!

Once you’re done, it should look something like this!

env_cubemap

Good? I hope so! If not, grab the download at the bottom. If all is well though, open up Photoshop and your PSD file. You’ll see your UV Map now, with all the yellow lines and grey fill.

env_cubemap

Now I recommend before you start painting, that you separate the UV Map from the unusable space, by using the Magic Wand tool, with a tolerance of 0, to select all the dead space. Then hit CTRL-I to invert your selection, and then CTRL-SHIFT-J to create a new layer via cut, from your selection. Now you can separate out the pieces of the model by using CTRL-SHIFT-J until all the pieces are on separate layers, nice and organised!

env_cubemap

Now get painting! I recommend using layer styles to fill in most of it, with colours, internal shadowing, material overlays etc. Then detailing certain parts of the model after rasterising, with scratches using custom brushes etc. Once you’re done, it should look like this!

env_cubemap

Now if something went wrong, or you just can’t take UV Mapping any longer, then feel free to download the file below. It’s contains the XSI scene file, the UV map and all the UV Coordinates ready for you to open up and continue on to the animating tutorial next week. I do recommend you give UV mapping a shot though, it’s hard, but very rewarding!

Download: Complete G36 Assault Rifle – Ready for Animating

Instructions: Install the .exp file to the following directory: C:\Softimage\Softimage_Mod_Tool_7.5\Addons\ModTool_Database\Scenes
then put the PSD file wherever you like, and link it using Alt-8 and selecting it within the Explorer view.

See you next time for the Animation Tutorial!