From 8453945106fc396fde964763d10799e16cc478ba Mon Sep 17 00:00:00 2001 From: Wesley Wolfe Date: Sat, 27 Aug 2016 22:41:01 -0500 Subject: [PATCH] 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. --- 13th Age Official/13th_Age_Official.html | 26 ++++++++---------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/13th Age Official/13th_Age_Official.html b/13th Age Official/13th_Age_Official.html index 0cb7193906..0c348dfa32 100644 --- a/13th Age Official/13th_Age_Official.html +++ b/13th Age Official/13th_Age_Official.html @@ -705,23 +705,15 @@ - - - - - - - - - - - - - - - - - + + + + + + + + +