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

Implement per-game configuration, refactor configurations in general #785

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kiwidoggie
Copy link
Contributor

This should solve the issues of:

#564

and

#397

And prepare the work for:

#614

@kiwidoggie
Copy link
Contributor Author

Can I get comments on this?

I did some profiling, at most it's negligible perf impact, could be less if we moved out the log settings to be on-game-start. Logging in general kills perf more than the settings does.

  1. The idea here is instead of having fragmented configuration block, then manually reading/writing each load/save, to just keep around the toml config file which gives us a few benefits
  2. Can check existing config against the current defaults to see if it's been changed (and need to load/re-save for new options)
  3. It allows to have default fallbacks in the event that a value isn't found in loaded config (this allows upgrading seamlessly)
  4. Changes are wrote directly to the toml object and can be saved at any point without keeping everything manually synced
  5. Fixes an issue where values aren't exposed properly, or not matching the config value

Allows you to save via title id, where "config" is the default TID, but you could save it as per-game, then upon loading switch the config managers title id, and it will automatically use those settings, seamlessly without modifying the existing codebase

I currently have helper/passthrough functions to allow shad to build without too much modifications but those should be deprecated for something more direct

If perf is super a concern I can make something that just passes around a global config block (memory structure) instead of going to/from toml, but I think it defeats the purpose of having the nicer config setup.

Add ConfigsDir to PathType
Add create_path call for the new Configs directory
@kiwidoggie
Copy link
Contributor Author

Bump, I'd like to complete this and move on to other feature requests.

@Hermiten
Copy link
Collaborator

Hermiten commented Oct 4, 2024

It's marked as a draft

@kiwidoggie
Copy link
Contributor Author

Yes, I'm aware that it's marked as draft. It's because it involves major code breaks. I wanted to ensure that the developers are okay with the method I am going to be doing things, before committing to writing a bunch of code that's not going to be used because it was not what the developers wanted. That's why I was looking for input.

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

Successfully merging this pull request may close these issues.

2 participants