DDL Asset: Difference between revisions

From COD Engine Research
No edit summary
Therifboy (talk | contribs)
mNo edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 3: Line 3:
[[Category:BO1]]
[[Category:BO1]]
[[Category:BO2]]
[[Category:BO2]]
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.
[[Category:BO3]]
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 the Black Ops franchise. The acronym that "ddl" represents (Data Definition Language most likely, Data Definition Library, Dynamic Data Library?) is currently unknown.
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
enum DataType : int
enum ddlPrimitiveTypes_e : unsigned int
{
{
   DT_INT8 = 0,
   DDL_INVALID_TYPE = 0xFFFFFFFF,
   DT_INT16 = 1,
   DDL_BYTE_TYPE = 0x0,
   DT_INT32 = 2,
   DDL_SHORT_TYPE = 0x1,
   DT_U_INT32 = 3,
   DDL_UINT_TYPE = 0x2,
   DT_INT64 = 4,
   DDL_INT_TYPE = 0x3,
   DT_FLOAT = 5,
   DDL_INT64_TYPE = 0x4,
   DT_STRING = 7,
   DDL_FLOAT_TYPE = 0x5,
   DT_STRUCT = 8
   DDL_FIXEDPOINT_TYPE = 0x6,
  DDL_STRING_TYPE = 0x7,
  DDL_STRUCT_TYPE = 0x8,
  DDL_ENUM_TYPE = 0x9,
#ifdef BO3
  DDL_PAD_TYPE = 0xA
#endif
};
};


struct ddlHash_t
struct ddlHash_t
{
{
#ifdef BO3
  char * unknownData; //Size = unknownSize << 3
  int unknownSize;
  int unknown;
#else
   int hash;
   int hash;
   int index;
   int index;
#endif
};
};


Line 28: Line 41:
   int memberCount;
   int memberCount;
   const char **members;
   const char **members;
#ifdef BO2
#if defined(BO2) || defined(BO3)
   ddlHash_t *hashTable;
   ddlHash_t *hashTable;
#endif
#endif
Line 36: Line 49:
{
{
   const char *name;
   const char *name;
#ifdef BO3
  int indexInParent;
  ddlStructDef_t * parent;
  char unknown2[0x4];
#endif
   int size;
   int size;
   int offset;
   int offset;
   DataType type;
   ddlPrimitiveTypes_e type;
   int externalIndex;
   int externalIndex;
   unsigned int rangeLimit;
   unsigned int rangeLimit;
Line 57: Line 75:
   int memberCount;
   int memberCount;
   ddlMemberDef_t *members;
   ddlMemberDef_t *members;
#ifdef BO2
#if defined(BO2) || defined(BO3)
   ddlHash_t *hashTable;
   ddlHash_t *hashTable;
#ifdef BO3
  ddlHash_t *hashTable2;
#endif
#endif
#endif
};
};
Line 64: Line 85:
struct ddlDef_t
struct ddlDef_t
{
{
#ifdef BO3
  const char * name;
  short version;
  unsigned int checksum;
  char unknown1[0x4];
  int size;
  int unknown2;
#else
   int version;
   int version;
   int size;
   int size;
#endif
   ddlStructDef_t *structList;
   ddlStructDef_t *structList;
   int structCount;
   int structCount;
Line 71: Line 101:
   int enumCount;
   int enumCount;
   ddlDef_t *next;
   ddlDef_t *next;
#ifdef BO3
  char unknown3[0x14];
#endif
};
};


Line 84: Line 117:
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.
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.
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 structureddatadef.

Latest revision as of 13:42, 7 November 2015

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 the Black Ops franchise. The acronym that "ddl" represents (Data Definition Language most likely, Data Definition Library, Dynamic Data Library?) is currently unknown.

enum ddlPrimitiveTypes_e : unsigned int
{
  DDL_INVALID_TYPE = 0xFFFFFFFF,
  DDL_BYTE_TYPE = 0x0,
  DDL_SHORT_TYPE = 0x1,
  DDL_UINT_TYPE = 0x2,
  DDL_INT_TYPE = 0x3,
  DDL_INT64_TYPE = 0x4,
  DDL_FLOAT_TYPE = 0x5,
  DDL_FIXEDPOINT_TYPE = 0x6,
  DDL_STRING_TYPE = 0x7,
  DDL_STRUCT_TYPE = 0x8,
  DDL_ENUM_TYPE = 0x9,
#ifdef BO3
  DDL_PAD_TYPE = 0xA
#endif
};

struct ddlHash_t
{
#ifdef BO3
  char * unknownData; //Size = unknownSize << 3
  int unknownSize;
  int unknown;
#else
  int hash;
  int index;
#endif
};

struct ddlEnumDef_t
{
  const char *name;
  int memberCount;
  const char **members;
#if defined(BO2) || defined(BO3)
  ddlHash_t *hashTable;
#endif
};

struct ddlMemberDef_t
{
  const char *name;
#ifdef BO3
  int indexInParent;
  ddlStructDef_t * parent;
  char unknown2[0x4];
#endif
  int size;
  int offset;
  ddlPrimitiveTypes_e 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;
#if defined(BO2) || defined(BO3)
  ddlHash_t *hashTable;
#ifdef BO3
  ddlHash_t *hashTable2;
#endif
#endif
};

struct ddlDef_t
{
#ifdef BO3
  const char * name;
  short version;
  unsigned int checksum;
  char unknown1[0x4];
  int size;
  int unknown2;
#else
  int version;
  int size;
#endif
  ddlStructDef_t *structList;
  int structCount;
  ddlEnumDef_t *enumList;
  int enumCount;
  ddlDef_t *next;
#ifdef BO3
  char unknown3[0x14];
#endif
};

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 structureddatadef.