[TOOL/INFO] Custom player model compile kit

Trp. Jed
09-03-2007, 01:14 AM
Now that I've figured out a lot about compiling working custom player model, I figured it would be useful to pass on some stuff to help others get theirs working.

I've put together a "kit" of files that together allowed me to sucessfully compile the German Assault class with M43 cap (http://www.dayofdefeat.com/forums/showthread.php?t=74823) model which you can hopefully modify and use for your own.

The kit contains a generic playermodel.qc file and a bunch of includes which together should correctly compile a player model which passes consistency checks. I've also included all the SMD files I used for the M43 cap model as an example.

NOTE: While I've made the QC file as generic as possible, creating new player models is not an easy task for the novice modeller. You will require some prior experience of modelling, exporting and sucessfulling compiling models to use this effectively.

I would also recommend you read this thread (http://www.dayofdefeat.com/forums/showthread.php?t=74776) on how the player model consistency checks work before you start customising player models so you know the limits you have to work to.

Note also, that apart from the actual SMD's for the model, pretty much all the other files created by the MDL decompiler are junk for DoD:S player models. This is largely why trying to recompile a model fails.

[DOWNLOAD] (http://www.wunderboy.org/public/dods_player_model_kit.zip)

How to use the kit

First of all, unzip the files where you want all your working files. You should find the following files and folders:

playermodel.qc <- main .qc file you edit for your player model
includes/ <- folder containing various needed include files
example files/ <- source SMD files for the German Assault with m43 cap model.

IMPORTANT: Don't mess with anything in the "includes" folder and dont move or rename it. Whats in there is a bunch of QC include files which handle setting up a bunch of default stuff and optimisations. I've seperated them out to keep the main QC file clean and easier to edit without confusing people.

OK. Next up, you need to export all your SMD files for your model. You're going to need three things:

1) SMD files for the player model without any headgear x 6.
2) SMD files for the players headgear only x 6.
3) SMD file for the players physics model.

For 1 and 2 above, you'll need the reference plus LOD level SMD's. The default DoD:S models have 5 LOD levels. We'll discuss these later.

For the physics model, if your edits are minor or you're just recompiling a default player model, you can just copy the phymodel.smd and re-use that. Note that with the default or a custom physics model, the SMD file must be phymodel.smd for it work with this kit.

Assuming all your SMD's are ready, copy them to the same folder that holds playermodel.qc.

Next stage is editing the QC file itself. You can open this in Notepad or some other simple text editor and I've added quite a few useful comments to the file to guide you. The main parts you need to edit are as follows:

1) Set $modelname and $cdmaterials for the player model your compiling.

2) Set $model to point to the reference SMD for your model.

3) In the helmet bodygroup, set the first studio command to point to the SMD for your headgear.

4) In each of the $lod and the $shadowlod defines, replace the SMD filenames with those of your reference and LOD level files.

5) Towards the bottom in the section that deals with the physics model, set if you want the default DoD:S ragdoll physics or my somewhat improved, more realistic physics model.

So with all that in place, you should now be able to just run playermodel.qc through the compiler!

LOD Levels

Source games use LOD (Level of Detail) models to reduce the detail on models when they are further away from the player. It makes no sense to draw 5000+ polygons for a model 500ft away so instead as the player moves away from the model, lower poly versions are swapped in it's place.

For player models, DoD:S uses 6 levels - 1 for close up, 4 others for various distances away from the player and a seperate level for drawing shadows.

To get an idea of how many polygons your LOD levels should have, open one of the default player models in HLMV, goto the model tab and under the "Auto LOD" checkbox is a dropdown with numbers in it. These numbers represent the LOD levels in the model - 0 being the reference or "full detail" version, 1-4 being he various LOD levels and 5 being the shadow level. To the right of this is the polycount and you can compare the count for each LOD level to get an idea of how many polygons your own LOD levels should have.

Creating LOD levels might seem complicated but most 3D applications have some sort of automatic polygon reduction tool which can speed up the process. Personally, I use 3DS Max's Multires modifier and they fix any smoothing errors by hand after.

Once nice thing to note - only your reference SMD needs to be rigged and weighted. The LOD levels don't have to be attached to the skeleton and the compiler will fit it all when compiling.

Example use

Ok heres a practical example of using this kit. Lets say you want to edit the German Rifleman model to use it's own texture, instead of the defaults. We'll assume this new texture is called german_rifleman.vmt

1) Unzip the player model kit into a working folder.

2) Decompile the default German Rifleman MDL file.

3) Copy the reference, LOD and phymodel.smd files from the decompile into the working folder.

4) Open each of the SMD files in a text editor and replace every instance of german_body.tga with german_rifleman.tga. Find and Replace is very useful for this! :D Save your SMDs.

3) Edit the playermodel.qc file to set the correct model name, material location and SMD filenames for reference and LOD.

4) Choose default or realistic physics model.

5) Compile!

When this is done, you should have the default German Rifleman model but instead of wanting german_body.vmt, it'll be looking for german_rifleman.vmt instead. You can now create a new or edit the default texture and VMT to match and have a custom texture for the German Rifleman class!

09-03-2007, 07:38 AM
I can not download the kit.the link did not work for me, can someone add a mirror? Thanks!

09-03-2007, 07:53 AM
Mirror (http://droxsden.bulletpain.com/uploads/dods_player_model_kit.zip)

Awesome job Jed!

09-03-2007, 08:03 AM
Mirror (http://droxsden.bulletpain.com/uploads/dods_player_model_kit.zip)

Awesome job Jed!

thank you!

09-03-2007, 08:09 AM
thank you!

No problem!

09-03-2007, 09:07 AM
very cool. thanks a lot jed!
i'll leech tonight and try a few things with it :)

Trp. Jed
09-03-2007, 03:31 PM
No probs. Hope it proves useful. You still obviously have to do the ground work to edit/make the player model but I analysed how the default models are built vs the junk mdldecompiler spits out.

Canononfodder gets my respect for his work but obvously, you can't decompile everything perfectly and I had to re-work a lot of stuff for compliance.

I just want to see how long before someone finally makes a proper US 101st Airborne model rather than just those reskins :D I was almost tempted to port my 1.3 US 101st models for giggles.

09-04-2007, 09:01 PM
great work. you do the dods community a big favor. finally some new content ahhh

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.