wlm24 (at) drexel (dot) edu |
 
Lesson: DTS Modeling

Introduction

DTS (Dynamix Three Space) objects are Torque models that are not interiors, such as static objects, players, items, weapons, and vehicles. They can be created in many of the major 3D modeling packages and sent to Torque using a third-party exporter; however, not every exporter is created equal. below is a listing seven major Torque-compatible exporters, and what features they support (from the TDN Wiki -- GG account required -- http://tdn.garagegames.com/wiki/DTS/FeatureChart):


View

Getting Started: A Few Quick Rules

Your models have to follow a few important rules, so keep them in mind when you are working:

Poly Counts

Torque does not limit polygon counts, but GarageGames recommends the following:

  • Characters: 2250 polygons
  • Vehicles: 1500 polygons
  • Weapons: 500 polygons
  • Other Objects: <400
  • Collision Geometry: 10-30 polygons*
However, these numbers may change depending on the scope of your game. Always try to keep your target system in mind.

* The more polygons you use in a collision, the bigger the performance hit (torque checks for collisions on every face on every frame)

Scale

1 3DSMax Unit/1 Maya Meter = 32 Quark Units = 1 Torque Unit

Textures

Texture files must be sized in powers of 2 (32, 64, 128, 256, 512), but do not have to be square. The maximum texture size is 512x512 (GarageGames recommends to use the maximum size rarely). Supported texture formats are GIF, PNG, and JPEG.

3DS Max Users: Cuneyt Ozdas (of Splutterfish fame) has developed a handy utility for generating a UV image map (similar to the Maya's Render UV tool). Plugins for 3DS Max v. 1-9 can be found here.

Modeling Practice

Models can be comprised of either single objects or multiple objects. While you can use other modeling methods to create your model (NURBS, subd, etc.), the model must be converted to a mesh or polygon object before exporting.

Let's Go!

Installing your exporter

Below is a link to download exporters for major modeling packages.
3DS Max (v4.2-8.0)DocumentationDownload
Maya (v4.5-7.0)DocumentationDownload
Lightwave (v7.5+)DocumentationDownload
Blender (v2.33+)DocumentationDownload
Milkshape (1.7.4)DocumentationDownload
Gamespace (1.5)DocumentationDownload

Exporting your model

Preparing your model for export depends on the modeling package you use. Usually, you must set up a scene tree, a hierarchy that the exporter uses to help generate the DTS model. This hierarchy is created using empty nodes (usually the exporter will handle building the hierarchy for you). To create this tree, simply parent the objects (typically Ctrl+P). Hierarchies for four major modeling packages are below:

Advanced Nodes

In addition to the nodes shown above, Torque has some specialized nodes for characters, vehicles and weapons.

For characters:

  • cam - 3rd person camera location (required only by playable characters).
  • eye - 1st person camera location (required only by playable characters). Without this node, the camera will be placed at the origin of the bounding box.
  • Light# - light emitter
  • Mount# - mount points for weapons and other equipment
  • Ski# - locators for "ski effect" (dust thrown up by feet)
  • SORT:: - used when a small object with transparent is rendering its z-depth incorrectly
  • MultiRes:: - 3DS Max Only Used to snapshot a particular character mesh for automatically generating LOD information.

For vehicles:

  • cam - 3rd person camera location (required only by playable characters).
  • Contrail# - creates contrails for flying vehicles
  • eye - 1st person camera location (required only by playable characters). Without this node, the camera will be placed at the origin of the bounding box.
  • hub# - marks where wheel DTS shape attaches to the vehicle mesh
  • JetNozzle# - creates jet exhaust
  • Light# - light emitter
  • Mount# - mount points for players or weapons. A typical setup is:
    • mount0 - pilot
    • mount1 - navigator/gunner
    • mount2 - passenger
    • mount3 - passenger
    • mount4 - passenger
    • mount5 - passenger
    • mount6 - passenger
    • mount7 - passenger
    • mount8 - passenger
    • mount9 - Weapon (bomb bay)
    • mount10 - Weapon (Gun)
  • Smoke_node# - used to place damage smoke

For weapons:

  • ejectpoint - where to eject shell casing DTS shape.
  • mountpoint - where the character will hold the weapon. If this node does not exist, will default to (0,0,0) of DTS file.
  • muzzlepoint - where the engine shows muzzle flash DTS when weapon is fired.
Weapon Sequence Helpers:
  • Activate - animation when weapon is activated. Options:
    • Cyclical sequence
    • Complete cycle
    • Blend sequence
    • FPS (Default: 60)
    • Transform Animation
  • Deactivate - animation when weapon is put away. Options:
    • Cyclical sequence
    • Complete cycle
    • Blend sequence
    • FPS (Default: 60)
    • Transform Animation
  • Fire - Animation that is played when the player fires. Options:
    • Cyclical sequence
    • Complete cycle
    • Blend sequence
    • FPS (Default: 60)
    • Transform Animation
  • NoAmmo - animation when weapon is out of ammunition. Options:
    • Cyclical sequence
    • Complete cycle
    • Blend sequence
    • FPS (Default: 60)
    • Transform Animation
  • Reload - animation when weapon is reloading. Options:
    • Cyclical sequence
    • Complete cycle
    • Blend sequence
    • FPS (Default: 60)
    • Transform Animation

A nice reference PDF (by Joe Foster and Joe Maruschak) containing this information can be found here.

Checking Your Work

To see if your model imported correctly, you do not have to start your world editor. GarageGames has a utility called ShowTool, based off the Torque engine, which allows you to preview your model in the engine environment quickly. Since it's built off of TGE, if your model works in ShowTool, it will work in your game. Exported DTS meshes must be placed in

/data/shapes
to be seen by ShowTool (and TGE)

ShowTool comes in two flavors, ShowTool and ShowTool Pro. The basic version is included in TGE, while ShowTool Pro is a standalone application which has a separate license ($34.95 Indie/$175.00 Commercial)

ShowTool

ShowTool is accessed by running Torque from the command line using the show flag (create a shortcut for this command for quick access):

The interface is fairly simple:

Models are previewed by clicking the "Load Shape" button. You will then be given a list of all DTS objects in your data/shapes/ folder. The camera controls are as follows:

  • Zoom in: W
  • Zoom out: S
  • Rotate Y left (slow): D
  • Rotate Y right (slow): A
  • Rotate Y left (fast): X
  • Rotate Y right (fast): Z
  • Rotate X forward: E
  • Rotate X back: C
Within ShowTool, you can adjust lighting and detail control manually. Once an object looks satisfactory in ShowTool, it can be placed in the environment.

ShowTool Pro

ShowTool Pro has an interface which is quite more robust.

While ShowTool Pro provides the same base functionality, it provides a large number of additional useful options, including node/joint display, the ability to mount equipment, environment maps and other rendering options, textures reloading/swapping, multiple orthographic views, colored vert weights, and the ability to set a project directory.

You can view the ShowTool Pro manual here.

Bringing Your Models In-Game

To place objects in the environment, press F11 then F4 to enter the World Creator. The imported objects can be found in the hierarchy located on the lower left-hand side of the editor. Meshes can then be scaled, rotated, and translated in the World Inspector.

You may notices that the extent of your object's interactivity will be collisions (if you can even call that interaction). Special items such as weapons need to have some scripting attached to them to allow for collection, but we will be exploring this later.

After importing meshes, be sure to save your current mission so your changes are retained when you restart the engine.