Closed Kagamia closed 2 years ago
I'm not sure if it is a common behavior for all wz versions, just a quick fix.
Appreciate your hard work. :clap:
So right now it's only applicable to GMS. I tested other versions with the map ID 701210000. The Map Render works for GMS, but not for JMS, CMST, or MSEA after the latest commit:
JMS:
MSEA:
CMST:
@PirateIzzy Thanks, fixed.
Confirming that this is working now.
seems this change is stable enough, close issue.
Like most GMS players suspected, starting from v230.1.20220208, GMS has removed the 2 bytes encver from wz just like KMS did two months ago (#181), But they have not split wz files into small pieces.
OK, it doesnot sound serious, as wcR2 already supports encver auto detection. The next thing is really BREAKING.
After you update the GMS latest version, you happily drag the base.wz into wcr2, wait a second, then check
Character.wz
, you'll see the same thing like me:Skipping some dull debug works, I could tell you that the
Character.wz
loading failed because it got some duplicated keys atGetDirTree
function, the duplicated node namesぞ㘱㜶⤰
and the full path is"Character/Shoes/ぞ㘱㜶⤰"
, the actual file offset in file is0xe2f2d
.OK, we opened the wz file with some hex file editor, goto the breaking position, now we must read wz file with your brain :)
we move to the string position, the real string position in file is
0x3c + 1 + 0x87b5 = 0x87f2
https://github.com/Kagamia/WzComparerR2/blob/65f576419d2f71c307df24b5bc716ea8622e611c/WzComparerR2.WzLib/Wz_File.cs#L365This is definitely wrong, but if we offset 1 byte, the things become reasonable:
So, in this scenario (encver removed), a referenced string should offset additional 1 byte to align the old wz format. The similar error does not appear in KMS, because KMS has already splited wz files, so each wz file has little possibility to reference other duplicated strings.