0

So essentialy i have a base number which starts at 1 and a percent multiplier that increases this base number. And i can spend 1 skill point to increase either the base number by 1 or the percent multipler by 5%.

So as a example if i have 100 avaliable skill points and i put 50 points into the base number and 50 points in the multiplier i get:

51x(1+(50*0.05)) = 178.5

And if i put 40 points into the base number and 60 into the multipler i get 183 which is obviusly better.

Now my question is how do i get a general formula from this so that

s = avaliable skill points
bi = starting number 
i = increase added to bi per skill point spend
bm = base multiplier
b = increase added to bm per skill point spend

And as a result i get the highest possible combination

Vajura
  • 133

1 Answers1

0

So let the amount of skillpoints that you put into the base stat be $x$. Then because we have $s$ available skill points, the amount of skill points that you put into the percentage multiplier will be $s-x$. So now we have:

$$\text{Stat} = (b_i + x*i) * (b_m + (s-x)*b)$$ $$ = b_i*b_m+s*b*b_i-x*b*b_i+b_m*x*i+s*b*x*i-b*i*x^2$$

We want to find how the stat changes with respect to $x$. So what we want to do is find the derivative of the function with respect to $x$ and set it to zero to find the maximum and minimum points. After we do that, we have the equation:

$$-bb_i+b_mi+sbi-2bix=0$$ or $$x = \frac{-bb_i+b_mi+sbi}{2bi}$$

*Naming convention is a bit weird

QCD_IS_GOOD
  • 2,318
  • 1
  • 16
  • 35
  • I was under the impression that the skill points can only be used as integers -- I think that aspect needs to be addressed. – joriki May 19 '16 at 12:56
  • @joriki Would comparing the situation where we round $x$ down to where we round $x$ up solve the integer problem? (just pick the one which gives the better stat?) – QCD_IS_GOOD May 19 '16 at 12:58
  • Yes, since the function is unimodal (in particular, quadratic), that works. – joriki May 19 '16 at 13:07