How do i calculate a general solution for when its better to increase the base number or the % increase in this game i am playing

28 Views Asked by At

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

1

There are 1 best solutions below

3
On

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