Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files for configuration that are written to disk on every session should be stored in the "PluginData" folder. #20

Closed
Galenmacil opened this issue Oct 18, 2016 · 14 comments

Comments

@Galenmacil
Copy link

This is to avoid module manager rebuilding the patches on each game loading instead of using the much faster cache. Read this for more information: m4v/RCSBuildAid#32

@PhineasFreak
Copy link

The following Scatterer config parameters are the ones that force MM to rebuild it's cache on every launch:

mainMenuWindowLocation
inGameWindowLocation

These, along with some other settings:

scrollSectionHeight
guiModifierKey1String
guiModifierKey2String
guiKey1String
guiKey2String

should probably be saved in a separate config file under the PluginData folder. The rest are damn useful to have them editable via MM.

@LGhassen
Copy link
Owner

Got it, will implement this soon

@Galenmacil
Copy link
Author

LGhassen, you could simply change the files extension from CFG to something else (TXT...) and Module Manager won't "see" them.

@PhineasFreak
Copy link

@Galenmacil the problem with that approach is that modders cannot then modify the parameters. Granted, every single one of them is accessible via the Scatterer main GUI but it is really nice & useful that we can also modify them via MM without writing instructions for the user on how to set them up.

@Galenmacil
Copy link
Author

Ah, I get the problem now... No easy solution.
If CFG files were written to disk only when edited in game and not on each session, this would fix the MM rebuilding problem.

@PhineasFreak
Copy link

But again MM would detect that the files were modified on the next start of KSP and would invalidate the cache. The issue here is not when but what: when you change the value of a ConfigNode it is usually a one - time thing. If you start including stuff that can be changed easily (even by restarting the game - saving the game epoch or the position of a GUI for example) then everything goes out of the window.

The only way to avoid this is to use a separate folder (PluginData) to store information like this and leave the rest upon to the user/modder.

@Joker58th
Copy link

Joker58th commented Jun 1, 2018

It seems this is still an issue and I guess my question is, if there are no config changes, why is it even writing to the file at all? I am seeing it hit the config file when I enter my save as well as when I exit the game.

@Joker58th
Copy link

Well, never mind. I found another mod that was causing the MM cache to rebuild every time. The config file is still being modified like I mentioned above but MM seems to be ignoring it.

@blowfishpro
Copy link
Contributor

blowfishpro commented Dec 5, 2018

Bumping this, I keep seeing GameData/scatterer/config/config.cfg modified which causes ModuleManager to reload all patches. If it's modified by Scatterer it should go in some PluginData directory so that ModuleManager ignores it (and KSP does not load it into the game database).

Speaking as a significant contributor to ModuleManager

@Gordon-Dry
Copy link

Man, stuff like this is old and really should be common knowledge.

(sorry, but today I'm generally annoyed)

@LGhassen
Copy link
Owner

LGhassen commented Dec 5, 2018

@Gordon-Dry Next time please ask yourself if this kind of comment is going to help anything before pressing enter.

@blowfishpro I will see what I can do.

@PhineasFreak
Copy link

PhineasFreak commented Dec 6, 2018

The Scatterer_config (global Scatterer settings) that @blowfishpro mentions stores the GUI X and Y positions (inGameWindowLocation). That is the reason why MM always invalidates the cache. This parameter could be moved to a) either a file under the PluginData directory or b) under a custom KSP Difficulty Settings node (stored in the respective KSP save file at runtime).

Mod-critical configuration files (that must be accessible via MM at all times) are:

  • Scatterer_planetsList (global celestial body settings)
  • Scatterer_sunflare (Scatterer Sun settings)

The individual Scatterer celestial body config files (Scatterer_atmosphere & Scatterer_ocean) are also "nice to have" available via MM but they are not critical.

@Galenmacil
Copy link
Author

If I remember correctly, I managed to have MM not rebuilt the cache each time by forcing the "Read Only" file flag on Scatterer config file(s). It has been a while since I messed with KSP stuffs so. This is more of a work around once you have Scatterer configured the way you like...

@LGhassen
Copy link
Owner

Fixed in latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants