Difference between revisions of "COM Map Asset"

From COD Engine Research
Jump to: navigation, search
(Call of Duty 4 & Modern Warfare 2 & 3 & Ghosts)
(World at War & Black Ops 1)
Line 54: Line 54:
 
{
 
{
 
#ifdef BO1
 
#ifdef BO1
      char unknown[0xD8];
+
  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;
 +
  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];
 
#else
 
#else
       char unknown[0x44]; //WaW contains one more int/float from above
+
       char unknown[0x44]; // TODO: WaW contains one more int/float from above
 
#endif
 
#endif
 
   const char *defName;
 
   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
 
struct ComBurnableCell
 
{
 
{
      char unknown[8];
+
  int x;
   char (*data[0x20]);
+
   int y;
 +
  ComBurnableSample (*data)[0x20];
 
};
 
};
  
Line 73: Line 127:
 
   unsigned int primaryLightCount;
 
   unsigned int primaryLightCount;
 
   ComPrimaryLight *primaryLights;
 
   ComPrimaryLight *primaryLights;
      char unknown1[0x10];
+
  ComWaterHeader waterHeader;
      unsigned int waterCellCount;
+
  unsigned int numWaterCells;
      char * waterCells; //Size = waterCellCount << 3
+
  ComWaterCell *waterCells; //Size = waterCellCount << 3
      char unknown3[0x10];
+
  ComBurnableHeader burnableHeader;
   unsigned int burnableCellCount;
+
   unsigned int numBurnableCells;
   ComBurnableCell * burnableCells;
+
   ComBurnableCell *burnableCells;
 
};
 
};
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 17:42, 27 December 2014

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];
#ifdef MW3 || Ghosts
  float up[3];
#endif
  float origin[3];
  float radius;
  float cosHalfFovOuter;
  float cosHalfFovInner;
  float cosHalfFovExpanded;
  float rotationLimit;
  float translationLimit;
#ifdef MW3 || 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
{
#ifdef BO1
  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;
  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];
#else
       char unknown[0x44]; // TODO: WaW contains one more int/float from above
#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

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;
};
 
struct ComWorld
{
  const char *name;
  int isInUse;
  unsigned int primaryLightCount;
  ComPrimaryLight *primaryLights;
};