Difference between revisions of "Talk:Gun Spread Formula"

17,477 bytes added ,  19:53, 8 February 2011
Silly me... my "AimBonus" is Iron Sights, isn't it?
imported>EscapedGoat
imported>Henning
(Silly me... my "AimBonus" is Iron Sights, isn't it?)
 
(24 intermediate revisions by 5 users not shown)
Line 17: Line 17:


::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.)
::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 itself in the GECK? because this is really not a good implementation!
::Is it possible to alter the formula (beyond changing parameter values) itself in the GECK? because this is really not a good implementation!


::[[User:EscapedGoat|EscapedGoat]] 14:50, 12 January 2009 (UTC)
::--[[User:EscapedGoat|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.
:::--[[User:SnakeChomp|SnakeChomp]] 20:43, 12 January 2009 (UTC)


== Clearer Formatting ==
== Clearer Formatting ==
Line 153: Line 156:
: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)--[[User:SnakeChomp|SnakeChomp]] 22:18, 21 December 2008 (UTC)
: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)--[[User:SnakeChomp|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.--[[User:SnakeChomp|SnakeChomp]] 22:22, 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.--[[User:SnakeChomp|SnakeChomp]] 22:22, 21 December 2008 (UTC)
== Gun Spread Formula: Skill And Condition Have Very Little Effect  ==
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 [[User: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.
:--[[User:SnakeChomp|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
[[User:Andrea.nasuelli|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.
:[[User:Mannon|Mannon]] 00:35, 1 June 2009 (UTC)
== WalkPenalty & RunPenalty ==
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.
[[User:Mannon|Mannon]] 02:41, 1 June 2009 (UTC)
== How "Min Spread" works ==
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.
:[[User:Raven55|Raven55]] 19:31, 22 June 2009 (GMT -5)
== How "Min Spread" works - another theory and game test ==
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.
[[User:DomFada|DomFada]] 23:38, 11 November 2009 (UTC)DomFada
== MUST READ !!! I've found the answer to Min. Spread and Spread !!! ==
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.
[[User:DomFada|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 [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.
: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.
:--[[User:ShadauxCat|ShadauxCat]] 23:36, 8 February 2011 (UTC)
Anonymous user