Difference between revisions of "MapEnts Asset"

From COD Engine Research
Jump to: navigation, search
 
Line 18: Line 18:
 
   int numEntityChars;
 
   int numEntityChars;
 
};
 
};
<\syntaxhighlight>
+
</syntaxhighlight>
 
The entityString is simply a string that defines different entitys, and it's length is numEntityChars. This is a simple as it gets.
 
The entityString is simply a string that defines different entitys, and it's length is numEntityChars. This is a simple as it gets.
 
== Modern Warfare 2 ==
 
== Modern Warfare 2 ==
Line 49: Line 49:
 
   byte stageCount;
 
   byte stageCount;
 
};
 
};
<\syntaxhighlight>
+
</syntaxhighlight>
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents asset, despite one of those never actually having been found.
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents asset, despite one of those never actually having been found.
 
== Modern Warfare 3 ==
 
== Modern Warfare 3 ==
Line 86: Line 86:
 
       unknownInternalMapEnts2 unknownStruct2;
 
       unknownInternalMapEnts2 unknownStruct2;
 
};
 
};
<\syntaxhighlight>
+
</syntaxhighlight>
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents and col_map_mp (clipMap) assets.
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents and col_map_mp (clipMap) assets.
 
== Black Ops 2 ==
 
== Black Ops 2 ==
Line 108: Line 108:
 
       unknownInternalMapEnts1 unknownStruct1;
 
       unknownInternalMapEnts1 unknownStruct1;
 
};
 
};
<\syntaxhighlight>
+
</syntaxhighlight>
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents asset.
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents asset.
 
== Ghosts ==
 
== Ghosts ==
Line 193: Line 193:
 
       unknownInternalMapEnts5 unknownStruct5;
 
       unknownInternalMapEnts5 unknownStruct5;
 
};
 
};
<\syntaxhighlight>
+
</syntaxhighlight>
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents and col_map_mp (clipMap) assets.
 
Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents and col_map_mp (clipMap) assets.
 
== Source Format ==
 
== Source Format ==
 
The source format must work in tandem with the other D3DBSP assets. Currently the used the source format is simply a text file with the entityString located at "raw/maps/(MAPNAME).d3dbsp" for SP maps and at "raw/maps/mp/(MAPNAME).d3dbsp" for MP maps.
 
The source format must work in tandem with the other D3DBSP assets. Currently the used the source format is simply a text file with the entityString located at "raw/maps/(MAPNAME).d3dbsp" for SP maps and at "raw/maps/mp/(MAPNAME).d3dbsp" for MP maps.

Revision as of 17:54, 16 January 2014

The map_ents asset is part of the D3DBSP system used that is produced by Radiant. This is used to define any entities in the map particularly spawn points, helicopter path points, physable entities, and destructible entities. Although the entity string itself is quite easy to understand, some unknown structures have been added on later Call of Duty games.

Call of Duty 4 & World at War & Black Ops 1

This is the simplest map_ents.

struct MapEnts
{
  const char *name;
  char *entityString;
  int numEntityChars;
};

The entityString is simply a string that defines different entitys, and it's length is numEntityChars. This is a simple as it gets.

Modern Warfare 2

Modern Warfare 2 adds some extra data to the end, believed to be buffer data and Stage data.

struct unknownInternalMapEnts1
{
  int unknownCount1;
  char * unknownData1;			//size = unknownCount1 << 3
  int unknownCount2;
  char * unknownData2;			//size = unknownCount2 << 5
  int unknownCount3;
  char * unknownData3;			//size = ((unknownCount3 << 2) + unknownCount3) << 2
};
 
struct Stage
{
  char * stageName;
  float offset[3];
  int flags;
};
 
struct MapEnts
{
  const char *name;
  char *entityString;
  int numEntityChars;
       unknownInternalMapEnts1 unknownStruct1;
  Stage * stages;
  byte stageCount;
};

Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents asset, despite one of those never actually having been found.

Modern Warfare 3

Modern Warfare 3 adds even more extra data to the end, believed to be buffer data.

struct unknownInternalMapEnts1
{
  int unknownCount1;
  char * unknownData1;			//size = unknownCount1 << 3
  int unknownCount2;
  char * unknownData2;			//size = unknownCount2 << 5
  int unknownCount3;
  char * unknownData3;			//size = ((unknownCount3 << 2) + unknownCount3) << 2
};
 
struct unknownInternalMapEnts2
{
  unknownInternalMapEnts1 unknownStruct1;
  short unknownCount1;
  char * unknownData1;			//size = unknownCount1 * 0x1C
  int unknownCount2;
  char * unknownData2;			//size = unknownCount2
  char * unknownData3;			//size = unknownStruct1->unknownCount1 << 1
  char * unknownData4;			//size = unknownStruct1->unknownCount1
  char * unknownData5;			//size = ((unknownStruct1->unknownCount1 << 1) + unknownStruct1->unknownCount1) << 2
  char * unknownData6;			//size = unknownStruct1->unknownCount1 << 2
  char * unknownData7;			//size = unknownStruct1->unknownCount1 << 1
};
 
struct MapEnts
{
  const char *name;
  char *entityString;
  int numEntityChars;
       unknownInternalMapEnts1 unknownStruct1;
       unknownInternalMapEnts2 unknownStruct2;
};

Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents and col_map_mp (clipMap) assets.

Black Ops 2

Black Ops 2 adds similar data to Modern Warfare 2 to the end of it's asset, believed to be buffer data.

struct unknownInternalMapEnts1
{
  int unknownCount1;
  char * unknownData1;			//size = unknownCount1 << 3
  int unknownCount2;
  char * unknownData2;			//size = unknownCount2 << 5
  int unknownCount3;
  BYTE * unknownData3;			//size = ((unknownCount3 << 2) + unknownCount3) << 2
};
 
struct MapEnts
{
  const char *name;
  char *entityString;
  int numEntityChars;
       unknownInternalMapEnts1 unknownStruct1;
};

Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents asset.

Ghosts

Ghosts provides a fundamental change to the way the map_ents asset works, because while the entityString still exists it goes unused.

struct unknownInternalMapEnts1
{
  int unknownCount1;
  char * unknownData1;			//size = unknownCount1 << 3
  int unknownCount2;
  char * unknownData2;			//size = unknownCount2 << 5
  int unknownCount3;
  char * unknownData3;			//size = ((unknownCount3 << 2) + unknownCount3) << 2
};
 
struct unknownInternalMapEnts2
{
  unknownInternalMapEnts1 unknownStruct1;
  short unknownCount1;
  char * unknownData1;			//size = unknownCount1 * 0x1C
  int unknownCount2;
  char * unknownData2;			//size = unknownCount2
  char * unknownData3;			//size = unknownStruct1->unknownCount1 << 1
  char * unknownData4;			//size = unknownStruct1->unknownCount1
  char * unknownData5;			//size = ((unknownStruct1->unknownCount1 << 1) + unknownStruct1->unknownCount1) << 2
  char * unknownData6;			//size = unknownStruct1->unknownCount1 << 2
  char * unknownData7;			//size = unknownStruct1->unknownCount1 << 1
  char * unknownData8;			//size = unknownStruct1->unknownCount1 << 1
  char * unknownData9;			//size = unknownStruct1->unknownCount1 << 1
};
 
struct unknownInternalMapEnts3
{
  short unknownCount;
  char * unknownData;			//size = unknownCount * 0x1C
};
 
struct unknownInternalMapEnts4Internal1
{
  short unknown1;
  ScriptString unknownScriptString1;
  ScriptString unknownScriptString2;
  ScriptString unknownScriptString2;
  char unknown2[0x18];
};
 
struct unknownInternalMapEnts4
{
  short unknownCount;
  unknownInternalMapEnts4Internal1 * unknownStruct;			//Count = unknownCount
};
 
struct unknownInternalMapEnts5Internal1Internal1
{
  char unknown1[8];
  char (*unknown2)[0x40];
  char unknown3[0x28];
  char (*unknown4)[0x30];
  char (*unknown5)[0x24];
};
 
struct unknownInternalMapEnts5Internal1
{
  short unknownCount;
  int unknown;
  unknownInternalMapEnts5Internal1Internal1 * unknownStruct;			//Count = unknownCount
};
 
struct unknownInternalMapEnts5
{
  short unknownCount;
  unknownInternalMapEnts5Internal1 * unknownStruct;			//Count = unknownCount
};
 
struct MapEnts
{
  const char *name;
  char *entityString;
  int numEntityChars;
       unknownInternalMapEnts1 unknownStruct1;
       unknownInternalMapEnts2 unknownStruct2;
       unknownInternalMapEnts3 unknownStruct3;
       unknownInternalMapEnts4 unknownStruct4;
       unknownInternalMapEnts5 unknownStruct5;
};

Keep in mind that the unknownInternalMapEnts1 is also used in the addon_map_ents and col_map_mp (clipMap) assets.

Source Format

The source format must work in tandem with the other D3DBSP assets. Currently the used the source format is simply a text file with the entityString located at "raw/maps/(MAPNAME).d3dbsp" for SP maps and at "raw/maps/mp/(MAPNAME).d3dbsp" for MP maps.