Gun Spread Formula

From GECK
Jump to: navigation, search

Mechanics

Projectile deviation from where crosshair points consists of two factors.

  1. Aim spread. Unsteady grip (sway, wobble) moving barrel of the weapon away from crosshair point in some semi-random fashion. The amplitude of the sway is defined by multiple factors: skill, walking, running, crouching, iron sight, arm damage, etc. Capped at 3.0.
  2. Gun spread. Projectile angle deviation when it is ejected from the barrel. This is defined by weapon parameter and, potentially, weapon condition (not 100% confirmed). Not capped.

The final deviation of the projectile from the crosshair point is the sum of the two above.

Spread = Aim Spread + Gun Spread
Aim Spread = 3.0 * PerkModifiers(IronSightsBonus * CrouchBonus * (ConditionPenalty + SkillBonus) * (WalkPenalty + RunPenalty) + ArmPenalty)
Gun Spread = WeaponMinSpread + ?

PerkModifiers is a function that modifies the input value using any perks active on the actor that have a "Calculate Gun Spread" Entry Point and returns the result.

IronSightsBonus = fGunSpreadIronSightsBase + fGunSpreadIronSightsMult * IsUsingIronSights

CrouchBonus = fGunSpreadCrouchBase + fGunSpreadCrouchMult * IsSneaking

ConditionPenalty = fGunSpreadCondBase + fGunSpreadCondMult * WeaponCondition

SkillBonus = fGunSpreadSkillBase + fGunSpreadSkillMult * ActorSkillValue

WalkPenalty = fGunSpreadWalkBase * !IsRunning + fGunSpreadWalkMult * IsWalking

!IsRunning means that if IsRunning is 1, !IsRunning is 0, and vice versa.

RunPenalty = (fGunSpreadRunBase + fGunSpreadRunMult) * IsRunning

ArmPenalty = fGunSpreadArmBase + fGunSpreadArmMult * ArmCondition


IsUsingIronSights is 1 if the actor is aiming with iron sights and 0 otherwise, but there is no function by this name.

IsSneaking is the IsSneaking function.

WeaponCondition is the condition of the weapon equipped by the actor.

This value is 1.0 at 100%, 0.5 at 50% and 0.0 at 0%

ActorSkillValue is the actor's skill value for the skill used by the weapon.

The skill value used is specified on the weapon form

IsRunning is the IsRunning function.

IsWalking is 1 if the actor is walking and 0 otherwise, but there is no function by this name.

ArmCondition is the condition of the actor's arm.

  • When using a one handed weapon, ArmCondition is 1 with a healthy right arm and 0 with a crippled right arm.
  • When using a two handed weapon, ArmCondition is 1 with both arms healthy, 0.5 with 1 arm crippled, 0 with two arms crippled.

Game settings used by this formula

Setting Default Description
fGunSpreadIronSightsBase 1 Used when calculating IronSightsBonus
fGunSpreadIronSightsMult -0.65 Used when calculating IronSightsBonus
fGunSpreadCrouchBase 1 Used when calculating CrouchBonus
fGunSpreadCrouchMult -0.4 Used when calculating CrouchBonus
fGunSpreadCondBase 0 Used when calculating ConditionPenalty
fGunSpreadCondMult 0 Used when calculating ConditionPenalty
fGunSpreadSkillBase 0.5 Used when calculating SkillBonus
fGunSpreadSkillMult -0.0050 Used when calculating SkillBonus
fGunSpreadWalkBase 1 Used when calculating WalkPenalty
fGunSpreadWalkMult 0 Used when calculating WalkPenalty
fGunSpreadRunBase 1 Used when calculating RunPenalty
fGunSpreadRunMult 0 Used when calculating RunPenalty
fGunSpreadArmBase 0.5 Used when calculating ArmPenalty
fGunSpreadArmMult -0.5 Used when calculating ArmPenalty


Second spread formula

Use of an additional formula for the gun's own spread has been suggested, taking into account the role of Min. Spread and Spread. Until it's been validated and this page changed, see the "Discussion" page for details.

Weapon Minimum Spread

The weapon minimum spread is the actual random bullet angle deviation when it is ejected from the barrel. It should be added to the Aim Spread to get the total spread.

Notes

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

Spread is also taken into account when determining VATS accuracy, and is the primary way that weapon skill affects VATS accuracy.

The default value of 1 for fGunSpreadWalkBase is important in this formula. Without it, the (WalkPenalty + RunPenalty) part of the equation would be 0 when not moving, negating the other spread calculations.

The "spread" value on the weapon form is ignored by the game engine. Only the "min spread" value is used.

Game settings 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

Other notable game settings

fGunWobbleMultScope
Default value: 1.0
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 the gun is still wobbling (you just don't notice it anymore). Because of this, you should avoid modifying this setting, or else you will confuse players.
Inversely, modifying Gun Spread will properly affect gun wobble.

See Also