Weapons settings

From Bohemia Interactive Community
Jump to navigation Jump to search

Bullet simulation is not kinematic (trajectory based), but dynamic (force based). Two basic forces are considered - drag (air friction) and gravity.

Vector3 accel=_speed*(_speed.Size()*_airFriction);
// add gravity
accel[1]-= _coefGravity * G_CONST;

Initial speed of the bullet degrades over distance, so HIT value.

Engine simulates even the penetration and deflection within individual parts, and the projectile causes damage in each parts it penetrates / deflects from, corresponding to the energy lost in the deflection / penetration. Indirect hits caused by explosions occlude with walls and floors.

CfgAmmo

model=\ca\Weapons\Data\bullettracer\tracer_green; //tracer model for bullets or model= \ca\Weapons\granat; // shell model in case simulation=shotShell;

typicalSpeed=900; // speed at 100% hit (m/s)

hit=20; // damage done on impact at typical speed, modified by actual speed depending on explosion coef.

For ArmA we used as help 
FMJ bullet energy hit = sqrt(weight/2)*speed/5 
This works for small arms fire, not that well for SABOT rounds or High explosive artilery shells.
First using of this equation was in ČSLA 2.2 for OFP. In BI games is since ArmA 1.05.

indirectHit=18; // HIT for object that was found in range (and was not hit directly), modified by distance (0 HIT is at 4x range) and simple occlusion with other objects.

indirectHitRange=7; // range in meters at that range the indirectHit is 100% and lineary degrades to 4x distance.

caliber = 1; // 1 equals penetration of = 7.62 bullet, if the bulelt should travel through pentration material 2x the distance set 2.

airFriction = -0.0005; // modifies speed degradation, the biger negative value, the more it slows down.

Can be calculated as: 
_airFriction = accel / speed^2 
using real world acceleration and speed of the bullet from balistic tables.

timeToLive=3; // how long does the fired object live before annihilating (can be used for maximum range definition) unless overridden, the ammo in annihilated if it does not hit anything soon

explosive=0; // float factor ranging from 0 to 1. explosive=true is translated as 1. This factor tells what part of the damage is caused by the explosion, and what part by the kinetic energy. The kinetic part is attenuated based on projectile speed, while explosive part is not. When the shot is deflected, only the kinetic part of damage is applied at the point of the deflection (the projectile is assumed not to explode on deflection). Coefficient is also used for visualisation of explosion efect.

deflecting=5; // max. angle at which the bullet will be deflected - 0 means no deflection

fuseDistance = 15;// some ammo needs a distance to travel before activates (rockets, grenades). It can be used also to prevent AI suicide.

tracerScale=1;

tracerStartTime = 0.05; // seconds, -1 disables tracer

tracerEndTime = 1; // seconds

nvgOnly = true; // tracer visible only by NVG

Values that affect missiles:

initTime=0; //how long it takes (after launch from tube) before the main engine starts

thrustTime=1.5; //how long does the main engine burn before reaching top speed

thrust=210; //default thrust calculation is: maxSpeed*0.7*thurstTime, normal missile speed is about 200 m/s

maxSpeed = 750; //m/s

irLock=false;

airLock=false;

laserLock=false;

manualControl=false;

maxControlRange=350; // max range for manual control

maneuvrability=1.0; // missile control maneuvrability, tells how much is the missile able to turn

trackLead=1.0; //Range 0-1 , how much is the missile performing "smart" tracking, which assumes onboard computer computing predicted target position at the impact time, resulting in a mostly straight flight trajectory. Value = 1 means this computation result is used 100 %, 0 means it is not used at all.

trackOversteer=1.0; //1 = no oversteer , simulating the analogue controls used in missiles, where missile directly reacts to target relative position by adjusting its flight direction. Oversteer = 1 means missile always tries to direct itself directly at the target.

sideAirFriction=1; // indirectly affects turning, affects the flight path once the missile changes its orientation. The higher the side friction, the more accurate the missile is maneuvring.

fireSpreadAngle=3; // Value for shotgun ammo (Arrowhead) with defined simulation=shotSpread; Number defines half of spread angle in degrees. Shot is simulated by 9 bullets which trajectory and damage is calculated for each separately (hit, indirectHit). If target is hit by complete buckshot, damage is 9x.

CfgMagazines

initSpeed = 100; // in case it is not in weapon

tracersEvery = 3; // determines what bullet is tracer

lastRoundsTracer = 5; // number of rounds on end of belt which are tracers (indicates running out of ammo)

CfgWeapons

initSpeed = 900; // muzzle velocity

burst = 13; // how many simulated shots fired

multiplier = 5; // says for each shot how many shots are taken out of the magazine, does not affect HIT

Rate of fire is limited in game. Maximum bullets fired per frame is 1, so in 20FPS (rate 0.05) it is 1200 bullets per minute. For rapid fire guns it can be compensated bu hit strength and indirect hit impact.

modes[] = {this}; // modes of magazine (muzzle)

dispersion=0.002;

It is a random dispersion of bullet from the gun chamber vector. It affects both players and AI. While it perhaps is not logical for dispersion to differ between the fire modes (physically it is a property of muzzle + ammo), the game is implementing this at firing mode level and it is possible to have different dispersion for different modes.

dexterity = 2; How fast the gun chamber changes direction shown by cursor. The bigger value the faster.

ballisticsComputer = 1;

ballisticsComputer = 0 - disabled
ballisticsComputer = 1 - Arma2 TAB lock results in zeroed scope, Arma2: Operation Arrowhead added also manual zeroing (PgUp/PgDwn)
ballisticsComputer = 2 - Arma2: Operation Arrowhead: only manual zeroing (PgUp/PgDwn)

Laser and reflector model (new in Arrowhead) is defined by:

class CfgCoreData
{ 
 gunLightModel = "ca\ca_e\data\gunLight.p3d";
 rayModel = "ca\ca_e\data\laserBeam.p3d";
};

Reflector is added in weapon config by:

class FlashLight
{
 color[] = {0.9, 0.9, 0.7, 0.9};
 ambient[] = {0.1, 0.1, 0.1, 1.0};
 position = "flash dir"; // memory points in model
 direction = "flash"; // memory points in model
 angle = 30;
 scale[] = {1, 1, 0.5};
 brightness = 0.1;
};

Laser is added in weapon config by:

irDistance = 100; // size of the ray model in meters
irLaserPos="laser pos"; // memory points in model
irLaserEnd="laser dir"; // memory points in model


AI

Several values are used for AI decision making and balancing AI skills against human player that thinks, makes misstakes and has got some experience.

When selecting ammo, weapon and its mode AI decision is affected by:

  • hit probability by range
  • ammo hit value
  • own weapon frequency of fire
  • ammo costs
  • target value
  • animation costs (how fast can he reload/change weapon)
  • threat (expectation how quickly can the oponent kill him)
  • lock possible (for weapons requiring lock)
  • target speed - ammo lead capability
  • indirect hit (how much the hit may damage other friendly / enemy targets)
  • crew damage (when unable to damage the vehicle, can we hit the crew?)

AI skill slider affects aiming precision (hands shaking) and reaction time (detection range, speed of movement). In Arma 2 it also modifies AIDispersion:

aiDispersionCoefX=1.0; aiDispersionCoefY=1.0;

Those values multiply weapon dispersion - AI chance of hitting target. The bigger AI skill the more this value will go back to 1 = same dispersion as player.

aiRateOfFire=5.0; // delay between shots at given distance

aiRateOfFireDistance=500; // at shorter distance delay goes lineary to zero

minRange=1;minRangeProbab=0.30;

midRange=150;midRangeProbab=0.58;

maxRange=500;maxRangeProbab=0.04;

Values that guide AI for each firing mode with expectation of hit. Basicly think about players chance of hiting with this mode on given range. Range values only guide AI what mode might be good to use at each distance it deos not affect firing simulation. AI will choose which model is better on given distance.