From 0ce82f408b9c182cde407fcb0d3c98223c314ea9 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 26 Sep 2020 13:43:13 -0700 Subject: Scale Last Mouse Move by poll rate --- grapher/Models/AccelGUI.cs | 4 ++-- grapher/Models/AccelGUIFactory.cs | 5 ++++- grapher/Models/Mouse/MouseWatcher.cs | 16 ++++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) (limited to 'grapher') diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs index cc86ff7..1fff4c3 100644 --- a/grapher/Models/AccelGUI.cs +++ b/grapher/Models/AccelGUI.cs @@ -19,7 +19,7 @@ namespace grapher SettingsManager settings, ApplyOptions applyOptions, Button writeButton, - Label mouseMoveLabel, + MouseWatcher mouseWatcher, ToolStripMenuItem scaleMenuItem) { AccelForm = accelForm; @@ -32,7 +32,7 @@ namespace grapher Settings.Startup(); RefreshOnRead(); - MouseWatcher = new MouseWatcher(AccelForm, mouseMoveLabel, AccelCharts); + MouseWatcher = mouseWatcher; ScaleMenuItem.Click += new System.EventHandler(OnScaleMenuItemClick); WriteButton.Click += new System.EventHandler(OnWriteButtonClick); diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs index d986369..469fcf7 100644 --- a/grapher/Models/AccelGUIFactory.cs +++ b/grapher/Models/AccelGUIFactory.cs @@ -1,4 +1,5 @@ using grapher.Models.Calculations; +using grapher.Models.Mouse; using grapher.Models.Options; using grapher.Models.Serialized; using System.Windows.Forms; @@ -289,6 +290,8 @@ namespace grapher.Models showLastMouseMoveMenuItem, showVelocityGainToolStripMenuItem); + var mouseWatcher = new MouseWatcher(form, mouseLabel, accelCharts, accelCalculator.PollRate); + return new AccelGUI( form, accelCalculator, @@ -296,7 +299,7 @@ namespace grapher.Models settings, applyOptions, writeButton, - mouseLabel, + mouseWatcher, scaleMenuItem); } diff --git a/grapher/Models/Mouse/MouseWatcher.cs b/grapher/Models/Mouse/MouseWatcher.cs index c6e85c1..6209445 100644 --- a/grapher/Models/Mouse/MouseWatcher.cs +++ b/grapher/Models/Mouse/MouseWatcher.cs @@ -677,11 +677,12 @@ namespace grapher.Models.Mouse #region Constructors - public MouseWatcher(Form containingForm, Label display, AccelCharts accelCharts) + public MouseWatcher(Form containingForm, Label display, AccelCharts accelCharts, Field pollRate) { ContainingForm = containingForm; Display = display; AccelCharts = accelCharts; + PollRateField = pollRate; MouseData = new MouseData(); RAWINPUTDEVICE device = new RAWINPUTDEVICE(); @@ -694,6 +695,7 @@ namespace grapher.Models.Mouse devices[0] = device; RegisterRawInputDevices(devices, 1, Marshal.SizeOf(typeof(RAWINPUTDEVICE))); PollTime = 1; + PollRate = 1000; } #endregion Constructors @@ -706,9 +708,13 @@ namespace grapher.Models.Mouse private AccelCharts AccelCharts { get; } + private Field PollRateField { get; set; } + private MouseData MouseData { get; } - private double PollTime { get; } + private double PollRate { get; set; } + + private double PollTime { get; set; } #endregion Properties @@ -734,6 +740,12 @@ namespace grapher.Models.Mouse outSize = GetRawInputData((IntPtr)message.LParam, RawInputCommand.Input, out rawInput, ref size, Marshal.SizeOf(typeof(RAWINPUTHEADER))); + if (PollRateField.Data != PollRate) + { + PollRate = PollRateField.Data; + PollTime = 1000 / PollRate; + } + if (rawInput.Data.Mouse.LastX != 0 || rawInput.Data.Mouse.LastY != 0) { OnMouseMove(rawInput.Data.Mouse.LastX, rawInput.Data.Mouse.LastY, PollTime); -- cgit v1.2.3 From 80ffeaf6d6cb00106991bb7cc202c957c3e10d34 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 26 Sep 2020 15:13:53 -0700 Subject: Remove logarithm --- grapher/Layouts/LogarithmLayout.cs | 22 ---------------------- grapher/Models/Options/AccelTypeOptions.cs | 1 - grapher/ReadMe/Guide.md | 5 ----- grapher/grapher.csproj | 1 - 4 files changed, 29 deletions(-) delete mode 100644 grapher/Layouts/LogarithmLayout.cs (limited to 'grapher') diff --git a/grapher/Layouts/LogarithmLayout.cs b/grapher/Layouts/LogarithmLayout.cs deleted file mode 100644 index e39dbe7..0000000 --- a/grapher/Layouts/LogarithmLayout.cs +++ /dev/null @@ -1,22 +0,0 @@ -using grapher.Models.Serialized; - -namespace grapher.Layouts -{ - public class LogarithmLayout : LayoutBase - { - public LogarithmLayout () - : base() - { - Name = "Logarithm"; - Index = (int)AccelMode.logarithm; - LogarithmicCharts = false; - - AccelLayout = new OptionLayout(true, Scale); - CapLayout = new OptionLayout(true, Cap); - WeightLayout = new OptionLayout(true, Weight); - OffsetLayout = new OptionLayout(true, Offset); - LimExpLayout = new OptionLayout(false, string.Empty); - MidpointLayout = new OptionLayout(false, string.Empty); - } - } -} diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 9bd42f5..573e9b9 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -19,7 +19,6 @@ namespace grapher new NaturalLayout(), new NaturalGainLayout(), new PowerLayout(), - new LogarithmLayout(), new MotivityLayout(), new OffLayout() }.ToDictionary(k => k.Name); diff --git a/grapher/ReadMe/Guide.md b/grapher/ReadMe/Guide.md index 43619d3..e3fd442 100644 --- a/grapher/ReadMe/Guide.md +++ b/grapher/ReadMe/Guide.md @@ -89,10 +89,5 @@ Natural is a style found in the game Diabotical. It features a concave curve whi This curve looks like an "S" with the top half bigger than the bottom. Mathematically it's a "Sigmoid function on a log-log plot". A user can set the "midpoint" of the S, the "acceleration" (i.e. slantedness) of the S, and the "motivity". "Motivity" sets min and max sensitivity, where the maximum is just "motivity", and the minimum is "1/motivity." (Sensitivity is 1 at the midpoint.) This curve is calculated and stored in a lookup table before applying acceleration, which makes the gain graph look a little funny. This is one author's favorite curve, and an excellent choice for power users and new users who don't mind playing with the settings a little. ![MotivityExample](\images\motivity_example.png) -### Logarithm -Not a big difference between this and power in terms of shape. -![LogarithmExample](\images\logarithm_example.png) - - ## Further Help Further help and frequently asked questions can be found in the FAQ. \ No newline at end of file diff --git a/grapher/grapher.csproj b/grapher/grapher.csproj index 29b5cff..9e9b15b 100644 --- a/grapher/grapher.csproj +++ b/grapher/grapher.csproj @@ -55,7 +55,6 @@ - -- cgit v1.2.3 From 5d2741d95a9f227534998ecc2dfa6fdb8b95494e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 26 Sep 2020 15:42:29 -0700 Subject: Rename accel to scale in power mode --- grapher/Layouts/PowerLayout.cs | 2 +- grapher/ReadMe/Guide.md | 6 +++--- grapher/ReadMe/images/power_example.png | Bin 51251 -> 51672 bytes 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'grapher') diff --git a/grapher/Layouts/PowerLayout.cs b/grapher/Layouts/PowerLayout.cs index 5391506..e12ac4a 100644 --- a/grapher/Layouts/PowerLayout.cs +++ b/grapher/Layouts/PowerLayout.cs @@ -11,7 +11,7 @@ namespace grapher.Layouts Index = (int)AccelMode.power; LogarithmicCharts = false; - AccelLayout = new OptionLayout(true, Acceleration); + AccelLayout = new OptionLayout(true, Scale); CapLayout = new OptionLayout(true, Cap); WeightLayout = new OptionLayout(true, Weight); OffsetLayout = new OptionLayout(true, Offset); diff --git a/grapher/ReadMe/Guide.md b/grapher/ReadMe/Guide.md index e3fd442..5440877 100644 --- a/grapher/ReadMe/Guide.md +++ b/grapher/ReadMe/Guide.md @@ -63,10 +63,10 @@ See "Horizontal and Vertical" in the philosophy section to understand what these The Raw Accel GUI reads the output of the raw input stream, and thus the output of the Raw Accel Driver, and displays on the graphs red points corresponding to the last mouse movements. These calculations are slightly slow but build up a cache, so shaking your mouse around on GUI start should make the points display fast and smoothly. This feature can be turned off in the "Charts" menu. ### Scale by DPI and Poll Rate -This option does not scale your acceleration curve in any way. Rather, it scales the set of points used to graph your curve, and shows you a window of input speed relevant for your chosen DPI and Poll Rate. +This option does not scale your acceleration curve in any way. Rather, it scales the set of points used to graph your curve, and shows you a window of input speed relevant for your chosen DPI and Poll Rate. The poll rate is also used to determine the Last Mouse Move points and therefore should be set for accuracy in that measurement. ## Acceleration Styles -[To be added: pictures of the styles, typical settings] +The examples of various types below show some typical settings, without a cap or offset, for a mouse at 1200 DPI and 1000 hz. ### Linear This is simplest style used by most; it is simply a line rising at a given rate. This is a good choice for new users. @@ -77,7 +77,7 @@ This is the style found in Quake 3, Quake Live, and countless inspired followers ![ClassicExample](\images\classic_example.png) ### Power -This is the style found in CS:GO and Source Engine games. The user can set a rate by which the speed is multplied, and then an exponent to which the product is raised, which is then the final multiplier (no adding to 1.). In the aforementioned games the default m_customaccel_exponent value of 1.05 would be a value of 0.05 in Raw Accel, leading to a concave slowly rising curve. CS:GO and Source Engine games apply acceleration in an fps-dependent manner, so Raw Accel can only simulate acceleration from these games at a given fps. To do so, set rate to 1000/(in-game fps). +This is the style found in CS:GO and Source Engine games (m_customaccel 3). The user can set a rate by which the speed is multplied, and then an exponent to which the product is raised, which is then the final multiplier (no adding to 1.). In the aforementioned games the default m_customaccel_exponent value of 1.05 would be a value of 0.05 in Raw Accel, leading to a concave slowly rising curve. CS:GO and Source Engine games apply acceleration in an fps-dependent manner, so Raw Accel can only simulate acceleration from these games at a given fps. To do so, set scale to 1000/(in-game fps). ![PowerExample](\images\power_example.png) ### Natural & NaturalGain diff --git a/grapher/ReadMe/images/power_example.png b/grapher/ReadMe/images/power_example.png index 0fa1d7e..e17daaa 100644 Binary files a/grapher/ReadMe/images/power_example.png and b/grapher/ReadMe/images/power_example.png differ -- cgit v1.2.3 From ac0d8d4209c71cc9b38b683e123f67bacdad7687 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 26 Sep 2020 15:57:41 -0700 Subject: test touchups --- grapher/ReadMe/FAQ.md | 9 +++++++++ grapher/ReadMe/Guide.md | 2 ++ 2 files changed, 11 insertions(+) (limited to 'grapher') diff --git a/grapher/ReadMe/FAQ.md b/grapher/ReadMe/FAQ.md index d0ce31c..30080e8 100644 --- a/grapher/ReadMe/FAQ.md +++ b/grapher/ReadMe/FAQ.md @@ -14,5 +14,14 @@ See the guide to understand more about the Gain Cap option and other new feature ## Does this driver work with AntiCheat? Yes. That is one of the fundamental goals of this driver. It is fully signed and has a one-second delay on write, so it cannot be used to cheat and should be considered safe by AntiCheat programs. However, we can never guarantee that the humans in control over AntiCheat code make the right decisions. So far it is working in FaceIT, Valorant, and Diabotical matches. +## How do I install the driver, uninstall the driver, or start the GUI? +Instructions for these are in the beginning of the guide. + +## Does the GUI need to be running for Raw Accel to work? +No. Once settings are passed to the driver by the GUI, they stay in use until the computer is shut down. + +## Does the GUI need to be run every time I start my PC? +Yes. The driver itself does not store your settings. To enable them on PC start, run the GUI, or run "writer.exe settings.json". + ## I don't understand something, or have some other question. Read the guide to see if it answers your question. If not, join our [Discord](https://discord.gg/7pQh8zH) and ask. \ No newline at end of file diff --git a/grapher/ReadMe/Guide.md b/grapher/ReadMe/Guide.md index 5440877..b495e65 100644 --- a/grapher/ReadMe/Guide.md +++ b/grapher/ReadMe/Guide.md @@ -5,6 +5,8 @@ Run "installer.exe" in the release directory to install the raw accel driver. Re Run "uninstaller.exe" in the release directory to uninstall the driver. Restart for the uninstallation to take effect. +Run "grapher.exe" when the driver is installed in order to run the Raw Accel GUI. + ## Philosophy The Raw Accel driver and GUI's workings and exposed parameters are based on our understanding of mouse acceleration. Our understanding includes the concepts of "gain", "whole vs by component", and "anisotropy." For clarity, we will outline this understanding here. Those uninterested can skip to Features below. -- cgit v1.2.3 From 3714f31d1fc462fde952be275a9bc53670ace333 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Sat, 26 Sep 2020 16:34:13 -0700 Subject: Guide on last mouse move updated --- grapher/ReadMe/Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grapher') diff --git a/grapher/ReadMe/Guide.md b/grapher/ReadMe/Guide.md index b495e65..ee026de 100644 --- a/grapher/ReadMe/Guide.md +++ b/grapher/ReadMe/Guide.md @@ -62,7 +62,7 @@ Weight is primarily a quick and dirty way to test a new curve. It also can be gi See "Horizontal and Vertical" in the philosophy section to understand what these do. ### Last Mouse Move -The Raw Accel GUI reads the output of the raw input stream, and thus the output of the Raw Accel Driver, and displays on the graphs red points corresponding to the last mouse movements. These calculations are slightly slow but build up a cache, so shaking your mouse around on GUI start should make the points display fast and smoothly. This feature can be turned off in the "Charts" menu. +The Raw Accel GUI reads the output of the raw input stream, and thus the output of the Raw Accel Driver, and displays on the graphs red points corresponding to the last mouse movements. These calulations should be fast and your graph responsive, but it comes at the cost of higher CPU usage due to needing to refresh the graph often. This feature can be turned off in the "Charts" menu. ### Scale by DPI and Poll Rate This option does not scale your acceleration curve in any way. Rather, it scales the set of points used to graph your curve, and shows you a window of input speed relevant for your chosen DPI and Poll Rate. The poll rate is also used to determine the Last Mouse Move points and therefore should be set for accuracy in that measurement. -- cgit v1.2.3