Page 1 of 1

Model Formats

Posted: Wed Sep 09, 2009 18:06
by Janitor
I have some models that are currently in MDL format. I'd like to convert them to MD2 or MD3. So a few questions: (1) is this possible? I'd like to be able to retain all the animations (2) what kind of program would I need to do this? are there any good free programs that will work for this? (3) If this is possible, would there be any major drawbacks?

Any help is appreciated, thanks in advance :D

Re: Model Formats

Posted: Wed Sep 09, 2009 19:22
by Enjay
When you say "MDL" I assume that you mean Quake format MDLs. There are quite a number of games that use MDL as the extension for their models but they are very different formats.

If you do mean the Quake format, then Quake Model Editor (v 0.90 is common) will probably do it. I haven't used to to load quake format models but it can do it and it can certainly export MD2 models so it should be able to convert them for you reasonably easily.

I couldn't find a download for it so I've put it here:

http://files.drdteam.org/user_uploads/E ... mdlr9b.zip

I could be wrong but I am remembering that there is something "funny" about MDL files like, maybe, the skin is compiled into the model or something.

[edit]
Doh! should have realised that the model editor would be on idgames

http://www.gamers.org/pub/idgames2/plan ... 2modeller/

[/edit]

Re: Model Formats

Posted: Wed Sep 09, 2009 21:28
by Janitor
Yes, I am actually referring to the Half-Life model format ... I dont know if it is the same as the quake one (I was under the impression they were the same?)

Thanks!

Re: Model Formats

Posted: Wed Sep 09, 2009 22:11
by Enjay
Oh, right, in that case, it is a different (or maybe just modified) format. The tool that I have used for it is Milkshape - which has a trial version but the full version requires payment.

http://chumbalum.swissquake.ch/

What I have done with it is decompiled HL MDLs and then been able to re-make them as MD2s. Often they require a bit of work because many of the HL models have multiple images in their skins which need to be stitched together into a single skin and then the UV map re-done before it will work in GZdoom. In addition, HL models supported effects that are not in GZdoom (eg the shiny/reflective effect on some models).

I have only managed (or tried, to be fair) to get static, non animated models from HL working in this way. I'm pretty sure that Tormentor has managed to get animated models working though.

Re: Model Formats

Posted: Mon Aug 01, 2011 15:20
by I.C.H.I. Znot
The Half-Life MDL format is completely different than Quake.

Quake MDL is just set of 3d frames and textures (can be more than one), each frame contain just vertexes other info like polygons and texture coordinates is stored only once for all frames.

Half-Life MDL is like pack, inside is textures, 3d models with LODs, animation tracks, also HL MDL is skeletal and it is main difference. Half-Life MDL is even better than MD3. Also if you make model in HL MDL and Q1 MDL with many animations then HL MDL size be much smaller, again it's because HL is skeletal.

As i know Milkshape include plugin which can unpack HL MDL format.

Re: Model Formats

Posted: Thu Aug 18, 2011 1:36
by metroid014
I actually have a fair bit of experience with putting Half Life models into GZDoom, it takes a little bit of work. But yes, you can get the animations into GZDoom!

1. Decompile the MDL file to get access to the textures and SMD files. You can use Milkshape 3D to decompile them for this. Hit Tools -> Half Life -> Decompile Normal HL MDL File. (btw, personally I recommend downloading the HD Half Life Models and using those, they look better)
2. Convert the texture files from .bmp to .png so they work with GZDoom.
3. Half Life uses many SMD files to make up the model. The SMD files beginning the "DC" are the base files, they store no animations and are just the static model. Import those first into Milkshape, there may be a few as it might be a multi part model.
4. Half Life stores each individual animation state into its own SMD file. So say you want to import the Idle animation of a grunt, you'd import idle1.smd or idle2.smd after importing the static meshes.
5. Most Half Life Models use multiple textures, something MD2 models do not support... BUT MD3 DOES. Hit Tools -> Quake 3 Arena -> Generate QC File. This will create a .qc file for your model. Open up the file and edit the "$skin" line so the file inside the quotations is the name of the .png texture you want to use for each model part. Half Life usually has each mesh named after its .bmp texture so just copy and paste that file name and replace the .bmp with .png. For example heres what my grunts .qc file looks like:

Code: Select all

// Quake III Arena MD3 control file, generated by MilkShape 3D
//
$model "models/players/model/model.md3"
// reference frame
//$frames -1 -1
// frame 1-343
$frames 1 343
$flags 0
$numskins 0

// you can have one or no parent tag

// tags

// meshes (surfaces)
$mesh "DC_soldier_face_cmdr_blk.BMP"
$skin "DC_soldier_face_cmdr_blk.png"
$flags 0

$mesh "DC_soldier_torso.BMP"
$skin "DC_soldier_torso.png"
$flags 0

$mesh "DC_soldier_misc.BMP"
$skin "DC_soldier_misc.png"
$flags 0

$mesh "DC_soldier_skin_blk.BMP"
$skin "DC_soldier_skin_blk.png"
$flags 0

$mesh "m4_world.BMP"
$skin "m4_world.png"
$flags 0
6. Make sure your textures are in the same folder as your .qc file, after you do this, export the model as an MD3 in milkshape to the same folder as where your .qc file is. Make sure your .md3 file has the same file name as the .qc file. So you should have something like grunt.md3 and grunt.qc.
7. Make a DECORATE actor for your Half Life model.
8. Make a ModelDef, don't define a skin in the ModelDef though, as you defined the skins in the .qc file so you could use more then one.
9. Put your .md3, .qc, textures, ModelDef, and DECORATE definition (unless you have it loading into the game somewhere else) into a .pk3.
That's about it, summon your actor into the game and you should be good to go!

Just so you can see an example, here's a Half Life grunt I imported into GZDoom. Just load the .pk3 up with the game, open the console, and hit "summon grunt_blk"
http://files.drdteam.org/index.php/file ... /grunt.pk3

Re: Model Formats

Posted: Thu Aug 18, 2011 14:26
by Rex Claussen
metroid014 wrote:Just so you can see an example, here's a Half Life grunt I imported into GZDoom.
That is fantastic! A couple of years ago I had asked about converting Half- Life's mdl files into GZDooM's md2/3 format, and back then it was a tremendous chore. Congratulations on pulling off a magnificent conversion!

A few points:

1. You've scaled the actor down to 0.9, and perhaps for GZDooM it ought to be scaled down further. [For Paranoid, however, the scale will be perfect.]
2. When the actor dies face down, the M16 "sinks" into the ground and looks odd.
3. It might be better if the actor drops the weapon, which you can make pickable.
4. Would you please post the MODELDEF and DECORATE definitions for the other actors that use the same models (e.g., grunt_wht)?

Re: Model Formats

Posted: Thu Aug 18, 2011 17:34
by Enjay
Wow! Yes, an excellent job on doing that conversion. I love the fact you kept the ability for the grunt to kick his target too. Looks very nice indeed.

Thanks for the "step by step" too. It's still a reasonably complex process, but much clearer because of your tutorial.