DDL Asset: Difference between revisions

From COD Engine Research
No edit summary
No edit summary
Line 17: Line 17:
};
};


struct EntryData
struct ddlHash_t
{
{
   int hash;
   int hash;
   int entryID;
   int index;
};
};


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


struct MemberEntry
struct ddlMemberDef_t
{
{
   char *name;
   const char *name;
   int bitSize;
   int size;
   int bitOffset;
   int offset;
   DataType dataType;
   DataType type;
   int structType;
   int externalIndex;
   int unknown1[3];
   unsigned int rangeLimit;
   int arrayCount;
   unsigned int serverDelta;
  unsigned int clientDelta;
  int arraySize;
   int enumIndex;
   int enumIndex;
   int unknown2;
   int permission;
#ifdef BO1
#ifdef BO1
   int unknown3;
   int unknown3;
Line 49: Line 51:
};
};


struct StructEntry
struct ddlStructDef_t
{
{
   char *name;
   const char *name;
   int structSize;
   int size;
   int entryCount;
   int memberCount;
   MemberEntry *entries;
   ddlMemberDef_t *members;
#ifdef BO2
#ifdef BO2
   EntryData *entryData;
   ddlHash_t *hashTable;
#endif
#endif
};
};


struct DataDef
struct ddlDef_t
{
{
   int mainStructMemberCount;
   int version;
   int mainStructSize;
   int size;
   StructEntry *structEntries;
   ddlStructDef_t *structList;
   int structCount;
   int structCount;
   EnumEntry *enumEntries;
   ddlEnumDef_t *enumList;
   int enumCount;
   int enumCount;
   DataDef * next;
   ddlDef_t *next;
};
};


struct DataDefLanguage
struct ddlRoot_t
{
{
   char *name;
   const char *name;
   DataDef *entires;
   ddlDef_t *ddlDef;
};
};
</syntaxhighlight>
</syntaxhighlight>

Revision as of 23:23, 20 December 2014

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 ddlHash_t
{
  int hash;
  int index;
};

struct ddlEnumDef_t
{
  const char *name;
  int memberCount;
  const char **members;
#ifdef BO2
  ddlHash_t *hashTable;
#endif
};

struct ddlMemberDef_t
{
  const char *name;
  int size;
  int offset;
  DataType type;
  int externalIndex;
  unsigned int rangeLimit;
  unsigned int serverDelta;
  unsigned int clientDelta;
  int arraySize;
  int enumIndex;
  int permission;
#ifdef BO1
  int unknown3;
#endif
};

struct ddlStructDef_t
{
  const char *name;
  int size;
  int memberCount;
  ddlMemberDef_t *members;
#ifdef BO2
  ddlHash_t *hashTable;
#endif
};

struct ddlDef_t
{
  int version;
  int size;
  ddlStructDef_t *structList;
  int structCount;
  ddlEnumDef_t *enumList;
  int enumCount;
  ddlDef_t *next;
};

struct ddlRoot_t
{
  const char *name;
  ddlDef_t *ddlDef;
};

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.