XIM Community

Smoother Boost Formula  (Read 880 times)

Offline kodek64

  • MVP
  • *
  • Posts: 502
    • View Profile
Smoother Boost Formula
« on: 11:39 PM - 03/13/11 »
Hey OBsIV,

I spent a few hours thinking about the boost graph and a way to smooth it out, and I came up with smooth, continuous piecewise function that should have the same effect as the graph you made, but without a sudden jump when out of boost mode.

Assuming the old (latest released firmware) version of the boost curve is modeled by y=mx+b, where b is the boost, the formula I came up with is:

Code: [Select]
(x (2 b P+m P^2-b x))/P^2
Domain: 0<=x<=P

where b is the same boost and P is a value you should play with to find how quickly you want the boost to be applied (similar to how you said you were playing with the slope of the newer boost graph).

If you have mathematica, here is a command to let you play with it and see what it looks like:

Manipulate[ Plot[{Piecewise[{{(x (2 b P + m P^2 - b x))/P^2, x < P}, {m*x + b,
      x > P}}], x, 1000*m + b, 0}, {x, 0, 1000},
  PlotRange -> {0, 1000*m + b}], {P, 0, 1000,
  Appearance -> "Labeled"}, {m, 1, 3, Appearance -> "Labeled"}, {b, 0,
   1000, Appearance -> "Labeled"}]

I really hope it can be of use and that it's not too CPU intensive to calculate. Let me know if you find this of any help.

Thank you!

KodeK
XIM Sensitivity Calculator!
http://xim3-app.heroku.com/

Offline roads

  • MVP
  • *
  • Posts: 19727
    • View Profile
Re: Smoother Boost Formula
« Reply #1 on: 11:52 PM - 03/13/11 »
Makes sense, can you please also make a graph with the acceleration knob turned on to lets say 0.50? I wonder how that affects the boost part.
Crusade atm: none

Offline OBsIV

  • Administrator
  • MVP
  • *
  • Posts: 36450
  • It's obsessive.
    • View Profile
    • OBsIV's Blog
Re: Smoother Boost Formula
« Reply #2 on: 12:11 AM - 03/14/11 »
Thanks for looking at this -- I appreciate it. :) Unfortunately, this is going to be a little too CPU intensive.
Get the most out of your XIM APEX, read the XIM APEX Support FAQ.

Offline kodek64

  • MVP
  • *
  • Posts: 502
    • View Profile
Re: Smoother Boost Formula
« Reply #3 on: 12:31 AM - 03/14/11 »
Thanks for looking at this -- I appreciate it. :) Unfortunately, this is going to be a little too CPU intensive.

I was afraid it would be. One thing, though, is that most of the terms are actually constants. Since it's just a parabola, it can be reduced to its standard Ax^2 + Bx + C form (m x + (2 b x)/P - (b x^2)/P^2). What if the coefficients are precalculated after the user makes any changes? It would simplify the real-time calculations quite a bit. Also, when x>P, the more complex code wouldn't even be running. Would this still be too much for our poor XIMs?

I also thought about using approximations, but that would defeat the entire purpose of the idea :P
XIM Sensitivity Calculator!
http://xim3-app.heroku.com/

Offline kodek64

  • MVP
  • *
  • Posts: 502
    • View Profile
Re: Smoother Boost Formula
« Reply #4 on: 01:09 AM - 03/14/11 »
Makes sense, can you please also make a graph with the acceleration knob turned on to lets say 0.50? I wonder how that affects the boost part.

I don't know how the acceleration curve is implemented so I can't give you an exact answer, but it would look something like this:
XIM Sensitivity Calculator!
http://xim3-app.heroku.com/

Offline roads

  • MVP
  • *
  • Posts: 19727
    • View Profile
Re: Smoother Boost Formula
« Reply #5 on: 03:13 AM - 03/14/11 »
K thanks there would be a freaky deceleration between the accel and the end of the boost. Will e interesting to test.
Crusade atm: none

Offline kodek64

  • MVP
  • *
  • Posts: 502
    • View Profile
Re: Smoother Boost Formula
« Reply #6 on: 03:15 AM - 03/14/11 »
K thanks there would be a freaky deceleration between the accel and the end of the boost. Will e interesting to test.

The same as if the boost were a straight line. That's all my design changes, really.


Edit: Also, my acceleration curve is not the same as the one used by the XIM. I picked random values for mine. I'm sure it's more pronounced than that.
XIM Sensitivity Calculator!
http://xim3-app.heroku.com/