Section I: Introduction to the Max2DTSexporter

This documentation explains how to use the max2dtsExporter with 3D-Studio MAX4. MAX3 users please note that most of the material contained herein also applies to MAX3 but there may be some differences.

A File Pack containing all example files referenced in this documentation is available for download: (torque_max_filepack.zip 2,314 KB)


Installation:

Place the file 'max2dtsExporter.dle' in the 3DSMAX 'Plugins' directory. Please make sure that you download and install the plugin for the version of MAX that you are running.

NOTE: Max plugins are compatible only with the version of the software that they were compiled for.


General Information:

This document assumes a certain level of familiarity with 3DStudioMAX versions 3 or 4. The majority of the information here is presented to allow users to become familiar with "Torque" specific tools and techniques. Where appropriate, certain basic information about how to work within 3DSMAX has been included.

The DTS exporter is a utility and can be found in the 3DSMAX utility panel.

To access the utility, click on the Utility panel and press the "more" button. This will bring up a new window. Within the new window, there will be a list. Scroll down the list and select the"DTS Exporter Utility".

It is advisable that you add "DTS Exporter Utility" to your default set of buttons in your utility panel. For information how to add a new button to your Utility set, please consult your 3DSMAX documentation or help file.

The exporter uses 3DSMAX's units to determine the size of the object. One 3DSMAX unit is equal to one meter in the game. : It does not matter if you have your unit scale set to centimeters, inches, or miles. One of 'whatever' is equal to one meter in the engine. Consult your 3DSMAX documentation to set this up properly.

Meshes without texture coordinates will not work correctly in the game. Make sure you have UV coordinates on the meshes you are trying to export.

The exporter generates a dump file named dump.dmp in the directory you are exporting to. If your export fails, check the dump file first to see where it is crashing in the export process. Most of the time it is something simple, like spelling the word "bounds" wrong.

The exporter is for the most part stable. Like all 3DSMAX plugins, it can crash. If it is constantly crashing on export with ALL shapes, the error likely lies not in the exporter, but in your system configuration.

If a particular model is continually crashing on export, corrupted meshes, bad texture vertices, or double faces in the model might be the cause. Check your dump file, and if it stops on a particular mesh, do a test by deleting it in your scene, then try to export again.

After you have successfully exported a model, check your shapes in the showtool (-show switch) first before bringing them into your game. If it works in the showtool but not in the game, the file exported properly and the problem probably exists elsewhere.

The requirements of a game may be different than the requirements to get a shape exported. What is required for it to work 'in the game' is not the same as what is required for a shape to export. If your game requires certain nodes be present, a certain naming convention, or certain parameters set a certain way, then get that information and set up the shape accordingly. If your shape works in -show but not in the game then it is most likely not the exporter that is at fault.

Some of the tools and techniques outlined in this document (especially the animation setup and usage) require a paradigm shift about how one thinks of setting up shapes. The engine supports a very flexible Non Linear Animation (NLA) system. It is hard at first to grasp, but with patience, one can understand and utilize the tools controllably.

This document will take you through the steps of setting up some simple shapes that will familiarize you with the exporter and how it works, and then will move on to more complex topics.


A Simple Shape:

You can use the SimpleShape.max in the file pack to follow along with.

From either the top, user, or perspective view, make a sphere with 16 sides. Make sure the sphere has mapping coordinates by putting a check in the checkbox at the bottom of the creation panel. Align the sphere to the center of the world using the transform type-in floater. (While in Move Mode, go to Tools. Transform Type-In) and enter 0 in all the boxes in "Absolute World". Name this shape "SimpleShape".

Copy SimpleTexture.bmp from the file pack and put it in your export destination directory in the Torque project. The texture must reside in the same directory as the exported file in order to work in the test tool and the game.

Go to the 3DSMAX Material Editor and select a material. Open the 'maps' rollout panel. In the diffuse slot, select the button to choose a texture. Select 'bitmap' from the list. Find and choose SimpleTexture.bmp.

Turn on 'Show map in Viewport' (the button looks like a little checkerboard cube.)

Make a box that encloses the entire shape. Again, do this from either the top, user or perspective view. Align this to the world center as above. Name this box "bounds".

You are now almost ready to export a DTS shape.


MultiRes:

The MultiRes modifier in 3DSMAX is supported for detail level creation. Continuous level of detail is not supported. At export time, the exporter looks to see if there is a MultiRes modifier on the object and if so, creates static Level of Detail meshes based on the parameters input into either the shapes "User Properties" or through the .CFG file using the T2Autodetail parameter.


Collision Objects:

There is no correct way to make collision objects for the Torque engine. It all depends on how your programmer wants to implement collision detection. Several games used this engine and they all used different collision schemes. Different collision schemes can be different for different shapes as well. Some shapes use simple sphere collision that is derived from the bounding box, some have custom-built collision shapes. Vehicles tend to have custom collision shapes.

Custom collision shapes can be created by assigning a negative detail number to the shape (like -1) and creating a corresponding detail marker. Shapes with negative number will export but not draw.

The Torque engine presently uses detail markers named "Collision-" with the mesh shapes named Col-. The shapes must be convex hulls (no concave surfaces).

Here are some of the naming conventions:


Materials and Textures:

The following describes procedures and usage for texture mapping of objects in the Torque engine.


Sequence Objects:

Sequence objects are necessary if animation is to be exported. The sequence object tells the exporter how to export animation data over a given range of time in 3DSMAX, and what to call the sequence. A sequence object can be created like any other helper object found within 3DSMAX.

This is done in the Create tab by clicking on the "Helpers" menu, and then using the pull down menu to choose "General DTS Objects". See the section on the Sequence Object Parameters (found below) for more details about the sequence objects.

Sequence helpers that you place in the scene are unlinked objects that float unlinked in the world,( they do not need to be linked to anything.)