jaclaz, on 05 June 2012 - 08:10 AM, said:
...I am making quite a few "discoveries" (not in the sense of anything "new", only about something in the "XP ballistics article" and in the way the thingy has been implemented that simply make NO sense - to me at least).
There are a some things that don't make sense in that XP Ballistics article.
If it *had* made reasonable sense, there would be no MarkC Windows 7 fixes! My fixes were a byproduct of the research needed to make sense of the errors in that article, and convince somebody that it was a real problem.
jaclaz said:
The data are (the general idea being that the 1:1 curve is a 100% slope - your .vbs produces on my machine a 102.4% slope for XP/VIsta and a 100% for Windows 7:
(they look VERY unlike the ones you posted till now

)
Quote
;Windows7 Test Settings @96 dpi Win2K None
I confirm that is a 1:1 curve.
But there is a twist.
Inside Windows it does the calculations with 48.16 fixed point numbers (48 bits to the left of the binary point, 16 bits to the right).
As the calculations are done, remainders occur and are discarded (because the result has bits past the last 16th binary digit).
Often these discarded remainders have no effect, EXCEPT when you reverse the mouse left<->right or up<->down, and there will be a one pixel error appear (MouseMovementRecorder will show a pointer movement 1 different from the mouse movement).
If:
- Smooth_X is the delta SmoothX value of the segment (SmoothMouseXCurve[i] - SmoothMouseXCurve[i-1])
(1.0 = 0x10000 = 65536)
- Smooth_Y is the delta SmoothY value of the segment (SmoothMouseYCurve[i] - SmoothMouseYCurve[i-1])
- DPI is 96 (or whatever)
- MouseSensitivity is "MouseSensitivity" from the registry
- MouseSensitivityFactor is =INT(MouseSensitivity*65536/10) (65536 for the 6/11, "10" position)
Then the final sensitivity (Windows 7) is:
Scaling=INT(INT(INT(Smooth_Y*INT(DPI*65536/150)/65536)*MouseSensitivityFactor/65536)*65536/(Smooth_X*3.5))/65536
Often (but not always) the value of delta SmoothX that gives a desired target scaling is:
Smooth_X = INT(INT(INT(Smooth_Y*INT(DPI*65536/150)/65536)*MouseSensitivityFactor/65536)/(Target_Scaling*3.5))
For the 1st segment of your 1:1 curve, Scaling = 65535/65536, ~0.99998, not quite 1:1
If you decrease your SmoothX from 10000 down by 1 to FFFF, then the scaling comes out at an exact 65536/65536.
(Or increase Smooth_Y a bit.)
Quote
;Windows7 Test Settings @96 dpi Win2K Low
Yes, 1:1, stepping up to 2:1!
But stepping up at what mouse speed?
You can test your curves on Windows XP or Vista. There will be the 2.4% difference you note (@60Hz monitor refresh rate), but that's close enough to get a general feel. Running MouseMovementRecorder.exe while testing will show the exact mouse speed threshholds a curve has.
If you try your Win2K Low curve, you should see it bumps up to 2:1 at 25 (rather than 7).
? The SmoothMouse?Curve values are nominally inches/second, NOT mouse counts/polling interval or pixels/whatever.
I'm guessing MS used Mouse CPI=450 (didn't a popular MS mouse have 450 CPI?) and polling interval 125Hz, to give a conversion factor of 450/125=3.6, rounded to 3.5:
To convert a SmoothMouseXCurve value to a mouse count ("mickey"), multiply or divide by 3.5.
The SmoothMouseXCurve corresponding to 7 is 7/3.5 = 2.0
Despite what any MS technet doc might say, the Win2K thresholds apply when the mouse moves strictly GREATER THAN the threshold.
So if MouseThreshold1 = 7, a 7 mouse movement will still be 1:1. 8 and higher will be 2:1
So you should add 1 to any Win2K threshold (add at least one...)
Windows XP/Vista/7 sort-of use the magnitude of the movement vector as the input to the curve lookup.
The calculation is:
Magnitude = Max(Abs(X),Abs(Y)) + Min(Abs(X),Abs(Y)) / 2
For example, a mouse movement of x=7, Y=3, counts as 7+3/2 = 8.5
In Win2K, a movement of x=7, Y=3 has each axis treated separately, so in the X axis, 7<=MouseThreshold1 and so still 1:1, and 3<=MouseThreshold1 so still 1:1.
x=8, y=3 would be treated as 8>MouseThreshold1, so 2:1 in the X axis but 3<=MouseThreshold1, so still 1:1 in the Y axis.
When building a Windows 7 curve, if the mouse moved X=7, Y=3, we might want to treat that as 1:1, because Win2K would treat that as 1:1 (in both axes).
But with Windows XP/Vista/7 magnitude calculation gives 8.5, and 8.5>7, so we apply accel based on the next curve segment.
To prevent that, I set the 1st segment SmoothX to ~8.75/3.5 (=2.5), so that 7,3 is 1:1 but 7,4 or 8,2 is 2:1
8.75 is a compromise setting.
Given these curves will be used by gamers, and much movement is left/right (?) rather than up/down, maybe 7.75 might be a better compromise.
7,0 and 7,1 would then be 1:1 (same as Win2K), but 8,0 would be 2:1...
Internally, Windows processes the raw curves. It calculates : (SmoothY[i]-SmoothY[i-1]) / (SmoothX[i]-SmoothX[i-1])
Because your SmoothX[1] and SmoothX[2] values are the same (7), that would be a divide by zero!
Windows checks for the potential divide by zero and instead stores 0 for both the re-calculated Y and X values.
There are 2 ways to handle the step up from 1:1 to 2:1:
- Use a very narrow segment, say SmoothX[1] = 7/3.5 and SmoothX[2] = 7.1/3.5 (to avoid the divide by zero)
- Just set both SmoothX[2] and SmoothY[2] to zero!
The first method has a short segment with a very steep slope, which can cause some strange behaviour...
The second relies on the inner workings of the curve lookup, and works better! It's a trick that works because of how the curve lookup works.
Quote
;Windows7 Test Settings @96 dpi Win2K Medium
Curve segment 1 starts out at 2:1, but it needs to start at 1:1
At 12 (actually 12*3.5, see above about dividing by 3.5) it steps to 4:1
To exactly match the 1:1, 2:1, 4:1 Win2K "curve", we really need 5 segments:
1) 1:1
2) A narrow, steep segment to step-up to 2:1 (or the zero trick)
3) 2:1
4) A narrow, steep segment to step-up to 4:1 (or the zero trick)
5) 4:1
Unfortunately, the SmoothMouse curves only have 4 segments (5 points, but 4 segments between the points).
What I did in the Threshold1=2, Threshold1=5 example curve was this:
1) 1:1
2) A wider segment to get between 1:1 and 2:1 (a slope, not a step)
3) A wider segment to get between 2:1 and 4:1 (a slope, not a step)
4) 4:1
This assumes that the user cares more about consistent 4:1 at high speeds, and can live with a variable curve between 2 and 5.
If they really need the consistent 2:1, then the slope from 2:1 to 4:1 will have to be variable...
Quote
;Windows7 Test Settings @96 dpi Win2K High
Similar comments as for Win2K Medium.
jaclaz said:
If you are "around", I would like (in a couple of days) send you the draft of the new worksheet for your review (and check).
I'll look forward to it.
jaclaz said:
If I may, both your .vbs and the data you posted is "beautified" by a [TAB] that prevents directly copy/paste in an Excel spreadsheet, it seems to me that even without it, the data is not "that much ugly" and it could be removed.
meh.
jaclaz said:
Besides, it would be nice if you could have the .vbs add a "comment" string, like I do in the spreadsheet, so that you "keep" the file name even when you copy and paste just the data in it.
That's a good idea.
When I next update my VBS tool I'll make that change (which likely won't be for a while, unless I decide to put a Win2K curve builder into the mix).
jaclaz said:
I don't understand the way you build your new "Win2K - like" curves

, I added the plot of your posted "Windows7_MouseFix_TextSize(DPI)=100%_Scale=1-to-1(2-to-1@9)_@6-of-11" to the attached spreadsheet, it seems to me like a zig-zag, can you spend a couple lines to explain the reasoning behind it?
- Segment 1 goes from 0 to SmoothX = 2.5, corresponding to Mouse=2.5x3.5 = 8.75 (8.75 explained above as a compromise so that x=7,y=3 would still be 1:1)
- Segment 2 goes from SmoothX = 2.5 to 0, and is ignored by the Windows lookup (this is trick to avoid a short steep segment that can cause problems)
- Segment 3 goes from 0 to SmoothX = 5, corresponding to Mouse=5x3.5 = 17.5, BUT the exact number doesn't matter for the last valid segment, because Windows extrapolates the last valid segment forward. All that matters is the slope of the last segment. So it could be DeltaY=35, DeltaX=17.5 (as it is), giving 2:1 (DeltaY=35 after x96/150 factor applied), or could be DeltaY=2000, DeltaX=1000.
- Segment 4 is ignored because of the zeros (I think...!

)
The fact that the last segment is extrapolated forward is a good reason NOT to display or plot the last point on any graphs: It is only the slope (direction) of the last segment that matters, not where it "ends" (it doesn't end, it is extrapolated forward).
With the curve lookup trick, and the extrapolation, my Win2K Low curve looks like this:
Windows7_MouseFix_TextSize(DPI)=100%_Scale=1-to-1(2-to-1@9)_@6-of-11.png (20.41K)
Number of downloads: 10
This post has been edited by MarktheC: 07 June 2012 - 06:00 AM