Model Motorcycle

TheCaptain

L1: Registered
Nov 18, 2010
6
7
While it's not Team Fortress 2 specific, I was redirected here by my friend Icarus while trying to compile my first model, a motorcycle, for use in Half Life 2 Episode 2. I've tried compiling it numerous times with modificatons to the QC and each time it gives me the same result (see figure 1)
The first screenshot is the motorcycle in-game. Actually, it's three of them. In a row from right to left should be a Physics Prop of the motorcycle, a static prop and a dynamic prop. However, the dynamic is the only one that shows up, and it's untextured and has no collision detection or physics interaction (however it does cast shadows based upon the main mesh.)
If the model is looked at in the SDK model viewer, Collision mesh, the tickbox does nothing, and no mesh appears. As seen in screenshot 2, the model I constructed has an LOD1, an LOD2 and a collision mesh. (Wether or not it's properly constructed to be convex, I'm not sure.)
This is the completed QC I'd hope to use for this being a physics prop:
$modelname "motorcycle\motorcycle.mdl"
$body motorbike "motorcycle_ref.smd"
$staticprop
$surfaceprop metal
$cdmaterials "models\motorcycle"

$sequence idle "motorcycle_idle.smd" loop fps 15

$collisionmodel "motorcycle_phys.smd"
{
$mass 400.0
}

$lod 20
{
replacemodel "motorcycle_ref.smd" "motorcycle_lod1.smd"
}

$lod 40
{
replacemodel "motorcycle_ref.smd" "motorcycle_lod2.smd"
}

$shadowlod
{
replacemodel "motorcycle_ref.smd" "motorcycle_lod2.smd"
}
I strongly suspect some kind of problem GUIStudio is having issues with my collision mesh, but I don't know what or how to circumvent it, seeing as I'm not seeing errors, nor what to look for in a problem related to my pipeline
(Maya 2011->OBJ->Softimage 2010 with ValveSource (unknown version, downloaded in September)->SMDs->GUI Studio 2.2 ->Hammer->HL2E2)
If it's any more supplementary, here's the Compile log.
GUIStudioMDL 2.2/Source - © 2007 Neil 'Jed' Jedrzejewski - http://www.wunderboy.org/

Loaded QC file - "C:\Program Files\Steam\steamapps\Anarchemitis\sourcesdk_content\ep2\modelsrc\models\motorcycle\motorcycle.qc"

Created command line: "C:\Program Files\Steam\steamapps\Anarchemitis\sourcesdk\bin\orangebox\bin\studiomdl.exe" -game "c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2" -nop4 -nox360 "C:\Program Files\Steam\steamapps\Anarchemitis\sourcesdk_content\ep2\modelsrc\models\motorcycle\motorcycle.qc"

all paths:c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2\;c:\program files\steam\steamapps\anarchemitis\sourcesdk\bin\orangebox\ep2\;c:\program files\steam\steamapps\anarchemitis\sourcesdk\bin\orangebox\episodic\;c:\program files\steam\steamapps\anarchemitis\sourcesdk\bin\orangebox\hl2\
qdir: "c:\program files\steam\steamapps\anarchemitis\sourcesdk_content\ep2\modelsrc\models\motorcycle\"
gamedir: "c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2\"
g_path: "C:\Program Files\Steam\steamapps\Anarchemitis\sourcesdk_content\ep2\modelsrc\models\motorcycle\motorcycle.qc"
Building binary model files...
Working on "motorcycle.qc"
SMD MODEL motorcycle_ref.smd
SMD MODEL motorcycle_idle.smd
SMD MODEL motorcycle_phys.smd
Collision model completed.
---------------------
writing c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2\models/motorcycle\motorcycle.mdl:
bones 964 bytes (1)
animations 112 bytes (1 anims) (1 frames) [0:00]
sequences 220 bytes (1 seq)
ik/pose 164 bytes
eyeballs 0 bytes (0 eyeballs)
flexes 0 bytes (0 flexes)
textures 72 bytes
keyvalues 0 bytes
bone transforms 0 bytes
collision 0 bytes
total 1728
---------------------
writing c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2\models/motorcycle\motorcycle.vvd:
vertices 346992 bytes (7229 vertices)
tangents 115664 bytes (7229 vertices)
total 462720 bytes
---------------------
Generating optimized mesh "c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2\models/motorcycle\motorcycle.sw.vtx":
body parts: 8 bytes
models: 20 bytes
model LODs: 12 bytes
meshes: 9 bytes
strip groups: 25 bytes
strips: 27 bytes
verts: 65061 bytes
indices: 52764 bytes
bone changes: 16 bytes
everything: 117966 bytes
---------------------
Generating optimized mesh "c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2\models/motorcycle\motorcycle.dx80.vtx":
body parts: 8 bytes
models: 20 bytes
model LODs: 12 bytes
meshes: 9 bytes
strip groups: 25 bytes
strips: 27 bytes
verts: 65061 bytes
indices: 52764 bytes
bone changes: 16 bytes
everything: 117966 bytes
---------------------
Generating optimized mesh "c:\program files\steam\steamapps\anarchemitis\half-life 2 episode two\ep2\models/motorcycle\motorcycle.dx90.vtx":
body parts: 8 bytes
models: 20 bytes
model LODs: 12 bytes
meshes: 9 bytes
strip groups: 25 bytes
strips: 27 bytes
verts: 65061 bytes
indices: 52764 bytes
bone changes: 16 bytes
everything: 117966 bytes

Completed "motorcycle.qc"
If anyone feels the need, they can download the original OBJs, VMT, VTF, QC [and Texture TGA if I made the VMT/VTF incorrectly)

Please help :)|
 
Last edited:

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
Hey, The Captain. I can take a look at your model and determine the issue. It would be hard to tell just from the description what's really going on just by looking at your qc and compile log. I'll take a look and get back to you. Something I think would help you in general is to find a way to cut Softimage from your pipeline. From my use of XSI Mod tool way back I found that it just causes problems on top of problems. I was almost certain there was a .smd export function floating around somewhere for maya? I could be wrong. I found this article in the source sdk wiki, might be of use to you, I don't know if it will work for 2011, but my guess is that it probably will: http://developer.valvesoftware.com/wiki/Maya (instructions for utilizing valve's built in .smd functions). You'll probably be much happier staying in Maya for the whole process, as I know how aggravating XSI can be.
 

TheCaptain

L1: Registered
Nov 18, 2010
6
7
Good advice.
I learned from my Rigging class teacher that whatever you rig in, you render in. Very very rare exceptions.
However my initial reason why I never used Maya to export to SMD was because that plugin is for 2009, which I'm not sure if 2011 would be backwards compatible.

Or if the plugin is forwards compatible. x)
 

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
Try it, I'm pretty sure it'll work. If not, no loss, other than maybe 10-20 minutes of fiddling.

Also, you haven't included your motorcycle_ref.smd or even a .obj of it, I'll need this to troubleshoot, I just got out of the shower and noticed it wasn't there.
 

nik

L12: Fabulous Member
Aug 14, 2009
987
564
Those textures look pretty awkward.
 

TheCaptain

L1: Registered
Nov 18, 2010
6
7
Try it, I'm pretty sure it'll work. If not, no loss, other than maybe 10-20 minutes of fiddling.

Also, you haven't included your motorcycle_ref.smd or even a .obj of it, I'll need this to troubleshoot, I just got out of the shower and noticed it wasn't there.

LOD1 is the Master model from which the idle animation comes from, as well as the ref.
 

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
Hey there, sorry it took me longer than I wanted but I got a chance to take a closer look at the files here.

Using your files and your .qc, I was able to compile the model without many issues. There were a few things I had to alter because I knew they would cause problems, but the result is essentially success.

(in the hlmv)
motorcycle.jpg


In your OP you posted that you thought there should be 3 versions of the model in your first screenshot, the physics model, the static and the dynamic. The difference from these 3 in my experience with all 3 types is the presence of the line "$staticprop". The static version of course has this line when compiled in the .qc. You would need to compile a second version of the model omitting this .qc line if you wanted to use this prop as a dynamic, and another as a physics prop. Technically the version with $staticprop could be used as dynamic prop, if you wanted to parent it to something, as that works with props compiled with $staticprop, but if your model had another sequence, an animation, you would not be able to use that unless the model was compiled omitting the $staticprop line. As for physics, you would need the collision mesh and the mass information in the qc (and you omit the $staticprop line, just as for the dynamic version), additionally you would need it to have a certain parameters of prop_data enabling it to be used as a physics model.

motorcycle2.jpg


As for your textures not working right that's an issue that has to do with 3 things: Your applied texture name/.vtf and .vmt configuration, your 3d software, and your .smd export method/format. Basically all 3 of these things have to be coordinated correctly. It helps if in your 3d software your texture applied is the name you'll use as the .vtf/.vmt format, but it also depends on your .smd exporter. It'll take some playing with to figure out how your .smd export method works, as it can be different from 3d softwares and .smd exporters. It's a big mess really, but the best way to find out how yours works is to export a .smd and open it in notepad:

version 1
nodes
0 "root" -1
end
skeleton
time 0
0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
end
triangles
motorcycle.tga
0 -0.882420 37.367401 26.290340 -0.359863 -0.339898 -0.868889 0.458714 0.727431
0 -1.969233 37.573338 26.922649 -0.528462 -0.262873 -0.807233 0.457305 0.735514
0 -1.972043 40.735279 25.311562 -0.528405 -0.499410 -0.686570 0.449060 0.735514
motorcycle.tga
0 -1.972043 40.735279 25.311562 -0.528405 -0.499410 -0.686570 0.449060 0.735514
0 -0.886555 40.344009 24.773685 -0.360267 -0.503625 -0.785219 0.449655 0.727405
0 -0.882420 37.367401 26.290340 -0.359863 -0.339898 -0.868889 0.458714 0.727431
motorcycle.tga
0 -0.886555 40.344009 24.773685 -0.360317 -0.591622 -0.721218 0.449655 0.727405
0 -1.972043 40.735279 25.311562 -0.528405 -0.499410 -0.686570 0.449060 0.735514
0 -1.974274 43.244614 22.802233 -0.528361 -0.687074 -0.498762 0.442141 0.735514
motorcycle.tga...

As you can see what's being used is motorcycle.tga for texture information. The suffix doesn't matter, this texture could be applied in the 3d software as a .jpg, .png or .psd, just as long as the filename remains the same upon export, that's what you should name your .vmt and .vtf. This should help you clue into how your 3d software and .smd exporter is doing the work.

Another thing I added in your .vmt was "$alphatest" "1", which gives you the transparency based on your alpha channel for your motorcycles spokes.

As far as your LODs go, it was pretty confusing. When it's all said and compiled, you have 4 LODs in your model, but only 2 of them do anything: the original, and LOD 2. Your first LOD version doesn't do anything, since it uses the same .smd for the reference mesh and the LOD. I suggest a much more simplified LOD setup:

$lod 40
{
replacemodel "motorcycle_ref.smd" "motorcycle_lod2.smd"
}

And that's it...you don't need anything else in your LOD lines. For your collision mesh, you'd need to specify "$concave" as well as the mass. The last thing I would add is a lighting origin line, which would be as easy as "$illumposition 0 0 32" which tells the engine to light the model from 32 units above model's origin.

I hope that helps!
 

nik

L12: Fabulous Member
Aug 14, 2009
987
564
I love the look of it, and it's spectacular for your first model!

so a 9?
 

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
It was your first EEEEEEEVER? My first model was a box. I owned that box. My 2nd model was a cylinder. I pwnzored that cylinder.

Honestly it's pretty good. There's some smoothing stuff here and there that could be fixed, and the texture job is decent, minus some seaming, but it makes a good half-life 2 era model. Something as complex as a motorcycle I would expect a highpoly to lowpoly modern workflow to create it, if you want it to be as realistic as possible and still be usable in a game engine. That way all your fine detail could be modeled/sculpted/painted, and you wouldn't have to rely on using photographs so much to texture your model.

And wait, is 1 good or is 10 good?