STEAM GROUP
Payday 2 Mechanics PD2mech
STEAM GROUP
Payday 2 Mechanics PD2mech
12
IN-GAME
74
ONLINE
Founded
27 September, 2015
Showing 1-2 of 2 entries
5
ADS Sensitivity Equation Is Wrong
Preface that yours is technically correct, but only for a 360 degree rotation. But you'll never do this while ADS so it's sort of moot. Granted it's much better than vanilla.

Your equation for sensitivity is off by up to ~19%, deviation increasing with FOV and smaller mouse movements. Using your example of 1.4 FOV multiplier and 65 hipfire and 45 ADS, you suggest that ADS sensitivity should be 59% of hipfire sensitivity. Using a correct FOV equation, it should be 50%.

http://i.imgur.com/Eci1gIY.png is basically your equation.

http://i.imgur.com/U5IOyia.png is the correct equation. Note that 3/4 is used because overkill made FOV in terms of a 4:3 aspect ratio.

In place of x approaching 0, you could just put a small number. 1 is 11.8% off, 0.1 is 0.15% off, and 0.01 is 0.0015% off.

I wish I knew my way around lua enough to give you the correct code, but yeah.

Edit: this maybe? I used 0.1 since idk how small I can make it before having to worry about loss of precision.

local fovMul = managers.user:get_setting( "fov_multiplier" ) sens = sens * ( math.atan ( 0.1 * math.tan ( math.atan ( math.tan ( ( currentState._equipped_unit:base():zoom() or 65 ) * ( fovMul+1 ) / 4) * (3 / 4) ) ) ) / math.atan ( 0.1 * math.tan ( math.atan ( math.tan ( 65*fovMul / 2 ) * ( 3 / 4 ) ) ) ) )

Edit: Way more optimized version:

local fovMul = managers.user:get_setting( "fov_multiplier" ) sens = sens * math.tan(math.rad((currentState._equipped_unit:base():zoom() or 65) * (fovMul+1) / 4)) / math.tan(math.rad(65 * fovMul / 2))

Simplified equation is simply tan(adsFOV/2)/tan(hipfireFOV/2)

Edit: forgot lua uses radians and not degrees, fixed the optmized version.
Showing 1-2 of 2 entries