Recompiling a player model perfectly


f64
04-22-2006, 05:08 PM
I have recompiled a dod:s player model to work with the mani-admin plugin and it seems to work fine with one exception: the helmet remains on the head, even though one is seen to blow off.

I found that this recompiled model is missing a bone in hlmv: ValveBiped.Bip01_L_Knee
It doesn't have a hitbox.

Using the same reference model, my file sizes don't come out the same either, no matter what I do in the .qc.

american_assault.dx80.vtx 189 KB
american_assault.dx90.vtx 185 KB
american_assault.mdl 20 KB
american_assault.phy 33 KB
american_assault.sw.vtx 184 KB
american_assault.vvd 278 KB

testmodel.dx80.vtx 180 KB
testmodel.dx90.vtx 173 KB
testmodel.mdl 20 KB
testmodel.phy 33 KB
testmodel.sw.vtx 172 KB
testmodel.vvd 216 KB

The model won't pass the consistency check if compiled as the default name/directory model.

I have seen recompiled models that work perfectly and are exactly the same as the default models in all aspects.
Is this done with a modeling app or just the sdk tools?

Trp. Jed
04-23-2006, 06:52 AM
Hate to break this to you but the decompiler wont decompile the models perfectly and it would take a monumental ammount of effort to get them to re-compile exactly the same.

The QC it produces is flakey and based loosely on whats in the MDL. However when doing proper character rigging from the start theres a lot of additional stuff that can go into the QC that mdldecompiler wont reproduce.

As for the missing bone problem, the left knee bone is usually a helper bone used to help smooth animation. That fact that your's vanishes hints at the fact nothing uses it so the compiler will strip it out. To get around it you're either going to have to use the $definebone command or put a temporary attachment onto it.

f64
04-23-2006, 07:15 PM
Thanks, Trp. Jed.

I did have concerns regarding Cannonfodder's decompiler, although it works great as is and sv_consistency 1 will gladly accept my models if named differently or placed in a different directory than default.

Here are some lines generated by the hlmv that aren't present in my mdldecompiler.qc:

$jointcollide valvebiped.bip01_l_forearm valvebiped.bip01_l_thigh
$jointcollide valvebiped.bip01_l_forearm valvebiped.bip01_pelvis
$jointcollide valvebiped.bip01_l_forearm valvebiped.bip01_spine1
$jointcollide valvebiped.bip01_l_forearm valvebiped.bip01_spine2
$jointcollide valvebiped.bip01_l_forearm valvebiped.bip01_head1
$jointcollide valvebiped.bip01_l_forearm valvebiped.bip01_r_forearm
$jointcollide valvebiped.bip01_l_forearm valvebiped.bip01_r_hand
$jointcollide valvebiped.bip01_l_hand valvebiped.bip01_l_thigh
$jointcollide valvebiped.bip01_l_hand valvebiped.bip01_pelvis
$jointcollide valvebiped.bip01_l_hand valvebiped.bip01_spine1
$jointcollide valvebiped.bip01_l_hand valvebiped.bip01_spine2
$jointcollide valvebiped.bip01_l_hand valvebiped.bip01_head1
$jointcollide valvebiped.bip01_l_hand valvebiped.bip01_r_hand
$jointcollide valvebiped.bip01_r_forearm valvebiped.bip01_r_thigh
$jointcollide valvebiped.bip01_r_forearm valvebiped.bip01_pelvis
$jointcollide valvebiped.bip01_r_forearm valvebiped.bip01_spine1
$jointcollide valvebiped.bip01_r_forearm valvebiped.bip01_spine2
$jointcollide valvebiped.bip01_r_forearm valvebiped.bip01_head1
$jointcollide valvebiped.bip01_r_hand valvebiped.bip01_r_thigh
$jointcollide valvebiped.bip01_r_hand valvebiped.bip01_pelvis
$jointcollide valvebiped.bip01_r_hand valvebiped.bip01_spine1
$jointcollide valvebiped.bip01_r_hand valvebiped.bip01_spine2
$jointcollide valvebiped.bip01_r_hand valvebiped.bip01_head1
$jointcollide valvebiped.bip01_r_thigh valvebiped.bip01_l_thigh
$jointcollide valvebiped.bip01_r_thigh valvebiped.bip01_l_calf
$jointcollide valvebiped.bip01_r_thigh valvebiped.bip01_l_foot
$jointcollide valvebiped.bip01_r_calf valvebiped.bip01_l_thigh
$jointcollide valvebiped.bip01_r_calf valvebiped.bip01_l_calf
$jointcollide valvebiped.bip01_r_calf valvebiped.bip01_l_foot
$jointcollide valvebiped.bip01_r_foot valvebiped.bip01_l_thigh
$jointcollide valvebiped.bip01_r_foot valvebiped.bip01_l_calf
$jointcollide valvebiped.bip01_r_foot valvebiped.bip01_l_foot
}
$sequence ragdoll "ragdoll_pose" FPS 30 activity ACT_DIERAGDOLL 1

------------------------------------------------------------------------------------

I can add all but the last line.

I don't intend to model, so hopefully a modeler can come along with the answer. It has been done though!

Trp. Jed
04-24-2006, 05:47 AM
Well whats the error your getting with the last line? The decompiler has a habit of saying ragdoll pose but giving the animation SMD another name. I've had that before.

f64
04-24-2006, 02:22 PM
mdldecompiler gives this:
$sequence ragdoll "ragdoll" ACT_DIERAGDOLL 1 fps 30.00
to all models

hlmv gives this:
$sequence ragdoll "ragdoll_pose" FPS 30 activity ACT_DIERAGDOLL 1
to my model and the default one as well.

Both lines used yields: ERROR: Duplicate sequence name "ragdoll"

So apparently I can only have one, but if I use the hlmv line as is,
I get this error: ERROR: could not load file 'C:\Program Files\.../ragdoll_pose.smd'
as it's named ragdoll.smd in the mdldecompiler.qc.

It will compile if I match the .qc ragdoll "name" to the ragdoll.smd name, so
$sequence ragdoll "ragdoll_pose" FPS 30 activity ACT_DIERAGDOLL 1
combined with ragdoll_pose.smd in the .qc directory works too.
But I don't see any change to my model when adding the $jointcollide lines or changing the $sequence lines.

I had hoped it was possible to implement the protection of sv_consistency to my models,
but because the code has been written (by Valve?) so that it only protects the
default named models in the default directory, I cannot get that protection - because
I have to name the model differently or place it in a different directory in order to
properly control which model the player sees with the mani-admin changer.

So, all I'm really hoping for now, is to fix the helmet issue of staying on the head.
Not a great issue in itself; it just looks strange. As for the cvar limitation, I
guess that's the price that has to be paid for having some customization.

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.