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

[WIP] Media versioning #265

Closed
wants to merge 3 commits into from
Closed

Conversation

TheJJ
Copy link
Member

@TheJJ TheJJ commented Mar 29, 2015

My attempt on versioning the media files. Introduces a data pack format (#86).

Basically, all converted and generated files will store some version (e.g. the gamedata specification hash). The engine can detect required/present discrepancies and trigger reconversion.

When this is merged, users won't have to reconvert everything for changes in one area only, but this will require #79 to be finished.

This implements and thus closes #204.

New features:

  • Hashing the exported struct member configuration
  • Simple mod data pack format
  • Check if the compiled-in struct format hash == exported-gamedata-files-format-hash

@TheJJ TheJJ added nice new thing ☺ A new feature that was not there before lang: python Done in Python code area: assets Involved with assets (images, sounds, ...) labels Mar 29, 2015
@@ -381,7 +382,7 @@ def structs(cls):
dbg(lazymsg=lambda: "%s: exporting member %s<%s>" % (repr(cls), member_name, member_type), lvl=3)

if isinstance(member_type, MultisubtypeMember):
for subtype_name, subtype_class in member_type.class_lookup.items():
for subtype_name, subtype_class in sorted(member_type.class_lookup.items()):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to sort the items?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't sort the items, their order is undefined; in practice, it varies from run to run.
The iteration order translates to the order of the segments in the generated C++ code, which will be different with each run, triggering unneeded re-builds.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, thought I was still reading the hashing code, not the C++ struct exporting one! now it makes sense lol

@TheJJ TheJJ mentioned this pull request Jul 29, 2015
2 tasks
@TheJJ
Copy link
Member Author

TheJJ commented Aug 19, 2015

This is kinda obsolete since the python interface was merged, I'll try updating some time and introduce mod pack config files.

We have basic media file versioning now with openage/convert/changelog.py.

@TheJJ TheJJ closed this Aug 19, 2015
@TheJJ
Copy link
Member Author

TheJJ commented Aug 28, 2015

To revive this, the format hashing should be ported to the current version again.
It's a version indicator for the gamespec format, that should trigger a reconversion if different from what the engine currently understands.

@TheJJ
Copy link
Member Author

TheJJ commented Oct 7, 2016

This is now upstream btw, came in with e59f5c8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: assets Involved with assets (images, sounds, ...) lang: python Done in Python code nice new thing ☺ A new feature that was not there before
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Media file versioning
3 participants