Difference between revisions of "Save File Format"

From Shield Cat Wiki
Jump to navigation Jump to search
Line 44: Line 44:
 
|-
 
|-
 
!4
 
!4
 +
!2 Bytes
 +
|Lance's current health.
 +
|-
 +
!6
 +
!2 Bytes
 +
|Lance's current magic.
 +
|-
 +
!8
 
!1 Byte
 
!1 Byte
 
|Lance's attack stat
 
|Lance's attack stat
 
|-
 
|-
!5
+
!9
 
!1 Byte
 
!1 Byte
 
|Lance's defense stat
 
|Lance's defense stat
|-
 
!6
 
!4 Bytes
 
|The abilities Lance has, as packed bytes. Please see the <b>Ability Byte Format</b> table below.
 
 
|-
 
|-
 
!10
 
!10
!4 Bytes
 
|The abilities Lance has equipped, as packed bytes. Please see the <b>Ability Byte Format</b> table below.
 
 
<i><b>Please note</b> that if it is marked Lance has an ability equipped that he does not actually have, undefined behavior will occur.</i>
 
|-
 
!14
 
 
!1 Byte (packed)
 
!1 Byte (packed)
 
|Various flags about Lance's state:
 
|Various flags about Lance's state:
Line 69: Line 67:
 
* Bits 6-7: unused.
 
* Bits 6-7: unused.
 
|-
 
|-
!15
+
!11
 
!1 Byte (packed)
 
!1 Byte (packed)
 
|Various flags about the game itself:
 
|Various flags about the game itself:
Line 84: Line 82:
 
* Bits 6-7: Unused.
 
* Bits 6-7: Unused.
 
|-
 
|-
!16
+
!12
 
!3 Bytes
 
!3 Bytes
 
|How many Pretty Petals Lance has in his possession.
 
|How many Pretty Petals Lance has in his possession.
 +
|-
 +
!15
 +
!2 Bytes
 +
|Which save location Lance saved at.
 +
|-
 +
!colspan=3|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 [[Lance's Abilities#Active Abilities|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
 
!19
 
!2 Bytes
 
!2 Bytes
|Which save location Lance saved at.
+
|Dagger - Explosion - Piercer - Surplus
 
|-
 
|-
 
!21
 
!21
 
!2 Bytes
 
!2 Bytes
|Lance's current health.
+
|Lance - Doubletime - Javelin - Grand Lance
 
|-
 
|-
 
!23
 
!23
 
!2 Bytes
 
!2 Bytes
|Lance's current magic.
+
|Fire - Flame On - Long Distance - Triple Flame
|-
 
!colspan="3"|Lance's Inventory
 
|-
 
|colspan="3"|The first 4 bits indicate how many of these Lance can have, up to 15. The last 4 bits indicate how many he has equipped. Some he can only have one equipped. The amount he has equipped should never be more than the amount he has! For the two byte ones, the first 8 bits are how many he has, and the last 8 bits are how many he has equipped.
 
 
 
If Lance gets an item in game that he can't carry any more of, then it will be converted automatically into Pretty Petals.
 
 
|-
 
|-
 
!25
 
!25
 
!2 Bytes
 
!2 Bytes
|How many Attack Up abilities Lance has. He can carry and equip up to 255. If the result would make Lance have more attack than is possible, it will be capped.
+
|Ice - Chill Master - Ice Spreader - Cool Blast
 
|-
 
|-
 
!27
 
!27
 
!2 Bytes
 
!2 Bytes
|How man Defense Up abilities Lance has. He can carry and equip up to 255. If the result would make Lance have more defense than is possible, it will be capped.
+
|Super Spin - Ultra Spin - Radical Spin - Sure Footed
 
|-
 
|-
 
!29
 
!29
 
!2 Bytes
 
!2 Bytes
|How many HP Up abilities Lance has. He can carry and equip up to 255. If the result would make Lance have more health than is possible, it will be capped.
+
|Air Dash - Distance Dash - Sharp Wind - Maneuverability
 
|-
 
|-
 
!31
 
!31
 
!2 Bytes
 
!2 Bytes
|How many Magic Up abilities Lance has. He can carry and equip up to 255. If the result would make Lance have more magic than is possible, it will be capped.
+
|Boomerang - Doublerang - Returner - Center of Focus
 
|-
 
|-
 
!33
 
!33
!1 Byte
+
!8 Bytes
|How many Lucky abilities Lance has. He can equip up to 15.
+
|Unused, allows for 4 more Active Abilities to be added in later.
|-
 
!34
 
!1 Byte
 
|How many Magic Master abilities Lance has. He can equip up to 15.
 
|-
 
!colspan=3|Active Ability Overflow
 
|-
 
|colspan=3|If Lance finds an ability in the field, and he already has the ability, it will be stored here. Lance can then sell it at the shop for Pretty Petals.
 
!35
 
!4 Bytes
 
|Packed byte indicating excess Abilities and Upgrades Lance finds in the field. Follows the Ability table below.
 
|-
 
!colspan=3|Passive Abilities (single)
 
|-
 
|colspan=3|The bit format is as follows: First 3 bits is how many Lance has, and the 4th bit is if Lance has one equipped or not.
 
!39
 
!1 Byte
 
|How many Flame Tail abilities Lance has. He can equip 1 and sell the rest.
 
!25
 
!1 Byte
 
|How many Lantern abilities Lance has. He can equip one and sell the rest.
 
|-
 
!26
 
!1 Byte
 
|How many Survivor abilities Lance has. He can equip one and sell the rest.
 
|-
 
!27
 
!1 Byte
 
|How many Healer abilities Lance has. He can equip one and sell the rest.
 
|-
 
!28
 
!1 Byte
 
|How many Double Magic abilities Lance has. He can equip one and sell the rest.
 
|-
 
!29
 
!1 Byte
 
|How many Triple Magic abilities Lance has. He can equip one and sell the rest.
 
|-
 
!30
 
!1 Byte
 
|How many Distance Traveller abilities Lance has. He can equip one and sell the rest.
 
|-
 
!31
 
!1 Byte
 
|How many Magic Saver abilities Lance has. He can equip one and sell the rest.
 
|-
 
!25-50
 
!25 Bytes
 
|Unused, reserved for future use.
 
|}
 
 
 
Below is an explaination of the packed bytes that represent the abilities Lance currently owns and has equipped. For a detailed explaination of his abilities, please visit [[Lance's Abilities]].
 
 
 
{| class="wikitable"
 
!colspan="2"|Ability Byte Format
 
|-
 
!Bit Offset
 
!Ability/Upgrade Name
 
|-
 
!colspan="2"|Shield
 
|-
 
!0
 
|Shield Ability
 
|-
 
!1
 
|Shield Upgrade - Homing
 
|-
 
!2
 
|Shield Upgrade - Wave
 
|-
 
!3
 
|Shield Upgrade - Indestructible
 
|-
 
!colspan="2"|Dagger
 
|-
 
!4
 
|Dagger Ability
 
|-
 
!5
 
|Dagger Upgrade - Explosion
 
|-
 
!6
 
|Dagger Upgrade - Piercer
 
|-
 
!7
 
|Dagger Upgrade - Surplus
 
 
|}
 
|}
  

Revision as of 21:54, 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 50 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.

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.