angarg12 / nucleogenesis

Nucleogenesis JS incremental game
GNU General Public License v3.0
40 stars 20 forks source link

Production Measurements are Different per Resource #176

Closed BobChao87 closed 6 years ago

BobChao87 commented 6 years ago

While playing the game and attempting to derive certain values related to the prestige system, I discovered that different resources are measured differently in the exotic matter tab. I currently only have Hydrogen unlocked, so this is by no means an exhaustive list.

Grows with Production:

Grows with Quantity and Production:

Resources in the Grows with Production category increase each game tick by an amount equal to the amount produced during that game tick. i.e. If you have 117 2H stored and the exotic matter tab reports 593 2H and the game tick produces 4 2H, then after the game tick, you end up with 121 2H stored and the exotic matter tab reporting 597 2H.*

Resources in the Grows with Quantity category increase each game tick by an amount equal to the existing amount of that resources before the game tick changes resolve and the total amount produced during that game (minus 1 for some reason). i.e. If you have 117 1H stored and the exotic matter tab reports 593 1H and the game tick produces 4 1H, then after the game tick, you end up with 121 1H stored and the exotic matter tab reporting 713 1H (equal to 593 + 117 + 4 - 1).*

While I suspect that the Grows with Quantity algorithm is the one that is a bug, I'm not really sure which is the bug here since Grows with Quantity has massive benefits for long-term idle periods. However, it make sense that all resources that contribute to the exotic matter production should behave the same way and consequently at least one of these algorithms would likely need to be changed.

* Examples assume that during these sample game ticks, no processes are consuming the resource in the example as that is an unnecessary complication to the math as presented. The numbers are additionally fabricated and may not represent values that are possible to achieve through normal gameplay.

angarg12 commented 6 years ago

That is the effect of electronegativity.

Electronegativity spontaneously redoxes ions and the main isotope for each element.

So for simplicity sake, lets say you have 100 1H and 100 H-. The electronegativity gives you a 10% chance to oxidise and 5% to reduce. Then, 10 1H become H- and 5 H- become 1H, so you end up with 95 1H and 105 H-. For exotic matter purposes you produced those resources.

I hope that clarifies this issue.

BobChao87 commented 6 years ago

The effect I'm observing seems too strong to be attributed to just electronegativity as you describe. I can have on the order of 1e9 added to the exotic matter measure for 1H even when there are only 5e4 (each) of H- and H+. It seems unlikely that 100% of my 1H is being converted back and forth each game tick.

I realize that you probably know more about electronegativity than I do, so for now I will close this bug and look into the issue and re-open it if I find more evidence of any issues. I guess I will also review electronegativity, since it has been a long time since I've used that for anything.

angarg12 commented 6 years ago

Electronegativity is a fairly complex affair so it is probable there are some bugs lurking around.

Please reopen if you identify any strange behaviour.

BobChao87 commented 6 years ago

For some final closure, it looks like this issue is gone in master after the public v2.8.0 beta cut. I could find the exact commit, but that seems moot since the issue has already resolved.