Difference between revisions of "Save File Format"

From Shield Cat Wiki
Jump to navigation Jump to search
(Created page with "{{FutureFeatures}} {| class="wikitable" !style="color: red;"|Warning! |The information below is to be considered a <b>draft.</b> This means that the information presented is <...")
 
Line 11: Line 11:
 
   OTTSAV00.BIN
 
   OTTSAV00.BIN
 
where <code>00</code> is the number of the save file. The game, therefore, supports up to 255 save files.
 
where <code>00</code> is the number of the save file. The game, therefore, supports up to 255 save files.
 +
 +
Save information is stored in blocks, where each block has a certain data associated with it. <b>There <u>cannot</u> be two blocks of the same type.</b> All blocks listed below must be present, or the file will be considered invalid.
 +
 +
In Gamemaker, it is loaded and saved as a Buffer with type <code>buffer_fast</code>. It is <code>buffer_u8</code> 1 byte aligned.
  
 
== Header ==
 
== Header ==
 
<code>OTTSAV</code> files start with the following header:
 
<code>OTTSAV</code> files start with the following header:
 
   SC_OTTSAV_V00
 
   SC_OTTSAV_V00
where <code>00</code> is the version of the save format. <b>During the prototype phase,</b> all save files will use format 00.
+
where <code>00</code> is the version of the save format. <b>During the prototype phase,</b> all save files will use format 00. The format may also change a lot.
 +
 
 +
== 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>23 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 these numbers don't match the upgrades he has, the save will be invalid.</i>
 +
 
 +
{| class="wikitable"
 +
!Offset
 +
!Bytes
 +
!Description
 +
|-
 +
!0
 +
!2 Bytes
 +
|Lance's max health
 +
|-
 +
!2
 +
!2 Bytes
 +
|Lance's max magic
 +
|-
 +
!4
 +
!1 Byte
 +
|Lance's attack stat
 +
|-
 +
!5
 +
!1 Byte
 +
|Lance's defense stat
 +
|-
 +
!6
 +
!8 Bytes
 +
|The abilities Lance has, as packed bytes. Please see the <b>Ability Byte Format</b> table below.
 +
|-
 +
!14
 +
!8 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, the file will be invalid.</i>
 +
|-
 +
!22
 +
!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.
 +
|}
 +
 
 +
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 Abilites]].
 +
 
 +
{| 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
 +
|}
  
 
[[Category:Technical Info]]
 
[[Category:Technical Info]]

Revision as of 06:36, 18 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, therefore, supports up to 255 save files.

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.

In Gamemaker, it is loaded and saved as a Buffer with type buffer_fast. It is buffer_u8 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 23 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 these numbers don't match the upgrades he has, the save will be invalid.

Offset Bytes Description
0 2 Bytes Lance's max health
2 2 Bytes Lance's max magic
4 1 Byte Lance's attack stat
5 1 Byte Lance's defense stat
6 8 Bytes The abilities Lance has, as packed bytes. Please see the Ability Byte Format table below.
14 8 Bytes The abilities Lance has equipped, as packed bytes. Please see the Ability Byte Format table below.

Please note that if it is marked Lance has an ability equipped that he does not actually have, the file will be invalid.

22 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.

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 Abilites.

Ability Byte Format
Bit Offset Ability/Upgrade Name
Shield
0 Shield Ability
1 Shield Upgrade - Homing
2 Shield Upgrade - Wave
3 Shield Upgrade - Indestructible
Dagger
4 Dagger Ability
5 Dagger Upgrade - Explosion
6 Dagger Upgrade - Piercer
7 Dagger Upgrade - Surplus