COM Map Asset: Difference between revisions

From COD Engine Research
 
(6 intermediate revisions by 3 users not shown)
Line 8: Line 8:
[[Category:BO2]]
[[Category:BO2]]
[[Category:Ghosts]]
[[Category:Ghosts]]
[[Category:BO3]]
The com_map (believed to be "common map") appears to be dedicated to holding light data for the primary lights around the map. This asset is part of the D3DBSP system produced by Radiant so it has existed on every Call of Duty game so far.
The com_map (believed to be "common map") appears to be dedicated to holding light data for the primary lights around the map. This asset is part of the D3DBSP system produced by Radiant so it has existed on every Call of Duty game so far.
== Call of Duty 4 & Modern Warfare 2 & 3 & Ghosts ==
== Call of Duty 4 & Modern Warfare 2 & 3 & Ghosts ==
Line 13: Line 14:
struct ComPrimaryLight
struct ComPrimaryLight
{
{
#ifdef MW3 || Ghosts
      char unknown[0x4C];
#else
   char type;
   char type;
   char canUseShadowMap;
   char canUseShadowMap;
   char exponent;
   char exponent;
   char unused;
   char unused;
   vec3_t color;
   float color[3];
   vec3_t dir;
   float dir[3];
   vec3_t origin;
#if defined(MW3) || defined(Ghosts)
  float up[3];
#endif
   float origin[3];
   float radius;
   float radius;
   float cosHalfFovOuter;
   float cosHalfFovOuter;
Line 29: Line 30:
   float rotationLimit;
   float rotationLimit;
   float translationLimit;
   float translationLimit;
#if defined(MW3) || defined(Ghosts)
  float cucRotationOffsetRad;
  float cucRotationSpeedRad;
  float cucScrollVector[2];
  float cucScaleVector[2];
  float cucTransVector[2];
#endif
#endif
   const char *defName;
   const char *defName;
Line 42: Line 49:
</syntaxhighlight>
</syntaxhighlight>


== Black Ops 2 ==
== World at War & Black Ops 1 ==
Note that "waterCells" and "burnableCells" were added in World at War and most likely left over in Black Ops 1, as they were subsequently removed in Black Ops 2. Also there is 0x10 unknown bytes before each cell entry, believed to be cell information.
<syntaxhighlight lang="cpp">
struct ComPrimaryLight
{
  char type;
  char canUseShadowMap;
  char exponent;
  char priority;
  __int16 cullDist;
  char _pad[2];
  float color[3];
  float dir[3];
  float origin[3];
  float radius;
  float cosHalfFovOuter;
  float cosHalfFovInner;
  float cosHalfFovExpanded;
  float rotationLimit;
  float translationLimit;
#ifdef BO1
  float mipDistance;
  float diffuseColor[4];
  float specularColor[4];
  float attenuation[4];
  float falloff[4];
  float angle[4];
  float aAbB[4];
  float cookieControl0[4];
  float cookieControl1[4];
  float cookieControl2[4];
#endif
  const char *defName;
};
 
struct ComWaterHeader
{
  int minx;
  int miny;
  int maxx;
  int maxy;
};
 
struct ComWaterCell
{
  __int16 waterheight;
  char flooroffset;
  char shoredist;
  char color[4];
};
 
struct ComBurnableHeader
{
  int minx;
  int miny;
  int maxx;
  int maxy;
};
 
struct ComBurnableSample
{
  char state;
};
 
struct ComBurnableCell
{
  int x;
  int y;
  ComBurnableSample (*data)[0x20];
};
 
struct ComWorld
{
  const char *name;
  int isInUse;
  unsigned int primaryLightCount;
  ComPrimaryLight *primaryLights;
  ComWaterHeader waterHeader;
  unsigned int numWaterCells;
  ComWaterCell *waterCells; //Size = waterCellCount << 3
  ComBurnableHeader burnableHeader;
  unsigned int numBurnableCells;
  ComBurnableCell *burnableCells;
};
</syntaxhighlight>
 
== Black Ops 2 & 3 ==
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
struct ComPrimaryLight
struct ComPrimaryLight
Line 73: Line 166:
};
};


struct ComWorld
#ifdef BO3 //These definitions are new to BO3
{
typedef char ComLightTriggerData[0x14];
   const char *name;
 
   int isInUse;
struct ComLightExploder {
   unsigned int primaryLightCount;
  int unknown;
   ComPrimaryLight *primaryLights;
  unsigned int lightTriggerDataCount;
   ComLightTriggerData * lightTriggerData;
};
 
typedef char ComProbeTriggerData[0x24];
 
struct ComProbeExploder {
   int unknown;
   unsigned int probeTriggerDataCount;
   ComProbeTriggerData * probeTriggerData;
};
};
</syntaxhighlight>


== World at War & Black Ops 1 ==
typedef char ComUmbraVolume[0x18];
Note that "waterCells" and "burnableCells" were added in World at War and most likely left over in Black Ops 1, as they were subsequently removed in Black Ops 2. Also there is 0x10 unknown bytes before each cell entry, believed to be cell information.
typedef char ComUmbraTomeGate[0x4];
<syntaxhighlight lang="cpp">
 
struct ComPrimaryLight
struct ComUmbraTome {
{
  char * name; //double check
#ifdef BO1
      unsigned int unknownVolumeCount1;
       char unknown[0xD8];
      ComUmbraVolume * unknownVolumeArray1;
#else
       unsigned int unknownVolumeCount2;
       char unknown[0x44]; //WaW contains one more int/float from above
      ComUmbraVolume * unknownVolumeArray2;
#endif
       char unknown[0xC];
   const char *defName;
  unsigned int tomeGateCount;
   ComUmbraTomeGate * tomeGates;
};
};


struct ComBurnableCell
struct ComUmbraGate {
{
  char * name; //double check
      char unknown[8];
   int unknown;
   char (*data[0x20]);
};
};
#endif


struct ComWorld
struct ComWorld
Line 107: Line 209:
   unsigned int primaryLightCount;
   unsigned int primaryLightCount;
   ComPrimaryLight *primaryLights;
   ComPrimaryLight *primaryLights;
       char unknown1[0x10];
#ifdef BO3 //Up to this point, BO3 hasn't changed anything. Umbra has clearly expanded on lighting elements in maps for BO3.
       unsigned int waterCellCount;
  unsigned int lightExploderCount;
       char * waterCells; //Size = waterCellCount << 3
  ComLightExploder * lightExploders;
       char unknown3[0x10];
       unsigned int unknownUnsignedIntArrayCount1;
   unsigned int burnableCellCount;
      unsigned int * unknownUnsignedIntArray1;
   ComBurnableCell * burnableCells;
       unsigned int unknownUnsignedIntArrayCount2;
       unsigned int * unknownUnsignedIntArray2;
  unsigned int probeExploderCount;
  ComProbeExploder * probeExploders;
      unsigned int unknownTomeArrayCount1;
      ComUmbraTome * unknownTomeArray1;
      unsigned int unknownTomeArrayCount2;
       ComUmbraTome * unknownTomeArray2;
   unsigned int gateCount;
   ComUmbraGate * gates;
#endif
};
};
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 18:13, 31 October 2015

The com_map (believed to be "common map") appears to be dedicated to holding light data for the primary lights around the map. This asset is part of the D3DBSP system produced by Radiant so it has existed on every Call of Duty game so far.

Call of Duty 4 & Modern Warfare 2 & 3 & Ghosts

struct ComPrimaryLight
{
  char type;
  char canUseShadowMap;
  char exponent;
  char unused;
  float color[3];
  float dir[3];
#if defined(MW3) || defined(Ghosts)
  float up[3];
#endif
  float origin[3];
  float radius;
  float cosHalfFovOuter;
  float cosHalfFovInner;
  float cosHalfFovExpanded;
  float rotationLimit;
  float translationLimit;
#if defined(MW3) || defined(Ghosts)
  float cucRotationOffsetRad;
  float cucRotationSpeedRad;
  float cucScrollVector[2];
  float cucScaleVector[2];
  float cucTransVector[2];
#endif
  const char *defName;
};

struct ComWorld
{
  const char *name;
  int isInUse;
  unsigned int primaryLightCount;
  ComPrimaryLight *primaryLights;
};

World at War & Black Ops 1

Note that "waterCells" and "burnableCells" were added in World at War and most likely left over in Black Ops 1, as they were subsequently removed in Black Ops 2. Also there is 0x10 unknown bytes before each cell entry, believed to be cell information.

struct ComPrimaryLight
{
  char type;
  char canUseShadowMap;
  char exponent;
  char priority;
  __int16 cullDist;
  char _pad[2];
  float color[3];
  float dir[3];
  float origin[3];
  float radius;
  float cosHalfFovOuter;
  float cosHalfFovInner;
  float cosHalfFovExpanded;
  float rotationLimit;
  float translationLimit;
#ifdef BO1
  float mipDistance;
  float diffuseColor[4];
  float specularColor[4];
  float attenuation[4];
  float falloff[4];
  float angle[4];
  float aAbB[4];
  float cookieControl0[4];
  float cookieControl1[4];
  float cookieControl2[4];
#endif
  const char *defName;
};

struct ComWaterHeader
{
  int minx;
  int miny;
  int maxx;
  int maxy;
};

struct ComWaterCell
{
  __int16 waterheight;
  char flooroffset;
  char shoredist;
  char color[4];
};

struct ComBurnableHeader
{
  int minx;
  int miny;
  int maxx;
  int maxy;
};

struct ComBurnableSample
{
  char state;
};

struct ComBurnableCell
{
  int x;
  int y;
  ComBurnableSample (*data)[0x20];
};

struct ComWorld
{
  const char *name;
  int isInUse;
  unsigned int primaryLightCount;
  ComPrimaryLight *primaryLights;
  ComWaterHeader waterHeader;
  unsigned int numWaterCells;
  ComWaterCell *waterCells; //Size = waterCellCount << 3
  ComBurnableHeader burnableHeader;
  unsigned int numBurnableCells;
  ComBurnableCell *burnableCells;
};

Black Ops 2 & 3

struct ComPrimaryLight
{
  char type;
  char canUseShadowMap;
  char exponent;
  char priority;
  __int16 cullDist;
  char useCookie;
  char shadowmapVolume;
  vec3_t color;
  vec3_t dir;
  vec3_t origin;
  float radius;
  float cosHalfFovOuter;
  float cosHalfFovInner;
  float cosHalfFovExpanded;
  float rotationLimit;
  float translationLimit;
  float mipDistance;
  float dAttenuation;
  float roundness;
  vec4_t diffuseColor;
  vec4_t falloff;
  vec4_t angle;
  vec4_t aAbB;
  vec4_t cookieControl[3];
  const char *defName;
};

#ifdef BO3 //These definitions are new to BO3
typedef char ComLightTriggerData[0x14];

struct ComLightExploder {
  int unknown;
  unsigned int lightTriggerDataCount;
  ComLightTriggerData * lightTriggerData;
};

typedef char ComProbeTriggerData[0x24];

struct ComProbeExploder {
  int unknown;
  unsigned int probeTriggerDataCount;
  ComProbeTriggerData * probeTriggerData;
};

typedef char ComUmbraVolume[0x18];
typedef char ComUmbraTomeGate[0x4];

struct ComUmbraTome {
  char * name; //double check
       unsigned int unknownVolumeCount1;
       ComUmbraVolume * unknownVolumeArray1;
       unsigned int unknownVolumeCount2;
       ComUmbraVolume * unknownVolumeArray2;
       char unknown[0xC];
  unsigned int tomeGateCount;
  ComUmbraTomeGate * tomeGates;
};

struct ComUmbraGate {
  char * name; //double check
  int unknown;
};
#endif

struct ComWorld
{
  const char *name;
  int isInUse;
  unsigned int primaryLightCount;
  ComPrimaryLight *primaryLights;
#ifdef BO3 //Up to this point, BO3 hasn't changed anything. Umbra has clearly expanded on lighting elements in maps for BO3.
  unsigned int lightExploderCount;
  ComLightExploder * lightExploders;
       unsigned int unknownUnsignedIntArrayCount1;
       unsigned int * unknownUnsignedIntArray1;
       unsigned int unknownUnsignedIntArrayCount2;
       unsigned int * unknownUnsignedIntArray2;
  unsigned int probeExploderCount;
  ComProbeExploder * probeExploders;
       unsigned int unknownTomeArrayCount1;
       ComUmbraTome * unknownTomeArray1;
       unsigned int unknownTomeArrayCount2;
       ComUmbraTome * unknownTomeArray2;
  unsigned int gateCount;
  ComUmbraGate * gates;
#endif
};