Developed by Legend Entertainment (Creators of Wheel of Time)
Programmed by David Townsend
Last Updated: 07/01/98
To create animated models for Unreal mods, you will need the following tools:
To be able to take advantage of this tool, you need to become familiar with:
Next, be aware that importing animations into Unreal has proven to be the trickiest aspect of Unreal content creation, because of the multiple tools that need to be used (a 3D modelling program, 3ds2unr, and UnrealEd), and because of the large number of steps that need to be followed carefully in order to successfully import and use a model in Unreal.
For the sake of clarity, here are the files you'll be dealing with:
Here is the 3D Studio to Unreal converter, including the utility (3ds2unr.exe), quick documentation (ImportingModels.doc), and the source code. The source code compiles with Microsoft Visual C++ 5.0 using Service Pack 2. We haven't tested with other compilers, versions, or service packs. The source code is unsupported and is provided as-is. Enthusiasts have permission to modify and redistribute the code on a non-commercial, not-for-profit basis.
Here is an example of some of the cool things people could do by modifying the source. :)
Models must be made up of a single 3D Studio object, which lives within the 256x256x256 coordinate space centered on the origin. (Setting the grid extents to 128..128 and turning on the grid is helpful here.) The model itself should be centered on the origin (0,0,0) because of how Unreal specifies the collision cylinders used to determine when objects are touching.
Models will lose some precision when imported. Specifically, X and Y coordinates are truncated to the nearest 1/8th (0.125) unit, and Z coordinates are truncated to the nearest 1/4th (0.25) unit.
One 3DS coordinate equals 6" in Unreal X and Y coordinates, or 12" in Unreal Z coordinates. You generally dont have to worry about this scaling, as the model can be rescaled when its imported into Unreal.
Object polygons shouldnt intersect. The hardware supported by Unreal gets confused when polygons intersect, resulting in an unpleasant shimmering.
If your object is a character that will be carrying a weapon that will be separately modeled, place an extra polygon (the weapon triangle) in or on the part of the character where the weapon should be. This polygon will be invisible in the game; its just used to sync the weapons position with the characters animation.
The conversion tool will only convert objects with sequence numbers in their names (Obj01, Obj02, ...). The object name itself is meaningless; its the sequence numbers that count. They must begin at 01 (even if thats the only frame!) and you cant have any "holes" in the sequence. (Under 3D Studio 4, it was easiest to use the "Snapshot" option; Im not sure how 3DS MAX handles this.)
Objects that wont be animated (e.g. 3rd person weapon views) should be in their own .3DS file (e.g. save the angreal of healing as AngrealHeal.3DS).
Make sure that all animation frames stay entirely within the 256x256x256 coordinate space.
The Unreal animators are typically designing their animations for 30-35 fps playback. Then, to save memory, they shave the animations down to 15-17 fps and let Unreal do the tweening.
Objects that are animated should have a separate .3DS file for each animation sequence (Run.3DS, Walk.3DS, Shoot.3DS, etc.). You probably want a separate directory for each animating character, so that each can have its own Run.3DS sequence.
You still use 3D Studio to do your texture mapping. However, there are some (pretty heavy) restrictions on what will actually show up in Unreal.
The only type of texturing that has any effect is using actual texture maps bump maps, opacity maps, specular maps, etc. are meaningless. Furthermore, the bitmaps that you use as textures should be 256x256 pixels in size, and you cant have more than nine of them for any one model. To conserve memory, you should use as few texture maps as possible. 3DS Max V2 allows you to map part of a material to your geometry; using this feature lets you squeeze many smaller texture maps together into one big bitmap.
Our Wheel of Time characters currently use two texture maps. The angreal use only one.
Under most circumstances, the material names that you use in 3D Studio dont matter. However, there are several pre-defined material names that you can use to get special effects when the model is imported into Unreal. The special names are:
|SKIN||This texture will be assigned as the models Skin property in Unreal. Skin textures can be replaced easily at runtime (to show increasing damage, for example) and are the basis for Unreals corona effects.|
|TRANSLUCENT||The polygons mapped with this texture will be marked as translucent, and can have their transparency set by the program. Wheel of Time uses this to get the transparent globe on the Shield angreal.|
|TWOSIDED||The polygons mapped with this texture will be marked as two-sided, so the texture mapping will show up on both sides of the polygon. Wheel of Time uses this for the characters cloaks.|
|WEAPON||The polygon (there should be only one!) mapped with this texture will be marked as the weapon triangle. So it wont be visible|
Note that this naming convention applies to the material name itself; the filename of whatever TGA file you use as the bitmap is irrelevant.
Youll need a copy of the 3ds2unr.exe conversion program, plus some way (Photoshop, Debabylizer, etc.) of converting TGA files to PCX format. A text editor (Notepad will do in a pinch) is also handy.
The conversion program expects an Unreal-like directory structure to exist before it will run. Specifically, you need:
This directory tree is what Unreal itself expects, so it may already be set up. If it isnt, youll have to make it yourself before doing any conversions.
The converter is a Windows console application, meaning it runs by typing rather than pointing and clicking. Make sure that the 3ds2unr.exe program is somewhere in your DOS path before you begin.
Once youre set up, using the converter is pretty simple. Just type 3ds2unr, followed by an optional class name and one or more .3DS files, like so:
3ds2unr Trolloc Walk.3ds Run.3ds Attack.3ds
The converter reads the given 3DS files, and produces a class file (Trolloc.uc) and model files (Trolloc_a.3d and Trolloc_d.3d) to be used by Unreal.
If this is the first time that youve run the converter, youll be prompted to select your project directory (i.e. the directory from item #2 in the preparation list (for me, c:\Unreal\WOT). Once youve set this directory, you wont need to set it again. If you do need to change it, because youve began a new project, just type
and youll be able to select another project directory.
When specifying 3DS files, you can use standard DOS wildcard characters (`?' and `*'). So, if all of those Trolloc animation sequences were the only 3DS files in the current directory, you could type:
3ds2unr Trolloc *.3ds
The class name is just the name of the object that youre converting (Trolloc, AngrealHealing, Myrddraal, etc.) and is used as the base filename for the converters output. If youre converting an object with no animation, you can omit the class name, in which case the base name of the sole 3DS file is used as the class name. In other words, this:
does what you probably want it to. However, if you try to convert more than one 3DS file at a time without supplying a class name, you'll be prompted to make sure that the class name inferred by the converter is correct. For example, omitting the "Trolloc" from the previous example is probably an error:
3ds2unr *.3dsClassName [Walk]?
You can just hit Enter to continue with that name, or type the correct name (Trolloc) first.
Be careful with your class names the converter will happily overwrite existing files.
The converter will create three files:
(where "..." is your project directory).
The .uc file will contain the appropriate UnrealScript commands to import your model, list its animation sequences, and set its textures.
Unreal needs all three files to use your model. The same three files are used by the Mesh Viewer (see below, and separate documentation) to view models.
Since the converter doesnt read 3DS materials files, and Unreal requires PCX rather than TGA-format input, you have to manually help out the converter.
First, you need 8-bit PCX versions of all of the textures that you used in the model use Photoshop, etc.
You then need to examine the .uc file in a text editor that can handle straight ASCII text Notepad is fine. Look for the lines that begin with #exec TEXTURE IMPORT and note that each such line ends with a material name after a pair of slashes:
#exec TEXTURE IMPORT NAME=JSpider1 FILE=MODELS\Spider1.PCX GROUP=Skins FLAGS=2 // SpiderSkin
(The above should be a single line, but cant be shown here legibly that way.)
Notice the reference to a Spider1.PCX file. Both Unreal and MeshViewer will need this file to properly display your model. It corresponds to whatever TGA file you used in the given material, SpiderSkin. You need to have this file name match the name of the materials 8-bit PCX file, which you can do by either editing the .uc file directly, or renaming your PCX file to correspond with the name in the .uc file.
Using the above example, say that the SpiderSkin material was made with a SpiderSkin.TGA texture map. Youd convert that TGA file to and 8-bit SpiderSkin.PCX file. You could then either rename that file to Spider1.PCX (because thats what the script is expecting), or edit the script to look for SpiderSkin.PCX instead of Spider1.PCX.
You might encounter the following problems when converting:
can't find file
You referred to a file that doesnt exist. Make sure youve typed the name and directory correctly.
No project directory found exiting
The converter couldnt establish a project directory, either because you cancelled out or theres a problem in the system registry. Make sure that your project directory structure is correct, then try rerunning the converter with the setproj option before attempting conversion again. The converter cannot run without a project directory.
read error [TAG]
The converter was expecting data that wasnt there. This probably means the 3DS file is corrupted.
too many textures
Unreal has a limit of ten materials that can be applied to an object, and the converter encountered an eleventh material. For memory and rendering performance reasons, you really should be using less than ten anyway.
Warning: out of sequence obj (Foo) skipped
The converter expects to find sequentially numbered objects in file, and it found an object either without a sequence number (e.g. Box instead of Box01) or with an out-of-sequence number (e.g. Box01, Box02, Box04). This is probably something you want to fix, although in some cases, like leaving a stray light source in the project, it might be OK to ignore (providing that the correct object was converted).
Warning: Filename.3DS: Bad coordinate x.xxxxx, y.yyyyy, z.zzzzz
The converter found a coordinate that was outside the allowable 256x256x256 coordinate space. Rescale your model or fix the animation sequence. To minimize warning lines, only one bad coordinate is reported per object in the file.
If you encounter errors other than those listed here, it probably indicates a converter bug.