DIF/File Format

From TDN

Introduction


You can grab a more complete DIF file format specification here which covers the DIF file format that shipped with TGE 1.5.2 and TGEA 1.0.3. Feel free to help move/convert it to this page if you have the time.

This document describes the structure of a DIF file.



NOTE: this document is a work in progress at the moment, feel free to contribute.



Overview


field                         type/class               short description
------------------------------------------------------------------------------------------
FileVersion                   U32                      file format version
PreviewBitmap                 bool                     has preview bitmap
  PNGImage                    PNG image                preview image in PNG format
numDetailLevels               U32                      number of detail levels
  DetailLevel                 Interior                 detail 1
  ...                         Interior                 detail ...
numSubObjects                 U32                      number of subobjects (mirrors, translucencies)
  SubObject                   Interior                 subobject 1
  ...                         Interior                 subobject ...
numTriggers                   U32                      number of triggers
  Trigger                     InteriorResTrigger       trigger 1
  ...                         InteriorResTrigger       trigger ...
numChilds                     U32                      number of childs
  Child                       InteriorPathFollower     child 1
  ...                         InteriorPathFollower     child ...
numForceFields                U32                      number of fields
  ForceField                  ForceField               field 1
  ...                         ForceField               field ...
numSpecNodes                  U32                      number of SpecNodes
  SpecNode                    AISpecialNode            SpecNode 1
  ...                         AISpecialNode            SpecNode ...
dummy1                        U32                      dummy, always 1
  VehicleCollision            ?                        if DetailLevel(s) present VehicleCollision of detail 1
dummy2                        U32                      =2 if GameEntities present
  numGameEntities             U32                      number of GameEntities
    GameEntitie               ItrGameEntity            GameEntitie 1
    ...                       ItrGameEntity            GameEntitie ...
null                          U32                      null file termination



Breakdown


FileVersion
Current file version is X.

PreviewBitmap
Tells us whether or not the file has a preview picture.

PNGImage
The preview picture is in the PNG format.

numDetailLevels
numDetailLevels.

DetailLevel
DetailLevel.

numSubObjects
numSubObjects.

SubObject
SubObject.

numTriggers
numTriggers.

Trigger
Trigger.

numChilds
numChilds.

Child
Child.

numForceFields
numForceFields.

ForceField
ForceField.

numSpecNodes
numSpecNodes.

SpecNode
SpecNode.

dummy1
dummy1.

VehicleCollision
VehicleCollision.

dummy2
dummy2.

numGameEntities
numGameEntities.

GameEntitie
GameEntitie.