Commit Graph
1 Commits
Author SHA1 Message Date
Wesley Wolfe 8453945106 Remove ABS calls in 13th Age Official
This commit removes calls to ABS in internal attributes in favor
of other built-in functionality: dice calculations.

Calls to ABS suffer from performance issues, with AC/MD/PD calls
taking upwards of 10 seconds. When changing these to use the
built-in dice calculations, there are no noticable performance
issues.

The built-in dice functions are treated as clamp operations,
providing concise min and max operators, and tests, providing
level-range operations.

Min and max operators are used rather directly for calculating
the middle-mod for stats. They are also used to clamp the
escalation die to [0, 6] range.

The max operator is used to form baselines for health
multipliers, with higher health "overflowing" from 0 when the
level matches the next change in step-size.

The level multiplier for stats in damage rolls is calculated
by performing 3 tests, adding together the successes to form
the [1, 3] range of multiplier. A level of at least 1 is assumed
during the calculation, and that test is kept for reading
clarity.
2016-08-28 02:08:31 -05:00