Gun Spread Formula

Revision as of 19:33, 21 December 2008 by imported>SnakeChomp (Add fGunWobbleMultScope setting information)

Variables

fGunSpreadSkillBase = SB
Default 0.5
fGunSpreadSkillMult = SM
Default -0.0050
Actor skill with the given weapon = S
fGunSpreadIronSightsBase = ISB
Default 1
fGunSpreadIronSightsMult = ISM
Default -0.65
This value is 0 unless aiming with iron sights (holding the right mouse button with the default control scheme)
fGunSpreadWalkBase = WB
Default 1
This value is 0 when running, but applies when stationary or walking
fGunSpreadWalkMult = WM
Default 0
This value is non zero only when walking
fGunSpreadRunBase = RB
Default 1
This value is non zero only when running
fGunSpreadRunMult = RM
Default 0
This value is non zero only when running
fGunSpreadCrouchBase = CrB
Default 1
fGunSpreadCrouchMult = CrM
Default -0.4
This value is 0 unless the actor is crouched (sneaking)
fGunSpreadArmBase = AB
Default 0.5
fGunSpreadArmMult = AM
Default -0.5
Actor arm condition = AC
1 at 100% condition, 0 when crippled
fGunSpreadCondBase = CB
Default 0
fGunSpreadCondMult = CM
Default 0
Any perks that affect gun spread = PerkModifiers(x) => y
The weapon's "min spread" value from the weapon form = MinS

Formula

Gun Spread = Max( MinS, PerkModifiers((AB + AC * AM) + (ISB + ISM) * (CrB + CrM) * (CB + C * CM + SB + S * SM) * (WB + WM + RB + RM)) )

Formula notes

Most weapons have a non zero min spread value. Therefore, no matter how skilled you are with the weapon and what perks you have, your weapon will always have a slight amount of spread. One notable exception to this are sniper rifles, which have 0 minimum spread.

The default value of 1 for WB is important in this formula. Without it, the (WB + WM + RB + RM) factor would be 0 when not moving, meaning you would never have any gun spread while stationary.

This formula has been derived by systematically tweaking the settings using the console and observing the effects on the magnitude of weapon sway.

Other notable settings

fGunWobbleMultScope
Default 1
This setting controls how much scoped weapons will wobble when aiming with the scope, but it does not modify the weapon spread. If you modify some game settings to give the sniper rifle considerable wobble and set this setting to 0, the cross hairs will not wobble when you use the scope, but the bullets will still fly off course. Because of this, you should avoid modifying this setting, or else you will confuse players.

Variables not used by this formula

These are variables that should logically have an impact on this formula but do not appear to have any effect on the player character's gun spread when tweaked. Further research into these settings should be performed. Perhaps they only effect NPC gun spread?

  • fGunSpreadHeadMult
  • fGunSpreadHeadBase
  • fGunSpreadNPCArmBase
  • fGunSpreadNPCArmMult
  • fNPCMaxGunWobbleAngle