Board Thread:The Quarters - Q & A/@comment-204.94.39.142-20140519140025

I've noticed, when I accidentally marked a To-Do complete that I wasn't intending to, that the amount of gold and XP subtracted was different from the amount awarded when I marked the To-Do complete in the first place. I just ran a quick test to confirm this - I created a To-Do titled "test", marked it complete, unmarked it, marked it, unmarked it. Each time the amount was different, and the end result was a net gain of 0.03 gold. (Better than a net loss, but still...)

I think it's because the reward/penalty for To-Dos is calculated based on a combined statistic for all of your To-Do's, so when you mark one complete your To-Do's stat rises by a little bit, and unmarking it makes your stat fall, but something with the sequence of this stat change and calculation of the amount of gold/XP means a different result for the two interactions. Here's a simple math theory of what I think is happening, without having looked at the code I'm using over-simplified and made up numbers:

1st possibility:

to do stat: 100

mark to-do complete - to do stat becomes 101, get reward based on f(101)

mark to-do incomplete - to do stat becomes 100, subtract reward based on f(100)

2nd possibility:

mark to-do complete - get reward based on n(1.01)

mark to-do incomplete - subtract reward based on n(0.99)  (but should be based on n(1/1.01=0.9900990099...) )

So the first possibility is that the order of changing the stat and calculating the reward amount happen in the wrong sequence when unmarking a to-do. The second possibility is based on the fact that when you take a number, increase it by 10%, then reduce the result by 10%, you don't get the original number, because your reduction is 10% of the higher value. Whew, I hope that makes sense!

Thanks,

Dansiman 