Get decompiled savegame
Savegames are actually written to disk in a plaintext form and then compiled by the engine. The source file is deleted afterwards. To obtain it under Linux:
- save your game, name it e.g. “TEST”
- find your savegame folder, it should be:
~/.local/share/spacepiratesandzombies/b_save/
- make sure there are the files
sg_TEST.cs.dso
andsi_TEST.cs
in that folder - touch an empty file
sg_TEST.cs
and make sure its permissions allow read/write for the user - now remove the write permission from the directory (
chmod a-w b_save
) - in the game, (may load first) and save again under the same name (overwrite!)
- the
sg_TEST.cs
should now contain the full savegame
Compile after modifications
To make SPAZ load the modified file, you have to compile it first. SPAZ won’t compile it on its own. But we can trick it:
- find your SPAZ settings folder, it should be
~/.local/share/spacepiratesandzombies/b_settings/
- rename the files
spz_settings.cs
andspz_settings.cs.dso
to something else - now copy your modified
sg_TEST.cs
into it and name itspz_settings.cs
- run SPAZ from Steam, until you see the resolution/mod-pack selection screen, quit SPAZ
- you should now find a file
spz_settings.cs.dso
in that folder – that’s your compiled savegame - rename
spz_settings.cs
→sg_TEST.cs
andspz_settings.cs.dso
→sg_TEST.cs.dso
- rename the original files back to
spz_settings.cs
andspz_settings.cs.dso
Calculate Checksum
SPAZ does a primitive checksum validation on its savegames. If you take a look at the si_TEST.cs
, you’ll find something like this:
TEST
2013 08 12 22 42 01
1
3
6
THE SOL SYSTEM
1.605
0
371866351
TEST2013 08 12 22 42 01136THE SOL SYSTEM1.6050371866351
The number in the last but one line is a decimal CRC32 checksum with its bytes negated (signed 4-byte integer). The number occurs a second time at the end of the last line.
To calculate the number from our new file, first calculate the CRC32:
$ crc32 sg_TEST.cs.dso
e9d5c510
Now negate that value, so we get: ffffffff162a3aef
. We only use the last 8 nibbles (last 4 bytes): 162a3aef
.
Finally, turn that into a signed decimal number: 371866351
. Done. This is our new checksum which goes right into the si_TEST.cs
file. Now you’re able to load the modified savegame.