Weapon Spread (Fallout 3)

Spread is the value that determines by how much your shots can deviate from intended targets (the center of the cross hair). The higher the spread, the more inaccurate weapons are.

Calculation
Spread = PerkModifiers(IronSightsBonus * CrouchBonus * (ConditionPenalty + SkillBonus) * (WalkPenalty + RunPenalty) + ArmPenalty)

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

Minimum Spread
The gun spread value used by the game engine will never be less than the "Min Spread" value specified on the weapon form for the equipped weapon. If the value given by the formula is less than the "Min Spread" value, the value from the formula will be ignored and the "Min Spread" value for the weapon will be used instead.

Most weapons have a non zero value for "Min Spread". Therefore, no matter how skilled you are with the weapon or 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, allowing weapon spread to be eliminated with a small guns skill of 100. The laser pistol and rifle also have 0 min spread.