CloverPerformance
Performance patches for very high deadlines
| Last updated | 2 days ago |
| Total downloads | 51 |
| Total rating | 0 |
| Categories | Tweaks |
| Dependency string | Ooseykins-CloverPerformance-1.0.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2304README
CloverPerformance
Performance patches for very high deadlines. This brings my Deadline 205 framerate from 3fps to 60+fps.
Source
https://gist.github.com/Ooseykins/244c9ba60ddbbad6760d5aed62311f39
How does it work?
CloverPerformance contains 4 separate patches to skip costly math operations when the numbers involved get extremely high. These patches can be toggled off individually in CloverPerformanceConfig.json in the mod's folder if they are causing other problems.
SkipRerollSaves
In high deadline runs you may often be restocking the store or rerolling phone options frequently. This patch skips saving in those situations since the save file can be very large.
CacheStrings
The Strings.Sanitize function is the major culprit in performance loss at higher deadlines. The intention of this function is to replace keys like [C_TICKET] with the clover ticket graphic. It also contains some keys like [DEBT_NEXT] that invoke methods like GameplayData.DebtGetExt which don't pose a problem with small debt numbers, but become extremely slow when debt gets high. These slow methods are called regardless of if the input string has the keys or not.
This patch will cache the results of Sanitize until a major update to gameplay data, such as depositing into the ATM, spending coins, or spending clover tickets. This patch is most likely to cause visual issues, but will not cause any gameplay changes even if the text is displayed wrong.
CacheBigIntegerMath
Some expensive methods like GameplayData.InterestEarnedHypotetically are called multiple times in a single frame. This patch will cause any calls of these methods to cache their results for a single frame. This can potentially cause some wrong calculations if I implemented it wrong. If there's any patch to disable if you're worried about gameplay errors, I'd recommend this one.
PatchStringsSanitize
This is a kind of complicated patch called a "transpiler" which edits the code inside the Strings.Sanitize method. This will cause the method to skip over some costly math in the case that it isn't required by the input string. There are a lot of limitations to what I could do with this patch, but it is a pretty big performance improvement on it's own.
Contact
You can message me on Discord @Ooseykins or on Twitter as @ooseykins or @Aetha_Azazie