DTS tutorial/process !

Poponfu

Lead Developer
DTS TUTORIAL


With the release of player servers I thought I would make this to help future moders out. Keep in mind if you add any custom shapes/textures to your server , players will have to download them externally before they will be able to connect. For todays episode I am going to show you one of the cores that will hopefully be in a soon'ish content update. You are going to need a 3D modeling/animation program that has a DTS exporter available for it.

There are exporters for free programs:
Blender

I am going to use Maya but the steps should be about the same in almost any 3D creation app.. just located in different places. For specifics about different exporters check out http://www.garagegames.com/documentation/artist later on.

An inexpensive tool I suggest you buy if you are serious is http://www.garagegames.com/products/showtoolpro this will let you quickly check your model/materials/animations/mounts without having to put it in legions to find out something is broken. This is not required though.

This tutorial is not for teaching you how to make 3D art.. the basics are covered 10000 times over on the interwebs. This is to show you how to setup / export your work for legions.


MAKE SURE YOUR SCENE IS SET TO METERS / 30 FPS
----------------------------------------------

Step one: Modeling/Texturing/Animation.


Get your model you want to use all finished up , Lay out UVs and Texture it and normal map if you need to. All the animations go in the one scene. Make sure your hierarchy for joints/geo is correct before animating. ( next section below ) Put one empty frame between the end of one animation and start of another.


----------------------------
Scene hierarchy.
----------------------------

heiarchy.png


Your scene hierarchy should look something like this. base01--->start01---* and then whatever joints/nodes you need go under that.. as well as any RIGID geometry. Skinned meshes stay in the scene root. ( the kind where you paint vertex weights )

Make sure you have a object(cube) in the scene root called 'bounds' thats encompasses your entire object you want to export.

-------------------
Scene hierarchy. - Detail Levels (LOD)
-------------------

refer to scene hierarchy pic. ^

Detail levels are very important to set up. For this I am going to use three , which should cover most anything you create. You should consider more if your object is extremely high poly. The number after your objects name tells the exporter what detail level it belongs in. warpCore100 , warpCore60 and warpCore2 are shown in the image above. The number of the detail level is how big something is on the screen in pixels when that detail level shows up. So if the warp core is larger than 100 pixels , that shows. Less than that and the next level down , warpCore60 shows and so on.

You also need nodes to tell the exporter what detail levels there are. These should be children of start01. They should be named 'detail#'. For this we need detail100,detail60 and detail2 as seen in the image above.

<tip> for all the levels except for 2 you should be able to fiddle with a mesh reduce option in your creation app of choice. Make sure to preserve UVs and object borders. You must create a detail 2 separately for not only performance but all our legions lite friends.


-----------------------------
Scene hierarchy. - Collision Meshes
-----------------------------

This step is not necessary , you can use the bounding box as the collision object. If you dont need a complicated collision mesh , use the bounding box.. they can be very taxing on the game. For cores I did not have to use them. This screenshot shows what it would look like though.

colcp.png



Collision objects are named Col_# up to 9 and located with other objects. You also need Collision marker nodes, these should be children of start01 named Collision_#, one for each Collision object you have. These should be very very low poly if you use them.


-------------------------
Step four: Material Setup
-------------------------

mayamaterials.png


Make new lamberts materials and apply them to your different pieces. Anything that is going to need to use separate textures/effects needs its own material. Try and have things share as much as possible. ( 5 glow colors do not need 5 textures.. just 1 with 5 splotches of color for their different uvs etc..)

Maya
Map a file into the color of your new material... the name you put into the path field is the name you are going to use later in setting up your material files mapTo(covered below) . Circled in the image above.

Max
Map a file into the color of your new material.. the name minus the extension is what you will use in the material file mapTo. (covered below)

----------------------------
Animations - defining your sequences
----------------------------

This is going to vary quite a bit exporter to exporter. For maya, in the exporter menu go to: DTS--->Sequences--->Create sequence node . This will create a node in the scene root where you set the start/end frame range for this animation..whether its cycled and how it blends among a whole lot of other things. In the same menu,selecting Sequence Attributes will show you complete list of whats available.

Torque has the ability to separate out animations into different .dsq files but in legions we use them all inside the one .dts with multiple sequence nodes.


We are going to use a visibility animation on a part of this. You add this by selecting the object you want it on and going to DTS-->Rendering Options-->visibility animation. This will create a new attribute for the object called 'Vis'. This will allow you to key the visibility off during its first idle animation and flicker or fade on for its activate. You can key the values from 0 to 1. For instance the players jet glow is a visibility anim on certain sequences.

visl.png


Look again at the sequence nodes attribtes in your scene. Set 'Enable Vis' for both to 1.



-------
Export
-------

You need to triangulate every part of your mesh before export or it will error. ( this isn't true for 3ds max , it does it for you on export )


You will need a .cfg file for export. . You can add things not to export if you use things specific to your program to create animations like curves and the such.

Code:
NeverExport:
nurbsCircle1
nurbsCircle4
nurbsCircle3
//etc
-Param::CollapseTransforms


If you dont use things specific to your 3D app that wont export right, you can use this instead.

Code:
AlwaysExport:
*
-Param::CollapseTransforms

Save this as <scenename>.cfg in the same directory as your objects maya scene. Make sure its the exact same name as your scene name. Click Export settings and set the name the same as your scene name. The path should be the same directory as your scene. Then just click export shape and wait.

<tip> When you have blend animations, the display updates much slower than the exporter can do its thing. If you have hundreds of frames this can take minutes to export. Minimize your program and it will finish in seconds instead.

This is our finished shape.. now just have to set up the material file.


-------------------
Material file setup
-------------------

Material files go in /client/materials . You can have multiple shape's materials in one file to keep things organized. Below is the script for this cores material's with a few comments here and there.

Code:
//warp core
 
 
new Material(warpCoreMaterial1)
{
  mapTo = "warpCoreExtras"; //remember this name from the material setup step ? insert here
  baseTex[0] = "legions/data/shapes/cores/Warp/warpCoreExtrasDif.png";
  emissive[0] = true;
  glow[0] = true;
  translucent = false;
  selfShading[0] = true;
  // translucentBlendOp = Multiply;
 
  animFlags[0] = $scroll; //this scrolls the texture.. there are others too. Be tricky with uvs and create effects with these.
  scrollDir[0] = "1.0 0.0";
  scrollSpeed[0] = 0.4;
 
  };
 
  new Material(warpCoreMaterial2)
{
  mapTo = "warpCoreMtl";
  baseTex[0] = "legions/data/shapes/cores/Warp/warpCore_dif.dds";
  bumpTex[0] = "legions/data/shapes/cores/Warp/warpCore_nrm.dds"; //this is where nrm map goes
  pixelSpecular[0] = true;  // enable your spec map
  specular[0] = "0.4 0.35 0.3 0.0";
  specularPower[0] = 32.0;
  ambientCube = GradientAmbientCubemap;
  compressNormalMaps = true;
 
    };
 
  new Material(warpCoreMaterial4)
{
  mapTo = "warpCoreLOD";
  baseTex[0] = "legions/data/shapes/cores/Warp/warpCoreLOD_Dif.png";
 
};
 
//cut some out to keep post under limit

For a good list of all the different things you can do in the material file , check out: http://docs.garagegames.com/tgea/official/content/documentation/Materials%20and%20Shaders/Materials.html

If you are going to use the transparency flag , use pngs.. it is the alpha channel as usual.

If you want to turn on pixel specular you need to put your specular map into the alpha channel of the diffuse texture .dds DXT5

If you use a normal map , you need to put it through a strange process for it to look correct in legions from all angles. The steps are located here http://www.sc2mapster.com/forums/re...-normal-map-conversion-from-purple-to-orange/ . Also saved out as a .dds DXT5

--------------------

You should now be ready to test out your object !

 

Volt Cruelerz

Legions Developer
I didn't even make it past the second paragraph before I scrolled down to hit Like :D Thank you :)

EDIT: Y THIS NO STICKY?
 

Immanent

Member
I was dying to find out why all legionnaires had that random 'hole' on their back!
Anyway, all the technical term seems like gibberish to me, therefore hopefully these cores will be released and pushed live 'soon'! Good work.
 
Top