Contents

Introduction


DSQ is the native, binary format used by the Torque engine to store animation data. This document serves as a basic specification for the DSQ file format. Very little context is given to the sequence data fields read from the DSQ file so it is recommended that this resource be read along with the Torque source code. The DSQ file format is shown below. Note that all values are stored as little-endian, so on non-Intel platforms you will have to handle perform endian conversion for 16 and 32-bit values.


Note: All values are stored as little-endian, so on non-Intel platforms you will have to perform endian conversion for 16 and 32-bit values.

DSQ Format

Name# bytesData TypeDescription
DSQ version number2S16DSQ version of this file. Note that the current DSQ version (for files saved by T3D) is 26. Most DTS exporters and the ShowToolPro tool only read/write version 24. There is actually no difference between v26 and v24, but files generated by T3D will always use the latest DTS version number.
Exporter version number2S16For tracking version of the exporter that generated this file. Can usually be ignored.
numNodes4S32Number of nodes in the shape
nodeNamesnumNodes * ?S32 and char[]Node names stored as a 4-byte length followed by N characters (terminating NULL not included in length or DSQ file)
dummy4S32Dummy value
numObjects4S32Number of objects in the shape
numNodeRotations4S32Number of node rotation keyframes
nodeRotationsnumNodeRotations * 8Quat16 { S16 x, S16 y, S16 z, S16 w }Array of quaternions for node rotation keyframes (all sequences)
numNodeTranslations4S32Number of node translation keyframes
nodeTranslationsnumNodeTranslations * 12Point3F { F32 x, F32 y, F32 z }Array of points for node translation keyframes (all sequences)
numNodeUniformScales4S32Number of node uniform scale keyframes
nodeUniformScalesnumNodeUniformScales * 4F32Array of floats for node uniform scale keyframes (all sequences)
numNodeAlignedScales4S32Number of node aligned scale keyframes
nodeAlignedScalesnumNodeAlignedScales * 12Point3F { F32 x, F32 y, F32 z }Array of points for node aligned scale keyframes (all sequences)
numNodeArbScales4S32Number of node arbitrary scale keyframes
nodeArbScaleRotsnumNodeArbScales * 8Quat16 { S16 x, S16 y, S16 z, S16 w }Array of quaternions for node arbitrary scale rotation keyframes (all sequences)
nodeArbScaleFactorsnumNodeArbScales * 12Point3F { F32 x, F32 y, F32 z }Array of points for node arbitrary scale factor keyframes (all sequences)
numGroundFrames4S32Number of ground transform keyframes
groundTranslations4Point3F { F32 x, F32 y, F32 z }Array of points for ground transform keyframes (all sequences)
groundRotations2Quat16 { S16 x, S16 y, S16 z, S16 w }Array of quaternions for ground transform keyframes (all sequences)
dummy4S32Dummy value
numSequences4S32Number of sequences in the shape
sequencesnumSequences * ?SequenceArray of Sequences - size of each sequence depends on which nodes are affected etc.
numTriggers4S32Number of triggers (all sequences)
triggers4Trigger { U32 state, F32 pos }Array of sequence triggers (all sequences)


Sequences

Sequences are stored in the DSQ file as shown below. Note that this is almost identical to how sequences are stored in DTS files except for the name:

Name# bytesData TypeDescription
name?S32 and char[]The name of this sequence stored as a 4-byte length followed by N characters (terminating NULL not included in length or DSQ file)
flags4U32Sequence flags
numKeyframes4S32Number of keyframes in this sequence
duration4F32Duration of the sequence (in seconds)
priority4S32Sequence priority
firstGroundFrame4S32First ground transform keyframe in this sequence (index into the groundTranslations and groundRotation arrays)
numGroundFrames4S32Number of ground transform keyframes in this sequence
baseRotation4S32First node rotation keyframe in this sequence (index into the nodeRotations array)
baseTranslation4S32First node translation keyframe in this sequence (index into the nodeTranslations array)
baseScale4S32First node scale keyframe in this sequence (index into the nodeXXXScales arrays)
baseObjectState4S32First object state keyframe in this sequence (index into the objectStates array)
baseDecalState4S32First decal state keyframe in this sequence (index into the decalStates array). Note that DTS decals are deprecated, and this value should be 0.
firstTrigger4S32First trigger in this sequence (index into the triggers array)
numTriggers4S32Number of triggers in this sequence
toolBegin4F32Value representing the start of this sequence in the exporting tool's timeline (can usually by ignored)
rotationMatters?BitSetBitSet indicating which node rotations are animated by this sequence.
translationMatters?BitSetBitSet indicating which node translations are animated by this sequence.
scaleMatters?BitSetBitSet indicating which node scales are animated by this sequence.
decalMatters?BitSetBitSet indicating which decal states are animated by this sequence. Note that DTS decals are deprecated.
iflMatters?BitSetBitSet indicating which IFL materials are animated by this sequence.
visMatters?BitSetBitSet indicating which object's visibility is animated by this sequence.
frameMatters?BitSetBitSet indicating which mesh's verts are animated by this sequence.
matFrameMatters?BitSetBitSet indicating which mesh's UV coords are animated by this sequence.


BitSets

BitSets are stored in the DSQ file as:

Name# bytesData TypeDescription
dummy4S32Dummy value
numWords4S32Number of 32-bit values in the BitSet
bits4 * numWordsU32Array of 32-bit values representing the bits in the BitSet