Problems when editing Twilight Princess HD RARC archives
v1993 opened this issue · 9 comments
I'm trying to edit TPHD archives, but game refuses to pick up output files.
Archive can be successfully imported and extracted, but exported files won't work (export finishes without errors and resulting files still can be imported in GCFT). This issue can be triggered by simply importing and immediately exporting archive without and additional changes to it.
Example with original and exported files: showcase.zip. Exported file is also notably bigger than original. I'm not sure if it's important.
I think this file created by wszst when extracting original archive might be useful for a quick look: wszst-setup.txt
I can't reproduce this. I can export TP archives and the game loads them without crashing. This includes the bmgres_exported.arc from your showcase.zip. (I placed it in files/res/Msgus/bmgres.arc
.)
I also tried hex editing a line of text in the arc, and it showed up in game as expected:
Exported file is also notably bigger than original. I'm not sure if it's important.
That's expected. The arc was originally Yaz0 compressed, GCFT decompresses it automatically and doesn't recompress it. You can recompress it manually in the Yaz0 tab if you want (though it will still not be exactly the same as the original compression because Nintendo's compression algorithm isn't identical to the one I use).
Oh wait I just realized you said TPHD. I thought you were talking about TPSD.
I won't fix this since GCFT is only intended to support GC games and it works fine with the GC version of TP. They probably just changed something about the RARC format in the 10 years between TPSD and TPHD, so it's expected that it wouldn't work right. It's weird that GCFT can even open the RARC.
I can't find any programs capable of working with new format, so this sucks to know. Oh well, thank you anyways. Maybe I should try to find differences myself then.
Update: I've got it to work! Turns out that I had to apply Yaz0 compression afterwards. Thank you so much!
Oh nice, glad you got it working! In that case I guess the issue was TPHD no longer detecting compressed files automatically, maybe it's coded to assume they're all compressed
It appears that TPHD have some sort of hard file size limit (for translation archives? 100KiB?), since even with Yaz0 compression some text is missing. This is supported by fact that more efficient compression that results in smaller file (I've tried a bunch of different compressors) reveals more lines.
That's pretty unusual that there would be a size limit on the compressed data instead of the uncompressed data. In WWSD I've seen a file (common.jpc) that has a size limit, but that file isn't even compressed at all.
There might be some memory allocation call before the file load you'll need to find and adjust the size of, but I've never hacked a Wii U game so I wouldn't know more specifics than that.
Turns out that sizes for each file are actually recorded in content/FileSizeList.txt
, so changing that file should fix it. In addition, padding shorter file to required length seems to work as well (if file's too short game gets stuck loading).