Game Data and Calculations - ahvonenj/synergism-hypersynergy GitHub Wiki

Game Data and Calculations

Overview

The mod being able to access Synergism's save/game data has opened a great deal of doors for the mod's development. Starting from Hypersynergism version 2.8.0 the mod also no long requires beating up the local storage as much (forced to write to it, but no need to read from it).

However, as the data the mod can access and what we're working with is sort of "pre-crunched" save-data, it basically contains non-computed data and values such as the amount of each upgrade the player has bought. What it doesn't contain is e.g. how these upgrades affect everything, because those values are calculated by the game during the runtime.

The computed values are very useful though and they consist of maybe ~75% of all the useful values that could be used, so something needed to be done.

Introducing... HSGameDataAPI.

HSGameDataAPI

HSGameDataAPI is the mod's one-stop-shop for computed values. It comes with built-in caching based on each variable a given calculation uses. Due to the nature of the game, some of the calculations can depend on 20+ variables and we don't want to be re-calculating everything 30-60 times per second.

Below you can find a list of currently supported computed values which the mod can calculate based on the save/game data. The R_ prefix is simply to denote that these values and the corresponding functions used to calculate them with have been "ripped" from Synergism's source code.

There are still a massive amount of calculations missing, but it's a start. I'll be adding new ones as they're needed.

List of computed values

R_AmbrosiaGenerationShopUpgrade
R_AmbrosiaGenerationSingularityUpgrade
R_AmbrosiaGenerationOcteractUpgrade
R_SingularityMilestoneBlueberries
R_DilatedFiveLeafBonus
R_SingularityAmbrosiaLuckMilestoneBonus
R_AmbrosiaLuckShopUpgrade
R_AmbrosiaLuckSingularityUpgrade
R_AmbrosiaLuckOcteractUpgrade
R_TotalCubes
REDAMB_blueberryGenerationSpeed
REDAMB_blueberryGenerationSpeed2
REDAMB_freeLevelsRow2
REDAMB_freeLevelsRow3
REDAMB_freeLevelsRow4
REDAMB_freeLevelsRow5
REDAMB_regularLuck
REDAMB_regularLuck2
REDAMB_viscount
R_CampaignAmbrosiaSpeedBonus
R_CampaignLuckBonus
R_CookieUpgrade29Luck
R_SumOfExaltCompletions
R_NumberOfThresholds
R_ToNextThreshold
R_RequiredBlueberryTime
R_RequiredRedAmbrosiaTime
EVENTBUFF_Quark
EVENTBUFF_GoldenQuark
EVENTBUFF_Cubes
EVENTBUFF_PowderConversion
EVENTBUFF_AscensionSpeed
EVENTBUFF_GlobalSpeed
EVENTBUFF_AscensionScore
EVENTBUFF_AntSacrifice
EVENTBUFF_Offering
EVENTBUFF_Obtainium
EVENTBUFF_Octeract
EVENTBUFF_BlueberryTime
EVENTBUFF_AmbrosiaLuck
EVENTBUFF_OneMind
R_RawAscensionSpeedMult
R_HepteractEffective
R_AllShopTablets
R_LimitedAscensionsDebuff
R_SingularityDebuff
R_SingularityReductions
R_EffectiveSingularities
R_AscensionSpeedExponentSpread
R_RedAmbrosiaLuck
R_LuckConversion