Target version for WLDX
ds-sloth opened this issue · 8 comments
For TheXTech's Compat update to correctly detect the best target version for content, modern WLDX files should mark their target branch and version.
This can be a very simple field (string for branch and integer for version would be sufficient), and could be integrated into the config pack.
It would be nice to add this feature to the upcoming stable version of Moondust so that content created following release will be marked correctly.
Related: TheXTech/TheXTech#163
Ah, I am sorry. I now see in the issue @0lhi linked that @Wohlstand wrote "Right now every LVLX/WLDX file contains the config pack key name that was made to prevent possible faults."
What is the format of the key name? Would it be possible for us to parse it for TheXTech's internal use?
There is a .meta.configPackId field (exists at both LVLX and WLDX). For TheXTech needs it must be:
- empty (levels made before the config pack ID field had been introduced)
- contain
SMBX1.3Compat(levels and worlds made with "SMBX 1.3 Compatibility" config pack and saved as LVLX/WLDX manually) - contain
TheXTech(levels and worlds made with "TheXTech SDK" config pack)
Treat other values as "possibly incompatible"
So, maybe this is only a Config Pack issue, not a code issue for Moondust. We could simply update TheXTech's config pack name to be "TheXTech 1.3.6.1" or "TheXTech 1.3.7, and then begin parsing version numbers inside of TheXTech's code.
Note about the version code: it is NOT implemeted yet here. And if you do this, this will lead a warning that "level made with incompatible config pack", just because it expects a fixed string. No matter which version, just the family. The config pack ID means the FAMILY, not a specific version. So, it will lead to a warning at the Editor when attempting to load levels that have a minor difference in the config pack id.
Maybe it would be best to keep a single string, but allow Moondust to parse version codes (final word of string) and only provide the warning if the level was created with a newer config pack version than the user's version of Moondust?
I think, I could add the support of the format with a version separated by a space, and do:
- treat as a single string if the format doesn't match the "key version" format
- treat as key and version if the format is valid "KeyWithNoSpaces x.x.x.x" or "KeyWithNoSpaces XXXX" (have the version with dots, or have a simple number)
No longer needed: TheXTech/TheXTech#163 (comment)