Save Files

Revision as of 10:38, 20 June 2024 by Savage13 (talk | contribs) (Add weather save file information)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

BotW can store up to 9 save states per profile, 6 for normal mode (1 manual save and 5 autosaves) and 2 for master mode (1 manual save and 1 autosave).


Folder Structure

The content of the save folder is structured as following:

0
    caption.jpg
    caption.sav
    game_data.sav
1
...
album
    pict_000.jpg
    pict_001.jpg
    ...
pict_book
    Animal_Cassowary_A.jpg
    Weapon_Sword_008.jpg
    ...
tracker
    trackblock00.sav
    trackblock01.sav
    ...
option.sav

The numbered folders each represent one save state.

Options

option.sav contains the settings set in the options menu (inverted camera, stick sensitivity etc.). The exact data stored here corresponds to the game flags defined in Pack/Bootup.pack//GameData/savedataformat.ssarc///saveformat_*.bgsvdata, where the file_list array's zero-index dictionary contains the file_name "option.sav"

Album

The album folder contains one JPG file for each entry in the in-game album, numbered in the order they were taken.

Hyrule Compendium

Each JPG file in the pict_book folder corresponds to one entry in the Hyrule Compendium. The name of each file is the internal name of the given item, weapon or animal. Do note that the compendium is not directly tied to a specific save state, meaning the images are shared between all saves.

Save State

Each save state contains 3 files:

  • caption.jpg A screenshot taken at the time of saving.
  • caption.sav Contains a small amount of data for each save that is displayed in the save select screen (e.g. time and location). The exact data stored here corresponds to the game flags defined in Pack/Bootup.pack//GameData/savedataformat.ssarc///saveformat_*.bgsvdata, where the file_list array's zero-index dictionary contains the file_name "caption.sav"
  • game_data.sav The data for each save state. The exact data stored here corresponds to the game flags defined in Pack/Bootup.pack//GameData/savedataformat.ssarc///saveformat_*.bgsvdata, where the file_list array's zero-index dictionary contains the file_name "game_data.sav"

.sav Folder Format

All data in these files is stored as little endian on Switch and as big endian on Wii U.

A save file (with the exception of files in the tracker folder) starts with the following header:

Offset Size Description
0x00 4 version: Version of the game that created the save file.
0x04 4 marker: Always 0xFFFFFFFF.
0x08 4 unknown: Always 0x1.

Versions:

Game version Save version
1.0.0 0x24E2
1.1.0 0x24EE
1.1.1
1.1.2
1.2.0 0x2588
1.3.0 0x29C0
1.3.1 0x2A46
1.3.3 0x3EF8
1.3.4 0x3EF9
1.4.0 0x471A
1.4.1 0x471A
1.5.0 0x471B
1.6.0 0x471E

The data after the header is comprised of 8-byte chunks:

Offset Size Description
0x00 4 id: ID of the data being stored, crc32 of the internal key
0x04 4 value

In Pack/Bootup.pack//GameData/savedataformat.ssarc///saveformat_*.bgsvdata, the game stores a mapping for each ID to the corresponding entry name. This name is then further defined in one of the files in Pack/Bootup.pack//GameData/gamedata.ssarc//*, depending on its data type.

Strings are stored with the maximum possible number of characters (e.q. 256 characters for strings defined in string256_data_0.bgdata) and are broken up into 4-byte parts. These are then stored in sequential chunks with the ID repeating for each chunk.

For arrays the data is also stored in sequential chunks, each with an identical ID. The horse names for example will take up 96 chunk with the ID 0x7B74E117 in the save file, 6 names with 16 chunks (= 64 characters) for each name.

Data types for value include bool, int32, float32, string, string64, string256, vector2f, vector3f, vector4, bool_array, int32_array, float32_array, string64_array, string256_array, vector2f_array, and vector3f_array. Value types are read as, and therefore must correspond to, the type defined in the Pack/Bootup.pack//GameData/gamedata.ssarc/* in the key of the main byml dictionary where the id is found. (Note that, in the vanilla game, this also corresponds to the name of the file, itself, but this relationship is not strict and therefore may not be the case for files added by mods.)

Inventory items are stored in PorchItem with a maximum of 420 internal string identifiers, e.g. Weapon_Sword_023. Associated arrays of PorchEquip: boolean and PorchItem_Value1: int32 store if the item is equipped and its current durability * 100 or item count. Swords, Bows and Shields also store their modifier key in PorchSword_FlagSp: uint32 and modifier value PorchSword_ValueSp: int32. Similar Flag and Value exist for the Bows and Shields. FlagSp modifiers can take any or all of the following values.

Modifier Value
AttackUp 0x1
DurabilityUp 0x2
CriticalHit 0x4
LongThrow 0x8
MultiShot 0x10
Zoom 0x20
QuickShot 0x40
SurfMaster 0x80
Enchanced Modifer 0x80000000

Associated data with Cooked Items are held in CookEffect0: vector2f, CookEffect1: vector2f, and StaminaRecover: vector2f arrays. Values within these arrays are

Save Key Index Description
CookEffect0 0 EffectType
CookEffect0 1 EffectLevel
CookEffect1 0 Cooked Item SellingPrice
CookEffect1 1 Never set
StaminaRecover 0 HitPointRecover
StaminaRecover 1 EffectLevel

Weather data with type data are found in climateWeather : int32_array, climateWeather2: int32_array and climateWeather3 : int32_array. These values contain the weather for the next three in-game days. Arrays are 20 values in length map directly to climate values of each Map area. Each int32 value contains 6 packed WorldMgr weather types that each are 4 bits long (nibble, 0x0-0xF). These weather types identify are for each 4 hour long period during the day.