AntonioDePau / KHPCPatchManager

A tool based on OpenKH to allow modders and users to easily mod the PC release of the Kingdom Hearts collection
Apache License 2.0
57 stars 14 forks source link

Critical bug #55

Open gledson999 opened 1 week ago

gledson999 commented 1 week ago

Describe the bug I recently found a bug in the tool I was using to fix textures with HDAssets and update the mod. However, when I fixed all of them, some textures could not be fixed even though I placed them correctly.

image image-1

So I tried to re-extract the pkg that had applied the mod and discovered that it crashes and gives an error in this same file. So I took the same original file and inserted it too, but on re-extraction, it causes the same error, confirming that it is a possible tool bug.

To Reproduce

  1. copy the 'original' folder from 'kh2_fifth': obj/N_EX940_BTL.mdlx obj/N_EX940_BTL.mset obj/N_EX940_BTL.a.us and... copy the 'remastered' folder with .dds images too obj/N_EX940_BTL.a.us obj/N_EX940_BTL.mdlx

  2. Rename all from 'N_EX940' to 'N_EX990' with the intention of creating a new enemy for mod (I also tested with the same name, but inserting it in kh2_fourth)

  3. make the .kh2pcpatch using the KHPCPatchManager.exe (last build) and patch it

  4. Re-extract the patched mod and the error happen image

Expected behavior Some .dds images do not show the particle effect rendering, even though they are in the correct position. As if it were not registered, so the list of images that work: image

Affected games (please complete the following information):

Formats involved

To make it easier, I'm sending the patch file, just apply it and try to re-extract the pkg/hed to reproduce the error MyPatch.zip

AntonioDePau commented 1 week ago

I've seen some issues with the Zlib library before. Try making your kh2pcpatch file manually:

  1. Create a new empty zip archive (with 7zip, ideally)
  2. Re-create the folder structure (original/remastered) and put the patched files where they should be OR copy/paste your mod's content (including original/remastered folders) inside the newly created archive
  3. Try patching the vanilla game again with the new patch
  4. Try starting the game and testing your mod
  5. Try extracting the patched PKG(s) again

To be clear, this doesn't look like an issue with KHPCPatchManager itself, but with the Zlib library it uses. If there's a but for the library that has been fixed with a recent update, happy to upgrade the library for the next version of KHPCPatchManager. Otherwise, you'll have to create your patch archive files yourself as I'm not willing to debug Zlib and fix their code myself.

gledson999 commented 1 week ago

I did what you recommended, but the same error persists when extracting, even when doing it manually.

  1. I tried using 7zip
  2. I tried using winrar (.zip)
  3. I tried using winzip