Whisperrr / SensitivityRandomizer

Randomize mouse sensitivity over time.
82 stars 8 forks source link

Uneven randomization #5

Open xchiptune opened 3 years ago

xchiptune commented 3 years ago

Seems like the app is simply randomizing within the range it was set at and it and doesn't actually take into consideration the base multiplier. If you choose your limits to be 1/3 to 3x with a base of 1, you get a lot more sensitivities above your base than bellow (see image). I believe the purpose of the base sensitivity is for that you get roughly a even distribution of sensitivities above and bellow that base? Seems this isn't just a case of bad RNG, no matter how many times I regenerate the curve it's always ~80% above the base.

Don't want to sound pretentious, I'm no programmer. But I'm guessing it's because it's more likely for a random number between 0.33 and 3 to land between 1 and 3 rather than 0.33 and 1. Considering this is a multiplier it would probably be best to randomize on a logarithmic scale. That way the odds of a number landing between 0.33 and 1 would be equal to landing between 1 and 3. (log(1/3) = -0.477, log(3) = 0.477, randomize between -0.477 and 0.477 for x, then 10^x = your random multiplier)

Whisperrr commented 3 years ago

Hey! This is definitely an issue I've been messing around with for a bit. As of now, I use a log-normal distribution to generate values prior to smoothing. As you've noticed, for some reason that doesn't entirely work. I'm not too sure why at the moment (since I figured it would effectively do the same thing you're talking about), so kinda just left that as an open problem...

Would definitely be interested to hear your opinion on it :)

But that might be the way to go, and I'll test it out when I have time!