Difference between revisions of "Gun Spread Formula"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>SnakeChomp
(Add fGunWobbleMultScope setting information)
imported>SnakeChomp
(Improved formatting)
Line 1: Line 1:
=== Variables ===
GunSpread = Max( MinWeaponSpread, WeaponSpread )


;fGunSpreadSkillBase = SB
'''Max''' is a function which returns which ever input value is the largest.
:Default 0.5


;fGunSpreadSkillMult = SM
'''MinWeaponSpread''' is the "min spread" value specified for the equipped weapon on the [[Weapons|weapon form]].
:Default -0.0050


;Actor skill with the given weapon = S
'''WeaponSpread''' is calculated as follows.


;fGunSpreadIronSightsBase = ISB
WeaponSpread = PerkModifiers(IronSightsFactor * CrouchFactor * (ConditionFactor + SkillFactor) * (WalkFactor + RunFactor) + ArmFactor)
:Default 1


;fGunSpreadIronSightsMult = ISM
'''PerkModifiers''' is a function that modifies the input value using any perks active on the actor and returns the result.
: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
'''IronSightsFactor''' = fGunSpreadIronSightsBase + fGunSpreadIronSightsMult
:Default 0
:*fGunSpreadIronSightsBase = 1
:This value is non zero only when walking
:*fGunSpreadIronSightsMult = -0.65
:*:This value is 0 unless aiming with iron sights (holding the right mouse button with the default control scheme)


;fGunSpreadRunBase = RB
'''CrouchFactor''' = fGunSpreadCrouchBase + fGunSpreadCrouchMult
:Default 1
:*fGunSpreadCrouchBase = 1
:This value is non zero only when running
:*fGunSpreadCrouchMult = -0.4
:*:This value is 0 unless the actor is crouched (sneaking)


;fGunSpreadRunMult = RM
'''ConditionFactor''' = fGunSpreadCondBase + WeaponCondition * fGunSpreadCondMult
:Default 0
:*fGunSpreadCondBase =  0
:This value is non zero only when running
:*fGunSpreadCondMult =  0
:*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%


;fGunSpreadCrouchBase = CrB
'''SkillFactor''' = fGunSpreadSkillBase + ActorSkillValue * fGunSpreadSkillMult
:Default 1
:*fGunSpreadSkillBase = 0.5
:*fGunSpreadSkillMult = -0.0050
:*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]]


;fGunSpreadCrouchMult = CrM
'''WalkFactor''' = fGunSpreadWalkBase + fGunSpreadWalkMult
:Default -0.4
:*fGunSpreadWalkBase = 1
:This value is 0 unless the actor is crouched (sneaking)
:*:This value is zero unless the actor is walking or not moving
:*fGunSpreadWalkMult = 0
:*:This value is zero unless the actor is walking


;fGunSpreadArmBase = AB
'''RunFactor''' = fGunSpreadRunBase + fGunSpreadRunMult
:Default 0.5
:*fGunSpreadRunBase = 1
:*:This value is zero unless the actor is running
:*fGunSpreadRunMult = 0
:*:This value is zero unless the actor is running


;fGunSpreadArmMult = AM
'''ArmFactor''' = fGunSpreadArmBase + ArmCondition * fGunSpreadArmMult
:Default -0.5
:*fGunSpreadArmBase = 0.5
:*fGunSpreadArmMult = -0.5
:*ArmCondition = 1 or 0
:*: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.


;Actor arm condition = AC
=== Notes ===
:1 at 100% condition, 0 when crippled
This formula has been derived by systematically tweaking the settings using the console and observing the effects on the magnitude of weapon sway.
 
;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 [[Weapons|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.
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.
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.
 
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 ===
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.
;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 ===
=== Variables not used by this formula ===
Line 81: Line 69:
*fGunSpreadNPCArmMult
*fGunSpreadNPCArmMult
*fNPCMaxGunWobbleAngle
*fNPCMaxGunWobbleAngle
=== 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.

Revision as of 15:26, 24 December 2008

GunSpread = Max( MinWeaponSpread, WeaponSpread )

Max is a function which returns which ever input value is the largest.

MinWeaponSpread is the "min spread" value specified for the equipped weapon on the 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 and returns the result.

IronSightsFactor = fGunSpreadIronSightsBase + fGunSpreadIronSightsMult

  • fGunSpreadIronSightsBase = 1
  • fGunSpreadIronSightsMult = -0.65
    This value is 0 unless aiming with iron sights (holding the right mouse button with the default control scheme)

CrouchFactor = fGunSpreadCrouchBase + fGunSpreadCrouchMult

  • fGunSpreadCrouchBase = 1
  • fGunSpreadCrouchMult = -0.4
    This value is 0 unless the actor is crouched (sneaking)

ConditionFactor = fGunSpreadCondBase + WeaponCondition * fGunSpreadCondMult

  • fGunSpreadCondBase = 0
  • fGunSpreadCondMult = 0
  • 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%

SkillFactor = fGunSpreadSkillBase + ActorSkillValue * fGunSpreadSkillMult

  • fGunSpreadSkillBase = 0.5
  • fGunSpreadSkillMult = -0.0050
  • ActorSkillValue is the actor's skill value for the skill used by the weapon.
    The skill value used is specified on the weapon form

WalkFactor = fGunSpreadWalkBase + fGunSpreadWalkMult

  • fGunSpreadWalkBase = 1
    This value is zero unless the actor is walking or not moving
  • fGunSpreadWalkMult = 0
    This value is zero unless the actor is walking

RunFactor = fGunSpreadRunBase + fGunSpreadRunMult

  • fGunSpreadRunBase = 1
    This value is zero unless the actor is running
  • fGunSpreadRunMult = 0
    This value is zero unless the actor is running

ArmFactor = fGunSpreadArmBase + ArmCondition * fGunSpreadArmMult

  • fGunSpreadArmBase = 0.5
  • fGunSpreadArmMult = -0.5
  • ArmCondition = 1 or 0
    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.

Notes

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.

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.

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.

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

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.