# Talk:Gun Spread Formula

## Weapon Condition[edit source]

The result of the following term will obviously allways be zero as long as both fGun constants are zero:

ConditionPenalty = fGunSpreadCondBase + WeaponCondition * fGunSpreadCondMult

- 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%

--> Does this mean that Weapon condition does NOT affect spread? And how did you arrive at the formula given that this is allways zero? did you change fGunSpreadCondMult to a non-zero value for testing purposes?

- --EscapedGoat 06:58, 7 January 2009 (UTC)

- Yes, default values of 0 mean that weapon condition does not effect gun spread. And yes, I derived the formula by changing the values to something non zero and observing the results and also observing how these values interacted with the other values involved in the formula.
- Also, please sign your comments in the future. Put ~~~~ after your text to do this. I added a signature to your last comment for historical purposes, but feel free to edit it to change it to ~~~~ so the real signature can be generated for your username.
- --SnakeChomp 21:14, 6 January 2009 (UTC)

- So the condition term is allways zero, and with a skill of 100, the skill term is also zero. So if this is the correct formula, a skill of 100 effectively makes iron sights, crouching, walking AND running have ZERO effect on spread? (since those terms are multiplied with a zero term.)
- Is it possible to alter the formula (beyond changing parameter values) itself in the GECK? because this is really not a good implementation!

- --EscapedGoat 14:50, 12 January 2009 (UTC)

- You cannot change the formula because it is contained within the game engine. You can only change the values of the settings used by the formula. For example, you can make having 100 skill not produce a 0 term so that the iron sights and crouch bonuses won't be negated.
- --SnakeChomp 20:43, 12 January 2009 (UTC)

## Clearer Formatting[edit source]

I think we can make this page a bit clearer if we simplify the formula by merging the Base/Mult pairs in the variables section. So we'd do something like:

Skill Factor (SF) = fGunSpreadSkillBase + (fGunSpreadSkillMult * RelatedSkillValue)

And then in the formula you could just plug in SF instead of (SB + (S * SM)), which will reduce the length of the formula by ~half, as well as making it easier to understand visually.

Another guideline we could use is UESP: UESP Damage Formula

I have to go out for a bit but when I come back I'll make a mockup on my user page so we can decide which works better

--Quetzilla 21:43, 21 December 2008 (UTC)

- I agree the formula is a bit unwieldy. I didn't put it in a <code> tag because that style of formatting messes up when it spans multiple lines. It makes sense to separate it into logical fragments, such as (ISB + ISM) and (CrB + CrM) and etc.--SnakeChomp 22:33, 21 December 2008 (UTC)

- Okay, I've complete my mockup of how I think we could improve the page:
- User:Quetzilla/Spread_Formula_Test
- This is intended just for the first two sections of this page rather than the whole thing. I've put the formula itself first as that way the essence of how the settings affects things can be comprehended before seeing all the details about the settings themselves
- I've left the formula as is, but split up into into 3 stages to aid in understanding. It may not be as comprehensive to see it separately, but I think it will be more helpful to new users looking at the information than the previous method.
- Also, is it possible that WeaponMinSpread is just added onto the total spread, rather than the Max() function being used? I imagine that when the other values aren't trivial (skill < 20 for example), the min spread may just be hard to discern.
- --Quetzilla 00:17, 22 December 2008 (UTC)
- It is definately possible that the min spread is simply added in after the perk multiplier, but its hard to scientifically test that as the observations of spread differences can be subjective. I'll update the formula page based off the new format.--SnakeChomp 03:25, 22 December 2008 (UTC)
- Actually I lied, I'll see if I make some tweaks to the example page you made but I'll wait on changing the actual one.--SnakeChomp 03:49, 22 December 2008 (UTC)

- It is definately possible that the min spread is simply added in after the perk multiplier, but its hard to scientifically test that as the observations of spread differences can be subjective. I'll update the formula page based off the new format.--SnakeChomp 03:25, 22 December 2008 (UTC)

- I updated the formatting, take look and see what you think.--SnakeChomp 20:27, 24 December 2008 (UTC)

- Thoughts:
- ArmFactor needs to be named ArmPenalty or something similar. 'Factor' implies that it is multiplied by something but it is not. I chose Factor and Penalty in my mock up specifically.
- The initial part that builds up the formula needs a clearer walkthrough in common human terms to go along with the formulas. Also, it should really be in reverse order from this, more how I did in the mock up. The purpose of the page is to illustrate to the reader how the game arrives at the spread that is observed in the game, thus it is important to start from the beginning rather than the end.
- The parts that say 'fSomeSetting = X.X' need to be clarified to show that they represent the default values and not hard coded constants.
- Parts where the formula is X + Y * A should be formatted as X + (Y * A). You and I know how PEMDAS works but not everyone reading the page does, and it also serves as a visual aid in understanding the formulas presented

- --Quetzilla 23:06, 24 December 2008 (UTC)

- Thoughts:

- I attempted to remedy these concerns with a few changes.
- Renamed formula components to indicate the intent of the component (Bonus vs Penalty)
- Removed the first formula box, making note of the minimum weapon spread in a new section below the formula instead.
- Changed "fFoo = 1" to "fFoo default value: 1" to hopefully indicate these are not constants

- I feel it is appropriate to assume that readers have basic mathematical knowledge, so I will leave formulas as they are. This purpose of this page is to document a mathematical formula, after all.
- --SnakeChomp 01:04, 25 December 2008 (UTC)

- I attempted to remedy these concerns with a few changes.

- Bonus/Penalty is good. I think the defaults part would look better this way:
- fGunSpreadIronSightsBase: 1.0 (default)

- I think the explanation of the formula itself still needs work, which I might take a crack at later. Do you have a reason for
*not*including the parentheses as I mentioned? They aid comprehension regardless of whether the reader understands PEMDAS or not, and the only downside I can say is possibly that they look ugly, but that can be fixed with formatting. - --Quetzilla 01:31, 25 December 2008 (UTC)

- Bonus/Penalty is good. I think the defaults part would look better this way:

- They are unnecessary because the information they provide is redundant? The UESP damage formula page you linked to earlier doesn't include them? I could list several reasons, but this is just a philosophical disagreement. I doubt either of us is going to change our minds. Is something so insignificant really worth the effort to debate? Please just leave it as is.--SnakeChomp 03:09, 25 December 2008 (UTC)

- Would you be opposed to doing it this way:

**SkillBonus** = fGunSpreadSkillBase + fGunSpreadSkillMult*ActorSkillValue

- And, it's not a philosophical disagreement at all -- it's a matter of making sure the information is as clear to the user as it can be. All of the boldness and bullet point stuff on the page is 'redundant', and yet it can't be said to be uneccessary. Speaking as a
**user**of these pages, anything that helps to make it**immediately**obvious what the text/formula means is beneficial. - --Quetzilla 03:24, 25 December 2008 (UTC)
- I am continuing this discussion on principle. You claim that the boldness and bullet points are redundant; they are not. Boldness aids in navigating what would otherwise be a wall of text, and the bullet points provide structure to what would otherwise be a wall of text with bolded parts. Both properties help to guide readers through the document and make it easier to find where the one specific component of the formula is defined. Furthermore, you assume that readers will understand what having parenthesis in a formula means. If you assume that, then you must also assume they know about the basic order of operations, because they cannot know what parentheses do without this basic understanding. Therefore I maintain that there is no reason to add them in this instance, nor would there be a reason to remove them if they were already there, as they happen to be on the Weapon Damage Formula page. There is an argument to keep the syntax standard across the formula pages, but honestly, there are more important things that deserve attention.--SnakeChomp 05:51, 25 December 2008 (UTC)

- And, it's not a philosophical disagreement at all -- it's a matter of making sure the information is as clear to the user as it can be. All of the boldness and bullet point stuff on the page is 'redundant', and yet it can't be said to be uneccessary. Speaking as a

Glancing through it

- You should be able to fit all of the individual components (i.e., IronSightsBonus) on a single page (no need to scroll) if you remove the default information. The default information is still important, but they can all be placed together as a walkthrough of the formula, as a formula complete with numbers below the top one (not sure if it can be formatted correctly), or as a separate page/section. The last option is not that unusual - the default potion strength information was placed on UESP while the detailed, game setting formula was placed on the CS.
- The bold type calls a lot of attention to the word - to the point that it's harder to focus on the rest of the equation. Indenting should be enough, maybe bold the game settings:

IronSightsBonus = **fGunSpreadIronSightsBase + fGunSpreadIronSightsMult**

- This value is 0 unless aiming with iron sights (holding the right mouse button with the default control scheme)

CrouchBonus = **fGunSpreadCrouchBase** + **fGunSpreadCrouchMult**

- This value is 0 unless the actor is crouched (sneaking)

- The wording for the Walk and Run penalties is a bit confusing. However, ArmPenalty isn't :) ArmCondition makes the equation a bit easier to understand (especially since the equation is already confusing and isn't the intuitive
**= Base * Mult**). - I can't play the game yet (card on the way!), so it's unclear just what
**spread**is - is it the chance to miss, does it only apply to scatter weapons like shotguns, does it stray with a chance to hit someone else or is it like Morrowind where a shot connects but "doesn't do any damage"?

--Haama 07:57, 28 December 2008 (UTC)

- Spread is effected in the game world as the ability to hold the gun straight. If spread is high, the player's gun wobbles around on the view. The lower the end result spread, the more stable the gun is on the screen (still wobbles, but the degree of wobble is lowered). In combat, the effect is that when the player fires the gun, the gun isn't pointed directly at the crosshair, and is thus more likely to miss the target. The effect matters more when the target is at range, as if the target is close, the deviation from the crosshair won't matter as much.
- --Quetzilla 10:08, 28 December 2008 (UTC)

- Haama, in response to your suggested formatting, it is incorrect to say that the value of
*IronSightsBonus*is 0 unless you are using iron sights. Only the value of*fGunSpreadIronSightsMult*is 0 when not using iron sights.*fGunSpreadIronSightsBase*always uses the value of the game setting. If this was not the case you would never have any spread unless you were trying to aim more carefully using iron sights because IronSightsBonus is multiplied with the result of (almost) all of the other calculations. And just to be clear, "using iron sights" is just like using the zoom-in marksman perk in oblivion. While zoomed you are using iron sights and otherwise you are not. - It would be possible to instead say that "The
*fGunSpreadIronSightsMult*value is 0 unless..." in your explanatory line to correct that, but I feel the loss of default values takes away from understanding the formula. I know I am a biased observer because I derived the formula, but for someone seeing it for the first time I think it helps to know that "When I'm just standing there doing nothing then IronSightsBonus is 1," which you can only know if you know the default values. - Also, maybe a note should be made at the top of the page explicitly instructing people to ignore the variable names because they are meaningless. The formula is only confusing if you read the page thinking that "variables named base should do X and variables named mult should do Y." The names themselves have no bearing on their use in the formula. It is the formula itself that dictates how variables are used.
- --SnakeChomp 17:12, 28 December 2008 (UTC)

- Haama, in response to your suggested formatting, it is incorrect to say that the value of

- Actually, ALL of the variables follow the base+mult archetype, (as can be seen in the way I set up the mockup for which the new formatting is somewhat based on) it's just that BGS took some leeway with what kind of related value affects the Mult.
- The Base+Mult set up is very simple, and the purpose is to allow the devs to influence the affect of any particular variable on a result by changing the values of the base vs the mult. It's no mistake that in every factor/penalty in the formula, there is a set of values which results in the base+(mult*value) equaling 0 or 1 (depending on how the value is meant to affect the formula).
- edit: more specifically in response to Haama's suggestion, this is a result of not using the names I had originally suggested, as 'Bonus' can lead to thinking of the variable as additive, when in fact it's multiplicative, and this would be clear if the variables had retained the original names with the word Factor in them.
- --Quetzilla 23:37, 28 December 2008 (UTC)
- I see now that this page is missing a clear explanation that a value of 0 is the best result from this formula and values higher than 0 are worse. Without this information it is not immediately clear what the words "Bonus" and "Penalty" mean in the context of this equation.
- I chose names like "Crouch Bonus" specifically because when you are crouching you have less weapon spread, or in other words you gain bonus accuracy while crouching, hence the "crouch bonus". "Bonus" is being used to convey the result the user will observe, it is not meant to indicate how the variable is used in the equation.
- Also, don't forget that this isn't the only formula page. Among all the formula pages, there are three known cases where the
*base + mult * value*style does not hold. On the Weapon Damage Formula page you have`WeaponDamage * fDamageSkillBase + ActorSkillValue * fDamageSkillMult`, and on this formula page you have`fGunSpreadWalkBase * (`and*IsWalking*|| !*IsMoving*) + fGunSpreadWalkMult **IsWalking*`(fGunSpreadRunBase + fGunSpreadRunMult) *`. (Note that your mockup page is incorrect when it describes the WalkFactor and RunFactor.) Instead of trying to explain what things like*isRunning*`foo * (`mean, I tried to use regular sentences to say that certain values are 0 in certain situations. In looking at the mockup page using a*IsWalking*|| !*IsMoving*)`foo *`style again, it doesn't seem so unreasonable to do it this way, but I am a programmer in my day job, so things like that make perfect sense to me. I cannot really know what makes more sense to non programmers. I think it's safe to say that*IsWalking*`fGunSpreadWalkBase * (`would require an english explanation for non programmers to understand it.*IsWalking*|| !*IsMoving*) - --SnakeChomp 03:40, 29 December 2008 (UTC)

- indenting for clarity:
- I hadn't looked at the weapon damage formula page, but looking at it now, I can tell you that it's wrong in terms of the example you listed above:

`WeaponDamage * fDamageSkillBase + ActorSkillValue * fDamageSkillMult`

- should be

`WeaponDamage * (fDamageSkillBase + (fDamageSkillMult * ActorSkillValue))`

- According to your formula, weapon damage as listed in the GECK is cut in half, and then (skill*0.5) is added to the damage. If that were true, then at 100 skill, each weapon would do damage equal to: BaseWeapDmg/2 + 50! Which is obviously wrong. When you use my formula above, you discover that the full damage formula becomes:

`BaseWeaponDamage * ConditionFactor * SkillFactor`

- Where each Factor is a proper base/mult pair.
- This is how Bethesda sets up their formulas, so that you have a base value and then you add or multiply related values, where each value is a base/mult pair. Gun Spread is just confusing because the aim is a lower value, rather than higher in the case of weapons, and we don't have a concrete way of measuring the exact final spread to be 100% confident that the formula is correct, such as in this case:

`fGunSpreadWalkBase * ( IsWalking || !IsMoving) + fGunSpreadWalkMult * IsWalking`

- where I'm not 100% sure that that's actually true, but I'm taking your word on it because I'm too lazy to test it.
- --Quetzilla 04:47, 29 December 2008 (UTC)
- Do you have any proof that either of my formulas are wrong other than by assuming what variables do because of their names? Do your own tests if you don't believe the formulas. I keep repeating that the base and mult names are
**not**used consistently as their names would logically lead you to believe and I'm not saying it because I'm bored. I'm saying it because I tested the formulas without assuming anything about how the variables are used. Here is a test you can do. - Set fDamageSkillBase to 0, fDamageSkillMult to 1, use a 10mm pistol at 100% condition on a character with 50 small guns skill. Observe that the weapond damage shown in the pipboy is 5. That is because (0.66 + 1 * 0.34) * (9 * 0 + 5 * 1) = 5. (Note that the skill value is divided by 10 before being used by the formula as explained on the weapon damage formula page. The fact that you missed this part means the formula page should be improved to make this part more obvious.) If the formula was as you suggest, the result would be (0.66 + 1 * 0.34) * (9 * (0 + 5 * 1)) = 45, and that is not what is observed in game.
**This is why you should never assume that a variable does something because it is named a certain way.** - To measure the gun spread, set fGunSpreadRunBase to 0 and fGunSpreadWalkBase to 5. Observe the results with a 10mm pistol while stationary, walking and running. You will have a very small spread while running and a very huge spread while walking or when not moving at all.
- It is entirely possible my formulas are wrong, but don't accuse them of being wrong just because they
*look*wrong due to the names BSG choose for the game settings. If you think they are wrong, try them out and prove they are wrong. - I must say that it is frustrating to say the same thing over and over. If you are too lazy to test your theories, don't accuse mine of being wrong.
- --SnakeChomp 05:40, 29 December 2008 (UTC)

- Do you have any proof that either of my formulas are wrong other than by assuming what variables do because of their names? Do your own tests if you don't believe the formulas. I keep repeating that the base and mult names are

- I did make a mistake, but it was similar to the one you made -- it's that skill is divided by 100. I did just test this out in the game. In your example, the damage is 5 because of this:

- base = 9, condition factor = 1, skill factor = 0 + (1 * 50/100)
- result = 9 * 1 * .5 = 4.5, rounded up to 5.

- If you want to see that my formula is correct, simply do the following:
- Give yourself a 100% condition 44 magnum, force smallguns to 50, leave the game settings at default. The GECK damage for a 44 magnum is 35. According to your formula, the damage displayed in game is:

- (35 * 0.5base) + (0.5mult * 50skill / 10) = 17.5 + 2.5 = 20

- However, the damage you see in the game is 26! Observe, with my formula:

- (35 * (0.5base + (0.5mult * 50skill / 100)) = 35 * (.5 + (.5 * .5)) = 35 * (.5 + .25) = 35 * .75 = 26.25, rounded down, is 26.

- Are you satisfied now? As a side note, the 10mm pistol is a unique case because it spits out the same numbers in both of our formulas (I was trying to use it as an example but it kept giving the same numbers, proving useless as an example).
- Later I may test the walk/run stuff myself to settle this once and for all :P.
- --Quetzilla 06:37, 29 December 2008 (UTC)
- edit: I want to make clear that I'm not trying to bash your work or anything, as I appreciate all the effort you are putting in here -- most of the settings pages wouldn't exist without your efforts. However, I think it will be beneficial for everyone if you understand that BGS does use base/mult for just about everything, as it should help you make the pages as clear as they can be.
- p.p.s. - you'll notice that in our two formulas above, the only difference other than skill being divided by 10 or 100 is... parentheses. Sorry, had to say it :P.
- --Quetzilla 06:56, 29 December 2008 (UTC)

- (
*Those parentheses actually change the meaning of the formula this time. You are lucky I appreciate sarcasm. Jerk. =P*.)--SnakeChomp 07:25, 29 December 2008 (UTC)

- (

- Thank you for finally testing your theory in game; it is clear now that the current formula is wrong. It is unfortunate that the discussion had to go where it did before a more correct formula was found. And for the record, I am not satisfied, but only because of the way I handled the discussion. I am glad that we were able to work through it and fix the formula in any event. However, in the future it would be helpful if you provided some record of in game testing to support fixed versions of formulas so that they can be verified by others. And I hope you do test out the walking and running stuff and how it effects the spread; independent verification will help ensure that the formula is either correct or that it is corrected.
- Also, I think we should move this discussion onto the talk page for the weapon formula as it doesn't really relate to the gun spread formula itself. We can link to it from this page just incase someone reading who wants to follow the drama can indulge themselves.
- --SnakeChomp 07:12, 29 December 2008 (UTC)

## Formula still needs work[edit source]

Current Forumla:

Gun Spread = PerkModifiers((AB + AC * AM) + (ISB + ISM) * (CrB + CrM) * (CB + C * CM + SB + S * SM) * (WB + WM + RB + RM))

I think this is still inaccurate particularly this part:

(CB + C * CM + SB + S * SM)

If this is true, then when S (skill) == 100, with default values, that whole part of the equation collapses to 0. That part is multiplied by everything else in the equation except the ArmCrippled influence, but if the arm is not cripple then that is 0 as well, which would result in 100 skill completely eliminating spread, which isn't what I observe in the game. 100 skill would also eliminate any effect of crouching or iron sights, which doesn't seem to be true either.

Also, this formula doesn't take into account the Spread value set on the Weapon Object in the GECK at any point, that I can see.

- I have heard that a weapon skill of 100 is indeed supposed to remove weapon sway, but I haven't checked it myself. I'll take a moment to do that, but consider my next statement to see if that describes the behavior you see.
- As for the weapon spread on the weapon form, I think there is a max() function that is compared with the value of the formula and the weapon minimum spread chance. Even with the formula resulting in a value of 0. So the real result would be max(min wepaon spread, formula), therefore you never actually have 0 weapon spread, you only ever have something like 0.5 spread as specified on the weapon form (the 10mm pistol has 0.5 spread)--SnakeChomp 22:18, 21 December 2008 (UTC)
- Just did a quick test, and indeed, with a weapon skill of 100 using a weapon with 0 spread, there is 0 spread. Using a weapon with a non zero spread, there is still spread equal to the spread value of the weapon form. I'll add this to the formula page.--SnakeChomp 22:22, 21 December 2008 (UTC)

## Gun Spread Formula: Skill And Condition Have Very Little Effect[edit source]

I'm trying to get the condition of the weapon and the player skill to actually affect accuracy, but have since been able to produce minuscule to no effect at all. I gone through the range of Base/Skill values for both from vanilla 0.5 -0.005, as low as 0.2 and as high as 0.9, even 1.3 -0.009 or 0.45 -0.0075 and none of it seem to make any difference regarding skill or weapon condition. My uneducated guess is that the skill and CND values have very little impact on the original formula. I can make my 10mm blast all over the cliffside, but forcing skill to 100 and changing to a brand-new 10mm don't really make any difference. VATS is another thing. I get variations of around 1% whether my skill is 100 or 15 and gun CND seems to have no apparent effect at all. If anyone can figure out a formula that'd make a Small Guns 30 with a crappy gun unable to hit a barn wall from the inside to a 85 SG with a brand new heater hit the eye of a Bloatfly from 50 meters, PLEASE tell me. I'm sick and tired of weaponskill and condition affecting firearm damage, which it really shouldn't, and not accuracy. Sanguine420 Sanguine420 11:09, 20 February 2009 (UTC)

- Um, I don't understand why you don't think skill has much affect on gun spread. With default values, skill has
**the largest impact**on gun spread of all the factors. What is more likely happening is that the changes you are making to the game settings do not result in a significant enough change to gun spread for you to observe. There is no way to accurately measure gun spread other than to actually fire and watch where the bullets go, so minute changes are difficult to detect. - Also, with vanilla settings, weapon condition has
**no affect at all**on gun spread. fGunSpreadCondBase and fGunSpreadCondMult are both 0 with default settings (as the formula page indicates). - Furthremore, note that some weapons have a minimum spread value and there is nothing you can do to make gun spread with those weapons go below the minimum spread unless you modify the weapon in the GECK to remove minimum spread.
- --SnakeChomp 23:57, 20 February 2009 (UTC)

There is a big big problem about weapon spread, i'll explain with an example:

The classic formula for Weapon Spread is the following, right?

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

Okay, so it means that with 10 skill we have a spread of 0,1575 using Ironsight, standing still, not crouched and with healthy arms.

This would mean that the formula is NOT changing a thing, and that the spread is only related to the min spread value of the weapon sheet. Why? Consider a 10mm pistol, it has 0,5000 min spread so even at 10 or 100 skill, the result of the Max(weap spread = 0,5000, spread = 0.1575) should always be 0,5000.

Naturally, we know that it's impossible.

To be sure of it, I did a little test: with vanilla settings I tried shooting at a wall carefully watching where the bullets were going to hit: the difference between 20 skill and 100 skill is noticeable.

What's wrong? oO

Andrea.nasuelli 16:10, 19 April 2009 (UTC)

- I think some more research into this would be very beneficial. If the max of spread from the formula and minspread from the weapon is taken this has the in game effect of nullifying factors other than minspread on accuracy as skill increases. More importantly the point at which the factors become nullified is actually at a lower skill value for LESS accurate weapons. On the other hand it would make much more sense in terms of game mechanics if spread and minspread were added together. Otherwise the effects of spread become completely irrelevant to anything except the highly accurate weapons long before reaching 100 skill.

- I'm not saying that isn't how it works, just that if it is how it works it is a big enough difference that we should really figure it out. Unfortunately it is impossible to test this with the accurate weapons, which certainly makes testing more difficult. My thinking was that you could select or edit a weapon with a large minspread for testing and modify the other variables to produce a spread value of 0 as a control and then a spread value equal to the minspread, and then a spread value double the minspread just for good measure. It is difficult to observe small changes in accuracy, but hopefully it would be possible to discern a doubling of a large innacuraccy. So if the first two tests have identical results but the third is doubled then we know the max of the two values is taken. But if the second test is twice as inaccurate as the first and the third test is three times as inaccurate then we know they are added. Hopefully this level of discrepancy could be observed in game.

- Unfortunately I can only play on the Xbox and thus have a limited ability to test things.

- Mannon 00:35, 1 June 2009 (UTC)

## WalkPenalty & RunPenalty[edit source]

The article defines WalkPenalty as:

**WalkPenalty** = fGunSpreadWalkBase * !*IsRunning* + fGunSpreadWalkMult * *IsWalking*

- !
*IsRunning*means that if*IsRunning*is 1, !*IsRunning*is 0, and vice versa.

Are we missing something here? Considering fGunSpreadWalkMult=0 this formula would result in IsWalking being ignored thus producing a value of 1 anytime the player is not running and 0 the rest of the time. (Taken in context with RunPenalty this would produce a permanent penalty of 1 even when crouched and not moving.)

The possible outcomes would be as follows:

(WalkPenalty) + (RunPenalty)

(1 * 1 + 0 * 0) + ((1 + 0) * 0) = (1 + 0) + (1 * 0) = 1 + 0 = 1 (IsWalking 0, IsRunning 0)

(1 * 1 + 0 * 1) + ((1 + 0) * 0) = (1 + 0) + (1 * 0) = 1 + 0 = 1 (IsWalking 1, IsRunning 0)

(1 * 0 + 0 * 0) + ((1 + 0) * 1) = (0 + 0) + (1 * 1) = 0 + 1 = 1 (IsWalking 0, IsRunning 1)

(1 * 0 + 0 * 1) + ((1 + 0) * 1) = (0 + 0) + (1 * 1) = 0 + 1 = 1 (IsWalking 1, IsRunning 1)

Note: The whole thing with all values is a bit unwieldy so I added two simplification steps between the full formula and the final result.

As you can see this results in a permanent 1 penalty.

Perhaps we're missing parenthesis such as:

**WalkPenalty** = (fGunSpreadWalkBase * !*IsRunning* + fGunSpreadWalkMult) * *IsWalking*

This would also bring it in line with the RunPenalty formula, although I am not really certain IsRunning need be included within the parenthesis.

To my mind it is mere clearly understandable when expressed as follows:

**WalkPenalty** = (fGunSpreadWalkBase + fGunSpreadWalkMult) * *IsWalking* * !*IsRunning*

This places both of the binary logic bits at the end and the math bit at the beginning showing even more the similarity to RunPenalty.

The results of this formula are as follows:

(WalkPenalty) + (RunPenalty)

((1 + 0) * 0 * 1) + ((1 + 0) * 0) = (1 * 0) + (1 * 0) = 0 + 0 = 0 (IsWalking 0, IsRunning 0)

((1 + 0) * 1 * 1) + ((1 + 0) * 0) = (1 * 1) + (1 * 0) = 1 + 0 = 1 (IsWalking 1, IsRunning 0)

((1 + 0) * 0 * 0) + ((1 + 0) * 1) = (1 * 0) + (1 * 1) = 0 + 1 = 1 (IsWalking 0, IsRunning 1)

((1 + 0) * 1 * 0) + ((1 + 0) * 1) = (1 * 0) + (1 * 1) = 0 + 1 = 1 (IsWalking 1, IsRunning 1)

In this version the penalty while walking, running, or walking and running is still 1, but at least the penalty while doing neither is 0.

By the way, I'm assuming the * !IsRunning bit is necessary because IsWalking is 1 even while running, thus it is a way of turning off the WalkPenalty while running, which with default values produces 1, exactly the same penalty, but could presumably be any other value higher or lower. Is this correct? This seems logical to me, just unclear.

If so then the following statement is confusing:

"*IsWalking* is 1 if the actor is walking and 0 otherwise, but there is no function by this name."

To a layperson as myself one cannot simultaneously walk and run, therefore saying this would implicitly mean that IsWalking should be 0 while Running.
Perhaps the statement should read as follows instead:

"*IsWalking* is 1 if the actor is moving and 0 otherwise, but there is no function by this name."

This would better fit the logic since one by definition is moving while running. I know it's a small change, but it totally changes the logic. (Also I'm unable to test this so I am reluctant to change the actual article.)

hmm... Actually I am quite confused by the walk and run penalties, both with and without my suggested changes the only possible values for (WalkPenalty + RunPenalty) are 0 and 1 which are then multiplied by everything except ArmPenalty. If this is true then you can simply ignore crouching, using iron sights, or even your weapons skill, so long as you stand still the value for WalkPenalty + RunPenalty will be 0 and will cancel everything else out.

I may be entirely wrong in my assumptions here, but if so I think it only underscores more clearly the need to clarify the information on the page.

Mannon 02:41, 1 June 2009 (UTC)

## How "Min Spread" works[edit source]

Apparently most people think Min Spread is the minimum spread of the bullets (i.e. Min Spread of 2.0 means that the bullets will deviate at least 2.0 degrees).

At least that's what's written on the Weapons page, and if read correctly I think some people made the same assumption in their comments on discussion page here.

I just tested this theory, and with a Min Spread of 20 I still have bullets hitting very close to the middle (i.e. where my crosshair is aiming). (NOTE: my small guns skill is 71). However, most bullets have spread so large that they completely miss the target (from what I could tell, the spread sometimes seemed close to 45 degrees, but I did not measure it, this is only a quick observation).

I think Min Spread is actually the AVERAGE spread of the bullets. To test this, I changed the Min Spread setting of my weapon from 20 to 45. I ended up with bullet impacts at nearly 90 degrees on the ceiling, the floor and the walls on the side.

I think it works like this: if Min Spread is 20, bullets my spread anywhere between 0 and 40 degrees. Why? Because 20 is right in the middle of 0 and 40. If Min Spread is 45, bullets may spread anywhere between 0 and 90 degrees. If Min Spread is 0.5, bullets may spread a minimum of 0 and a maximum of 1.0 degrees. And so on for any value of Min Spread.

Basically: Real minimum spread = 0 Maxmimum spread = Min Spread x 2

This makes sense since the game needs a way to decide the maximum spread a bullet may have.

NOTE: the real bullet spread of a weapon is probably affected by other factors, such as small guns skill, bonuses, agility, perks, and so on. Here I am not considering such factors as I only wish to explain how Min Spread works (I am not trying to find the complete spread formula). For example, with a small guns skill of 70 I did not have any bullets hitting at exactly 90 degrees, but the bullets which had the biggest spread angle during testing had a spread angle close to 90 degrees. Therefore I assume that other factors have a minor effect on bullet spread, however such effect seems small to my observations.

Hope this helps.

- Raven55 19:31, 22 June 2009 (GMT -5)

## How "Min Spread" works - another theory and game test[edit source]

Just finished a comprehensive round of testing, and I think I finally figured out exactly how Min. Spread interacts with bullet path. It's in fact surprisingly simple.

1. The Spread Formula, as you wrote it, controls the wobble of the player's arm and torso. This gives us a barrel axis.

2. Whenever a shot is fired, each single projectile will have a trajectory determined by the barrel axis, modified by the Min. Spread value.

So, as suggested above, Min. Spread is in fact added to regular spread. This has gameplay implications : you can for example have a very precise shotgun (Min. Spread of 1.5), in the hands of a very clumsy shooter (large Gun Spread Formula value). The character's aim will wander widely, but the pellets in each shot will stay tightly grouped.

So, to summarize :

- Gun Spread Formula = player's aim - Min. Spread = weapon's own precision

Testing this is easy : take a vanilla Fallout3, modify the base 10mm to have a 0 Min. Spread, and set fGunSpreadCondBase to 20. Load a game, spawn a brand new gun, set smallguns to 100. Shoot - your arm goes everywhere, but each bullet follows a visibly straight path out of the gun's barrel. Now set fGunSpreadCondBase to 0, and Min. Spread to 20. Your gun stays still, bullets fly everywhere.

With that in mind, it may be a good idea to rename the Gun Spread Formula to Aim Spread Formula, or something to that effect.

NOTE : this opens the possibility that the gun's spread (not the player's) has its own formula using Spread, something like :
Gun Spread = Spread * *Unknown setting/var* + Min. Spread
This would explains the cryptic claim by Ajunta, in the weapons' talk page, that the setting does indeed work, possibly because of a seemingly unrelated setting or game var that's different on his setup. So far, however, I haven't been able to identify it. So, for now, just food for thought.

DomFada 23:38, 11 November 2009 (UTC)DomFada

## MUST READ !!! I've found the answer to Min. Spread and Spread !!![edit source]

Gah ! In retrospect, that was so bleeding obvious...

Just as I said before, there are TWO formulas, not one.

Player's aim : your formula works just fine

Gun spread : the following formula

Gun Spread = Spread * WeaponConditionSpread + Min. Spread

where WeaponConditionSpread is determined by the gun's condition and the fWeaponConditionSpreadX settings.

Tested and validated in game. Set the 10mm's Min. Spread to 0, and Spread to 20. Then, set all the fWeaponConditionSpreadX settings to 1. Go in game. Shoot. Change Spread to 3. Repeat. Change Spread to 0. Rinse.

No idea why they set the settings to 0 in the release, the system works perfectly. Dumbing down for their expected "target demographics" ? Anyway, I can't believe it took all of us so long to figure it out. Glad it's over - or at least I hope so.

PS : I'm leaving the previous subject because it contains a detailed explanation of the bullet path mechanics, and I'm too lazy to properly merge both. When you've validated this and changed the main page, feel free to remove my comments to clear this page. Until then, I've made a minor edit to the main page encouraging readers to look here. Hope I'm not breaking policy by such an edit, but I have validated this new formula thoroughly, and I believe it would be of use to anyone consulting the page. Reverse if needed.

DomFada 00:32, 12 November 2009 (UTC)DomFada

- 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 = (PerkModifiers(IronSightsBonus * CrouchBonus * (ConditionPenalty + SkillBonus) * (WalkPenalty + RunPenalty) + ArmPenalty)) * 3 + MinSpread

- 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:

**WalkPenalty**= fGunSpreadWalkBase * !*IsRunning*+ GunSpreadWalkMult * (*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. (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.)

- The proof here is in the pudding: I just released 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.

- I think the article should be edited ASAP, but I'd like to leave this here for a bit for peer review before I do so, just in case someone else finds my revision in need of additional revision. Experience with writing and testing my mod, however, leads me to believe that the above is correct.
- --ShadauxCat 23:36, 8 February 2011 (UTC)