We now have a new hypothesis to test. How well does our porposed algorithm fit the data. As a quick reminder – we settled in part 4 on the likely algorithm of
T = 250 – 72 x log10 (CP)
We can compare the calculated to the observed values. Unfortunately we see a clear bias in the calculated values.
CP | Decay | Stdev | Hours | Hours calc | Diff (in seconds) |
2744 | 10.000 | 0.003 | 8.00 | 2.44 | na |
2355 | 10.005 | 0.003 | 8.00 | 7.22 | na |
2320 | 9.999 | 0.023 | 8.00 | 7.68 | 1136 |
2310 | 9.785 | 0.013 | 8.18 | 7.82 | 1282 |
2303 | 9.675 | 0.011 | 8.27 | 7.91 | 1275 |
2143 | 7.606 | 0.008 | 10.52 | 10.17 | 1266 |
2029 | 6.547 | 0.003 | 12.22 | 11.88 | 1237 |
1913 | 5.684 | 0.003 | 14.07 | 13.72 | 1287 |
1827 | 5.168 | 0.003 | 15.48 | 15.15 | 1170 |
1454 | 3.533 | 0.004 | 22.65 | 22.30 | 1263 |
1095 | 2.543 | 0.004 | 31.46 | 31.16 | 1080 |
1019 | 2.355 | 0.014 | 33.96 | 33.41 | 1988 |
971 | 2.270 | 0.004 | 35.24 | 34.92 | 1148 |
969 | 2.269 | 0.003 | 35.26 | 34.98 | 976 |
942 | 2.202 | 0.028 | 36.32 | 35.87 | 1636 |
731 | 1.811 | 0.003 | 44.17 | 43.80 | 1325 |
657 | 1.684 | 0.003 | 47.50 | 47.14 | 1299 |
500 | 1.438 | 0.013 | 55.62 | 55.67 | -201 |
359 | 1.198 | 0.012 | 66.78 | 66.03 | 2690 |
300 | 1.110 | 0.001 | 72.07 | 71.65 | 1522 |
100 | 1.127 | 0.041 | 70.98 | 106.00 | na |
95 | 1.179 | 0.051 | 67.86 | 107.60 | na |
10 | 1.111 | na | 72.00 | 178.00 | na |
On average all predicted times are too small. Taking the average off only the best data (stdev < 0.05) we get a positive bias of 1231 seconds. We can easily correct this in the function by rounding it to 1200 seconds and using 250 1/3 hours. This is also closer to the actual best fit.
Personally I opted to use 1269 seconds instead to get a value of 250.35 hours. So why do I think the final value is 250.35 hours?
Remember the Farfetched from Part 5. I had selected the Farfetched because of the CP it represented – and because I like rounding to close numbers. Mathematically I should have taken the closest CP to 296.6.
Using 72 and 250 I calculate 71.647 hours as expected values for the time it takes for the motivation to decay to the minimal value. But this misses the point from the game developer. What if the programmer was asked to keep it flat until 300 CP and from there onward motivation decays more rapidly.
As game developer I face the following function
72 = k – 72 x log10 (300)
Solving this equation for k results in 250.35273 – with 0.35273 hours being 1269 seconds.
I therefore propose that the final answer to the motivation decay is
T(max) = 250.35 hours – 72 hours x log10 (CP)
Below 300 CP T(max) is fixed to 72 hours. Above 2320 CP t(max) is fixed to 8 hours. We can now use this information to calculate the hourly decay as 80 / T(max)
CP range | Hourly decay in % |
10-300 | 1.11% (or more precice 80/72 %) |
300-2322 | 80 / ( 250.35 hours – 72 hours x log10 (CP) ) |
2323+ | 10% |
In case you don’t see my reply on reddit, you can rework the formula to eliminate the 250.35[…] constant:
cp_decay(cp) = 1/((72/0.80) * (log10(300 / cp) + 1))
Where 72 hours is the max decay time. 0.80 is the max decay amount. 300 is the CP floor.
I actually saw the reply on reddit first – as well as your png with the curve you produced. I hope you are ok that I use your plot in my next article. Actually my very first successful fitting attempt was: T(max) = -1.3044 ln(x) + 10.44. This is days not hours. I played around with days/hours/seconds at that stage as I assumed we are looking for some round numbers but don’t know what the programmers use as time scale. I realised this is the same as 3 log10(x) + 10.44 but 10.44 seemed so close to 250 that I used 72 hours and 250 instead of 3 days and 10.44 days.
Maybe time to revisit and play around with different values – we could even try milli-seconds as I think this is the accuracy they use.
Comments are closed.