Merge pull request #438 from s4Ys369/revert-434-patch-1
[sm64pc.git] / SAVE_FORMAT.MD
blob5f44a01169a0ee134c798b3ef795942dccbf4268
1 # Text-based savefile format
2 This small document describes a new, TOML-like text format for game saves. This format allows the user to use a simple text editor to change the data necessary for the game (for example, special saves for speedrun training).
4 All data is stored in pairs (*key = value*). Pairs can be placed arbitrarily within a single section. The format of values may differ for each section.
6 Each savefile (4 total) must be named `save_file_X.sav`, where X - save slot (0, 1, 2 or 3).
8 > **Note**: The game creates the savefile only when you are saved in the game after completing a course!
9 ___
10 ## Header
11 The header is automatically generated by the game when saving progress. It mainly contains information about the value of the 0 and 1 flags, the character that the comment starts with, and the time when the file content changed.
13 Example:
14 ```
15 # Super Mario 64 save file
16 # Comment starts with #
17 # True = 1, False = 0
18 # 2020-05-18 17:37:07
19 ```
21 ___
22 ## Commenting
23 All comment lines starts with `#` character. Comments can be located on a separate line or as part of another line. When the game reads the save, comments are ignored.
25 Example:
26 ```
27 # This is a comment
28 coin_score_age = ??     # This is a comment too!
29 ```
31 ___
32 ## Menu Section - [menu]
33 This section contains two flags for menu. 
35 | Flag | Value | Description |
36 |---|---|---|
37 | coin_score_age | 0, 1, 2, 3 | Each save file has a 2 bit "age"    for each course. The higher this value, the older the high score is. This is used for tie-breaking when displaying on the high score screen
38 | sound_mode | stereo, mono, headset | Sound mode for the game
40 Example:
41 ```
42 [menu]
43 coin_score_age = 0
44 sound_mode = stereo
45 ```
46 ___
47 ## Flags Section - [flags]
48 This section contains all main game flags (walkthought milestones).
49 > **Note**: The value can be only 0 (False) or 1 (True).
51 | Flag | Description |
52 |---|---|
53 | wing_cap | **Red Switch** is pressed 
54 | metal_cap | **Green Switch** is pressed
55 | vanish_cap | **Blue Switch** is pressed. 
56 | key_1 | Key is found in **Bowser in the Dark World**
57 | key_2 | Key is found in **Bowser in the Fire Sea**
58 | basement_door | Mario unlocked castle's basement door
59 | upstairs_door | Mario unlocked castle's upper floors
60 | ddd_moved_back | **Dire Dire Docks** painting is moved back 
61 | moat_drained | Water is drained in the moat of the castle
62 | pps_door | **Princess's Secret Slide** window is unlocked
63 | wf_door | **Whomp's Fortress door** is unlocked
64 | ccm_door | **Cool, Cool Mountain door** is unlocked
65 | jrb_door | **Jolly Roger Bay door** is unlocked
66 | bitdw_door | **Bowser in the Dark World door** door is unlocked
67 | bitfs_door | **Bowser in the Fire Sea** door is unlocked 
68 | 50star_door | **Endless Staircase** is not endless anymore
70 Example:
71 ```
72 [flags]
73 wing_cap = 1
74 metal_cap = 1
75 vanish_cap = 0
76 key_1 = 1
77 key_2 = 1
78 ```
79 ___
80 ## Main Courses Section - [courses]
81 This section contains all stars and coins that Mario collected in each main course.
83 The first value stores the number of coins collected.
84 > **Warning!**: Make sure that coins count will not exceed 255!
86 The second value stores the stars (or completed missions). Each mission (6 main + 1 bonus) is must be marked `0` (not completed) and `1` (completed). 
87 > **Warning!**: The sequence of stars' missions goes from **RIGHT** to **LEFT**!
88 > **Note**: Last star flag is **100 coins star**
90 | Flag | Short for |
91 |---|---|
92 | bob | Bob-omb Battlefield |
93 | wf | Whomp's Fortress
94 | jrb | Jolly Roger Bay
95 | ccm | Cool, Cool Mountain
96 | bbh | Big Boo's Haunt
97 | hmc | Hazy Maze Cave
98 | lll | Lethal Lava Land
99 | ssl | Shifting Sand Land
100 | ddd | Dire, Dire Docks
101 | sl | Snowman's Land
102 | wdw | Wet-Dry World
103 | ttm | Tall, Tall Mountain
104 | thi | Tiny-Huge Island
105 | ttc | Tick Tock Clock
106 | rr | Rainbow Ride
108 Example:
110 [courses]
111 bob = "3, 0000011"
112 wf = "3, 0000101"
113 jrb = "0, 1000000"
114 ccm = "1, 1111111"
117 ## Bonus Section - [bonus]
118 This section contains all bonus stars that Mario collected in the castle and all bonus courses.
119 > **Note**: The game takes into account only the number of bonus stars collected, the order of stars flags can be arbitrary
121 | Flag | Stars | Description |
122 |---|---|---|
123 | hub | 5 | MIPS' stars and Toads' stars
124 | bitdw | 1 | Bowser in the Dark World 
125 | bitfs | 1 | Bowser in the Fire Sea 
126 | bits | 1 | Bowser in the Sky
127 | pss | 2 | The Princess's Secret Slide
128 | cotmc | 1 | Cavern of the Metal Cap
129 | totwc | 1 | Tower of the Wing Cap
130 | vcutm | 1 | Vanish Cap Under the Moat
131 | wmotr | 1 | Wing Mario Over the Rainbow
132 | sa | 1 | The Secret Aquarium
134 Example:
136 [bonus]
137 hub = 11101
138 bitdw = 1
139 bitfs = 0
140 bits = 1
141 pss = 10
144 ## Cap Section - [cap]
145 This section contains information about where Mario lost his cap and who take it.
146 | Flag | Value | Description |
147 |---|---|---|
148 | type | ground, klepto, ukiki, mrblizzard | The one who or what took the cap from Mario. Default flag is **"ground"**
149 | level | ssl, sl, ttm, none | Specifies the course where the cap is located. Default flag is **"none"**.
150 | area | 1, 2 | Specifies the area in the course.
152 Example:
154 [cap]
155 type = ground
156 level = ssl
157 area = 1