[Release] GFA Packer for Yoshi's Wooly World

Discussion in 'Wii U - Hacking & Backup Loaders' started by jam1garner, Apr 19, 2017.

  1. jam1garner
    OP

    jam1garner Advanced Member

    Newcomer
    92
    138
    Apr 7, 2016
    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, Apr 19, 2017
    an07her, lordelan and ElyosOfTheAbyss like this.
  2. ElyosOfTheAbyss

    ElyosOfTheAbyss GBAtemp Addict

    Member
    2,214
    1,719
    Aug 20, 2015
    darn, ah well, good job anyway
     
  3. jam1garner
    OP

    jam1garner Advanced Member

    Newcomer
    92
    138
    Apr 7, 2016
    United States
    It's not really as big an issue as it sounds, most levels are less than a third the size of the limit.
     
  4. ElyosOfTheAbyss

    ElyosOfTheAbyss GBAtemp Addict

    Member
    2,214
    1,719
    Aug 20, 2015
    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
     
  5. jam1garner
    OP

    jam1garner Advanced Member

    Newcomer
    92
    138
    Apr 7, 2016
    United States
    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
    [​IMG]
    map005 unpacked
    [​IMG]
     
  6. ElyosOfTheAbyss

    ElyosOfTheAbyss GBAtemp Addict

    Member
    2,214
    1,719
    Aug 20, 2015
    ah, I was talking about gfa's that include the model in, since thats where it contains files like map.MapScene
     
  7. memoryman3

    memoryman3 GBAtemp Regular

    Member
    208
    87
    Feb 24, 2015
    Can you make new GFA files with this tool?
     
  8. jam1garner
    OP

    jam1garner Advanced Member

    Newcomer
    92
    138
    Apr 7, 2016
    United States
    You can but it requires the original to copy over hashes from.