Cleanup is going to take awhile, so the site is back up but editing has been disabled.
Complex Collision Models
From HalfLife 2 Knowledge Base
by Sean Mcbride (n30g3n3s1s)
Thanks to hl2world.com for such a great knowledge base.
While reading this tutorial I assume that you've read my Static Models tutorial first. http://www.hl2world.com/wiki/index.php/Static_Models
Startup Information: First I would like to say by no means am I a master of the source engine. These are just my findings in the first few hours of playing around. These collision models are made up of boxes (and low poly cylinders) that use 1 smoothing group. If smoothing groups are used it confuses the engine because a smoothing group break will actually break and make seams in your models. This is how the same "smoothing group" effect is achieved in-game. You must use 1 smoothing group. I think you can use different smoothing groups for each piece like I've seen in other tutorials but why do that when you can just select the whole model and click on the 1 smoothing group button. Now... on with the tutorial.
Creating your collision hitboxes
1) Ok, so you've made your model you've got your reference and your still frame exported just like in my first Static Models tutorial. First open your file with your static object you want to build a collision model(CM) for and resave it under another name because your going to be deleting parts later. (Fig. 1)
Figure 1:
2) Now that you have another file for your CM. Start making boxes around the parts that you want the engine to make solid. (Fig. 2) Keep it fairly low poly and rough but close enough to the model that it will represent it well. The CM MUST be made of boxes and simple cylinders otherwise the engine will not take it. Keep in mind if your CM face is to far away it will not apply a damage decal on the model and the bullet hits will look funny so try and represent your model well. It doesn't have to be perfect, its alot like when your working on your model and you use big blocks to make the basic shapes you want. (some character modelers do this) I let the modeling program create my blocks and cylinders and don't do any modifying other than moving the verts around. Your modeler instincts may tell you to start optimizing faces that won't be see but DON'T. The engine requires enclosed boxes and cylinders to work. Also don't worry about overlapping your boxes or cutting through your model just a little your boxes wont be perfect, just getting the effect to look right with a low polygon count is what you're after. The more polygons, the more processing time it takes up.
Figure 2:
3) After you finish off your box/cylinder making and it should look something like (Fig 2). The Purple blocks are 6 sided cylinders and the light blue are boxes. If your using 3dstudio max start using the attach feature to start grouping all of the blocks for your CM into one big group. After they are all in one group select all the faces of your boxes and click clear all. Then click the 1 button to assign them all to smoothing group 1. (Fig. 3)
Figure 3:
4) You're basicly done with your CM. Just apply a physique modifyer just like you did to your static model and make sure all of the verts are assigned to that 1 bone. Delete your referance of the accual model you were working over so it wont export with the CM you just created. (Fig. 4) Make sure you have a multi/sub-object texture and a tga applied to the model when you export it. Its really dumb but your tricking the compiler into thinking it has a texture so it will work.
Figure 4:
5) Export as a referance and save as ModelName_phys.smd or whatever you like.
6) You can use my sample QC that comes with this tutorial as a referance to write your own. Its the very basic static object QC.
$modelname static/statue/statue.mdl
$cdmaterials models/static/statue
$staticprop
$scale 1.0
$body studio "C:\HL2Mod\_ModName_\modelsrc\static\statue\statue_ref.smd"
$sequence idle "statue_still" loop fps 15
$collisionmodel "statue_phys.smd" {
// Mass in kilograms
$Mass 100
$concave
}
7) Compile! Your done you should get some results like (Fig. 5).
Figure 5/Results:
Yes I know there aren't any texture for this model tutorial but I'm showing you how to create a collision model. If you need to know how to create a static object with textures read my Static Model tutorial.
Hope this helped. Thanks to LDuke on the hl2world.com forums for decompiling the model from Counter-Strike.







