TheGarbageCollector
Mod that helps get rid of the random lag spikes that can occur with lots of mods installed.
| Date uploaded | 3 years ago |
| Version | 1.4.3 |
| Download link | ApacheThunder-TheGarbageCollector-1.4.3.zip |
| Downloads | 25679 |
| Dependency string | ApacheThunder-TheGarbageCollector-1.4.3 |
This mod requires the following mods to function
MtG_API-Mod_the_Gungeon_API
Adds the good parts of Mod the Gungeon to BepInEx.
Preferred version: 1.9.2README
TheGarbageCollector
Got lots of mods? Got lots of random hitches/frame drops happening at inoppertune times? Also have lots of ram in your PC you don't know what to do with?
Then install this mod! It disables Unity's GarbageCollector. Well not entirely because I'm not that insane. :P
Instead it manually controls when GC can run. It will allow it to run during floor loads and while game is paused or if player is afk out of combat for more then 5 minutes.
It otherwise allows for a much smoother game play experience! Do note this will cause the game to use more ram. A machine with 8GB or more of ram is recommended. Though I won't prevent you from using it if you have less, but don't don't complain to me if you get out of memory errors. This game will on average use about 4.5GB of ram during a normal run that reachs the Forge. It can go to 5GB+ if you use specific items that create new rooms and such. But that probably won't happen that often.
I've stress tested this. It should be ok to use as long as you have a decent amount of ram. Oh and definitely don't use this with the 32bit version of the game....For obvious reasons. :P
Credit to https://forum.unity.com/threads/how-to-disable-the-garbage-collector-on-windows.369015/ where I discovered how to do this for Enter the Gungeon. Credit To SpecialAPI for help with making BepInEx MTG possible and for help porting mods to it.
Changelog:
1.4.3:
Delay when mod disables GC during game startup to avoid possible crash issues with large mods on startup.
CHANGELOG
v1.4.5:
Fixed color settings for certain console text displayed by the mod.
v1.4.4:
Re-implement audio fx used for when mod is toggled on and when garbage collection is triggered while debug stats are enabled. This was previously disabled after the port to BepInEx due to error in root namespace setting in csproj. This has been fix and is now usable again.
Reworded console text to better make clear when the mod is enabled or disabled.
Prevented "garbagecollector toggle" command from being used before main menu has finished showing title screen. (exceptions would occur otherwise. It's not meant to be used until the foyer has loaded)
Mod will now display error in console if user tried to load mod on Linux/MacOS version of the game and further loading is prevented. (this mod is only compatible with the Windows version of the game)
v1.4.3:
Delay when mod disables GC during game startup to avoid possible crash issues with large mods on startup.
v1.4.2:
Initial port to BepInEx version of MTG.
v1.4:
Fixed mistake that caused game to lag if game was paused for more then 2 minutes.
Minor adjustments to Stats UI for stats command.
v1.3:
Clean up/optimized GC_Manager code.
GC monitor will now wait till player is not in combat before duing a collection. (though you'll really only ever see this happen if you have a low memory cap set either manually or from having a small system ram stat that caused it to set a lower value for this)
Added a couple new console commands:
"garbagecollector setmemcap" and "garbagecollector stats"
setmemcap command manually sets the max memory usage cap before GC monitor will try to do a collection during gameplay. This is set based on how much memory the user has but can be manually set if so desired.
stats command allows displaying some stats on memory usage and amount of collections. Uses a custom dfLabel! :D
v1.1:
Adds sound effect for when you use the toggle command. (only plays if it's toggled to "on" state).
v1.0:
Initial release version.
Use the command "garbagecollector" in the console to get a list of valid sub commands. The most common command to use will be "garbagecollector toggle" which will turn on or off the mod's GC manager depending on what state it was last on.
This mod uses PlayerPref's to store it's settings so they are retained across game exits/restarts.