Closed ThielHater closed 10 months ago
Phoenix does some special case handling in that part of the code and I have to say that I am not 100 percent sure if the fix is accurate but it yields the expected vertex count and OpenGothic will load and render the mesh properly now. 😄
Hi and thanks for the PR :) Am I understanding correctly that all that XZEN does is extend the size of vertex indices in meshes (and only bare meshes) by two bytes, from an uint16_t
to a uint32_t
? It does not touch anything else, like the polygon flags?
Yep. You may have a look at the plugin code, the comments are very insightful:
Okay. Could you verify that it still works fine with these changes @ThielHater, please?
I pulled your changes and rebuild OpenGothic, then I verified that it works with G1 and G2 as well as our mod.
Cool, thanks! Merged!
This pull request will add support for XZEN, a variation of the Gothic 1 mesh format that uses a wider vertex index like Gothic 2 does.
The Gothic Reloaded Mod aims to improve the graphics of Gothic 1 and when we added more details to the level mesh, it became too complex. Years ago, even before Union, @ataulien wrote a plugin to patch the engine at runtime to read and write wider vertex indizes. To indicate this format, he set the user name in the header of the .ZEN file to XZEN, giving it the name.
We shared this solution with the community, so it is probably used by other Gothic 1 mods too. The GothicZEN converter tool of @withmorten also supports it.
I came across this issue when I tried to run the mod on OpenGothic, which uses phoenix.