summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-09-26 20:07:06 -0400
committerGitHub <[email protected]>2020-09-26 20:07:06 -0400
commit02de2ce503fad0b501893d040405922b23814dc9 (patch)
tree14cf982742ce4fc52c742b0befd8b256aa0dce94
parentMerge pull request #24 from JacobPalecki/GUI (diff)
parentHide minimum time attribute (diff)
downloadrawaccel-02de2ce503fad0b501893d040405922b23814dc9.tar.xz
rawaccel-02de2ce503fad0b501893d040405922b23814dc9.zip
Merge pull request #25 from JacobPalecki/GUI
Small fixes and touchups
-rw-r--r--common/accel-logarithm.hpp32
-rw-r--r--common/common.vcxitems1
-rw-r--r--common/rawaccel-settings.h2
-rw-r--r--common/rawaccel.hpp3
-rw-r--r--grapher/Layouts/LogarithmLayout.cs22
-rw-r--r--grapher/Layouts/PowerLayout.cs2
-rw-r--r--grapher/Models/AccelGUI.cs4
-rw-r--r--grapher/Models/AccelGUIFactory.cs5
-rw-r--r--grapher/Models/Mouse/MouseWatcher.cs16
-rw-r--r--grapher/Models/Options/AccelTypeOptions.cs1
-rw-r--r--grapher/ReadMe/FAQ.md9
-rw-r--r--grapher/ReadMe/Guide.md15
-rw-r--r--grapher/ReadMe/images/power_example.pngbin51251 -> 51672 bytes
-rw-r--r--grapher/grapher.csproj1
-rw-r--r--wrapper/wrapper.cpp3
15 files changed, 39 insertions, 77 deletions
diff --git a/common/accel-logarithm.hpp b/common/accel-logarithm.hpp
deleted file mode 100644
index 044d23c..0000000
--- a/common/accel-logarithm.hpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#pragma once
-
-#include <math.h>
-
-#include "accel-base.hpp"
-
-namespace rawaccel {
-
- /// <summary> Struct to hold sigmoid (s-shaped) gain implementation. </summary>
- struct logarithm_impl {
- double rate;
- double offset;
- double additive_const;
-
- logarithm_impl (const accel_args& args) :
- rate(args.rate), offset (args.offset) {
- additive_const = offset * rate;
- }
-
- inline double operator()(double speed) const {
- double scaled_speed = rate * speed + 1;
- double base_speed = speed + offset;
-
- return (scaled_speed * log(scaled_speed) + additive_const ) / ( rate * base_speed) - 1;
- }
-
- inline double legacy_offset(double speed) const { return operator()(speed); }
- };
-
- using accel_logarithm = additive_accel<logarithm_impl>;
-
-}
diff --git a/common/common.vcxitems b/common/common.vcxitems
index 3407cf2..f8cbf28 100644
--- a/common/common.vcxitems
+++ b/common/common.vcxitems
@@ -19,7 +19,6 @@
<ClInclude Include="$(MSBuildThisFileDirectory)accel-experimentone.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-motivity.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-linear.hpp" />
- <ClInclude Include="$(MSBuildThisFileDirectory)accel-logarithm.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-natural.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-naturalgain.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-noaccel.hpp" />
diff --git a/common/rawaccel-settings.h b/common/rawaccel-settings.h
index 93f4768..1a513ac 100644
--- a/common/rawaccel-settings.h
+++ b/common/rawaccel-settings.h
@@ -9,7 +9,7 @@ namespace rawaccel {
inline constexpr milliseconds WRITE_DELAY = 1000;
enum class accel_mode {
- linear, classic, natural, naturalgain, power, logarithm, motivity, noaccel
+ linear, classic, natural, naturalgain, power, motivity, noaccel
};
struct settings {
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp
index 2e627c9..14db883 100644
--- a/common/rawaccel.hpp
+++ b/common/rawaccel.hpp
@@ -8,7 +8,6 @@
#include "accel-linear.hpp"
#include "accel-classic.hpp"
-#include "accel-logarithm.hpp"
#include "accel-natural.hpp"
#include "accel-naturalgain.hpp"
#include "accel-power.hpp"
@@ -84,7 +83,6 @@ namespace rawaccel {
case accel_mode::natural: return vis(var.u.natural);
case accel_mode::naturalgain: return vis(var.u.naturalgain);
case accel_mode::power: return vis(var.u.power);
- case accel_mode::logarithm: return vis(var.u.logarithm);
case accel_mode::motivity: return vis(var.u.motivity);
default: return vis(var.u.noaccel);
}
@@ -101,7 +99,6 @@ namespace rawaccel {
accel_natural natural;
accel_naturalgain naturalgain;
accel_power power;
- accel_logarithm logarithm;
accel_motivity motivity;
accel_noaccel noaccel = {};
} u = {};
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/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/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);
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/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 43619d3..ee026de 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.
@@ -60,13 +62,13 @@ 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.
+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 +79,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
@@ -89,10 +91,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/ReadMe/images/power_example.png b/grapher/ReadMe/images/power_example.png
index 0fa1d7e..e17daaa 100644
--- a/grapher/ReadMe/images/power_example.png
+++ b/grapher/ReadMe/images/power_example.png
Binary files differ
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 @@
<ItemGroup>
<Compile Include="Constants\Constants.cs" />
<Compile Include="Layouts\MotivityLayout.cs" />
- <Compile Include="Layouts\LogarithmLayout.cs" />
<Compile Include="Layouts\NaturalGainLayout.cs" />
<Compile Include="Models\AccelGUIFactory.cs" />
<Compile Include="Models\Calculations\AccelCalculator.cs" />
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp
index 9a53189..3307b8d 100644
--- a/wrapper/wrapper.cpp
+++ b/wrapper/wrapper.cpp
@@ -11,7 +11,7 @@ using namespace System::Runtime::InteropServices;
public enum class AccelMode
{
- linear, classic, natural, naturalgain, power, logarithm, motivity, noaccel
+ linear, classic, natural, naturalgain, power, motivity, noaccel
};
[StructLayout(LayoutKind::Sequential)]
@@ -49,6 +49,7 @@ public ref struct DriverSettings
Vec2<AccelMode> modes;
Vec2<AccelArgs> args;
Vec2<double> sensitivity;
+ [NonSerialized]
double minimumTime;
};