Section IV: Appendix A - DTS Exporter Reference

This section covers in great detail how everything works and has some extra goodies to help you solve some of the more complex problems you may encounter with the engine and DTS export tools.


Valid Scenes:

The following describes how the exporter interprets the scene in 3DStudioMax.


Configuration(.CFG) Files:

There are a number of parameters used by the exporter that can be saved in configuration files. When the exporter first loads in 3DSMAX it looks for a file called 'DTSGlobal.CFG' in the 3DSMAX Plugins directory.

An example dtsGlobal.cfg is located in the documentation file pack.

When you export a shape the exporter looks for a file called <somename>.CFG' (usually named DTSScene.CFG) in the same directory as the .max file being exported. On each line of the configuration file there should be either one of the keywords 'AlwaysExport:', 'NeverExport:', or 'NeverAnimate:', a name, or a parameter expression (a line starting with +, -, or =).

An example of a scene .CFG script for the player shape (player.cfg) can be found in the documentation file pack.

Names are put into one of 3 lists (the always export list, the never export list, or the never animate list). Which list depends on which of the 3 keywords occurred most recently in the file (if none of them have, the name is put on the always export list). Names can include wildcards (*). The following discussion depends on understanding the distinction in 3DSMAX between nodes and objects. If you don't understand that distinction, you are probably ok skipping to the next section.

If a node's name matches a name on the never export list, the node won't be exported and any meshes hanging off it will be put on its parent (or its parent's parent if its parent is on the never export list too). If a node is on the always export list it will be exported even if there are no meshes on the node and even if the name matches a name on the never export list (i.e., the always export list takes priority over the never export list). A node matching a name on the never animate list will not be animated even if it animates in 3DSMAX.

For example, the lines:

would export nodes beginning with 'bip' but not nodes beginning with 'submesh'. Or if 'submesh*' was replaced by '*' exactly those nodes beginning with 'bip' would be exported.

Lines with + or - turn on or off boolean parameters. Lines with = set the value of valued parameters (note: the '=' occurs at the beginning of a line). You can save the current configuration as the default configuration or to a separate file via the exporter utility panel under the 'Configuration Control' sub-panel. Note: node names are only relevant in the DTSScene.CFG file. They are ignored in the 'DTSGlobal.CFG' file.


Unlinked Meshes and Level of Detail:

In the exporter there is generally only one subtree (although it supports more if desired) and the artist must supply a different set of meshes to be drawn for each detail level.

This is done by naming different detail levels of the same mesh with the same base name but a different trailing number. E.g., 'head64' and 'head32'. The numbers in the detail level should correspond to the number on the 'detail marker' (see section 'Subtrees').

One detail level of the mesh needs to be linked to the shape in the appropriate place; the other detail levels of the mesh should be unlinked. During export, these unlinked meshes are collected and added to the shape at the appropriate location.

In a 3DSMAX scene we only have one set of meshes linked to the shape at a time, so we need some convention for including in the file other meshes that correspond to lower detail levels.

This is done by leaving meshes that belong to other detail levels unlinked. Furthermore, they must be named just like the meshes that are attached to the shape, except they should end in a different detail number (if in the shape you have a mesh named 'head' or 'head64', then the unlinked version of that mesh that will be drawn for detail level 32 must be called head32).

During export, these loose meshes are collected and added to the shape at the appropriate location. The transform of these unlinked meshes is discarded and the transform of the corresponding shape in the subtree is used.


MultiRes and Detail Levels:

To use add the following fields to the user defined properties of the mesh.

  1. MULTIRES::SIZES,
  2. MULTIRES::DETAILS,

Each of these fields should have a list of entries separated by commas (no spaces, won't work with spaces). The first list should be the detail sizes you want to generate. This should correspond to the detail markers you have in the scene (the objects named detail150, detail100, etc). The second list is the percent of vertices to keep from the original mesh for the corresponding detail. So if the first field is 100,50,20 and the second is 1.0,0.5,0.2, then you will generate 3 detail levels with all the vertices, half the vertices, and a fifth of the vertices, respectively.


MultiRes and T2Autodetail:

A parameter can be added to your configuration file to automatically generate detail levels if you have MultiRes applied to the shape.

The syntax is:

=Params::T2AutoDetail <some_number>

The number of detail levels and decimation level is automatically calculated based on polygon count.

Take the number of polygons in your shape, and divide it by the number in you T2AutoDetail parameter. If the shape has 1000 polygons and the number is 200, five detail levels will be generated.

The Autodetail mechanism uses deviation from the base mesh (measured in pixels) as a metric for error. The maxError is the largest deviation in meters of the corresponding detail level, so at any given distance the pixel error can be computed. The detail mechanism makes sure that the pixel error stays below a fixed number that is set in code.

The following variables are relevant and should be added to your .CFG files:

=Params::T2AutoDetail <some_number>

This parameter was set at 250 for Tribes 2.


Sequences:


Miscellaneous: