MDLC

From FreeAllegiance Wiki
Revision as of 05:07, 21 February 2008 by Juckto (talk | contribs) (is this more like what you wanted to present, madp?)
Jump to navigationJump to search

MDLC is a MDL conversion program used to convert .bmp files into the .mdl format. MDL files are image files used by Allegiance for user interface items.

How do I edit .mdl files using MDLC?

  1. First, export the image that you want to edit using MDLUtility. When you export the image, remove the "bmp" off of the end of the name. *THIS IS IMPORTANT*
  2. Edit the file using mspaint or your favorite image editor. Make sure to keep it in the bmp format though.
  3. Copy your finished image into the folder where you extracted MDLC.exe
  4. Run mdlcMasterBat.exe, click "Select Files".
    • Note that you can select more than once file.
  5. Click "Open" once you have selected the files that you want to import. Now click "Run Batch".
  6. Take the .mdl files that MDLC.exe created and copy them into your artwork folder.

Screenshots

Mdlcmasterbat.png

Notes

Advanced users can skip using mdlcMasterBat.exe by simply editing the batch file titled "convert" that is provided with MDLC.exe or by creating their own batch file. mdlcMasterBat.exe was just created to save some time.

If you experience any problems, please make a post in the Helpline Forum and tell us at what step the problem occurred.

mdlc.exe command line functions

Convert .bmp to bmp.mdl

use:

   mdlc -convert inputfile.bmp outputfilebmp.mdl

Optimize a 3d model

This converts a 3d model in .x format and a text.mdl into a compressed binary 3d model. also supports multiple versions of the 3d model with varying levels of detail (LOD).

use:

mdlc -optimize inputfile outputfile

the "inputfile" text.mdl in its simplest form looks like

use "effect";

frame = ModifiableNumber(initialFrame);

object = ImportXFile("name.x", frame);

Where "name.x" is the name of your model. As the .x format allows animation but .mdl does not, you must also specify which frame within the animation a "snapshot" of the model should be taken to be used as the un-animated model in the .mdl.

To use LOD you need multiple input.x models and a text .mdl that looks something like

use "effect";

frame = ModifiableNumber(initialFrame); 

object =
   LODGeo(
       ImportXFile("name.x", frame),
       [
           ( 64, ImportXFile("lowest", frame)),
           ( 32, ImportXFile("low",      frame)),
           (  8, ImportXFile("medium",      frame))
       ]
   );

Where "name.x" is the highest quality model, "lowest.x" is the lowest quality model, "low.x" is of higher quality than lowest, and "medium.x" is a medium quality model. Which one gets used in game is a function of how far the player's camera is from the model (further away the lower the quality of the model).

Note: mdlc can be quite fussy about the format of a .x file and often doesn't work with perfectly valid ones, this is probably due to the fact it was written for use with whatever .x exporter the original ms developers were using, so it wasn't made flexible enough to handle .x files form other exporters (including tools in the directX SDK!). If you have trouble getting it to convert a .x file, try comparing your .x file to one of the original ones in the artwork source. Also note that when the original art was converted, there was some pre-processing using the [xmunge], [xtobm], [fmesh], [meshsimp], [rlines], [pmtopmx] and [pmxtox.] tools.

Compress a text font definition file into a binary font definition file

This is mainly for modifying font.mdl Takes a input text .mdl containing font definitions and produces a compressed binary .mdl containing font definitions and their glyphs. This means you can use non-standard fonts which you have on your system and have them included in the output .mdl so you can distribute it without the need for people to install the non-standard fonts you have used.

use:

mdlc fontsource.mdl font.mdl

where fontsource.mdl is of the form:

use "model";

smallFont     = Win32Font("Verdana", 12, false, 0);
smallBoldFont = Win32Font("Verdana", 12, true, 0);

largeFont     = Win32Font("Verdana", 15, false, 0);
largeBoldFont = Win32Font("Verdana", 15, true, 0);

hugeFont      = Win32Font("Verdana", 24, false, 0);
hugeBoldFont  = Win32Font("Verdana", 24, true, 0);

smVerdana      = Win32Font("Verdana", 10, false, 0);
medVerdana     = Win32Font("Verdana", 12, false, 0);
medBoldVerdana = Win32Font("Verdana Bold", 13, false, 0);
lgBoldVerdana  = Win32Font("Verdana Bold", 16, false, 0);

smTahoma       = Win32Font("tahoma", 12, false, 0);

titleFont      = Win32Font("Eurostile Bold", 18, false, 10);

promptFont       = Win32Font("Eurostile Bold", 12, false, 6);

smEuro        = Win32Font("Eurostile", 10, false, 0);
myfont        = Win32Font("myfonthere", size, computed bold true/false,0);