Difference between revisions of "Gun Spread Formula"

1,454 bytes added ,  22:58, 14 January 2009
New formatting
imported>SnakeChomp
(Describe arm condition more accurately)
imported>SnakeChomp
(New formatting)
Line 5: Line 5:
'''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.


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


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


'''ConditionPenalty''' = fGunSpreadCondBase + WeaponCondition * fGunSpreadCondMult
'''ConditionPenalty''' = fGunSpreadCondBase + fGunSpreadCondMult * ''WeaponCondition''
:*fGunSpreadCondBase defaults to: 0.0
:*fGunSpreadCondMult defaults to: 0.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%


'''SkillBonus''' = fGunSpreadSkillBase + ActorSkillValue * fGunSpreadSkillMult
'''SkillBonus''' = fGunSpreadSkillBase + fGunSpreadSkillMult * ''ActorSkillValue''
:*fGunSpreadSkillBase defaults to: 0.5
:*fGunSpreadSkillMult defaults to: -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]]


'''WalkPenalty''' = fGunSpreadWalkBase + fGunSpreadWalkMult
'''WalkPenalty''' = fGunSpreadWalkBase * !''IsRunning'' + fGunSpreadWalkMult * ''IsWalking''
:*fGunSpreadWalkBase defaults to: 1.0
:!''IsRunning'' means that if ''IsRunning'' is 1, !''IsRunning'' is 0, and vice versa.
:*:This value is zero unless the actor is walking or not moving
:*fGunSpreadWalkMult defaults to: 0.0
:*:This value is zero unless the actor is walking


'''RunPenalty''' = fGunSpreadRunBase + fGunSpreadRunMult
'''RunPenalty''' = (fGunSpreadRunBase + fGunSpreadRunMult) * ''IsRunning''
:*fGunSpreadRunBase defaults to: 1.0
:*:This value is zero unless the actor is running
:*fGunSpreadRunMult defaults to: 0.0
:*:This value is zero unless the actor is running


'''ArmPenalty''' = fGunSpreadArmBase + ArmCondition * fGunSpreadArmMult
'''ArmPenalty''' = fGunSpreadArmBase + fGunSpreadArmMult * ''ArmCondition''
:*fGunSpreadArmBase defaults to: 0.5
 
:*fGunSpreadArmMult defaults to: -0.5
 
:*When using a one handed weapon, ArmCondition is 1 with a healthy right arm and 0 with a crippled right arm.  
''IsUsingIronSights'' is 1 if the actor is aiming with iron sights and 0 otherwise.
:*When using a two handed weapon, ArmCondition is 1 with both arms healthy, 0.5 with 1 arm crippled, 0 with two arms crippled.  
 
''IsSneaking'' is 1 when the actor is sneaking and 0 otherwise.
 
''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 [[Weapons|weapon form]]
 
''IsRunning'' is 1 if the actor is running and 0 otherwise.
 
''IsWalking'' is 1 if the actor is walking and 0 otherwise.
 
''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 ===
 
{{SettingGroupHeader}}
{{SettingGroupSetting
|Name = fGunSpreadIronSightsBase
|Default = 1
|Description = Used when calculating ''IronSightsBonus''
}}
{{SettingGroupSetting
|Name = fGunSpreadIronSightsMult
|Default = -0.65
|Description = Used when calculating ''IronSightsBonus''
}}
{{SettingGroupSetting
|Name = fGunSpreadCrouchBase
|Default = 1
|Description = Used when calculating ''CrouchBonus''
}}
{{SettingGroupSetting
|Name = fGunSpreadCrouchMult
|Default = -0.4
|Description = Used when calculating ''CrouchBonus''
}}
{{SettingGroupSetting
|Name = fGunSpreadCondBase
|Default = 0
|Description = Used when calculating ''ConditionPenalty''
}}
{{SettingGroupSetting
|Name = fGunSpreadCondBase
|Default = 0
|Description = Used when calculating ''ConditionPenalty''
}}
{{SettingGroupSetting
|Name = fGunSpreadSkillBase
|Default = 0.5
|Description = Used when calculating ''SkillBonus''
}}
{{SettingGroupSetting
|Name = fGunSpreadSkillMult
|Default = -0.0050
|Description = Used when calculating ''SkillBonus''
}}
{{SettingGroupSetting
|Name = fGunSpreadWalkBase
|Default = 1
|Description = Used when calculating ''WalkPenalty''
}}
{{SettingGroupSetting
|Name = fGunSpreadWalkMult
|Default = 0
|Description = Used when calculating ''WalkPenalty''
}}
{{SettingGroupSetting
|Name = fGunSpreadRunBase
|Default = 1
|Description = Used when calculating ''RunPenalty''
}}
{{SettingGroupSetting
|Name = fGunSpreadRunMult
|Default = 0
|Description = Used when calculating ''RunPenalty''
}}
{{SettingGroupSetting
|Name = fGunSpreadArmBase
|Default = 0.5
|Description = Used when calculating  ''ArmPenalty''
}}
{{SettingGroupSetting
|Name = fGunSpreadArmMult
|Default = -0.5
|Description = Used when calculating ''ArmPenalty''
}}
{{SettingGroupFooter}}


=== Minimum Spread ===
=== Minimum Spread ===
Line 60: Line 129:
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.


=== Variables not used by this formula ===
=== 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?
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?


Line 69: Line 138:
*fNPCMaxGunWobbleAngle
*fNPCMaxGunWobbleAngle


=== Other notable settings ===
=== Other notable game settings ===
;fGunWobbleMultScope
;fGunWobbleMultScope
:Default value: 1.0
: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 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.
Anonymous user