Game Development Community

DTS File Format

by Nate Pendleton · in Torque Game Engine · 01/19/2004 (10:46 pm) · 13 replies

Hey everyone :)
i am rolling my own maya exporter, and have everything in place to start the actual file serialization. is there an actual binary file spec lying around anywhere, along with engine limitations and asterisks? i am ignorant of the c++ standard iostream operation regarding stl arrays etc, which is what the actual DTS shape mesh save function uses. i'm sure i could decode it given a bit of time, but i was hoping to spend that time making games :) thanks for any info

n8

#1
01/19/2004 (10:52 pm)
Nate, you got the source code of Torque and the DTS exporters for MilkShape and 3DS Max, why not check them out since the DTS format is not documented. :P
#2
01/20/2004 (1:35 am)
I will then...just hoping it was so i could take a little shortcut...thought maybe there was some docs i missed. maybe i'll contribute a little something by documenting this bitch ;)

n8
#3
01/20/2004 (9:26 am)
Nate,

We are working on an official Maya exporter. It will be extemely educational for you to do yours and the community can use another expert in the exporter area, but I just wanted to let you know.

-Jeff Tunnell GG
#4
01/20/2004 (11:50 am)
Nate,

maybe this will help you => www.knie-pfaffenhofen.de/DTS-FileFormat.pdf

Oki, it's not finished, maybe not 100% correct and still the comments in German, but maybe it helps.
#5
01/20/2004 (12:05 pm)
Sven,

Nice docs :)

Though you don't seem to mention if the int's are signed or unsigned, which is VERY important.
The avgError and minError variables in the DetailLevel structure are supposedly the newer form of switching detail levels. However, i think there are some problems with that system, and anyway, i don't quite get how its implemented :) (the size variable is much better)
And stream.flush() is meant to copy the DTS buffers to a file when you want to finish writing them.
#6
01/21/2004 (12:04 am)
James,

thanks and sorry about the signed or unsigned int. I thought it's enough to named the signed integers with int because if the would be unsigned it will be named uint.
In facts the DTS File Format doesn't use unsigned int.

you are right with the Detaillevels, the size variable is much better. I have just added the Detail Level stuff to the milkshape exporter and it works quite good.

But the real interesting things about the DTS Format is the tons of stuff in there which isn't use by the TGE.
The Format has the possibilities to handle:
- Detailmaps (there are also many functions for this in the tsShape classes, but i haven't figure it out how it works)
- Bumpmaps
- ILF Materials (within the DTS File, without separate Textfile)

and also sorry about the stream.flush() ;-) *should better clean up behind me* this is just an artefact :-D.
#7
01/21/2004 (4:26 am)
Sven,

Dts uses unsigned int in many places.
E.g when writing meshes, my blender exporter writes the following as unsigned variables :

for cnt in range(0, len(self.verts)):
					dstream.readu8() # dummy read of enormals

for cnt in range(0, dstream.reads32()):
				self.mindices.append(dstream.readu16()) # U16

self.flags = dstream.readu32()

(etc)

Checkpoints in a dts are also unsigned.

Don't be mislead by the milkshape exporter. The ts code in torque is a much more useful reference imo.
Regardless, its nice to see you are making some documentation on DTS :)

I think the IFL material stuff in the shape is for closely tying in the animated materials with sequences. e.g In thinktanks, the tracks on the tank only move when the tank plays its moving animations.
#8
01/21/2004 (5:44 am)
Hmm, I use the DTSSDK.lib (which is also used by the milkshape exporter and models from there seems to work) and there are following definitions in the DTSMesh.h

std::vector <char>      enormals ;  //!< Encoded normals (see encodeNormal)
std::vector <Primitive> primitives; //!< Mesh primitives
std::vector <short>     indices ;   //!< Vertex index array, for primitives
std::vector <short>     mindices ;  //!< ?

Oki, i should double check it with the TS stuff from the TGE. But anyway, i got at least Level of Details, LOSCollision working with the milkshape exporter.
#9
01/21/2004 (6:31 am)
Perhaps the mikshape exporter is lucky? :)
I had a few problems with signed and unsigned variables and whatnot when writing the blender exporter :)

Btw Sven, did you notice this oddity in the milkshape exporter?:

void Shape::setSmallestSize(int pixels)
   {
      if (pixels < 1) pixels = 1 ;
      smallestSize = pixels ;
      for (int i = 0 ; i < detailLevels.size() ; i++)
      {
         if (detailLevels[i].size < pixels)
            break ;
      }
      smallestDetailLevel = i ;
   }

Lets just say... if it breaks like that, it will select the wrong detail level (should be i-1, clamped so it doesn't go < 0 of course). Additionally, it does not quite take into account if you have your detail level sizes arranged in an odd manner.
(There is also the issue of torque generated billboard detail levels, which shouldn't be the smallest detail level. Though no exporter except the blender exporter supports these.)
#10
01/21/2004 (7:44 pm)
Jeff, is there any way to get an advance peek at the maya exporter code you guys are working on? i don't care if it doesn't compile/work/etc...just want some more reference

thanks!
n8
#11
01/21/2004 (7:57 pm)
Jeff, is there any way to get an advance peek at the maya exporter code you guys are working on? i don't care if it doesn't compile/work/etc...just want some more reference

thanks!
n8
#12
01/29/2004 (8:58 am)
Jeff. Once again I would like to thank you and GG for taking the time to do a Maya exporter. I know this is going to make a big difference for a lot of people, and IMO will spawn a whole new surge of Torque sales.

Looking forward to the exporter.
#13
04/17/2008 (6:50 am)
Hello everybody..

I want to search for some baby bots dts file like ants,spider etc.Where can i find baby bots dts file?