[Tutorial] Making static props for Source with XSI


Ricochet
09-20-2005, 03:22 PM
I had some free time on my hands, so I wrote a tutorial on making static props with Softimage XSI. It took me a while to get all this figured out so I hope this will give mappers a kick-start on prop modelling.

I wasn't sure whether I should put this in MSA or Mapping , but I figured mapmodels/props usually belong in here.

If a mod wants to move this thread though, then by all means go ahead.
-------------------------------------------



Making a static prop model with Softimage XSI for Half-Life 2

Introduction

It has often been stated that mapping for the Source Engine has become much more complex, due to the addition of normal maps, specular maps, displacement surfaces, area_portals and so on. Furthermore, the basic mapping concept has moved towards using less world brushes and more props and models to construct the map geometry. Models are easier on the engine to render and offer certain advantages, for example the ability to define LODs (Levels of Detail) which allows the mapper to decrease a model's complexity depending on the distance between prop and player.

Therefore, mapping for Source requires map makers to be able to make props for their maps. These can either be static props, like fences and trees, or physics props like furniture, debris etc.

The 3D-modelling software Softimage XSI Mod Tool is available for free to HL2 users and can be downloaded off Softimage's website. This is a very complex and powerful software package which can do a lot more than just construct props. But since it is free, one may consider it a definite alternative to 3D Studio Max.


Motivation

Although XSI is a large software bundle, tutorials and documentation for making Half-Life 2 props are few and short. Most tutorials only deal with specific aspects of modelling or texturing. This turned out to be a big problem when I started fooling around with XSI. The whole work flow of constructing a model, skinning it and getting it in to your map had to be scrounged together off the internet. This is why I decided to write a comprehensive tutorial which outlines the whole process from start to finish.

Please note that I am not a modelling guru. I have just started to use XSI and may not know all it's little secrets. Still, if you simply want to build your own props and get them into your map, then after reading this tutorial, you should be able to do so.

I will not be going into every little detail of the XSI interface and modelling itself, because that's a chapter of its own. Please refer to other tutorials or XSI's documentation for that.


Getting Started

Start up XSI. First we're going to change some of the preferences to make XSI a bit easier to use. Click on the "Select" tab in the toolbar on the right and:

Deactivate "Select single object in region"
Deactivate "Expand component selection"

Here are also some useful shortcut keys. Learn to use them. It makes working with XSI so much easier these can be used in "supra" or "sticky" mode. This means that if you tap the key once, XSI switches to that tool, whereas when you keep the key pressed, the tool will only be active until you release the key again. This saves you a lot of switching between tools.

u - Select Polygon raycast mode
i - Select Edge raycast mode
t - Select Point mode
SPACE - Select object
m - Move Point tool
x - Scale Tool
c - Rotate Tool
v - Translate tool
Alt-7 - Texture editor


I am going to create this prop for HL2 Deathmatch. Depending on the mod for which you're making the prop you'll have to substitute the hl2mp in the directories which I am using.

Building your model

In order to keep this tutorial clear and to-the-point, we'll be modelling a simple fence post. This will basically be a skinned cylinder.

Start off by Selecting Get > Primitive > Polygon Mesh > Cylinder from the left toolbar. Set the height to 1 and radius to 0.1. Set the subdivisions to U = 8, V = 1 and Base = 1 and then close the window.
Go to the right toolbar. Click on the "t" for "translate" in the "Transform" tab and make sure that "Global" is selected. Then enter "0.5" in the Translate Y field and hit enter. The cylinder should now be standing vertically on the reference plane in the 3D View.
Make sure your cylinder object is selected and hit "Freeze" to freeze the transformations

Don't worry about units and sizes at this point. Try to work at a scale that comes natural to you, like 1 unit equals 1 meter or foot. We are going to scale the model to HL2 units afterwards when we compile it.

http://img202.imageshack.us/img202/6210/screen10hz.jpg


Texturing

Now we will apply a texture to the model. This is done by a process called UV Mapping. Our model is made up of lots of polygons, which are defined by their corner points or vertices. To get a 2D texture on a 3D model we have to tell XSI what part of the texture corresponds to what polygon by mapping the vertices on the texture. Each vertex gets a UV coordinate assigned to it, which basically is a relative position on the texture image.

I suggest using a generic checkerboard or grid texture first, so you can see if the texture is properly mapped and that there are no distortions. I'll skip this though.

Now, there are a couple of ways to texture your model. Either you draw the texture first and then do the UV-Mapping, or you can unwrap the model first und draw the texture to fit the UVs. I'll do it the first way. I've made a simple texture in Photoshop consisting of a basic wood texture for the sides and ends of the fencepost. Save this texture as fencepost.tga in .../SteamApps/your@username.com/sourcesdk_content/hl2mp/materialsrc/models/Ricochet/.

http://img202.imageshack.us/img202/633/fencepost4wy.jpg

Now for applying the texture:

Click on the "Model" button in the upper left corner and switch the toolbar layout to "Render"
Select your object in the 3D or 2D views
In the left toolbar, do Get > Material > Blinn. A property window will pop up which you can close.
In the left toolbar, do Get > Texture > Image. A property window with XSI's standard texture will appear. Next to the first drop down menu, where it says "noIcon.pic", click on New > New from file... and select the fencepost.tga texture. Then, look down towards the Texture Projection tab and select New > UV. Close the window.

If you hit Alt-7 now you will open the texture editor and see your texture and the current UV map. At the moment it doesn't look very nice. In order to clean this up, go back to the 3D view and select all the polygons which make up the sides of the post with the raycast polygon select tool (Hotkey "u").

Now if you go back to the texture Editor you will see that these vertices are now selected.

http://img202.imageshack.us/img202/9171/screen27ke.jpg

In order for us to have a better view, go into the menu bar in the Texture Editor and select View > Show Selected. All unselected polygons are now hidden. We are going to unwrap these polygons cylindrically because this best emulates their shape in space. (You may notice that these polygons are already unwrapped cylindrically, but we'll do it anyway for practice). In the texture editor tool bar, click on the orange cylinder and then select XY object aligned. Now we have all the side polygons next to each other. Use the scale and translate tools to fit them onto the corresponding part of the texture.

After you've got the polygons where you want them, select View > Show All from the menu.

Now (in the 3D view) select the polygons which make up the bottom and top part of the cylinder and switch back to the Texture Editor. This time use the planar projection button (the orange plane) and then select "XZ World Aligned". This will map these polygons into an even octagon.

Move these polygons to where you want them to be and then have a look at the result in the 3d View. If you're happy with the result then move on to exporting. Freeze the model first, though, and save it.

You can export your UV map as a bitmap in the Texture Editor by clicking Edit > Stamp UV Mesh in the menu, in case you want to unwrap your model first and then fill in the textures.

http://img202.imageshack.us/img202/2246/screen36hd.jpg


Setting up for compiling

To compile this model, we need three .SMD files. One for the model, one for the animations (even though it has none) and one for the physics box (clipping/hitboxes). These SMD files need to be put together in the same directory. For this example, use .../SteamApps/your@username.com/sourcesdk_content/hl2mp/modelsrc/Ricochet/. Select your model, then in the menu bar select ValveSource > Export SMD...

In the dialog box, set the filename for the model SMD to fencepost.smd and click OK. Open the Export SMD... dialog again and this time select Physbox from the dropdown box and export this as fencepost_phys.smd by clicking OK. Lastly, select Skeletal Animation from the dropdown box and export this as fencepost_idle.smd.

Next, I suggest making shortcuts to studiomdl.exe and vtex.exe on your desktop. These files are located in .../SteamApps/your@username.com/sourcesdk/bin. This allows you to compile models and textures by dragging them onto the shortcut icon.

To begin compiling, make sure your fencepost.tga texture is located in .../SteamApps/your@username.com/sourcesdk_content/hl2mp/materialsrc/models/Ricochet/. Likewise, your SMD models should be in .../SteamApps/your@username.com/sourcesdk_content/hl2mp/modelsrc/Ricochet/.

Now, go to where your SMDs are and create a text file in the same directory called "fencepost.qc" copy the following lines into this file and save it:


// Output .MDL
$modelname Ricochet/fencepost.mdl

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

// Model properties
// model is a static prop
$staticprop

// Material properties
$surfaceprop "wood"

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

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

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

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




Compiling and finishing

Now drag the .qc file onto your studiomdl shortcut and watch it compile (provided Steam is running). The output will be placed in .../SteamApps/your@username.com/half-life 2 deathmatch/hl2mp/models/Ricochet/

Next, we have to compile the textures. Drag fencepost.tga onto your vtex shortcut. The texture will compile and create fencepost.vtf in .../SteamApps/your@username.com/hl2mp/materials/models/Ricochet/. Go to this directory and create text file named fencepost.vmt and copy the following lines in it:


"VertexLitGeneric"
{
"$baseTexture" "models/Ricochet/fencepost"
"$surfaceprop" "Wood_Solid"

}


And that's it! Now load up Hammer and add a prop_static model to the map. Open the entity properties, click Browse... and select ./Ricochet/fencepost.

http://img202.imageshack.us/img202/4669/screen43om.jpg

Further Reading

If you want to look into other aspects of modelling, compiling, texturing etc. I recommend the following sites:

Softimage website (http://www.softimage.com) - Where you can download Softimage XSI, documentation and read tutorials.

Valve Developer Wiki (http://developer.valvesoftware.com/wiki/Main_Page) - Official Valve Wiki with many tutorials.

HL2World.com Wiki (http://www.hl2world.com/wiki/index.php/Main_Page) - A community based Wiki with a large number of tutorials, even though many are the same as on the Valve Wiki.

Interlopers.net (http://www.interlopers.net/index.php?page=tutorials.htm) - Many tutorials, though mainly mapping

Desty's XSI Colt 1911 Video Tutorial (http://www.hl2modcentral.com/tutorial.php?id=27&cat=0) - A really great set of video tutorials for XSI. About 4 hours long all in all. Great for learning to model. At the time of this post, the page was offline. I'm posting this link anyway, hoping that the site will go up again soon.

Good luck,
Ricochet

Molybdenum
09-20-2005, 03:34 PM
Very helpful.
Thanks. :)

Trp. Jed
09-20-2005, 04:27 PM
Nice. I'm going to make a copy of this in the MSA tutorials section.

atamaca
09-20-2005, 05:53 PM
I was just talking about wanting to learn how to model, thanks a ton, I hope this helps me start off.

Watchtower
09-20-2005, 05:55 PM
Thanks Ricochet, I know I asked a few things the other day Im glad youve shared the knowledge.

Whats cool about XSI is that the model UV mapping can be done as well, where-as milkshape requires something like Lithunwrap.

All in all, I must say I still like the easier interface of Milkshape and the fact it doesnt try to bug you with online crap.

And after going through Jeds Lithunwrap tutorial, I was able to make a basic prop in MS3D ( a teller mine atop a wood post for a beach map), make the textures and UV map it in L-U.

Day 2 - I was able to make and ammo crate, a bench and a table in no time at all.

Remember that textures are a completely different thing as well people. For basic woods and metals, there are 1000's of tutorials available. All you have to do is search. Anything more complicated - IT NEVER HURTS TO REQUEST or ASK. You have nothing to lose and everything to gain if you just try, or ask someone for help. You'll find most people around here are quite friendly and more than willing to help out.

I'll go ahead and write a good tutorial on basic props for MS3d, just like what Ricochet did. Anyone capable of mapping is capable of modeling to a degree, once you familiarize yourself with the interface and controls.

Same principles all around - 3d objects. Faces (like using Hammer texture editor), groups (ie a box) and Vertexes. You've done it all before.

bone450
09-16-2006, 03:15 PM
Just a quick note that I think is critical and should be included above. Your directory structure should be something like: /SteamApps/your@username.com/sourcesdk_content/dod/modelsrc/bone/

All folders need to be lowercase otherwise problems will occur if mappers want to distribute the models with there maps with just a .res file.

For the reasons I outlined here in post number 6: http://www.dayofdefeat.net/forums/showthread.php?s=&threadid=66829

This problem had me scratching my head for about 6 months, thinking I didn't make my models right.

This has also been submitted into the new bugzilla sdk site as bug #19. We'll see where that goes.

Ca-Chicken-Soup
09-16-2006, 05:00 PM
*Sigh* I guess it's about time I started to learn modeling...
Tut looks good I should give it a try.

Ol' Noodle Head
09-16-2006, 08:27 PM
Word out on the street is that bone450 has a nice new Beerkeg cart model.

Someone needs to bump Ricochet's prop pack thread. I still haven't seen his cool telephone poles in any map but that obscure Foy version.

We need more prop models and less player-weapon-skinjob-fetish artists. No offense to those folks but please give us more than one dang wagon.

I'm just sayin'.

Ca-Chicken-Soup
09-17-2006, 07:37 PM
Originally posted by Ol' Noodle Head
Word out on the street is that bone450 has a nice new Beerkeg cart model.

Someone needs to bump Ricochet's prop pack thread. I still haven't seen his cool telephone poles in any map but that obscure Foy version.

We need more prop models and less player-weapon-skinjob-fetish artists. No offense to those folks but please give us more than one dang wagon.

I'm just sayin'.
Link to prop pack please!

Someth|ngW|cked
09-18-2006, 02:09 PM
Modeling is very easy to learn for basic map prop application especially when using XSI and after learning Hammer

After about 20 minutes of just sitting down and messing with XSI i banged out my first tanktrap model fully skinned

One thing to remember is that XSI's units are the same as Hammers, so you can create a object in hammer the exact side as you need it to be as a model and just use those units in XSI, also when doing any transformation, scale, movement, etc, you can use multiplyers

For example typing 1*6 as a scale parameter you will get an object that is 6 times larger in that space than the old value, you can do this with any combination of numbers and as far as i know any type of formula works, division, addition, etc.

Ol' Noodle Head
09-18-2006, 09:03 PM
Link to prop pack please!

[REL] Ricochet's Prop Pack (http://www.dayofdefeat.com/forums/showthread.php?postid=900322)

Trp. Jed
09-19-2006, 06:37 AM
I've added the link to the map models list thread and moved it from MSA to mapping.

madmilo
11-27-2006, 03:08 AM
Thanks to this great tutorial, we are now working on our first simple model for Day of Defeat:Source.
:p
-----

http://files.langal.dk/models/minen/minen.jpg

Ca-Chicken-Soup
11-27-2006, 02:38 PM
Yeah good tut, thou I still havn't givin it a go..

Day of Defeat Forum Archive created by Neil Jedrzejewski.

This in an partial archive of the old Day of Defeat forums orignally hosted by Valve Software LLC.
Material has been archived for the purpose of creating a knowledge base from messages posted between 2003 and 2008.