Sunday, March 31, 2013

Level Editing Formula

This is how I create the formula where only minimum and maximum variables are given, especially during balancing phase.


Here is the scenario:
Level 1 requires 60 exp
Level 30 requires 9000 exp

To create a formula, we assume:
x = Level
e = exp
Since it start with Level 1, so we could assume that Level 1 is the base, hence, formula A:
exp = (x - 1) * A + 60
Now, at Level 30 requires 9000 exp, hence:
exp = 9000
then we replace exp with formula A, hence:
(x - 1) * A + 60 = 9000
because we are at Level 30, so, x = 30
(30 - 1) * A + 60 = 9000
29 * A + 60 = 9000
29 * A = 9000 - 60
29 * A = 8940
A = 8940 / 29
Now, we can also conclude formula B:
A = (max exp - min exp) / (max level - min level)

Given that:
exp = (x - 1) * A + 60
So, the algorithm
exp = (x - 1) * (max_exp - min_exp) / (max_level - min_level) + min_exp
Constant variables (controlled) : max_exp, min_exp, max_level, min_level
Input variable (independent) : x
Result variable (dependent) : exp

No comments:

Post a Comment