AIPaths Asset

From COD Engine Research
Jump to: navigation, search

The aipaths asset was added on Modern Warfare 3 and clearly holds pathing information for AI to follow around the map. This is part of the D3DBSP system produced by radiant. When compared to the vehicle_track asset, the pathing information in this asset is much more dynamic.

Modern Warfare 3

struct unknownAIPathsStruct1Internal1
{
  char unknown1[6];
  ScriptString unknownScriptString1;
  ScriptString unknownScriptString2;
  ScriptString unknownScriptString3;
  ScriptString unknownScriptString4;
  ScriptString unknownScriptString5;
  char unknown2[0x28];
  unsigned short unknownCount;
  char * unknown3; //Size ((unknownCount << 1) + unknownCount) << 2
};
 
struct unknownAIPathsStruct1
{
  unknownAIPathsStruct1Internal1 unknownEmbeddedStruct;
  char unknown[0x48];
};
 
struct unknownAIPathsUnion1Struct1
{
  unsigned int unknownCount;
  unsigned short * unknown; //Count = unknownCount
};
 
union unknownAIPathsUnion1;
{
  unknownAIPathsUnion1Struct1 unknownStruct1;
  unknownAIPathsUnion1 * repeater[2];
};
 
struct unknownAIPathsStruct2
{
  unknownAIPathsUnion1 unknownUnion;
  char unknown[8];
};
 
struct AIPaths
{
  const char * name;
  unsigned int unknownCount1;
  unknownAIPathsStruct1 * unknownStructArray1;
  char * unknown1; //Size = unknownCount1 << 4
  int unknown2;
  unsigned short * unknown3; //Count = unknownCount1;
  unsigned short * unknown4; //Count = unknowncount1;
  unsigned int unknownCount2;
  byte * unknown5; //Size = unknownCount2
  unsigned int unknownCount3;
  unknownAIPathsStruct2 * unknownStructArray2; //Count = unknownCount3
};

Ghosts

enum PathNodeErrorCode
{
  PNERR_NONE = 0x0,
  PNERR_INSOLID = 0x1,
  PNERR_FLOATING = 0x2,
  PNERR_NOLINK = 0x3,
  PNERR_DUPLICATE = 0x4,
  PNERR_NOSTANCE = 0x5,
  PNERR_INVALIDDOOR = 0x6,
  PNERR_NOANGLES = 0x7,
  PNERR_BADPLACEMENT = 0x8,
  NUM_PATH_NODE_ERRORS = 0x9,
};
 
struct pathnode_yaworient_t
{
  float fLocalAngle;
  float localForward[2];
};
 
union PathNodeParentUnion
{
  scr_string_t name;
  unsigned __int16 index;
};
 
struct pathlink_s
{
  float fDist;
  unsigned __int16 nodeNum;
  char disconnectCount;
  char negotiationLink;
  char flags;
  char ubBadPlaceCount[3];
};
 
struct pathnode_constant_t
{
  unsigned __int16 type;
  unsigned int spawnflags;
  scr_string_t targetname;
  scr_string_t script_linkName;
  scr_string_t script_noteworthy;
  scr_string_t target;
  scr_string_t animscript;
  int animscriptfunc;
  float vLocalOrigin[3];
  union {
    pathnode_yaworient_t yaw_orient;
    float angles[3];
  };
  PathNodeParentUnion parent;
  union {
    float minUseDistSq;
    PathNodeErrorCode error;
  };
  __int16 wOverlapNode[2];
  unsigned __int16 totalLinkCount;
  pathlink_s *Links;
};
 
struct SentientHandle
{
  unsigned __int16 number;
  unsigned __int16 infoIndex;
};
 
struct pathnode_dynamic_t
{
  SentientHandle pOwner;
  int iFreeTime;
  int iValidTime[3];
  __int16 wLinkCount;
  __int16 wOverlapCount;
  __int16 turretEntNumber;
  char userCount;
  char hasBadPlaceLink;
  int spreadUsedTime[2];
  __int16 flags;
  __int16 dangerousCount;
  int recentUseProxTime;
};
 
struct __declspec(align(8)) pathnode_transient_t
{
  int iSearchFrame;
  pathnode_t *pNextOpen;
  pathnode_t *pPrevOpen;
  pathnode_t *pParent;
  float fCost;
  float fHeuristic;
  union
  {
    float nodeCost;
    int linkIndex;
  };
};
 
struct pathnode_t
{
  pathnode_constant_t constant;
  pathnode_dynamic_t dynamic;
  pathnode_transient_t transient;
};
 
struct pathnode_tree_nodes_t
{
  int nodeCount;
  unsigned __int16 *nodes;
};
 
union pathnode_tree_info_t
{
  pathnode_tree_t *child[2];
  pathnode_tree_nodes_t s;
};
 
struct pathnode_tree_t
{
  int axis;
  float dist;
  pathnode_tree_info_t u;
};
 
struct PathDynamicNodeGroup
{
  unsigned __int16 parentIndex;
  int nodeTreeCount;
  pathnode_tree_t *nodeTree;
};
 
struct PathData
{
  const char * name;
  unsigned int nodeCount;
  pathnode_t *nodes;
  bool parentIndexResolved;
  unsigned __int16 version;
  int visBytes;
  char *pathVis;
  int nodeTreeCount;
  pathnode_tree_t *nodeTree;
  int dynamicNodeGroupCount;
  PathDynamicNodeGroup *dynamicNodeGroups;
  int exposureBytes;
  char *pathExposure;
  int noPeekVisBytes;
  char *pathNoPeekVis;
  int zoneCount;
  int zonesBytes;
  char *pathZones;
  int dynStatesBytes;
  char *pathDynStates;
};