VitaSmith / gust_tools

A set of utilities for dealing with Gust (Koei Tecmo) PC games files
Other
213 stars 25 forks source link

gust_g1t BRSL issue / regression from 1.48 #56

Closed MrBMT closed 2 years ago

MrBMT commented 2 years ago

Hi,

Firstly thanks for these amazing tools.

I've found a regression in gust_g1t where in v1.49 it's unable to correctly process some Blue Reflection: Second Light .g1t files, namely (at least) the costume_image_*.g1t ones in the data\x64\res_cmn\ui folder (unpacked from PACK00_01.PAK).

The following example is reproducible with v1.49 and it always ends up creating invalid .g1t files.

  1. Take any costume image g1t file such as: costume_image_000.g1t (SHA1 Hash: FAEB5486D0186F215EE4B9D78955AE57EC4C81A4)
  2. Extract the contents using gust_g1t.exe
  3. Rename or delete the original file
  4. Recreate the costume_image_000.g1t from the folder, as shown below this results in an invalid file that can not be loaded by the game if you attempt to use it (Note: The SHA1 hash changes along with the file contents, which can be seen if you compare the original and re-created files using something like HxD's Data Comparison feature)

Invalid Costume Image

  1. Rename or delete the costume_image_000 folder
  2. Try to extract the invalid costume_image_000.g1t again using gust_g1t.exe

The following error is shown:

ERROR: Texture array with a factor of 32 doesn't match our assertion
Please report this error to https://github.com/VitaSmith/gust_tools/issues.

I noticed this issue when I was trying to change the images contained in the files and at first thought the dds files I was using might be in the wrong format, but eventually worked out even when the files being used were unchanged invalid g1t files were being generated in the above scenario.

After confirming dds the files I was using were in the correct format along with a few other things, in a last ditch attempt to get it working I downloaded v1.47 and found everything worked perfectly when re-creating costume_image_000.g1t from the folder, a file identical to the original with the same SHA1 hash is generated and the game loads it.

Since then I tried v1.48 which also works fine, so it seems the issue was introduced specifically in v1.49.

I hope this all makes sense, but if you need any more information from me please just let me know. Thank you!

VitaSmith commented 2 years ago

Thanks for the report. I should have a fix for this in the next release.