Difference between revisions of "Save File Format"
(Probably a better place for this than pastebin)
Latest revision as of 21:13, 8 February 2020
This page describes the save file format of Battle For Bikini Bottom.
If you're editing a GCI file (exported from Dolphin -> Memory Card Manager), it'll begin with the GCI header and banner + icon data. Assuming that's all still the default, the actual save file data should start at offset 0x5880.
Starting at 0x5880 is 512 null (0) bytes, then the string "SPONGEBOB:WHENROBOTSATTACK::RyanNeilDan", followed by 599 more null bytes.
The rest of the save file is structured in blocks, which have the following format:
|0||4||int||id (GDAT, LEDR, ROOM, etc.)|
|4||4||int||blockSize (size of the whole block, which includes padding bytes for alignment)|
|8||4||int||bytesUsed (number of bytes actually used)|
Blocks are padded with the value 0xBF.
blockSize is usually just 1, i'm not sure what that means checksum is calculated using the CRC-32 algorithm on the rest of the save file, starting from the LEDR block. The checksum HAS to be correct or else you'll get a "load failed!" screen. I don't know what the parameters are supposed to be for the algorithm yet, but I made an AR code to disable the bypass the checksum validation altogether (GameCube NTSC version only):
Use that and you can freely edit your save file without worrying about the checksum
|12||32||char||gameLabel (string. The text to show for the save file. Bikini Bottom, Jellyfish Fields, etc.)|
|44||4||int||progress (The percentage of the game completed. Can be negative :O)|
|60||1||char||thumbIconIdx (which game thumbnail to show on the right)
0 - Bikini Bottom
|12||4||int||sceneid (the last level you were in)|
|12||4||int||soundMode (0 = mono, 1 = stereo)|
|24||4||int||rumble (0 = off, 1 = on)|
|12||4||int||version (idk what this is)|
After this is a bunch of blocks containing "serialized" data, which are the game's way of storing persistent scene states as well as player and global counter states. The format is very weird, and not easily editable with a hex editor because values are sometimes written as single bits, which offsets future values by the number of bits written, which causes values to cross byte boundaries, and yeah it's kind of a mess. I'll explain more of this soon
These can be B101, DB01, JF01, etc.
Contains saved states for every object with the Persistent flag set (look in Industrial Park). The last value of a counter, the pressed/unpressed state of a button, the enabled/disabled state of a dispatcher, etc.
Max health, shinies, spatulas, socks, collectibles
Cheats, encountered robots, other stuff
After this is the following block: