Gamespeed scaling:
Diplo: Memory decay scaling is ok I guess. I changed my mind there.
doImprovement:
Yeah, you're right ... this snippet gets called a lot though, I'm just not sure it's worth it. We can make the original code (and your code if you use it) faster by moving the multiplies inside the iOdds > 0 check though.
Yes, for every worked mine it loops over all bonuses for which you have the revealing tech, so what I suggested could only ever be feasable if it was possible to only calculate the real odds once per turn/player and save it somewhere. I don't see how that would easily be possible though.
More importantly, the error introduced by this way of handling it is lower the lower the base chance and game speeds are, and since all mine resources have a discoverRand of 10k, the error must be really small.. I thought, and went ahead and calculated:
chances for one type of resource to be discovered on a worked mine:
[
<game speed>: <chance with current implementation> (<correct value>)]
Marathon: 1/30000 (~1/29998,99998)
* error: -0,0033334074111113443237323833734253%
* error after rounding to 29999: -0,003333333333333%
Epic: 1/15000 (~1/14999,75)
* error: -0,0016667129652779209632637655049945%
* error after rounding to 15000: 0
Normal: 1/10000 (1/10000)
* no error possible
Quick: 1/6700 (~1/6700,165)
* error: +0,0024627888779157460147099993370482%
* error after rounding to 6700: 0
On that note, I forgot the math::round() before the typecast even, so the errors I would have introcuded by cutting off the fractions would have been even worse than ones that come from the current not 100% mathematically correct implementation.