Difference between revisions of "Gun Spread Formula"

84 bytes added ,  20:57, 24 December 2008
Move minimum spread out of formula and into a descriptive section. Rename formula components. Attempt to indicate that game settings are not constant values.
imported>SnakeChomp
(→‎Notes: Move note about effect on VATS from gun settings page to here)
imported>SnakeChomp
(Move minimum spread out of formula and into a descriptive section. Rename formula components. Attempt to indicate that game settings are not constant values.)
Line 1: Line 1:
GunSpread = Max( MinWeaponSpread, WeaponSpread )
__NOTOC__


'''Max''' is a function which returns which ever input value is the largest.
  Spread = PerkModifiers(IronSightsBonus * CrouchBonus * (ConditionPenalty + SkillBonus) * (WalkPenalty + RunPenalty) + ArmPenalty)
 
'''MinWeaponSpread''' is the "min spread" value specified for the equipped weapon on the [[Weapons|weapon form]].
 
'''WeaponSpread''' is calculated as follows.
 
  WeaponSpread = PerkModifiers(IronSightsFactor * CrouchFactor * (ConditionFactor + SkillFactor) * (WalkFactor + RunFactor) + ArmFactor)


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


'''IronSightsFactor''' = fGunSpreadIronSightsBase + fGunSpreadIronSightsMult
'''IronSightsBonus''' = fGunSpreadIronSightsBase + fGunSpreadIronSightsMult
:*fGunSpreadIronSightsBase = 1
:*fGunSpreadIronSightsBase defaults to: 1.0
:*fGunSpreadIronSightsMult = -0.65
:*fGunSpreadIronSightsMult defaults to: -0.65
:*:This value is 0 unless aiming with iron sights (holding the right mouse button with the default control scheme)
:*:This value is 0 unless aiming with iron sights (holding the right mouse button with the default control scheme)


'''CrouchFactor''' = fGunSpreadCrouchBase + fGunSpreadCrouchMult
'''CrouchBonus''' = fGunSpreadCrouchBase + fGunSpreadCrouchMult
:*fGunSpreadCrouchBase = 1
:*fGunSpreadCrouchBase defaults to: 1.0
:*fGunSpreadCrouchMult = -0.4
:*fGunSpreadCrouchMult defaults to: -0.4
:*:This value is 0 unless the actor is crouched (sneaking)
:*:This value is 0 unless the actor is crouched (sneaking)


'''ConditionFactor''' = fGunSpreadCondBase + WeaponCondition * fGunSpreadCondMult
'''ConditionPenalty''' = fGunSpreadCondBase + WeaponCondition * fGunSpreadCondMult
:*fGunSpreadCondBase 0
:*fGunSpreadCondBase defaults to: 0.0
:*fGunSpreadCondMult 0
:*fGunSpreadCondMult defaults to: 0.0
:*WeaponCondition is the condition of the weapon equipped by the actor
:*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%
:*:This value is 1.0 at 100%, 0.5 at 50% and 0.0 at 0%


'''SkillFactor''' = fGunSpreadSkillBase + ActorSkillValue * fGunSpreadSkillMult
'''SkillBonus''' = fGunSpreadSkillBase + ActorSkillValue * fGunSpreadSkillMult
:*fGunSpreadSkillBase = 0.5
:*fGunSpreadSkillBase defaults to: 0.5
:*fGunSpreadSkillMult = -0.0050
:*fGunSpreadSkillMult defaults to: -0.0050
:*ActorSkillValue is the actor's skill value for the skill used by the weapon.
:*ActorSkillValue is the actor's skill value for the skill used by the weapon.
:*:The skill value used is specified on the [[Weapons|weapon form]]
:*:The skill value used is specified on the [[Weapons|weapon form]]


'''WalkFactor''' = fGunSpreadWalkBase + fGunSpreadWalkMult
'''WalkPenalty''' = fGunSpreadWalkBase + fGunSpreadWalkMult
:*fGunSpreadWalkBase = 1
:*fGunSpreadWalkBase defaults to: 1.0
:*:This value is zero unless the actor is walking or not moving
:*:This value is zero unless the actor is walking or not moving
:*fGunSpreadWalkMult = 0
:*fGunSpreadWalkMult defaults to: 0.0
:*:This value is zero unless the actor is walking
:*:This value is zero unless the actor is walking


'''RunFactor''' = fGunSpreadRunBase + fGunSpreadRunMult
'''RunPenalty''' = fGunSpreadRunBase + fGunSpreadRunMult
:*fGunSpreadRunBase = 1
:*fGunSpreadRunBase defaults to: 1.0
:*:This value is zero unless the actor is running
:*:This value is zero unless the actor is running
:*fGunSpreadRunMult = 0
:*fGunSpreadRunMult defaults to: 0.0
:*:This value is zero unless the actor is running
:*:This value is zero unless the actor is running


'''ArmFactor''' = fGunSpreadArmBase + ArmCondition * fGunSpreadArmMult
'''ArmPenalty''' = fGunSpreadArmBase + ArmCondition * fGunSpreadArmMult
:*fGunSpreadArmBase = 0.5
:*fGunSpreadArmBase defaults to: 0.5
:*fGunSpreadArmMult = -0.5
:*fGunSpreadArmMult defaults to: -0.5
:*ArmCondition = 1 or 0
:*ArmCondition is the condition of the actor's arm. A value of 0 indicates a crippled arm, a value of 1 indicates a non crippled arm.
:*:This value is the condition of the actor's arm. a value of 0 indicates a crippled arm, a value of 1 for a non crippled arm.
:*:'''Note: '''It is not known at this time whether only the condition of the weapon arm (right arm) matters, or if the condition of both arms is used.
:*:'''Note: '''It is not known at this time whether only the condition of the weapon arm (right arm) matters, or if the condition of both arms is used.
=== Minimum Spread ===
The gun spread value used by the game engine will never be less than the "Min Spread" value specified on the [[Weapons|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.


=== Notes ===
=== Notes ===
This formula has been derived by systematically tweaking the settings using the console and observing the effects on the magnitude of weapon sway.
This formula has been derived by systematically tweaking the settings using the console and observing the effects on the magnitude of weapon sway.
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.


Spread is also taken into account when determining VATS accuracy, and is the primary way that weapon skill affects VATS accuracy.
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 (WalkFactor + RunFactor) part of the equation would be 0 when not moving, negating the other spread calculations.
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.
 
With a weapon skill of 100, the default values for fGunSpreadSkillBase and fGunSpreadSkillMult result a SkillFactor value of 0, negating the effects of running, crouching, or using iron sights, but not negating arms being crippled.


The "spread" value on the [[Weapons|weapon form]] is ignored by the game engine. Only the "min spread" value is used.
The "spread" value on the [[Weapons|weapon form]] is ignored by the game engine. Only the "min spread" value is used.
Line 76: Line 71:
=== Other notable settings ===
=== Other notable settings ===
;fGunWobbleMultScope
;fGunWobbleMultScope
:Default 1
: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 of this, you should avoid modifying this setting, or else you will confuse players.
: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.
Anonymous user