Spark the Electric Jester 2

Spark the Electric Jester 2

Not enough ratings
Save file management
By Major Gnuisance
Describes how to:
  • Back up your save file
  • Restore your save file from a backup

On Windows and Linux (incl. Steam Deck)

NOTE: some aspects of this guide have not yet been tested.
In particular, the Windows section. Feedback appreciated.
   
Award
Favorite
Favorited
Unfavorite
Background
⚡ Know what you're doing? Go ahead and skip to the Summary section!

The current version of Spark 2 keeps its save data in an unusual place: the Windows Registry.

This makes it harder to deal with than a conventional save file and prevents the developer from using Steam Auto-Cloud to provide support for Steam Cloud Saves.

Why is it like this? No idea.

The save data is located in the following location in the registry:

HKEY_CURRENT_USER\Software\Feperd Games\SparkTwo

Backing up and restoring your save will consist of backing up and restoring the registry keys under that location.

There are many ways to do this. We'll be using the reg command for simplicity.
Windows
Backing up

To back up your save on a Windows system, open a command prompt and run:

reg export "HKCU\Software\Feperd Games\SparkTwo" Spark2_save.reg

A file named Spark2_save.reg will be created in the current working directory, containing your save data.

Restoring

To restore your save on a Windows system, open a command prompt and run:

reg import Spark2_save.reg

This assumes you have a file named Spark2_save.reg (produced as described above) in the current working directory.

🔒 For added security, open and examine the .reg file in a text editor before importing it. Don't import untrusted .reg files!

Q: Does it have to be named Spark2_save.reg?

A: It can be any valid file name ending in .reg

Q: Is there no better way to do this?

A: Probably! I haven't used Windows myself in a very long time and I'm writing this without a Windows system to test things on. If you know better, please share in the comments. But note that I would not consider a 10-click GUI adventure through regedit a better solution.

Q: Do I have to do all that every time I want to backup or restore?

A: If you're going to be doing it frequently, you should probably look into automating it, for example using a batch file. Protip: try add a timestamp to the output file name so your backups are neatly organized.
Steam Deck & Linux
More background

Spark 2 is a Windows game, so under Linux it runs via Proton.

Proton keeps a separate Windows-like environment for each game in what's called a WINE Prefix.
If all you want is a quick and dirty backup, just make a copy of this text file, which contains the whole "HKEY_CURRENT_USER" part of the registry:

~/.steam/steam/steamapps/compatdata/1079210/pfx/user.reg

It will contain a section that begins like this:
[Software\\Feperd Games\\SparkTwo]

That contains all the data, but in a format that might not be ideal to restore from. I haven't looked into it myself. See the next section for how to back up properly.

Note: If you're on a Linux system other than a Steam Deck and you installed the game to a secondary Steam Library Folder, then the part that reads ~/.steam/steam/steamapps will vary depending on the location of the specific Steam Library Folder you used. If unsure try browsing the game's files and see where that leaves you.

Backing up

Similarly to the instructions for Windows, we'll be using the reg command. However, that requires using Wine and selecting the correct WINE Prefix for the game.

The command will be like this:

WINEPREFIX="path_to_game_prefix" "path_to_wine" reg export 'HKCU\Software\Feperd Games\SparkTwo' output_filename.reg


The parts in bold will vary depending on where the game is installed, where Proton is installed and the desired output filename.

Here's a specific example, that should work on a Steam Deck:
WINEPREFIX="$HOME/.steam/steam/steamapps/compatdata/1079210/pfx" "$HOME/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine" reg export 'HKCU\Software\Feperd Games\SparkTwo' Spark2_save.reg

You'll be left with a Spark2_save.reg file in the current working directory, in a format that should be suitable to restore even on a Windows system.

🛈 Steam Deck tip

There are two main ways of using the command line on the Steam Deck:
  1. Set up remote access via SSH and run the commands from another computer
  2. Go into Desktop mode and use the Konsole app
I won't be elaborating due to time constraints. There are plenty of guides out there that do and it's the same process every time. For example, this guide includes using Konsole in Desktop mode: https://steamproxy.com/sharedfiles/filedetails/?id=3011832943

Restoring

Again similar to Windows, using the reg command.

The command will be like this:

WINEPREFIX="path_to_game_prefix" "path_to_wine" reg import input_filename.reg

The parts in bold may vary.

On a Steam Deck, with a Spark2_save.reg file in the current working directory:

WINEPREFIX="$HOME/.steam/steam/steamapps/compatdata/1079210/pfx" "$HOME/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine" reg import Spark2_save.reg

🔒 For added security, open and examine the .reg file in a text editor before importing it. Don't import untrusted .reg files!

Automation

I wrote a convenience script to make the process easier.
Save the code below to ~/spark2_saves.sh, then use like this:

bash ~/spark2_saves.sh backup Spark2_save.reg bash ~/spark2_saves.sh restore Spark2_save.reg

Or, to save a backup after each game session, add this to the game's launch options:
bash ~/spark2_saves.sh backup-after-run %command%

After each session a new timestamped backup will be generated at ~/saves/Spark2/Spark2_save.YYYY-MM-DD_HH_MM_SS.reg

Each backup takes up about 223 KiB.
If you edit the script to enable compression it's about 8 KiB each.

Obligatory legal disclaimer for the script:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Code for spark2_saves.sh:
#!/bin/bash ### Configuration # Location for automatic save backups backup_dir="$HOME/saves/Spark2" # Compress backups using zstd? (yes or no) compress=no # Note: decompress with unzstd command ### Constants. Change as needed or desired. export WINEDEBUG=-all export WINEPREFIX="$HOME/.steam/steam/steamapps/compatdata/1079210/pfx" my_wine="$HOME/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine" reg_key='HKCU\Software\Feperd Games\SparkTwo' function backup { "$my_wine" reg export "$reg_key" "$1" if [[ "$compress" == yes ]] ; then zstd --rm "$1" fi } function restore { "$my_wine" reg import "$1" } function backup-after-run { "$@" mkdir -p "$backup_dir" cd "$backup_dir" || return filename="Spark2_save.$(date +%F_%H_%M_%S).reg" backup "$filename" } function usage { echo "Call this script with arguments: [backup|restore] FILENAME.reg" echo "Alternatively, add to game launch options like this:" echo "bash \"$(realpath "$0")\" backup-after-run %command%" } if [[ $# -lt 2 ]] ; then usage exit fi case "$1" in backup) backup "$2" ;; restore) restore "$2" ;; backup-after-run) shift 1 backup-after-run "$@" ;; *) usage ;; esac

Q: Is there no better way to do this?

A: Probably! If you know better, please share in the comments.

Q: It's giving me an error like "bash: /home/deck/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine: No such file or directory"

A: Your Proton might live elsewhere. Adjust the path accordingly in the command or script.
Note that the /files/ part might be /dist/ depending on the version of Proton.

Q: Can I use my system's Wine instead of Proton's?

A: Yeah, probably. It might also help in case Proton's wine fails to run on your system for some reason. Otherwise you might need to add Steam Runtime into the mix.
Tranfering save files between devices
Now that you have a way to save and restore your save, you need a way to move those files between your devices.

There are many ways to do this, but if a Steam Deck is involved I recommend the following:

One shot, local network only: Warpinator
Persistent two-way syncing: Syncthing
No network: USB drive
If you have set up SSH: SFTP

SSH is particularly nice to have, since you can do everything in this guide from a desktop computer without going into Desktop Mode on the Deck.
Summary
This section serves as a command summary and a guide for busy people who know what they're doing.

Windows

Backup save file
reg export "HKCU\Software\Feperd Games\SparkTwo" Spark2_save.reg

Restore save file
reg import Spark2_save.reg

🔒 For added security, open and examine the .reg file in a text editor before importing it. Don't import untrusted .reg files!

Steam Deck

(And generic Linux, with some luck.)

Backup save file
WINEPREFIX="$HOME/.steam/steam/steamapps/compatdata/1079210/pfx" "$HOME/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine" reg export 'HKCU\Software\Feperd Games\SparkTwo' Spark2_save.reg

Restore save file
WINEPREFIX="$HOME/.steam/steam/steamapps/compatdata/1079210/pfx" "$HOME/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine" reg import Spark2_save.reg

🔒 For added security, open and examine the .reg file in a text editor before importing it. Don't import untrusted .reg files!

Linux (template)

(Identical to the commands for the Steam Deck if you don't edit them first.)

Backup save file
# Steam Library Folder where you installed Spark 2 steam_library_folder="$HOME/.steam/steam/steamapps" # Path to a compatible wine executable my_wine="$HOME/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine" # Actual command WINEPREFIX="$steam_library_folder/compatdata/1079210/pfx" "$my_wine" reg export 'HKCU\Software\Feperd Games\SparkTwo' Spark2_save.reg

Restore save file
# Steam Library Folder where you installed Spark 2 steam_library_folder="$HOME/.steam/steam/steamapps" # Path to a compatible wine executable my_wine="$HOME/.steam/steam/steamapps/common/Proton - Experimental/files/bin/wine" # Actual command WINEPREFIX="$steam_library_folder/compatdata/1079210/pfx" "$my_wine" reg import Spark2_save.reg
9 Comments
NekoFoxFox 7 May @ 12:56am 
I will be glad if there is a solution to the problem with flashes in the game. And about saving, yes, if you export through the command, the file is stored in System32. If you do the export yourself, the file can be saved anywhere.
Major Gnuisance  [author] 6 May @ 11:34pm 
System32?! That's definitely not where I'd expect it to be.
As for the white flashes bug, I think that's the first time I've heard of it.

To be honest I don't keep any Windows systems at hand to test with, so I can't really help with Windows stuff. I've just been answering from memory and looking stuff up online.
NekoFoxFox 6 May @ 2:36pm 
Can you help me with white flashes bug? For some reason there are white flashes on the characters almost all over the screen. This is most noticeable in cutscenes. How to fix it? I think this is a bug with bloom effect
NekoFoxFox 6 May @ 2:39am 
I found save in system32 folder after export. I also can export save via regedit.
Major Gnuisance  [author] 5 May @ 4:36pm 
By default, it should be in your user profile.
You know, you user's main directory, that contains other directories like Desktop, My Documents, etc.
Normally something like C:\\Users\YOUR_USERNAME
Major Gnuisance  [author] 5 May @ 4:23pm 
It will be in the directory where you ran the "reg export ..." command.
You can run this command to open a new file explorer window wherever that is:
explorer .
Mind the space and period (.) after "explorer"
NekoFoxFox 5 May @ 7:58am 
How to find save on pc after exporting?
Major Gnuisance  [author] 2 May @ 2:12pm 
Indeed, I just noticed there's a line missing!
The function backup-after-run is missing this at the end: [code]backup "$filename"[/code]
I'll edit the post to include it. Thanks for the heads up!
Inkblot-JustCallMeTony 1 May @ 1:49pm 
I seem to be having some trouble. when I put the "bash ~/spark2_saves.sh backup-after-run %command%" in the launch options of the game, It creates the folders but nothing gets saves in the "Spark 2" folder like the code says it should. If the script is creating the folders then it should have permission to write to that location, but for some reason it just doesn't. I also ran the "usage" command and used the code it gave me to see if that would fix it, but it still doesn't write anything to the folder. Any Idea what could be wrong? The normal backup/restore commands seem to work as normal so I can use those for the time being.