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

config.json is not preserved through game updates. #921

Open
evertvorster opened this issue Nov 29, 2024 · 2 comments
Open

config.json is not preserved through game updates. #921

evertvorster opened this issue Nov 29, 2024 · 2 comments
Assignees
Milestone

Comments

@evertvorster
Copy link
Contributor

We are now setting some configuration options in json.config, and the trend is that more options will be set in this file in the future.

When installing the game, config.json ends up in a system folder: /usr/share/vegastrike
When the game is updated, this file is removed, and a new version is installed, erasing any changes the user makes.

The old configuration file, vegastrike.config is also installed in the same location, and serves as a starting point for vsettings.
With vsettings, any modifications are stored in ~/.vegastrike in Linux.

When the engine binary is started, it has a hierarchy that it looks for the configuration files, and the system directory is at the bottom of that hierarchy. This means that if there is a configuration file in ~/.vegastrike, that will be used over the system installed one.

To preserve changes made to json.config a similar strategy should be implemented for json.config.
As a start, the game engine should look for json.config in the same hierarchy as vegastrike.config, and if it finds it there, that is the configuration that should be used for the game, rather than the system one.

We can at a later stage implement vsettings copying over the config.json file. For now, I am happy to do this step manually.

@royfalk
Copy link
Contributor

royfalk commented Nov 29, 2024

I think I'll write a script to merge them. It won't solve all cases but it will cover the use case of gradually migrating more from the xml to json.
The biggest issue is you would need to manually save a backup of your config.json or it could get overwritten.

@royfalk royfalk self-assigned this Dec 3, 2024
@royfalk
Copy link
Contributor

royfalk commented Dec 3, 2024

I happened to find the code that handles the vegastrike.config XML in the game engine. The problem we have is that vegastrike.config and config.json are not the same.

One is a complete and stable document. The other is a work in progress. The engine doesn't merge them. It simply copies the config over if it missing.

Like I said, I'll create a script and document it.

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

3 participants