Skip to content

Training Algorithm

totemo edited this page Jan 25, 2018 · 4 revisions

The effort, E, that must be expended to train an ability to an integer level, L, is:

E = K * (B ^ (L - 1) - 1)

Where:

  • K = effort scale factor
  • B = effort exponential base

Note that the effort to increment the level increases exponentially as the level increases. However, as discussed below, the ability increases as a linear function of the level. So, training gives diminishing returns as the level increases.

The effort scale factor is chosen arbitrarily. The effort base can be computed by substituting in the effort scale, K, the maximum effort, E_max, and the corresponding maximum level, L_max:

B = (1 + E_max / K) ^ (1 / (L_max - 1))

where the maximum level and corresponding maximum effort are carefully selected.

The current level can be expressed as a function L(E) of the effort expended in training, E, as:

L(E) = min(L_max, floor(1 + ln(1 + E / K) / ln(B)))

All of these equations were in fact derived from the initial starting concept:

L = 1 + log_B(1 + E / K)

where log_B signifies "logarithm to the base B". The logarithm of 1 is 0, so log_B(1 + E/K) will always be defined and greater than 0, increasing in proportion to effort scaled by K. The lowest level is 1, hence the leading "1 +" term.

Note that the current level may be presented to the user as an integer, though the training effort leads to a notional real number for the level. Also the level cannot be trained past the maximum, though admins can create horses with ability levels above the maximum.

Attributes such as speed, health (hearts) and jump strength are linearly interpolated according to the level, from 1 to the maximum level, and quantised to the value corresponding to L(E), recalling that L(E) is always rounded down to an integer.

Clone this wiki locally