2010-10-17, 03:10 PM
Umm Fiel, the reason why those values are off is because pddRounded is rounded, if you get rid of the flooring and +0.5 in that line, I bet your table will be as expected. As to your hypothesis of breakpoint and why it's true, here's your proof:
y = c - x (flat base)
y = (1 - sqrt(x)/100) x c (percentage)
Equate both equations and solve for x
c - x = (1 - sqrt(x)/100) x c
1 - x/c = 1 - sqrt(x)/100
x/c = sqrt(x)/100
Square both sides,
x^2/c = x/10000
x = c/10000, and there's your break-even point.
And for your calculator, you can't use this shortcut because the % curve is not continuous, discrete rather since % reduction is floored. Meaning you should just stick with your code and just add in floor in (100 - floor(sqrt(pddrounded)) * mob attack * 0.01). But you can still use the approximation, which I've been using if your brain works fast, very convenient. And by the way, it's % * 100, not % * 1000 as you said in your first post.
y = c - x (flat base)
y = (1 - sqrt(x)/100) x c (percentage)
Equate both equations and solve for x
c - x = (1 - sqrt(x)/100) x c
1 - x/c = 1 - sqrt(x)/100
x/c = sqrt(x)/100
Square both sides,
x^2/c = x/10000
x = c/10000, and there's your break-even point.
And for your calculator, you can't use this shortcut because the % curve is not continuous, discrete rather since % reduction is floored. Meaning you should just stick with your code and just add in floor in (100 - floor(sqrt(pddrounded)) * mob attack * 0.01). But you can still use the approximation, which I've been using if your brain works fast, very convenient. And by the way, it's % * 100, not % * 1000 as you said in your first post.

