Return to Castle Wolfenstein MDC Importer
v1.1 for gmax

by Chris Cookson
mojo.gmaxsupport.com



Introduction | Installation |  Usage |  Known Issues |  Notes | Credits | Links

Important Note!

This is an unofficial utility and is not supported in any way by Gray Matter Interactive or id Software. Please do not contact them with any questions about this script.

Introduction

This is a gmax utility script for importing Return to Castle Wolfenstein MDC models. The MDC file format is an extended version of Quake 3's MD3 model file format used by Castle Wolfenstein. MDC models are used in Castle Wolfenstein for mapobjects, player heads, player accessories (eg. belts, hats, sunglasses), weapons, pickups and for scenery in the cutscenes. Check out the notes for more information on Wolfenstein's file formats.

Features include:
Installation

If you want to have the script ready every time you use gmax, follow these steps:

  1. Copy rtcw-mdc.ms into your gmax\scripts\startup directory.
    For example, if you have installed gmax in c:\gmax, then copy the script into c:\gmax\scripts\startup
  2. Run or restart gmax
  3. Go to the utilities tab (the one with the hammer icon) and click on the "MAXScript" button. A rollout named "MAXScript" should appear.
  4. Each time you want to use the importer, find the "Utilities" drop down list and you should see the name of the importer ("RtCW MDC Import") somewhere in it. If you can't find it, then there was a problem during installation - check you've placed the script in the right directory. Select the script in the drop down list and a new rollout labelled "RtCW MDC Import" should appear below or above the "MAXScript" rollout. If you can't find it, try scrolling the utility panel up or down as it can sometimes appear offscreen.
If you don't want the script being loaded every time you start gmax, you can place it anywhere on your hard disk. Your gmax \scripts directory is recommended. To run the script manually, follow these steps:
  1. In gmax, go to the utilities tab (the one with the hammer icon) and click on the "MAXScript" button. Click the "Run Script" button and select the MDC importer script (rtcw-mdc.ms) using the dialog.
  2. Activate the script by finding the "Utilities" drop down list and clicking on the script's name ("RtCW MDC Import"), which should now have appeared.
  3. A new rollout labelled "RtCW MDC Import" should appear below or above the "MAXScript" rollout. If you can't find it, try scrolling the utility panel up or down as it can sometimes appear offscreen.

If you've followed either of these methods you should now see the "RtCW MDC Import" rollout in the Utilities panel containing the importer's interface. You're ready to roll...

Using the Importer

The interface of the importer should look something like the picture on the left.

The first thing to notice is the "Set Game Data Path" button. The game data path is where the importer can find the game directory structure so it can load any textures it may need. The easiest way to create this data structure is to unzip your PK3 files (which are just .ZIP files with a different extension) found in yourReturn to Castle Wolfenstein\Main\ directory. Before you panic, I should point out that the data path is in fact optional! You won't need to unzip gigabytes of PK3's in order to get the importer to work! Phew. You can just unzip the models you are interested in together with their textures into one directory and the importer will work off that without needing to look at the game data path. If you're going to look at lots of models it might be better to organize them into their proper directories, though.

For convenience, users with plenty of disk space may prefer to unzip all the game models from the PK3 /models/ directory. Some models may need the odd texture from the PK3 /textures/ directory, but I suggest extracting only the textures you need when necessary. The default game data path is c:\program files\Return to Castle Wolfenstein\Main\Data, so you can extract what you need from the PK3 files into this directory and use that without having to keep setting the game data path each time you run gmax.

Before I delve into the topic of tags, I'll mention the most important part - the "Import MDC..." button. Click this and you'll pop up a dialog where you can select the .MDC model you wish to import. Click "OK" and off you go. Models that contain a lot of animations will take some time, but you should see a progress bar ticking away in the gmax status bar to reassure you.

Tags (attachment points for other models) can be either be

  1. Ignored totally
  2. Loaded into the scene as Quake3 style right-angled triangles
  3. Used to automatically attach an imported model to its 'parent' tag in the current scene
These options can be used to build up tag-based animations, such as those used for the weapons in RtCW. Often such animations are stored in single MDC file that contains nothing but tags. By using "Auto Attach" you can then load each part of the object onto the correct tag and as if by magic you'll have a fully animated object. The importer makes an educated guess about which tag is the model's parent tag so it may get confused if you have many tags with the same name in a scene!

For example, to import the animated knife weapon as seen from the player's view - follow these steps:
  1. Select "Load All" in the tag options, and import /models/weapons2/v_knife_hand.mdc. This file contains nothing but tags, so you should see a group of 2 little triangles.
  2. Select "Auto Attach" in the tag options, and import v_knife_barrel.mdc and v_knife.mdc in any order.
  3. Hit the play button in the gmax animation toolbar and you should see the knife run through all its animations. If you're really interested check out weapon.cfg in the same directory as the model files and you can see which frames correspond to the drop, attack, switch animations.

The final option is a simple one. If you're annoyed by the message telling you to locate a 'missing' texture (ie. one that the importer can't find because it's not in the current directory or game data path), just uncheck "Prompt for missing textures". Once this is unchecked the importer will keep quiet, and just import the geometry untextured.

That's all, I think -- have fun!

Known Issues

Notes

The MDC file format differs from MD3 in only a few places. Tags are stored using ZXY rotations instead of a full matrix, animations are delta compressed (base frames and delta frames) and tag names are in a separate list. You can find more detailed information about the MDC format on The MDC File site on Planet Wolfenstein.

The other major file format used by RtCW is MDS. This is used solely for player models and contains information used by the skeletal animation system. Instead of storing per frame vertex data, MDS stores keyframes for each bone that makes up the player model's skeleton. The animated skeleton is then used to smoothly deform a single base player mesh into the correct pose for each frame. .

Credits

Code by Chris Cookson
v1.1a animation and tag attachment tweaks by Hewster.

People I'd like to thank:

Links

Copyright (c) Chris Cookson, 2001-2002