#Generators tick 50% faster after the game is loaded/resetted exactly twice in a new browser section

9 messages · Page 1 of 1 (latest)

dim arch
#

v4.1.1-v4.2.3 Web
To replicate:

  1. Go on an incognito tab on Chrome/Firefox
  2. Load the first save and buy one alchemy. 20 Coin mints will be generated every second.
  3. Again, load the save and buy one alchemy. 30 Coin mints will be generated every second.
  4. Again, load the save and buy one alchemy. 20 Coin mints will be generated every second. Further attempts will result in 20 generation per second until the browser session is restarted.

A similar effect applies to the second save file where Transcend can be gained faster on the second load. (Likely because autobuyers tick faster. I think this is due to updateAll() somehow ticking faster every second.

inner shore
#

Oh... I see why

dim arch
inner shore
# dim arch I NEED to know🙏, I cant find the underlying cause

https://github.com/Pseudo-Corp/SynergismOfficial/commit/54f393e5d0b70a3de7d3ec3657d8042b63bb23fa

So, when I was first looking at this bug I thought there was simply a setInterval being created using the built-in func (basically, we have our own implementation of setInterval which makes clearing them easier, when necessary), but checking that, I've confirmed all setIntervals were called correctly.

The actual bug was in clearInterval, in that the implementation would only delete every other existing interval. The implication is that not only would updateall be called twice when it should only be called once per interval (due to happenstance of how the intervals are created), but many of the functions were being called twice. Repeated imports caused every other one of those intervals to be deleted, meaning other functions might be called twice, or maybe even more times, depending on which intervals survived the clearInterval calls. This also created a memory leak if players repeatedly imported saves on the same session.

This was pushed to master because it is a rather serious bug.

dim arch
inner shore
#

Speaking of this, I really should standardize tick rates... the intervals are all over the place tbh

granite dome
#

derpsmith Yeah I never knew what was screwing with the importing but it made me paranoid

polar whale
#

Closing as fixed

shadow gorgeBOT
#

✅ Locked thread #1502988921972461609 (1502988921972461609)!