Difference between revisions of "Talk:Gun Spread Formula"

4,075 bytes added ,  22:41, 31 May 2009
no edit summary
imported>Mannon
imported>Mannon
Line 191: Line 191:


:[[User:Mannon|Mannon]] 00:35, 1 June 2009 (UTC)
:[[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)
Anonymous user