Problem with collision model on ragdoll

OK, I’m trying to port a ragdoll just to figure out the process, but I seem to be completely incapable of making it work. To simplify things, I’m importing a mesh from Oblivion, to make sure the problem is with my process, not the model itself.

FYI, I’m using Blender. It worked fine for static props, it works fine for every other game I care to mod, all the scripts are installed properly. I’m relatively certain my choice of editor isn’t the cause of this, but since I can’t rule it out, I stated it anyways.

I’ve gotten the static mesh in just fine. The problem is with the collision model, and the rig. Everything is working in-editor, but when I compile it, everything gets fucked up.

First, the collision model gets ignored. As in, the physics model I see in HLMV has no relation to the model I exported. When it left the editor, it had 17 boxes connected to the skeleton. The compiler reports only twenty faces in the collision mesh, about a fifth what should be there. Further, when I open it in HLMV and in-game, there is only a single box, located at the base of the model. I should note that there isn’t even a box there in the editor, the exporter is literally making it up.

HLMV seems to be telling me conflicting things, but it may just be my inexperience with this. The Physics tab tells me that there is only one collision component, a small box placed between the feet. The Bones tab tells me that all 70 bones, or at least all the ones with vertices, were imported correctly, since they’re all there, and in the right spots.

I suspect the problem lies with my .qc, but I cannot figure out what. Since you guys might be able to, here’s my .qc:


$scale			64
$modelname		"props_gman003/body_s_aa.mdl"
$model "body"	"body_s_aa.smd"
$surfaceprop	"flesh"
$cdmaterials	"models/props_gman003/oblivion"

$sequence idle	"idle.smd" loop fps 1

$collisionjoints	"body-phy.smd" {
	$concave
}


and here’s what the compiler spews out:



C:\Users\Kyle Jansen\AppData\Roaming\Blender Foundation\Blender\.blender\Oblivio
nData>"c:\steam\steamapps\bob42\sourcesdk/bin/orangebox/bin/studiomdl" -game "C:
\Steam\steamapps\bob42\garrysmod\garrysmod" -nop4 ./body_s_aa.qc
qdir:    "c:\users\kyle jansen\appdata\roaming\blender foundation\blender\.blend
er\obliviondata\"
gamedir: "C:\Steam\steamapps\bob42\garrysmod\garrysmod\"
g_path:  "./body_s_aa.qc"
Building binary model files...
Working on "body_s_aa.qc"
SMD MODEL body_s_aa.smd
SMD MODEL idle.smd
SMD MODEL body-phy.smd
Processing jointed collision model
Bip01                    ( 20 verts, 1 convex elements) volume: 1001.94
Collision model completed.
---------------------
writing C:\Steam\steamapps\bob42\garrysmod\garrysmod\models/props_gman003/body_s
_aa.mdl:
bones        18292 bytes (63)
animations     132 bytes (1 anims) (1 frames) [0:01]
sequences      468 bytes (1 seq)
ik/pose        164 bytes
eyeballs         0 bytes (0 eyeballs)
flexes           0 bytes (0 flexes)
textures       336 bytes
keyvalues        0 bytes
bone transforms     8632 bytes
Collision model volume 1001.94 in^3
collision        0 bytes
total        29680
---------------------
writing C:\Steam\steamapps\bob42\garrysmod\garrysmod\models/props_gman003/body_s
_aa.vvd:
vertices    446016 bytes (9292 vertices)
tangents    148672 bytes (9292 vertices)
total       594752 bytes
---------------------
Generating optimized mesh "C:\Steam\steamapps\bob42\garrysmod\garrysmod\models/p
rops_gman003/body_s_aa.sw.vtx":
body parts:         8 bytes
models:            20 bytes
model LODs:        12 bytes
meshes:            45 bytes
strip groups:     125 bytes
strips:           135 bytes
verts:          83628 bytes
indices:       101940 bytes
bone changes:       8 bytes
everything:    185945 bytes
---------------------
Generating optimized mesh "C:\Steam\steamapps\bob42\garrysmod\garrysmod\models/p
rops_gman003/body_s_aa.dx80.vtx":
body parts:         8 bytes
models:            20 bytes
model LODs:        12 bytes
meshes:            45 bytes
strip groups:     125 bytes
strips:           216 bytes
verts:          84834 bytes
indices:       101940 bytes
bone changes:     704 bytes
everything:    187928 bytes
---------------------
Generating optimized mesh "C:\Steam\steamapps\bob42\garrysmod\garrysmod\models/p
rops_gman003/body_s_aa.dx90.vtx":
body parts:         8 bytes
models:            20 bytes
model LODs:        12 bytes
meshes:            45 bytes
strip groups:     125 bytes
strips:           135 bytes
verts:          83628 bytes
indices:       101940 bytes
bone changes:     584 bytes
everything:    186521 bytes

Completed "body_s_aa.qc"


Can anybody figure out this problem?

I’m somewhat concerned by the scale 64 to be honest. Not sure how colision and scale work together. If I were you, I’d try compiling without the scale first.

Also do you have a material applied to the phymodel as well (any will do)

The scale isn’t the problem, since it’s being applied to both the collision and the render models. I can go ahead and retry without it, but unless there’s a VERY odd bug, it won’t be the source.

The phymodel does have a material applied.

then you need a material and a smoothing group to be applied to the model. Doesn’t matter which.

Tried again, after removing the $scale. Same result, only the collision box ended up about half a mile below the model.

[editline]07:25PM[/editline]

As far as I know, Blender does not use smoothing groups. Instead, smoothing is done by setting flags on individual edges.

[editline]07:42PM[/editline]

OK, after poking around the editor quite a bit more, I think the skeleton did not import in a way that let’s me use the collision model in Source. As far as I can tell, it’s using some sort of bezier surface that will be almost impossible to port.

I’m going to try redoing it by hand, but I would still like ideas on how to fix it.

[editline]08:16PM[/editline]

OK, I managed to whip up a very crude collision model that at least exports correctly. It shows up in HLMV, at least.

Since nothing ever just works with Source, something very fucked up is going on in-game. It spawns, but any part of the mesh that’s attached to a bone is placed about 500 units away, in a clump. I can’t tell exactly what, because if I move too close to it, or look at it too hard, it disappears.

I am dead serious, it fucking disappears if I look at it.

I’m going to try redoing the phymodel again, trying to keep it clean. Maybe I should try trimming out the more unneeded bones.