miguick Posted September 18, 2016 Share Posted September 18, 2016 See this stuff at the new wiki: http://geckwiki.com/index.php/Gun_Spread_Formula_(New_Vegas) While looking for info on how spread works in this game, I first saw that the most reliable source people take to be is the GECK wiki, which seems to have correct enough info, but for Fallout 3.New Vegas ditched completely that spread formula and implemented a new one with new game settings, yet kept the old settings to further confuse people it seems. Now it looks like Bethesda is closing down their old official forums and it's no longer possible to post in the New Vegas section. But from a search in Google, one can find a bit of info in a creepy bootleg forum which lead me to find an old thread in the official GECK section, where these settings were explained by Kai Hohiro, and which seem to be the most reliable info about how spread actually works in new Vegas. Link here, and I'd like to leave the OP transcript below for archiving purposes and to have another place to consult it: In-depth explanation of Spread/Accuracyby Schlangster and Kai HohiroSpread is the value that determines by how much your shots can deviate from your intended target (the center of your cross hair). The higher your spread, the more inaccurate you are. For the sake of powergamers, modders and the good of mankind we’ll explain in-depth how this mechanic works.1. Spread Calculation2. Spread in-game3. Testing Methods1. Spread CalculationA lot of you probably know the Gun Spread Formula from the GECK wiki. Now forget all about it, because none of the settings or formulas are used in Fallout New Vegas. (And just to point out here again, FNV is a full of data and settings that are legacies from Oblivion and FO3, so just because something exists in the data files, doesn’t mean it’s actually used anywhere).Instead we are presented with the following new settings in FNV:fRunningSpreadPenalty (Default: 0.2)fStandingSpreadPenalty (Default: 0.1)fUnaimedSpreadPenalty (Default: 0.2)fWalkingSpreadPenalty (Default: 0.1)fCrippledArm1HSpreadPenalty (Default: 0.2)fCrippledArm2HSpreadPenalty (Default: 0.4)fCrippledArms1HSpreadPenalty (Default: 0.4)fCrippledArms2HSpreadPenalty (Default: 0.6)fWobbleToSkillConversion (Default: 0.5)fMinGunSpreadValue (Default: 0.01)These settings all affect the player’s spread. Now the total spread consists of two major factors, the player’s spread (from here on referred to as PSp) and the weapon’s spread (referred to as WSp).The PSp is very variable, being affected by the players weapon skill, movement, arms and much more. Here is an overview of all the factors that affect PSp:Weapon SkillPerks/Traits/Chems (even those that say modify WSp, actually modify PSp)CrouchingUsing Scope/Iron SightsStanding/Walking/RunningUsing a 1 or 2 handed weapon and having 1 or 2 arms crippledWeapon’s required strengthWeapon’s required skillAmmo (this actually surprised me)The WSp is completely static and consists solely of the weapon’s ‘Min Spread’ value. The only thing that affects this are weapon mods, nothing else does. Many people probably have also noticed the ‘Spread’ value in weapon tabs. That value does nothing at all. It didn’t do anything in FO3 either, unless you re-enabled spread penalties based on weapon conditions. I’m not sure if it’s possible to enable that in FNV, haven’t really looked into that.Now what the PSp does is influence your character’s hand sway. The higher the PSp the more your hand will sway around, causing your shots to go off target. The sway you experience while using a weapon’s scope is exactly the same as your hand sway. The WSp on the other hand simply influence at what angle your bullet will leave the gun barrel, it will not cause any sway of the scope or player’s hand.Following are the calculations that are used to determinate the player’s exact spread:UnaimedPenaltyfUnaimedSpreadPenalty * !isUsingIronSightsRunningPenalty fRunningSpreadPenalty * isRunning * isMovingWalkingPenaltyfWalkingSpreadPenalty * !isRunning * isMoving(Walking and Running Penalties are exclusive to each other)StandingPenaltyfStandingSpreadPenalty * !isSneakingArmConditionPenaltyif 1ArmCrippledfCrippledArm1HSpreadPenalty * isUsing1HWeaponfCrippledArm2HSpreadPenalty * isUsing2HWeaponif 2ArmsCrippledfCrippledArms1HSpreadPenalty * isUsing1HWeaponfCrippledArms2HSpreadPenalty * isUsing2HWeapon(ArmConditionPenalties are all exclusive to each other)StrReqPenaltyIf Weapon Required Strength > Player Strength(Weapon Required Strength - Player Strength) * 0.025SkillReqPenaltyIf Weapon Required Skill > Player Skill(Weapon Required Skill - Player Skill) * 0.0025SkillBonusMultiplier1.00 - Player Skill/100 * fWobbleToSkillConversionPlayerSpread = Perks * Ammo * SkillBonusMult * (UnaimedPenalty + WalkingPenalty + RunningPenalty + StandingPenalty + ArmConditionPenalty + SkillReqPenalty + StrReqPenalty)if PlayerSpread < fMinGunSpreadValueset PlayerSpread to fMinGunSpreadValueWeaponSpread = WeaponMinSpread - WeaponModBonusTotalSpread = PlayerSpread + WeaponSpreadAnd there you have your spread value. A few noteworthy things:I wrote Player everywhere, however that’s interchangable with ActorMany people assumed player skill didn’t matter as long as you meet the minimum skill requirements of a weapon. That is incorrect, as soon as you have any kind of penalty, skill will matter.As long as you have the weapon’s required strength and skill values, and no crippled arms, you will have the best possible accuracy while crouching, not moving and using IronSights. Perks and ammo will not improve that.Trigger Discipline is only useful for Run’n'Gun players(or characters that otherwise have a lot of penalties), Fast Shot is FAR more useful for careful sniper characters that usually crouch and aren't moving.Shotgun slugs are less useful then expected. The Sawed-Off for example has a WSp of 7(!) which is not reduced in any way by using slugs, so that makes it incredibly hard to hit anything with a slug over a moderate distance, since you fire only 1(2) projectile instead of 7(14). Slugs are only useful at very very close range(or with more accurate shotguns).With the default values there is always a minimal amount of spread (fMinGunSpreadValue). It’s a nice touch for immersion, since it prevents the player’s weapon and scope to become completely static.2. Spread in-gameNow the spread numbers are only arbitrary values and were fairly easy to figure out. We went one step further and calculated the actual degrees of deviation that spread causes.These are approximations and may not be 100.00% correct, since we had little to work with here, however we did plenty of tests and these numbers fit into the calculations:PSp was actually surprisingly straight forward:1.00 PSp = 5.955 degrees of deviation.WSp however not at all because it didn’t follow a straight linear progression. Ultimately the following formula fit the debug values for different weaponspreads1.00 WSp = ((0.0125 * WeaponSpread²) + (0.125 * WeaponSpread)) * 5.955TotalDeviationDegree = (PlayerSpread + ((0.0125 * WeaponSpread²) + (0.125 * WeaponSpread)) ) * 5.955What’s noteworthy:PSp actually causes a much bigger degree in deviation than an equal number of WSp. So 2 PSp is a much bigger penalty to the players accuracy than 2 WSp.However most of the time players, especially those that use automatic weapons and shotguns, have a lot higher WSp than PSp. In those cases a weapon's Min Spread will be a way bigger factor in your overall accuracy than anything else.3. Testing MethodsThe PSp again was actually fairly easy to figure out, thanks to the fact that in the default settings the scope sway follows exactly the player’s hand sway.All we had to do was record all the extremes of the scope sway, then we could simply calculate the diameter of the sway circle with 3 xy coordinates via the following formula (where getAngle X is Y and getAngle Z is x)A + B(-x1) + C(-y1) = -(x12 + y12)A + B(-x2) + C(-y2) = -(x22 + y22)A + B(-x3) + C(-y3) = -(x32 + y32)xm = B/2, ym = C/2, and r2 = xm2 + ym2 - AIf you want to try this yourself you can simply write a script that records player.getAngle X and player.getAngle Z, while you are using a scope, have it record the 3 extreme points it will find during a 20 second duration) and input them into a circle calculator.What initially threw us off was that no matter what gamesettings we changed, the sway wouldnt alter one bit. That was because we were using the old calculation from FO3 and eventually realized they didn’t do anything at all. We then found the new spread GMSTs, and their effect was immidiately apparent.Calculating the PSp is fairly trivial since FNV uses a much much more straight forward calculation (that makes a lot more sense too) than what was used in FO3.In the end all we had to do was input various test circles into a spreadsheet and the common multiplier of 5.955 for the spread values became very apparent.Like mentioned the degrees of deviation caused by Weapon Spread were far more tricky to find out, since weapon spread doesn’t cause any kind of sway.In this case what we did was build a test room with a shooting range. Our test methods were fairly...brute force. We created a circle in the center of the HUD that we could expand and contract manually. Then we fired thousands of rounds into a wall and contracted the circle to fit the shot impacts, then we would use the diameters of those circles in our weapon spread calculations. It became quickly apparent that the deviation wasn’t a linear progression as it was for player spread, ie 4 MinSpread didn’t have twice the deviation of 2 MinSpread.In this case we simply had to rely on a lot of trial and error and approximations until we reached the above mentioned formula for WeaponSpread deviation.And that concludes our explanation of Spread. Hope these findings will prove helpful to people out there.Edited by Kai Hohiro, 16 December 2010 - 07:13 PM. The latest official patch fixed spread ammo modifiers to apply to the weapon instead of to the player, so that's taken care of. The settings controlling the influence of strength and skill requirements are fWeapStrengthReqPenalty (0.025) and fWeapSkillReqPenalty (0.01), but the skill setting doesn't seem to have any effect at all. And it doesn't look like either have any effect on melee or thrown weapons whatsoever.There's another important piece of info by th1nk regarding beam splitter weapon mods. Their B numeric value would act as a multiplier to the weapon min spread when the mod is installed, but incidentally, both the LAER and the laser rifle have it set to 0. I doubt that was intended, but at this point it's up to people to fix them in any way. Here's my other findings regarding spread:Perk effects are applied by formID order, there's no mathematical sanitation. Additions and substractions can go after divisions and multiplications. A perk effect's priority will only order the effects within the perk, but not in relation to other perks. So this means getting a sensible value for an entry point function altered by perks (calculate weapon damage, gun spread, etc) is only really possible if all perks in the game use one kind of operation, either addition or multiplication. Since all use multiplications in the vanilla game, one has to be careful when using additions with a mod. I think it's a bit more than that. Perk entries are actually applied by priority. Entry points with the same priority do get mathematically sanitized so additions go before multiplications. Entries with lower priority get applied last, with 0 being the lowest and what all vanilla entries use.Regarding spread, perk spread effects are applied after all game settings' influences on spread, and can modify it beyond the fMinGunSpreadValue setting. That's why Steady sets your spread to dead 0 after all.Player spread is a sway movement of the upper body obviously following some simple math function. A negative spread calculated value inverts this function and the sway pattern. But barring some graphic analysis method, I wouldn't know what that function is.This thing about negative spread also applies to weapon spread. No obvious difference between a negative and positive weapon spread with the same absolute value.There's pretty much no delay in player spread to sway changes when altering your state (from standing to crouching, unaimed to iron sights, walking to running). Particularly when aiming through a scope, spread immediately drops to your current calculated value, allowing easy 'quickscoping'. One mod I know of that aims to correct this is JT's Aim mod.And I think I finally figured out weapon requirements: StrReqPenaltyIf Weapon Required Strength > Player Strength(Weapon Required Strength - Player Strength {max 10}) * fWeapStrengthReqPenalty (0.025)SkillReqPenaltyIf Weapon Required Skill > Player Skill(Weapon Required Skill - Player Skill {max 100}) * 0.1 * fWeapStrengthReqPenalty (0.025) Yep, there must be some kind of error in the code and only fWeapStrengthReqPenalty is used for both strength and skill requirements, yet in the later case it is also divided by a 10 factor to make up. Also the stat penalties seem capped to what would be the max theoretical values of 10 strength and 100 skill.With that, player spread is: PlayerSpread = SkillBonusMult * (UnaimedPenalty + ((WalkingPenalty + RunningPenalty) / Modify Aiming Move Speed entry point multiplier perks if available) + StandingPenalty + ArmConditionPenalty + SkillReqPenalty + StrReqPenalty)if PlayerSpread < fMinGunSpreadValueset PlayerSpread to fMinGunSpreadValueAny suitable Calculate Gun Spread Perks applied afterwardsThe Modify Aiming Move Speed entry point type from perks like Run 'n Gun seems backwards in that it acts as a divisor to movement penalties when defined as a multiplier. Still no idea how it acts when defined as an addition or otherwise. Hopefully you can add anything relevant to spread to this topic, but even if not, I'd rather also have the info here so that it might be easier to find than in Bethesda's crumbling forum. Also hope it helps anyone to better understand spread.And my late thanks from here to Schlangster and Kai Hohiro for taking their time back then to test all this stuff. Link to comment Share on other sites More sharing options...
DoctorKaizeld Posted September 18, 2016 Share Posted September 18, 2016 Ah nice good to know. Im working on a weapons stat 'overhaul' mod for NV so this is useful. Link to comment Share on other sites More sharing options...
RoyBatterian Posted September 19, 2016 Share Posted September 19, 2016 Thanks for copying that here miguick. There's other stuff that should be copied here too, like cipscis's script speed tests and there's other stuff schlangster and kai on various mechanics. I hope they don't destroy the wiki again... that would really suck. Link to comment Share on other sites More sharing options...
miguick Posted September 19, 2016 Author Share Posted September 19, 2016 Regarding weapons' requirements, I've done some very crude testing to try to determine what's the problem with them, but I've got no solid leads. I nulled the settings for skill, running, walking, standing and unaimed spread penalties, so that only the ones related to requirements would remain.It seems fWeapSkillReqPenalty does nothing whatsoever, when changing it at least. fWeapSkillReqPenalty seems to have a greater effect the further your skill level is from the weapon's. It seems if your skill reaches the weapon's requirement, strength has much less of an effect on your sway with it.I'm starting to think they botched in an official patch and either fixed the value of fWeapSkillReqPenalty in the engine calculations, or devised a new formula that works without that setting and only uses fWeapStrengthReqPenalty somehow. But barring exhaustive testing like the ones carried 6 years ago, I'm probably only further muddling things. Link to comment Share on other sites More sharing options...
miguick Posted October 9, 2016 Author Share Posted October 9, 2016 I've been working on an upgrade to PN's crosshair scripts these past few weeks, and I think I've got some addendum to the info above. I'll try to list them:Perk effects are applied by formID order, there's no mathematical sanitation. Additions and substractions can go after divisions and multiplications. A perk effect's priority will only order the effects within the perk, but not in relation to other perks. So this means getting a sensible value for an entry point function altered by perks (calculate weapon damage, gun spread, etc) is only really possible if all perks in the game use one kind of operation, either addition or multiplication. Since all use multiplications in the vanilla game, one has to be careful when using additions with a mod.Regarding spread, perk spread effects are applied after all game settings' influences on spread, and can modify it beyond the fMinGunSpreadValue setting. That's why Steady sets your spread to dead 0 after all.Player spread is a sway movement of the upper body obviously following some simple math function. A negative spread calculated value inverts this function and the sway pattern. But barring some graphic analysis method, I wouldn't know what that function is.This thing about negative spread also applies to weapon spread. No obvious difference between a negative and positive weapon spread with the same absolute value.There's pretty much no delay in player spread to sway changes when altering your state (from standing to crouching, unaimed to iron sights, walking to running). Particularly when aiming through a scope, spread immediately drops to your current calculated value, allowing easy 'quickscoping'. One mod I know of that aims to correct this is JT's Aim mod.And I think I finally figured out weapon requirements: StrReqPenaltyIf Weapon Required Strength > Player Strength(Weapon Required Strength - Player Strength {max 10}) * fWeapStrengthReqPenalty (0.025)SkillReqPenaltyIf Weapon Required Skill > Player Skill(Weapon Required Skill - Player Skill {max 100}) * 0.1 * fWeapStrengthReqPenalty (0.025) Yep, there must be some kind of error in the code and only fWeapStrengthReqPenalty is used for both strength and skill requirements, yet in the later case it is also divided by a 10 factor to make up. Also the stat penalties seem capped to what would be the max theoretical values of 10 strength and 100 skill.With that, player spread is: PlayerSpread = SkillBonusMult * (UnaimedPenalty + ((WalkingPenalty + RunningPenalty) / Modify Aiming Move Speed entry point multiplier perks if available) + StandingPenalty + ArmConditionPenalty + SkillReqPenalty + StrReqPenalty)if PlayerSpread < fMinGunSpreadValueset PlayerSpread to fMinGunSpreadValueAny suitable Calculate Gun Spread Perks applied afterwardsThe Modify Aiming Move Speed entry point type from perks like Run 'n Gun seems backwards in that it acts as a divisor to movement penalties when defined as a multiplier. Still no idea how it acts when defined as an addition or otherwise. Technical jargon aside, I've managed to make a pretty solid spread and crosshair calculation system based on the work done in Project Nevada, and since requirements were working so wonky I also made a weapon requirement system replacer for melee and firearms to go with it. I think I can provide the spread calculating parts as a master file if people want to use it for their own projects. Link to comment Share on other sites More sharing options...
RoyBatterian Posted October 9, 2016 Share Posted October 9, 2016 If you have a fix for PN, I can stuff it in PN Extra Options. Link to comment Share on other sites More sharing options...
Recommended Posts