DDL Asset

From COD Engine Research
Revision as of 23:07, 13 January 2014 by CraigChrist8239 (talk | contribs)

The DDL asset is Treyarch's equivalent to IW's structureddatadef asset and is used to store structure information. As such it only appears in Black Ops 1 and Black Ops 2. The acronym that "ddl" represents (Data Definition Language most likely, Data Definition Library, Dynamic Data Library?) is currently unknown.

enum DataType : int
{
  DT_INT8 = 0,
  DT_INT16 = 1,
  DT_INT32 = 2,
  DT_U_INT32 = 3,
  DT_INT64 = 4,
  DT_FLOAT = 5,
  DT_STRING = 7,
  DT_STRUCT = 8
};

struct EntryData
{
  int hash;
  int entryID;
};

struct EnumEntry
{
  char *name;
  int entryCount;
  char **entries;
#ifdef BO2 //entryData only exists on Black Ops 2
  EntryData *entryData;
#endif
};

struct MemberEntry
{
  char *name;
  int bitSize;
  int bitOffset;
  DataType dataType;
  int structType;
  int unknown1[3];
  int arrayCount;
  int enumIndex;
  int unknown2;
#ifdef BO1
  int unknown3;
#endif
};

struct StructEntry
{
  char *name;
  int structSize;
  int entryCount;
  MemberEntry *entries;
#ifdef BO2
  EntryData *entryData;
#endif
};

struct DataDef
{
  int mainStructMemberCount;
  int mainStructSize;
  StructEntry *structEntries;
  int structCount;
  EnumEntry *enumEntries;
  int enumCount;
  DataDef * next;
};

struct DataDefLanguage
{
  char *name;
  DataDef *entires;
};

Source Format

The current public source format for DDLs is no good for the modding scene. It is similar to a string table with the name of the entries and their maximum and minimum values. A more useful format would be similar to the structureddatadefs with a structure and enums. DDLs are defined at "ddl/" for SP and shared DDLs, and at "ddl_mp/" for MP DDLs.

First enums must be dumped. These are very simple with each EnumEntry an individual enum and having a single string in the entries for each member of the enum.

Structures are the second and last item to be dumped. Each StructEntry is a structure to be used, and each MemberEntry is an item in the structure. Keep in mind that while IW's structureddatadef used normal lengths and byte offsets, the DDL uses bit offset/lengths and aligns almost nothing. Dumping the DDL should be fairly obvious when compared to the structreddatadef.