Vehicle Asset (BO2)

From COD Engine Research
Jump to: navigation, search

The vehicle asset was added on World at War and has been on every Call of Duty game since. The purpose of this asset is to declare vehicles, mostly used for killstreaks.

enum VehicleTypes : short
{
  VEH_WHEELS_4,
  VEH_MOTORCYCLE,
  VEH_TANK,
  VEH_PLANE,
  VEH_BOAT,
  VEH_ARTILLERY,
  VEH_HELICOPTER,
  NUM_VEHICLE_TYPES
};
 
enum EVehicleCameraMode : short
{
  VEH_MODE_FIRSTPERSON = 0x0,
  VEH_MODE_CHASECAM = 0x1,
  VEH_MODE_HLO = 0x2,
  VEH_MODE_STRAFE = 0x3,
  VEH_MODE_HORSE = 0x4,
  VEH_MODE_OLDTANK = 0x5,
  VEH_MODE_HOVER = 0x6,
  VEH_MODE_VTOL = 0x7,
  VEH_MODE_MAX = 0x8,
};
 
enum TractionType : int
{
  TRACTION_TYPE_FRONT = 0,
  TRACTION_TYPE_BACK = 1,
  TRACTION_TYPE_ALL_WD = 2,
  NUM_TRACTION_TYPES
};
 
struct view_limits_t
{
  float horizSpanLeft;
  float horizSpanRight;
  float vertSpanUp;
  float vertSpanDown;
  float horizResistLeft;
  float horizResistRight;
  float vertResistUp;
  float vertResistDown;
};
 
enum surfaceNames_t
{
  bark,
  brick,
  carpet,
  cloth,
  concrete,
  dirt,
  flesh,
  foliage,
  glass,
  grass,
  gravel,
  ice,
  metal,
  mud,
  paper,
  plaster,
  rock,
  sand,
  snow,
  water,
  wood,
  asphalt,
  ceramic,
  plastic,
  rubber,
  cushion,
  fruit,
  paintedmetal,
  player,
  tallgrass,
  riotshield,
  opaqueglass
};
 
struct DevGraph
{
  vec2_t *knots;
  int *knotCount;
  int knotCountMax;
  int selectedKnot;
  void (__cdecl *eventCallback)(DevGraph *, DevEventType, LocalClientNum_t);
  void (__cdecl *textCallback)(DevGraph *, const float, const float, char *, const int);
  void *data;
  bool disableEditingEndPoints;
};
 
//This is unused in the FF files, and acts as a sort of buffer in memory.
struct GraphFloat
{
  char name[64];
  vec2_t knots[32];
  int knotCount;
  float scale;
  DevGraph devguiGraph;
};
 
struct VehicleParameter
{
  float m_speed_max;
  float m_accel_max;
  float m_reverse_scale;
  float m_steer_angle_max;
  float m_steer_angle_speed_scale;
  float m_steer_speed;
  float m_wheel_radius;
  float m_susp_spring_k;
  float m_susp_damp_k;
  float m_susp_adj;
  float m_susp_hard_limit;
  float m_susp_min_height;
  float m_tire_fric_fwd;
  float m_tire_fric_side;
  float m_tire_fric_brake;
  float m_tire_fric_hand_brake;
  float m_body_mass;
  float m_roll_stability;
  float m_pitch_stability;
  float m_pitch_roll_resistance;
  float m_yaw_resistance;
  float m_upright_strength;
  float m_tilt_fakey;
  float m_peel_out_max_speed;
  float m_tire_damp_coast;
  float m_tire_damp_brake;
  float m_tire_damp_hand;
  float m_auto_hand_brake_min_speed;
  TractionType m_traction_type;
  const char *m_name;
  vec3_t m_bbox_min;
  vec3_t m_bbox_max;
  vec3_t m_mass_center_offset;
  vec3_t m_buoyancybox_min;
  vec3_t m_buoyancybox_max;
  float m_water_speed_max;
  float m_water_accel_max;
  float m_water_turn_accel;
  float m_water_turn_speed_max;
  float m_water_ebrake_power;
  vec3_t m_boat_motor_offset;
  float m_boat_speed_rise;
  float m_boat_speed_tilt;
  float m_boat_side_fric_scale;
  float m_boat_forward_fric_scale;
  float m_boat_vertical_fric_scale;
  float m_jump_force;
  float m_tire_fric_side_max;
  bool m_drive_on_walls;
  float m_linear_drag_scale;
  float m_angular_drag_scale;
};
 
struct VehicleDriveBySound
{
  int apex;
  const char *name;
  unsigned int alias;
};
 
struct VehicleEngineSound
{
  const char *name;
  unsigned int alias;
  float params[5];
};
 
struct VehicleGearData
{
  float minRPM;
  float maxRPM;
  float ratio;
};
 
struct VehicleEngine
{
  float idleRpms;
  float maxRpms;
  float maxTorque;
  float brakingCoeff;
  float onLoadFadeInStart;
  float onLoadFadeInEnd;
  float offLoadFadeOutStart;
  float offLoadFadeOutEnd;
  float loadScale;
  float loadSmoothing;
  float throttleLag;
  float pitchScale;
  VehicleEngineSound onload[5];
  VehicleEngineSound offload[5];
  int numGears;
  int loopLastGear;
  VehicleGearData gears[10];
};
 
struct VehicleAntenna
{
  float springK;
  float damp;
  float length;
  float gravity;
};
 
struct VehicleDef
{
  const char * name;
  VehicleTypes type;
  int remoteControl;
  int bulletDamage;
  int armorPiercingDamage;
  int grenadeDamage;
  int projectileDamage;
  int projectileSplashDamage;
  int heavyExplosiveDamage;
  EVehicleCameraMode cameraMode;
  int autoRecenterOnAccel;
  int thirdPersonDriver;
  int thirdPersonUseVehicleRoll;
  int thirdPersonCameraPitchVehicleRelative;
  int thirdPersonCameraHeightWorldRelative;
  float thirdPersonCameraRange;
  float thirdPersonCameraMinPitchClamp;
  float thirdPersonCameraMaxPitchClamp;
  float thirdPersonCameraHeight[2];
  float thirdPersonCameraPitch[2];
  int cameraAlwaysAutoCenter;
  float cameraAutoCenterLerpRate;
  float cameraAutoCenterMaxLerpRate;
  float thirdPersonCameraSpringDistance;
  float thirdPersonCameraSpringTime;
  float thirdPersonCameraHandbrakeTurnRateInc;
  float cameraFOV;
  float cameraRollFraction;
  vec3_t tagPlayerOffset;
  int killcamCollision;
  float killcamDist;
  float killcamZDist;
  float killcamMinDist;
  float killcamZTargetOffset;
  float killcamFOV;
  float killcamNearBlur;
  float killcamNearBlurStart;
  float killcamNearBlurEnd;
  float killcamFarBlur;
  float killcamFarBlurStart;
  float killcamFarBlurEnd;
  int isDrivable;
  int numberOfSeats;
  int numberOfGunners;
  int seatSwitchOrder[11];
  int driverControlledGunPos;
  float enterRadiusDriver;
  float enterRadiusGunner[4];
  float texureScrollScale;
  float wheelRotRate;
  float extraWheelRotScale;
  int wheelChildTakesSteerYaw;
  float maxSpeed;
  float maxSpeedVertical;
  float accel;
  float accelVertical;
  float rotRate;
  float rotAccel;
  float maxBodyPitch;
  float maxBodyRoll;
  float collisionDamage;
  float collisionSpeed;
  float suspensionTravel;
  float heliCollisionScalar;
  float viewPitchOffset;
  float viewInfluence;
  float tiltFromAccelerationPitch;
  float tiltFromAccelerationRoll;
  float tiltFromDecelerationPitch;
  float tiltFromDecelerationRoll;
  float tiltFromVelocityPitch;
  float tiltFromVelocityRoll;
  float tiltSpeedPitch;
  float tiltSpeedRoll;
  const char * turretWeapon;
  view_limits_t turretViewLimits;
  float turretRotRate;
  int turretClampPlayerView;
  int turretLockTurretToPlayerView;
  const char * gunnerWeapon[4];
  unsigned __int16 gunnerWeaponIndex[4];
  float gunnerRotRate;
  vec2_t gunnerRestAngles[4];
  view_limits_t passengerViewLimits[6];
  const char * turretSpinSndName;
  const char * turretStopSndName;
  unsigned int turretSpinSndIndex;
  unsigned int turretStopSndIndex;
  const char * wheelRoadNoiseSnd;
  const char * wheelSlidingSnd;
  const char * wheelPeelingOutSnd;
  float skidSpeedMin;
  float skidSpeedMax;
  const char *futzName;
  float futzBlend;
  int animType;
  const char *animSet;
  int scriptedAnimationEntry;
  float mantleAngleFront;
  float mantleAngleBack;
  float mantleAngleLeft;
  float mantleAngleRight;
  ScriptString extraWheelLeft1;
  ScriptString extraWheelRight1;
  ScriptString extraWheelLeft2;
  ScriptString extraWheelRight2;
  ScriptString driverHideTag;
  XModel * attachmentModels[4];
  ScriptString attachmentTags[4];
  XModel * deathAttachmentModels[4];
  ScriptString deathAttachmentTags[4];
  float tracerOffsetForward;
  float tracerOffsetUp;
  XModel * model;
  XModel * viewModel;
  XModel * deathModel;
  XModel * enemyModel;
  float modelSwapDelay;
  FxEffectDef * exhaustFx;
  int oneExhaust;
  FxEffectDef *treadFx[32]; //See surfaceNames_t for the names of these.
  FxEffectDef *deathFx;
  ScriptString deathFxTag;
  const char * deathFxSound;
  FxEffectDef * lightFxName[4];
  ScriptString lightFxTag[4];
  FxEffectDef * friendlyLightFx;
  ScriptString friendlyLightFxTag;
  FxEffectDef * enemyLightFx;
  ScriptString enemyLightFxTag;
  float radiusDamageMin;
  float radiusDamageMax;
  float radiusDamageRadius;
  const char *shootShock;
  const char *shootRumble;
  float deathQuakeScale;
  float deathQuakeDuration;
  float deathQuakeRadius;
  const char *rumbleType;
  float rumbleScale;
  float rumbleDuration;
  float rumbleRadius;
  float rumbleBaseTime;
  float rumbleAdditionalTime;
  int healthDefault;
  int healthMin;
  int healthMax;
  int eTeam;
  int boostAccelMultiplier;
  float boostDuration;
  float boostSpeedIncrease;
  int addToCompass;
  int addToCompassEnemy;
  const char *compassIcon;
  Material *compassIconMaterial;
  const char *gasButtonName;
  int gasButton;
  const char *reverseBrakeButtonName;
  int reverseBrakeButton;
  const char *handBrakeButtonName;
  int handBrakeButton;
  const char *attackButtonName;
  int attackButton;
  const char *attackSecondaryButtonName;
  int attackSecondaryButton;
  const char *boostButtonName;
  int boostButton;
  const char *moveUpButtonName;
  int moveUpButton;
  const char *moveDownButtonName;
  int moveDownButton;
  const char *switchSeatButtonName;
  int switchSeatButton;
  const char *steerGraphName;
  GraphFloat *steerGraph;
  const char *accelGraphName;
  GraphFloat *accelGraph;
  int isNitrous;
  int isFourWheelSteering;
  int useCollmap;
  float radius;
  float minHeight;
  float maxHeight;
  float max_fric_tilt_angle;
  float max_fric_tilt;
  int noDirectionalDamage;
  int fakeBodyStabilizer;
  float vehHelicopterBoundsRadius;
  float vehHelicopterDecelerationFwd;
  float vehHelicopterDecelerationSide;
  float vehHelicopterDecelerationUp;
  float vehHelicopterTiltFromControllerAxes;
  float vehHelicopterTiltFromFwdAndYaw;
  float vehHelicopterTiltFromFwdAndYaw_VelAtMaxTilt;
  float vehHelicopterTiltMomentum;
  int vehHelicopterQuadRotor;
  int vehHelicopterAccelTwardsView;
  float maxRotorArmMovementAngle;
  float maxRotorArmRotationAngle;
  int vehHelicopterMaintainHeight;
  int vehHelicopterMaintainMaxHeight;
  float vehHelicopterMaintainHeightLimit;
  float vehHelicopterMaintainHeightAccel;
  float vehHelicopterMaintainHeightMinimum;
  float vehHelicopterMaintainHeightMaximum;
  float vehHelicopterMaintainCeilingMinimum;
  int joltVehicle;
  int joltVehicleDriver;
  float joltMaxTime;
  float joltTime;
  float joltWaves;
  float joltIntensity;
  VehicleParameter nitrousVehParams;
  float p_driveby_sound_radius;
  float s_driveby_sound_radius;
  VehicleDriveBySound p[20];
  VehicleDriveBySound s[20];
  int doFootSteps;
  int isSentient;
  VehicleEngine engine;
  VehicleAntenna antenna[2];
  char *csvInclude;
  float customFloat[3];
  int customBool[3];
};

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".