Jump to content

Arena Breakout: Infinite

Hipfire is added, aims coming soon!
Read more...

Project L33T

See the game notes for instructions on how to disable smoothing.
Read more...

Twilight Town: A Cyberpunk FPS

Just added.
Read more...

Contain

See the game notes for instructions on how to disable smoothing.
Read more...

Vomitoreum

Just added.
Read more...

How are counts/360 and pixels/count calculated?


Recommended Posts

I tried to speculate calculations mostly for counts/360, but I could never find out this missing value, I narrowed it to:
counts/360 = unknown variable * eDPI

I think unknown variable might have to do with 360 or yaw? But I'm really not sure. I tried to look around for the calculation for counts/360 but I'm not getting favorable results. Any technical clue? I just want to know exactly what counts/360 means so I know what I'm actually getting

Edited by dontjustdontok
Link to comment

With mouse input we convert a physical distance to a virtual distance. To do this we normalise both to virtual units.

The "count" or "mickey" is a virtual unit defined by the DPI. If you are at 400 DPI, then 1/400th of linear inch movement, sends a "count" of 1 to the PC. 

At the PC side we convert these virtual count units to output distance units. This is either in pixels in 2D, or angles in 3D.

The angles in a game is indeed defined by a "Yaw" value e.g. Source engine by default has 0.022 degrees - this means that 1/400th of an inch (1 count) from our mouse movement turns 0.022 degrees (the base yaw) in the game. These are our normalised input and output virtual distances from your hand motion.

The sensitivity of any function is the ratio between the output and the input, therefore we can say it is a multiplier. Since we already have our normalised values, then we know the sensitivity of "1" is an input of 1/400th of inch on the mouse pad, and an output of 0.022 degrees, so a sensitivity of "0.5" would be an output of 0.011 degrees for the same input distance.

This can always be calculated as outputAngle = yaw * sensitivityFunction() * counts.

Therefore to solve for counts instead, we do counts =  outputAngle / ( yaw * sensitivityFunction() ).

Example; we have a game that has a yaw value of 0.014 degrees, sens of 1.2, and we're at 1600 DPI and want to turn 30 degrees. How many counts do we need to turn to this position?

so we have 30 / ( 0.014 * 1.2 ) = 1785.71.

To convert back to physical hand motion, it's therefore:  1785.71 / 1600 = 1.12 inches on the mouse pad turns 30 degrees in the game.

You have to always use the same units for both outputAngle and yaw value obviously. I use the term "sensitivityFunction()" because the value exposed to the user is not always linear like in Source, so this multiplier would be the return value of whatever formula a game uses to represent this to the player, which is highly variable and completely arbitrary so is one of the main reasons for this site's existence.

Edited by TheNoobPolice
Link to comment
  • Wizard

There are thousands of different ways games do this, which is why each one has to be analyzed and reverse engineered.

It can be as simple as:

  • 100/sens
  • Some factor of pi/sens
  • Or as in CSGO etc where it is 360/(sens*yaw)

Or much more complicated when:

  • 0 or negative numbers are valid
  • Different scaling depending on the sensitivity value
  • FOV affects the sensitivity in different ways
  • The sensitivity is logarithmic or exponential
  • The sensitivity has limits where it stops scaling

Counts/360 is unrelated to DPI though, cm or inch/360 is what you get when you factor in the DPI as well.

 

Link to comment

I suppose there can be many ways to calculate counts/360 but I really should have specified about how Mouse-sensitivity.com calculates counts/360 and later pixel ratio. But I do like the this formula:

outputAngle = yaw * sensitivityFunction() * counts

Say for CS GO, I use 0.944628 sens, 800 DPI, and I assume the yaw for CSGO would be 0.022, thus:

360 = 0.022 * 0.944628 * counts
360 = 0.022 * 0.944628 * counts
360 = 0.020781816 * counts
17322.83646

Which aligns with Mouse-sensitivity.com's calculation of 17322.8365 counts.

But as for pixel ratio (px/count)? Can it be used to calculate px/360? I feel like I'm missing something fundamental.I calculated the px/360 without using pixel ratio with FOV 106.3 and H px 1920. But this is maybe too simple and doesn't really capture what it means to have px/360?

px = (H px / FOV) * 360
px = 18.06208843 * 360
px = 6502.351834

We can adjust it so that we can move 80 degrees, or to get a px/80:

px = (H px / FOV) * 80
px = 18.06208843 * 80
px = 1444.967074

But if we use the pixel ratio of 0.1741 px/count from Mouse-sensitivity.com, for the example calculation for CSGO, 17322.8365 counts/360, to get the px/80:


px = counts/360 * 80 * pixel ratio
px = 17322.8365/360 * 80 * 0.1741
px = 670.2012966

I end up with two different values 1444.967074 and 670.2012966 for the total amount of pixels after turning 80 degrees. I'm missing something... I'm sure I miscalculated or they are correct and refer to different things?

Link to comment

Pixel ratio is calculated by dividing the sens- scaled yaw value (I.e degrees per count) by the amount of degrees in the centre of the screen over 1 pixel’s distance at any given FOV, which can be found as follows:

e.g for Counter Strike at 1920 x 1080 res:

yaw = 0.022 degrees;

sens = 0.5;

horizontal res = 1920 pixels;

horizontal FOV = 106.26 degrees;

Degrees per pixel distance = 2 * atan(tan(hFOV / 2 * pi / 180) / hRes) * 180 / pi = 0.0796 degrees;

Pixel ratio = yaw * sens / degrees per pixel distance = 0.138;

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...