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

How to best version scenario files and upgrading them? #27

Open
Trilarion opened this issue Jul 30, 2017 · 3 comments
Open

How to best version scenario files and upgrading them? #27

Trilarion opened this issue Jul 30, 2017 · 3 comments

Comments

@Trilarion
Copy link
Owner

Between version of the game, the structure of scenario files might differ. A first step is storing the game version in the scenario file, the other step is converting older scenario files to newer versions.

Outline a strategy for how this could be done most efficiently and most safely (so we do not get into a chaotic state where either older scenarios are lost or we get unintended behavior).

@krs013
Copy link
Contributor

krs013 commented Jul 31, 2017

As long as the scenario object can read older versions and fill in the gaps, I think it would be ok, right?

Provided the file is not too tightly coupled with the object itself, it shouldn't have to be changed often in destructive ways. Internal changes to the game can be handled at the object layer.

In the case where there are enough changes that we need a generalized updating, perhaps we could devise some mechanism by which a new class can inherit or extend its old version... but that sounds complicated enough that it would only be fun, but not useful. 😬

@Trilarion
Copy link
Owner Author

Trilarion commented Jul 31, 2017

About the scenario file version number, one question is if it should be the same as the game version number or if it needs to be more fine-grained. It would mean that we could introduce a new file version only if the version number is also increased.

Regarding the updates of older versions, I would chain them. Kind of writing a updater from last version to this version, and then upon loading of an old version apply the incremental updates in a chain. This should be least effort but can lead to some losses, if e.g. we remove a feature and then add it again in the course.

Overall, I think, it highlights the importance of thinking carefully and designing the scenario data structure (the file is mostly just a yaml representation of the data structure) in such a way that it doesn't need to be changed often.

@krs013
Copy link
Contributor

krs013 commented Jul 31, 2017

To your first point, I think that is one of the stipulations of semantic versioning, so it seems appropriate.

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

No branches or pull requests

2 participants