Thread:Lampville/@comment-5039776-20120904103459/@comment-5116140-20121001172939

Variability in the Negative Coin Balance Bug

Professor Onestone has been scratching his head and thinks he has figured out the variability in the negative coin big. For some, the bug kicks in around 1.11 Billion coins but for others this number can vary quite a bit. The 1.11 billion was a false limit!

1. We have already figured out that the problem kicks in due to integer overflow because some integers are stored using just 32 bits.

2. Here is the next clue. Your coin balance is not stored directly but is calculated as the difference between two quantities. That is, the coin balance is a calculated quantity.

Sometimes when I quite the game there is a file called Events.cache

This file summaraizes key data about your latest game session. It reveals for example the count of each dinosaur etc. But it does not contain the coin balance anywhere!

Instead the coin balance must be calculated as the difference of two quantites.

I have shown the values for my game below.

premium_earned = 496,918,264

premium_earned_spent = 390,624,977

You can see the difference is:

Coins = premium_earned - premium_earned_spent = 106,293,287 which is exactly my relatively meager coin balance! Predictions:

1. The coin bug will kick in as soon as the largest of these numbers [premium_earned] has an arithmetic overflow!

2. The coin bug will kick in at different coin values for different players.

3. The coin bug will kick in earlier for a player who sheds excess coins in the market. (such as OiOI was doing). Although this strategy will decrease your coin balance, it will not decrease the big number "premium_earned " which is in fact the number that causes the overflow! Shedding money in the market did not help you avoid the overflow at all, as it does not change the number "premium_earned". This is the big number that overflows!