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

Update .w3i Info file parser #80

Open
Luashine opened this issue Apr 21, 2023 · 5 comments
Open

Update .w3i Info file parser #80

Luashine opened this issue Apr 21, 2023 · 5 comments

Comments

@Luashine
Copy link
Contributor

Luashine commented Apr 21, 2023

The Map info file has been fully documented now, format versions 0-31. The missing legacy pieces are ROC Beta 100 (the first one).

After implementing this, you'll be able to correctly read the info of ROC/TFT Beta maps.


This would be a total rewrite of the hardcoded W3I.java

@Frotty
Copy link
Member

Frotty commented Apr 21, 2023

Thank you for letting us know. I appreciate your suggestion, but at this time, I think that implementing this feature is not a priority for us. However, if you or anyone else would like to contribute to the codebase and make this change, we would be happy to review a pull request.

@WaterKnight
Copy link
Contributor

I don't have any such old/odd formatted files for testing, though.

@WaterKnight
Copy link
Contributor

WaterKnight commented Apr 22, 2023

This would be a total rewrite of the hardcoded W3I.java

Well, the scheme there is that every format version will have its own parsing method except that the reusable chunks re-use some code. This may be not so well suited for small changes, but I was planning to do the parsing/writing at some point differently anyway, that the W3I would only be the model class and serializers/deserializers are extracted to better support different formats and those can be generated from schemas and make use of standard serialization/deserialization libraries.

@Luashine
Copy link
Contributor Author

In Warcraft the parser evolved around backwards-compatibility, like around a living format. The parser is a single entity with some branching for version support and does set default values where needed. This is the reason Hodor wrote his documentation the way he did and I picked up where he left.

@WaterKnight
Copy link
Contributor

Yes, I think it's good to write the documentation this way. If each version was separate, there would likely be drift and it's worse for interfacing. In wc3libs, I also did it this way that you can load files of different formats that map to the same model class and the fields not available in the serialized form are just null/default in the model then. Later, you might want to output it in a different format than it was originally read in, so stuff required in the serialized form missing in the model will again end up writing defaults or if some fields are not supported in the serialized form, those will just be omitted.

We can do this branching strategy as well in the parsers/writers, but when they are auto-generated from a schema that supports branching itself, it does not matter that much.

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