Difference between revisions of "Talk:Gun Spread Formula"

252 bytes removed ,  19:53, 8 February 2011
Silly me... my "AimBonus" is Iron Sights, isn't it?
imported>Henning
imported>Henning
(Silly me... my "AimBonus" is Iron Sights, isn't it?)
 
Line 346: Line 346:
:I can verify that this is correct.  The gun's minimum spread DOES have a separate effect from the formula shown here.  In creating a mod to show the player's accuracy in a circle on the HUD, I had to refine this formula - I discovered that both min spread and skill are taken into account in calculating the weapon accuracy - HOWEVER, as far as I can tell, spread still does not come into play at all.  Or at least, if it does, it's not in the way proposed above.  The two formulas are calculated at a 3:1 ratio - essentially, the formula is:
:I can verify that this is correct.  The gun's minimum spread DOES have a separate effect from the formula shown here.  In creating a mod to show the player's accuracy in a circle on the HUD, I had to refine this formula - I discovered that both min spread and skill are taken into account in calculating the weapon accuracy - HOWEVER, as far as I can tell, spread still does not come into play at all.  Or at least, if it does, it's not in the way proposed above.  The two formulas are calculated at a 3:1 ratio - essentially, the formula is:


  Spread = Aim * 3 + MinSpread
  Spread = (PerkModifiers(IronSightsBonus * CrouchBonus * (ConditionPenalty + SkillBonus) * (WalkPenalty + RunPenalty) + ArmPenalty)) * 3 + MinSpread


:Where Aim is the formula on this page.
:I can't verify that this is the EXACT angle that's used for spread (although it does seem probable that it is, I haven't done the trigonometric calculations required to actually compute the exact angle - there may be some multiplier in there or something), but I can verify that the ratio is 3:1.  However, the WalkPenalty and RunPenalty calculations are incorrect.  They should read:
 
:I can't verify that this is the EXACT angle that's used for spread (although it does seem probable that it is, I haven't done the trigonometric calculations required to actually compute the exact angle - there may be some multiplier in there or something), but I can verify that the ratio is 3:1.
 
:The aim formula DOES need a few corrections, howeverFirstly, the WalkPenalty and RunPenalty calculations are incorrect.  They should read:


:'''WalkPenalty''' = fGunSpreadWalkBase * !''IsRunning'' + GunSpreadWalkMult * (''IsMoving>''>0) * !''IsRunning''
:'''WalkPenalty''' = fGunSpreadWalkBase * !''IsRunning'' + GunSpreadWalkMult * (''IsMoving>''>0) * !''IsRunning''
:'''RunPenalty''' = GunSpreadRunBase * ''IsRunning'' + GunSpreadRunMult * (''IsMoving''>0) * ''IsRunning''
:'''RunPenalty''' = GunSpreadRunBase * ''IsRunning'' + GunSpreadRunMult * (''IsMoving''>0) * ''IsRunning''


:Where ''IsMoving'' is the [[IsMoving]] function (''IsMoving''>0 means this value is 1 if IsMoving is non-zero, 0 otherwise) and ''IsRunning'' is the [[IsRunning]] function.
:Where ''IsMoving'' is the [[IsMoving]] function (''IsMoving''>0 means this value is 1 if IsMoving is non-zero, 0 otherwise) and ''IsRunning'' is the [[IsRunning]] function. (The reason this correction has to be made is that IsRunning returns true even if the player is standing still, as long as the "run" key is being held or autorun is enabled.)
 
:Secondly, there is a missing value that needs to be inserted into the calculation, that's being left out.  For lack of a better word for it, I'll use ''AimBonus'' - a value that equals 0.5 if the player is holding the aim/block button, 1 if they are not. Thus, the final formula reads:
 
Spread = (PerkModifiers(IronSightsBonus * CrouchBonus * AimBonus * (ConditionPenalty + SkillBonus) * (WalkPenalty + RunPenalty) + ArmPenalty)) * 3 + MinSpread


:The proof here is in the pudding: I just released [http://www.fallout3nexus.com/downloads/file.php?id=15724 this mod] that very accurately shows your accuracy across all weapons and at all skill values, even with the walking, running, and condition modifiers changed.
:The proof here is in the pudding: I just released [http://www.fallout3nexus.com/downloads/file.php?id=15724 this mod] that very accurately shows your accuracy across all weapons and at all skill values, even with the walking, running, and condition modifiers changed.
Anonymous user