Hacking [Release] GFA Packer for Yoshi's Wooly World

jam1garner

Well-Known Member
OP
Newcomer
Joined
Apr 7, 2016
Messages
99
Trophies
0
Age
33
XP
382
Country
United States
Hey, had this sitting around for a while and completely forgot to post it but in case anyone wants to mod Yoshi's Wooly World *crickets chirp* then here you go. (Note: this is untested for Kirby's epic yarn but should work for it as well as I think it uses GFA also (tell me if you can confirm this))

How to use:
  • Install or have installed Python 2
  • Extract GFA using QuickBMS and the GFA BMS script
  • Edit files to your heart's content
  • Repack using the command "gfa-packer.py [name of folder to repack] [original gfa]"
For whatever reason the game checks what I assume to be hashes located in the GFA so those need to be copied over from the original (but don't have to match up with the present data). Dunno why this exists but it certainly caused me a lot of stress over figuring it out.

Known issues:
  • Compression fails on data sections larger than 1 MB, I don't have enough interest to solve this, sorry! (AKA if the total combined size of all the files is > 1MB)
How to contribute:
If you'd like to contribute the best way would be to write a string compressor for BPE in python and on replace lines 38 to 44 with "compressed = your_compression_function(uncompressedString)" then submit a pull request on github with these changes. If you'd like an example implementation of BPE compression look no further than Phillip Gage's implementation in C. This would definitely be helpful as it would make it cross platform as well as potentially remove the 1 MB data section limit.

Thanks to:
  • @MasterF0x for helping me out some (especially with testing)
  • Luigi Auriemma for QuickBMS and the unpacker
  • Phillip Gage for his BPE compressor I used out of laziness (partially because it would be slower to do a python rewrite)
Want to check out my other stuff? Here's my twitter: https://twitter.com/jam1garner
 
Last edited by jam1garner,

ElyosOfTheAbyss

Well-Known Member
Member
Joined
Aug 20, 2015
Messages
2,225
Trophies
1
XP
1,901
Country
It's not really as big an issue as it sounds, most levels are less than a third the size of the limit.
huh? the only levels under 1mb from what I can see are test levels and a bonus level
upload_2017-4-20_7-55-6.png
 

ElyosOfTheAbyss

Well-Known Member
Member
Joined
Aug 20, 2015
Messages
2,225
Trophies
1
XP
1,901
Country
The 1 MB is 1 MB of combined files uncompressed (not the entire archive, just the files). Also... they don't seem to be over 1 MB to me?
a couple of them compressed
RYUdyFS.png

map005 unpacked
pStiado.png

ah, I was talking about gfa's that include the model in, since thats where it contains files like map.MapScene
 

Awesomegameplayer

Member
Newcomer
Joined
Oct 10, 2023
Messages
7
Trophies
0
XP
59
Country
Canada
It appears your Python script doesn't work with Python 3 (Which is okay since you mention it needs Python 2 but if you could update it I'd appreciate it) and also it can't find files named "temp1.bin" and "temp2.bin" plus it can't find and access bpe.exe (Also the link no longer works). Also I was wondering how you're meant to format [name of folder to repack] [original gfa]; is it meant to be the directory or just the file name?
 
Last edited by Awesomegameplayer,

Awesomegameplayer

Member
Newcomer
Joined
Oct 10, 2023
Messages
7
Trophies
0
XP
59
Country
Canada
Follow up to my last post, I've figured it out (I just needed to put the folder and .gfa file in the same place as the Python script) and also got it updated to Python 3.11. Unfortunately that 1MB folder limit is really the only thing holding me back from making any progress on my mod, since the game's models, textures, and animations all together typically make the folder size too big, and Switch Toolbox does not allow you to save the edited .gfa file.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    realtimesave @ realtimesave: got a mig switch here, freshly smuggled in from China