sarbian / ModuleManager

176 stars 96 forks source link

Cache patched configurations to speed up loading times #43

Open AJMansfield opened 8 years ago

AJMansfield commented 8 years ago

When launching KSP with modded installs, ModuleManager can frequently take a significant amount of time to patch all of the configurations that need patching. If ModuleManager could be modified to cache the patched files, this could help speed up loading times.

Kerbas-ad-astra commented 8 years ago

It already does. It loads the cache if-and-only-if the configuration is exactly the same as before (i.e. nothing added or removed).

This doesn't always happen for me, even when I don't tinker with my mod install. I think that there are some mods whose settings are stored in the ConfigNode format, which means that any changes there (e.g. moving a window) would cause MM to discard the cache and start from scratch.

RealKolago commented 8 years ago

There are some CFG files in my install with settings... c:\Kerbal Space Program 1.0.5\GameData\000_FilterExtensions\Settings.cfg c:\Kerbal Space Program 1.0.5\GameData\HaystackContinued\settings.cfg c:\Kerbal Space Program 1.0.5\GameData\Kerbaltek\HyperEdit_1.4.2\hyperedit.cfg c:\Kerbal Space Program 1.0.5\GameData\KerboKatz\PluginData\keybindingSettings.cfg c:\Kerbal Space Program 1.0.5\GameData\KerboKatz\SmallUtilities\FPSViewer\PluginData \FPSViewerSettings.cfg c:\Kerbal Space Program 1.0.5\GameData\PartWizard\partwizard.cfg c:\Kerbal Space Program 1.0.5\GameData\REPOSoftTech\AmpYear\Plugins\Config.cfg c:\Kerbal Space Program 1.0.5\GameData\REPOSoftTech\DeepFreeze\Plugins\Config.cfg c:\Kerbal Space Program 1.0.5\GameData\WaypointManager\WaypointManager.cfg

One solution can be a ignore list for MM.

AJMansfield commented 8 years ago

Would it be possible for modmanager to track which files change frequently, and then cache a partially-patched set of files that include only patches from files that don't change?

For instance, make keeps track of build dependencies to let it only rebuilds files that depend on files that have changed since the last build. Perhaps ModuleManager could use a system more like that to keep track of the cache?

Because if it has to do a complete rebuild of everything whenever any settings change, the current caching is nearly useless for heavily-modded installs.

RealKolago commented 8 years ago

The problem is that real MM cfg can influence each other. Most of the changing cfg files are setting files from mods with no MM relevance at all. So the best solution is to put these known setting cfg`s into a blacklist file and ignore them altogether.

sarbian commented 8 years ago

2.6.17 will log the file that changed and invalidate the cache. Once I know a bit more about the mods that create those cfg I will see what I will do. A blacklist seems like the obvious solution but :

Edit : mod that use cfg for config saving should put them into a PluginData subdirectory where they are not loaded by the game.

RealKolago commented 8 years ago

If I look into the files that have changed in my GameData (96 Mods) and delete all entry's with PluginData folder this list comes up:

GameData\000_FilterExtensions\Settings.cfg GameData\Diazo\AGExt\AGExt.cfg GameData\Diazo\ModActions\ModActions.cfg GameData\HaystackContinued\settings.cfg GameData\PartWizard\partwizard.cfg GameData\Pilot Assistant\Presets.cfg GameData\RCSBuildAid\settings.cfg GameData\REPOSoftTech\AmpYear\Plugins\Config.cfg GameData\REPOSoftTech\DeepFreeze\Plugins\Config.cfg GameData\WaypointManager\WaypointManager.cfg

So we have the following options:

do not include it into

ModuleManager.ConfigSHA

sarbian commented 8 years ago

All those are reported in MM log or you checked the file date ?

RealKolago commented 8 years ago

I checked the last modified date and excluded all real MM cfg`s. Where is the MM log located?

Kerbas-ad-astra commented 8 years ago

It's inside the main log -- all of the lines that start with [ModuleManager].

blowfishpro commented 6 years ago

The cache is working to my knowledge. There are still some mods that store their settings in a bad location and break it, but those just have to be dealt with one by one (by asking the author to move the settings). Do we still need this issue?

RealKolago commented 6 years ago

Is there a possibility to get an in game list/display of the changed cfg files? Something better than going threw the log manually every time?

blowfishpro commented 6 years ago

That list could potentially be quite long if you actually added or removed a mod.

RealKolago commented 6 years ago

It think only list changed cfg files is ok. Not new or deleted ones.