Difference between revisions of "Save File Format"

From Shield Cat Wiki
Jump to navigation Jump to search
Line 26: Line 26:
  
 
== LINF ==
 
== LINF ==
The <code>LINF</code> block contains info about Lance and the abilities he has, max health, max magic, attack, defense, abilities equipped, and others. It is <code>50 Bytes</code> in length.
+
The <code>LINF</code> block contains info about Lance and the abilities he has, max health, max magic, attack, defense, abilities equipped, and others. It is <code>65 Bytes</code> in length.
  
 
<i><b>Please note</b> that Lance's health, magic, attack, and defense are computed from his base stats + any upgrades that you may have, and are provided for convenience. If you modify these numbers, and then Lance gets a new upgrade, the numbers will be corrected.</i>
 
<i><b>Please note</b> that Lance's health, magic, attack, and defense are computed from his base stats + any upgrades that you may have, and are provided for convenience. If you modify these numbers, and then Lance gets a new upgrade, the numbers will be corrected.</i>
Line 137: Line 137:
 
|-
 
|-
 
|colspan=3|The format for Lance's abilities is as follows:
 
|colspan=3|The format for Lance's abilities is as follows:
* For 1 Byte entries
+
* <b>Format 1</b>: Bits 0-2 is how many of the <b>first</b> ability shown is owned, and bit 3 shows if Lance has it equipped or not. Bits 4-6 is how many of the <b>second</b> ability shown is owned, and bit 7 shows if Lance has it equipped or not. He can equip <b>1</b> of the ability, and own up to <b>7</b>.
** <b>Format 1</b>: Bits 0-2 is how many of the <b>first</b> ability shown is owned, and bit 3 shows if Lance has it equipped or not. Bits 4-6 is how many of the <b>second</b> ability shown is owned, and bit 7 shows if Lance has it equipped or not. He can equip <b>1</b> of the ability, and own up to <b>7</b>.
+
* <b>Format 2</b>: Bits 0-3 shows how many Lance owns, and bits 4-7 shows how many Lance has equipped. He can own and equip up to <b>15</b> of this ability.
** <b>Format 2</b>: Bits 0-3 shows how many Lance owns, and bits 4-7 shows how many Lance has equipped. He can own and equip up to <b>15</b> of this ability.
 
* For 2 Byte entries
 
** Bits 0-7 show how many of this ability Lance owns, and bits 8-15 show how many Lance has equipped. He can own and equip up to <b>255</b> of this ability.
 
 
Lance's Passive abilities can be viewed [[Lance's Abilities#Passive Abilities|here]].
 
Lance's Passive abilities can be viewed [[Lance's Abilities#Passive Abilities|here]].
 
|-
 
|-
 
!41
 
!41
 
!1 Byte
 
!1 Byte
|<b>Format 1</b>.
+
(Format 1)
 +
|
 
* Bits 0-3: Lantern.
 
* Bits 0-3: Lantern.
 
* Bits 4-7: Survivor.
 
* Bits 4-7: Survivor.
Line 152: Line 150:
 
!42
 
!42
 
!1 Byte
 
!1 Byte
|<b>Format 1</b>.
+
(Format 1)
 +
|
 
* Bits 0-3: Healer.
 
* Bits 0-3: Healer.
 
* Bits 4-7: Double Magic.
 
* Bits 4-7: Double Magic.
 +
|-
 +
!43
 +
!1 Byte
 +
(Format 1)
 +
|
 +
* Bits 0-3: Triple Magic.
 +
* Bits 4-7: Distance Traveller.
 +
|-
 +
!44
 +
!1 Byte
 +
(Format 1)
 +
|
 +
*Bits 0-3: Magic Saver.
 +
*Bits 4-7: Flame Tail.
 +
|-
 +
!45
 +
!1 Byte
 +
(Format 1)
 +
|
 +
* Bits 0-3: Infinite Spin
 +
* Bits 4-7: <b>Unused.</b>
 +
|-
 +
!46
 +
!1 Byte
 +
(Format 2)
 +
|Lucky
 +
|-
 +
!47
 +
!1 Byte
 +
(Format 2)
 +
|Magic Master
 +
|-
 +
!48
 +
!1 Byte
 +
(Format 2)
 +
|Attack Up
 +
|-
 +
!49
 +
!1 Byte
 +
(Format 2)
 +
|Defense Up
 +
|-
 +
!50
 +
!1 Byte
 +
(Format 2)
 +
|HP Up
 +
|-
 +
!51
 +
!1 Byte
 +
(Format 2)
 +
|Magic Up
 +
|-
 +
!52
 +
!10 Bytes
 +
|<b>Unused.</b>
 +
|-
 +
!colspan=3|Upgrades
 +
|-
 +
|colspan=3|Lance can have up to 255 of each upgrade, although if the amount of upgrades would exceed the amount possible, then the result will be capped.
 +
|-
 +
!62
 +
!1 Byte
 +
|Attack Increase
 +
|-
 +
!63
 +
!1 Byte
 +
|Defense Increase
 +
|-
 +
!64
 +
!1 Byte
 +
|Magic Meter Increase
 +
|-
 +
!65
 +
!1 Byte
 +
|Health Increase
 
|}
 
|}
  

Revision as of 22:12, 27 September 2019

Warning! The information detailed on this page may not be in the present available build, and may only be available in an upcoming build! Therefore, all information here is to be considered volatile and could change or be removed without notice.
Warning! The information below is to be considered a draft. This means that the information presented is not final, so don't go running wild with this information.

Shield Cat saves are stored in the /saves directory. This directory is platform specific, please see Installation Instructions for its location on your platform.

Please note, save files can only be easily accessed and modified on Windows, Mac OS, and Linux. It may be possible on other platforms, but it is not supported.

Shield Cat save files are saved using the following structure:

 OTTSAV00.BIN

where 00 is the number of the save file. The game supports up to 200 save files.

OTTSAVFF.BIN is used for the Autosave file. Save slot 0 is not used.

Save information is stored in blocks, where each block has a certain data associated with it. There cannot be two blocks of the same type. All blocks listed below must be present, or the file will be considered invalid. They must also be in the correct spot, or the file will be invalid.

The save file is expected to be exactly 479 bytes in size. If it isn't, then it is considered invalid.

In Gamemaker, it is loaded and saved as a Buffer with type buffer_fixed. It is 1 byte aligned.

Header

OTTSAV files start with the following header:

 SC_OTTSAV_V00

where 00 is the version of the save format. During the prototype phase, all save files will use format 00. The format may also change a lot.

LINF

The LINF block contains info about Lance and the abilities he has, max health, max magic, attack, defense, abilities equipped, and others. It is 65 Bytes in length.

Please note that Lance's health, magic, attack, and defense are computed from his base stats + any upgrades that you may have, and are provided for convenience. If you modify these numbers, and then Lance gets a new upgrade, the numbers will be corrected.

Offset Bytes Description
0 2 Bytes Lance's max health
2 2 Bytes Lance's max magic
4 2 Bytes Lance's current health.
6 2 Bytes Lance's current magic.
8 1 Byte Lance's attack stat
9 1 Byte Lance's defense stat
10 1 Byte (packed) Various flags about Lance's state:
  • Bit 0: if Lance is allowed to use his equipment or not. If 0, none of his abilities will show.
  • Bits 2-3: number of health potions Lance has (up to 3)
  • Bits 4-5: number of magic recovery potions Lance has (up to 3)
  • Bits 6-7: unused.
11 1 Byte (packed) Various flags about the game itself:
  • Bit 0: If this is a randomized mode save or not. A Randomized Mode Remap File will be required.
  • Bits 1-3: Game difficulty mode.
    • Mode 0: Chill Mode
    • Mode 1: Regular Mode
    • Mode 2: Cool Mode
    • Mode 3: Fun Mode
    • Mode 4: Custom Mode. A Custom Difficulty Data File will be required.
    • Modes 5-7: Unused.
  • Bit 4: If cheats were enabled on this file or not.
  • Bit 5: If the game has been cleared or not.
  • Bits 6-7: Unused.
12 3 Bytes How many Pretty Petals Lance has in his possession.
15 2 Bytes Which save location Lance saved at.
Lance's Active Abilities
Each ability is stored using a 16bit value. The format is as follows:
  • Bits 0-2: How many of this ability Lance has (up to 7.) If it shows Lance has the ability equipped, but he has none, undefined behavior will occur.
  • Bit 3: If Lance has this ability equipped.

This format continues for each of the 3 upgrades possible. Below, the names of each ability and its upgrades will be displayed. Each one represents 4 bits, and are in the order shown to make the 16 bits. Lance's abilities are detailed here. Lance cannot use an ability upgrade for an ability he does not have. For instance, if he finds the Ultra Spin upgrade for the Super Spin ability, but does not have the Super Spin ability, he will not be able to use it.

17 2 Bytes Shield Ability - Homing - Wave - Indestructable
19 2 Bytes Dagger - Explosion - Piercer - Surplus
21 2 Bytes Lance - Doubletime - Javelin - Grand Lance
23 2 Bytes Fire - Flame On - Long Distance - Triple Flame
25 2 Bytes Ice - Chill Master - Ice Spreader - Cool Blast
27 2 Bytes Super Spin - Ultra Spin - Radical Spin - Sure Footed
29 2 Bytes Air Dash - Distance Dash - Sharp Wind - Maneuverability
31 2 Bytes Boomerang - Doublerang - Returner - Center of Focus
33 8 Bytes Unused, allows for 4 more Active Abilities to be added in later.
Passive Abilities
The format for Lance's abilities is as follows:
  • Format 1: Bits 0-2 is how many of the first ability shown is owned, and bit 3 shows if Lance has it equipped or not. Bits 4-6 is how many of the second ability shown is owned, and bit 7 shows if Lance has it equipped or not. He can equip 1 of the ability, and own up to 7.
  • Format 2: Bits 0-3 shows how many Lance owns, and bits 4-7 shows how many Lance has equipped. He can own and equip up to 15 of this ability.

Lance's Passive abilities can be viewed here.

41 1 Byte

(Format 1)

  • Bits 0-3: Lantern.
  • Bits 4-7: Survivor.
42 1 Byte

(Format 1)

  • Bits 0-3: Healer.
  • Bits 4-7: Double Magic.
43 1 Byte

(Format 1)

  • Bits 0-3: Triple Magic.
  • Bits 4-7: Distance Traveller.
44 1 Byte

(Format 1)

  • Bits 0-3: Magic Saver.
  • Bits 4-7: Flame Tail.
45 1 Byte

(Format 1)

  • Bits 0-3: Infinite Spin
  • Bits 4-7: Unused.
46 1 Byte

(Format 2)

Lucky
47 1 Byte

(Format 2)

Magic Master
48 1 Byte

(Format 2)

Attack Up
49 1 Byte

(Format 2)

Defense Up
50 1 Byte

(Format 2)

HP Up
51 1 Byte

(Format 2)

Magic Up
52 10 Bytes Unused.
Upgrades
Lance can have up to 255 of each upgrade, although if the amount of upgrades would exceed the amount possible, then the result will be capped.
62 1 Byte Attack Increase
63 1 Byte Defense Increase
64 1 Byte Magic Meter Increase
65 1 Byte Health Increase

FLGS

These are event flags for different events that happen in the game. It is 256 bytes in length, with 2048 possible event flags. If a value is 0 then it hasn't happened yet, while a value of 1 means that the event occurred.

Below is a description of the flag offsets, and what each one means when it is set to 1.

Please note that not all flags are consecutive. This allows me to add more later and group them together.

Bit Offset Bit description
Boss States
0 Parker defeated
1 Suzette defeated
2 Trent defeated
3 Olivia defeated
4 Ruby defeated
5 Claire defeated

TRSR

These are the different treasure locations in the game, and whether you got the treasure at that location or not. This block is 128 bytes in length, allowing for 1024 treasures.

Please Note that not every treasure slot is used. This allows me to add more treasures later and keep them in the same group.

This page is a stub. Roxy will probably come along later and add more to it.

ACHV

These are flags for the different Achievements you can get in the game. It is 16 bytes in length, allowing for 128 achievements. (However, it is unlikely that this many achievements will be in the game.)

This page is a stub. Roxy will probably come along later and add more to it.