Vehicle Asset (Ghosts)

From COD Engine Research
Jump to: navigation, search

The vehicle asset is a was added on Modern Warfare 2 and has been on every Call of Duty game since except for Black Ops 1. The purpose of this asset is to declare vehicles, mostly used for killstreaks.

enum VehicleType : int
{
  VEH_WHEELS_4 = 0x0,
  VEH_TANK = 0x1,
  VEH_PLANE = 0x2,
  VEH_BOAT = 0x3,
  VEH_ARTILLERY = 0x4,
  VEH_HELICOPTER = 0x5,
  VEH_SNOWMOBILE = 0x6,
  VEH_SUBMARINE = 0x7,
  VEH_UGV = 0x8,
  VEH_TYPE_COUNT = 0x9
};
 
enum VehicleAxleType
{
  VEH_AXLE_FRONT = 0x0,
  VEH_AXLE_REAR = 0x1,
  VEH_AXLE_ALL = 0x2,
  VEH_AXLE_COUNT = 0x3
};
 
enum VehCamZOffsetMode
{
  VEHCAM_ZMODE_WORLD = 0x0,
  VEHCAM_ZMODE_VEHICLE = 0x1,
  VEHCAM_ZMODE_VIEW = 0x2,
  VEHCAM_ZMODE_COUNT = 0x3
};
 
enum VehicleTurretFireType
{
  VEH_TURRET_SINGLE_FIRE = 0x0,
  VEH_TURRET_DUAL_FIRE = 0x1,
  VEH_TURRET_ALT_FIRE = 0x2,
  VEH_TURRET_FIRE_TYPE_COUNT = 0x3
};
 
const struct __declspec(align(8)) VehiclePhysDef
{
  int physicsEnabled;
  const char *physPresetName;
  PhysPreset *physPreset;
  const char *accelGraphName;
  VehicleAxleType steeringAxle;
  VehicleAxleType powerAxle;
  VehicleAxleType brakingAxle;
  float topSpeed;
  float reverseSpeed;
  float maxVelocity;
  float maxPitch;
  float maxRoll;
  float suspensionTravelFront;
  float suspensionTravelRear;
  float suspensionStrengthFront;
  float suspensionDampingFront;
  float suspensionStrengthRear;
  float suspensionDampingRear;
  float frictionBraking;
  float frictionCoasting;
  float frictionTopSpeed;
  float frictionSide;
  float frictionSideRear;
  float velocityDependentSlip;
  float rollStability;
  float rollResistance;
  float pitchResistance;
  float yawResistance;
  float uprightStrengthPitch;
  float uprightStrengthRoll;
  float targetAirPitch;
  float airYawTorque;
  float airPitchTorque;
  float minimumMomentumForCollision;
  float collisionLaunchForceScale;
  float wreckedMassScale;
  float wreckedBodyFriction;
  float minimumJoltForNotify;
  float slipThreshholdFront;
  float slipThreshholdRear;
  float slipFricScaleFront;
  float slipFricScaleRear;
  float slipFricRateFront;
  float slipFricRateRear;
  float slipYawTorque;
};
 
struct __declspec(align(2)) VehicleDef
{
  const char *name;
  VehicleType type;
  const char *useHintString;
  int health;
  int quadBarrel;
  int hitClientScriptables;
  float texureScrollScale;
  float topSpeed;
  float accel;
  float rotRate;
  float rotAccel;
  float maxBodyPitch;
  float maxBodyRoll;
  float fakeBodyAccelPitch;
  float fakeBodyAccelRoll;
  float fakeBodyVelPitch;
  float fakeBodyVelRoll;
  float fakeBodySideVelPitch;
  float fakeBodySidePitchStrength;
  float fakeBodyRollStrength;
  float fakeBodyPitchDampening;
  float fakeBodyRollDampening;
  float fakeBodyBoatRockingAmplitude;
  float fakeBodyBoatRockingPeriod;
  float fakeBodyBoatRockingRotationPeriod;
  float fakeBodyBoatRockingFadeoutSpeed;
  float boatBouncingMinForce;
  float boatBouncingMaxForce;
  float boatBouncingRate;
  float boatBouncingFadeinSpeed;
  float boatBouncingFadeoutSteeringAngle;
  float collisionDamage;
  float collisionSpeed;
  float killcamZDist;
  float killcamBackDist;
  float killcamUpDist;
  int playerProtected;
  int bulletDamage;
  int armorPiercingDamage;
  int grenadeDamage;
  int projectileDamage;
  int projectileSplashDamage;
  int heavyExplosiveDamage;
  VehiclePhysDef vehPhysDef;
  float boostDuration;
  float boostRechargeTime;
  float boostAcceleration;
  float suspensionTravel;
  float maxSteeringAngle;
  float steeringLerp;
  float minSteeringScale;
  float minSteeringSpeed;
  int disableWheelsTurning;
  int vehHelicopterIsASplinePlane;
  int vehHelicopterLockAltitude;
  int vehHelicopterOffsetFromMesh;
  float vehHelicopterAltitudeOffset;
  float vehHelicopterPitchOffset;
  float vehHelicopterBoundsRadius;
  float vehHelicopterMaxSpeed;
  float vehHelicopterMaxSpeedVertical;
  float vehHelicopterMaxAccel;
  float vehHelicopterMaxAccelVertical;
  float vehHelicopterDecelerationFwd;
  float vehHelicopterDecelerationSide;
  float vehHelicopterDecelerationUp;
  float vehHelicopterMaxYawRate;
  float vehHelicopterMaxYawAccel;
  float vehHelicopterTiltFromVelocity;
  float vehHelicopterTiltFromControllerAxes;
  float vehHelicopterTiltFromAcceleration;
  float vehHelicopterTiltFromDeceleration;
  float vehHelicopterTiltFromFwdAndYaw_VelAtMaxTilt;
  float vehHelicopterTiltFromFwdAndYaw;
  float vehHelicopterTiltMomentum;
  float vehHelicopterTiltSpeed;
  float vehHelicopterMaxPitch;
  float vehHelicopterMaxRoll;
  float vehHelicopterHoverSpeedThreshold;
  float vehHelicopterJitterJerkyness;
  float vehHelicopterLookaheadTime;
  int vehHelicopterSoftCollisions;
  int vehHelicopterUseGroundFX;
  FxEffectDef *vehHelicopterGroundFx;
  FxEffectDef *vehHelicopterGroundWaterFx;
  float vehHelicopterGroundFxDefaultRepeatRate;
  float vehHelicopterGroundFxSlowestRepeatRate;
  float vehHelicopterGroundFxFastestRepeatRate;
  float vehHelicopterGroundFxMinGroundDist;
  float vehHelicopterGroundFxMaxGroundDist;
  float vehSplinePlaneCorridorMaxXVel;
  float vehSplinePlaneCorridorMaxZVel;
  float vehSplinePlaneCorridorMaxXAccel;
  float vehSplinePlaneCorridorMaxZAccel;
  float vehSplinePlaneTangentLookAtRate;
  float vehSplinePlaneMaxPitchSpeed;
  float vehSplinePlaneMaxYawSpeed;
  float vehSplinePlaneMaxRollSpeed;
  float vehSplinePlanePitchSpeedRate;
  float vehSplinePlaneYawSpeedRate;
  float vehSplinePlaneRollSpeedRateUp;
  float vehSplinePlaneRollSpeedRateDown;
  float vehSplinePlaneMaxPitchAccel;
  float vehSplinePlaneMaxYawAccel;
  float vehSplinePlaneMaxRollAccel;
  float vehSplinePlaneYawToRollFactor;
  float vehSplinePlaneRollToYawFactor;
  float vehSplinePlaneRollToYawFactorBlend;
  float vehSplinePlaneMaxPitch;
  float vehSplinePlaneMaxRoll;
  float vehSplinePlaneMaxPitchFromRoll;
  float vehSplinePlaneMaxRollYawOffset;
  float vehSplinePlaneRollYawOffsetThreshold;
  float vehSplinePlaneMaxTiltRoll;
  float vehSplinePlaneMaxTiltPitch;
  float vehSplinePlaneTiltRollRate;
  float vehSplinePlaneTiltPitchRate;
  int camLookEnabled;
  int camRelativeControl;
  int camRemoteDrive;
  float camLerp;
  float camHeight;
  float camRadius;
  float camPitchInfluence;
  float camYawInfluence;
  float camRollInfluence;
  float camFovIncrease;
  float camFovOffset;
  float camFovSpeed;
  float camReturnSpeed;
  float camReturnLerp;
  float camVehicleAnglePitchRate;
  float camVehicleAngleYawRate;
  float camVehicleAngleRollRate;
  int vehCam_UseGDT;
  float vehCam_anglesPitch;
  float vehCam_anglesYaw;
  float vehCam_anglesRoll;
  float vehCam_offsetX;
  float vehCam_offsetY;
  float vehCam_offsetZ;
  float vehCam_radius;
  float vehCam_speedInfluence;
  float vehCam_pitchTurnRate;
  float vehCam_pitchClamp;
  float vehCam_yawTurnRate;
  float vehCam_yawClamp;
  VehCamZOffsetMode vehCam_zOffsetMode;
  float vehCam_anglesPitch3P;
  float vehCam_anglesYaw3P;
  float vehCam_anglesRoll3P;
  float vehCam_offsetX3P;
  float vehCam_offsetY3P;
  float vehCam_offsetZ3P;
  float vehCam_radius3P;
  float vehCam_speedInfluence3P;
  float vehCam_pitchTurnRate3P;
  float vehCam_pitchClamp3P;
  float vehCam_yawTurnRate3P;
  float vehCam_yawClamp3P;
  VehCamZOffsetMode vehCam_zOffsetMode3P;
  const char * turretWeaponName;
  WeaponCompleteDef *turretWeapon;
  float turretHorizSpanLeft;
  float turretHorizSpanRight;
  float turretVertSpanUp;
  float turretVertSpanDown;
  float turretHorizResistLeft;
  float turretHorizResistRight;
  float turretVertResistUp;
  float turretVertResistDown;
  float turretRotRate;
  VehicleTurretFireType turretFireType;
  snd_alias_list_name turretSpinSnd;
  snd_alias_list_name turretStopSnd;
  int trophyEnabled;
  float trophyRadius;
  float trophyInactiveRadius;
  int trophyAmmoCount;
  float trophyReloadTime;
  scr_string_t trophyTags[4];
  FxEffectDef *trophyExplodeFx;
  FxEffectDef *trophyFlashFx;
  Material *compassFriendlyIcon;
  Material *compassEnemyIcon;
  Material *compassFriendlyAltIcon;
  Material *compassEnemyAltIcon;
  int compassIconWidth;
  int compassIconHeight;
  snd_alias_list_name lowIdleSound;
  snd_alias_list_name highIdleSound;
  snd_alias_list_name lowEngineSound;
  snd_alias_list_name highEngineSound;
  float engineSndSpeed;
  scr_string_t audioOriginTag;
  snd_alias_list_name idleLowSndAlt;
  snd_alias_list_name idleHighSndAlt;
  snd_alias_list_name engineLowSndAlt;
  snd_alias_list_name engineHighSndAlt;
  float engineSndSpeedAlt;
  scr_string_t audioOriginTagAlt;
  snd_alias_list_name turretSpinSndAlt;
  snd_alias_list_name turretStopSndAlt;
  snd_alias_list_name engineStartUpSnd;
  int engineStartUpLength;
  snd_alias_list_name engineShutdownSnd;
  snd_alias_list_name engineIdleSnd;
  snd_alias_list_name engineSustainSnd;
  snd_alias_list_name engineRampUpSnd;
  int engineRampUpLength;
  snd_alias_list_name engineRampDownSnd;
  int engineRampDownLength;
  snd_alias_list_name suspensionSoftSnd;
  float suspensionSoftCompression;
  snd_alias_list_name suspensionHardSnd;
  float suspensionHardConpression;
  snd_alias_list_name collisionSnd;
  float collisionBlendSpeed;
  snd_alias_list_name speedSnd;
  float speedSndBlendSpeed;
  const char *surfaceSndPrefix;
  snd_alias_list_name surfaceSnds[0x1F];
  float surfaceSndBlendSpeed;
  float slideVolume;
  float slideBlendSpeed;
  float inAirPitch;
  const char *soundTriggerOverrideZone;
  bool soundTriggerOverrideReverb;
  bool soundTriggerOverrideMix;
  bool soundTriggerOverrideFilter;
  bool soundTriggerOverrideOcclusion;
  bool soundTriggerOverrideAmbient;
  bool soundTriggerOverrideAmbientEvents;
  bool soundTriggerOverrideADSR;
};

Source Format

The vehicle source files are raw text files with no extension, located at "raw/vehicles/". They use the same format as many other assets, with each setting name and value separated by a back-slash. The first setting identifies the file, and for vehicles the identifier string is "VEHICLEFILE".