Barotrauma Compress
A simple CLI utility to compress and decompress Barotrauma save files using fully cross-platform native code.
Installation
Manual: download an artifact from the latest release
Cargo: cargo install barotrauma-compress
Usage
Whether to compress or decompress will be chosen automatically based on what <INPUT> is: files will be decompressed,
and directories will be compressed.
Usage: barotrauma-compress <INPUT>
Arguments:
<INPUT> input file or directory.
Options:
-h, --help Print help
-V, --version Print version
Quick Guide to Save Editing
- Get a .save file from
%localappdata%\Daedalic Entertainment GmbH\Barotrauma\Multiplayer - Don't forget to back up your save somewhere in case you blunder!
- Run
barotrauma-compresson the .save file - It will create a folder next to the save file. Look inside and copy the filename of the .sub file, minus the
extension. For example, given
My Sub Name.subyou should now haveMy Sub Namein your clipboard. - Create a new empty submarine in the sub editor, paste the sub name from your clipboard, and save. This will generate
a new folder at
C:\Steam\steamapps\common\Barotrauma\LocalMods\My Sub Namethat contains aMy Sub Name.suband afilelist.xmlfile. This whole step was an exercise to generate thatfilelist.xmlwith the correct contents. - Close the submarine editor.
- Copy the .sub file from your decompressed save over the
C:\Steam\steamapps\common\Barotrauma\LocalMods\My Sub Name\My Sub Name.subfile. - Reopen the sub in the submarine editor. You should see your campaign sub with all its contents. Make your edits, and save.
- Copy the edited
C:\Steam\steamapps\common\Barotrauma\LocalMods\My Sub Name\My Sub Name.subfile back into your decompressed save, and use Barotrauma Save Decompressor to recompress the directory. - If all went well you can now load that campaign up and it'll work properly.
Removing the Hull Gunk
You may notice weird gunk on your walls that you cannot select. You don't need to remove this, but if it bothers you
here's how. It's some extra metadata in the hulls that the sub editor doesn't know how to deal with: specifically in the
xml, the <Hull> entries have a backgroundsections attribute that defines the gunk. If you just select all your
hulls and move them a bit, then Ctrl+Z them back it nukes all the background gunk. This saves you some effort over
gunzipping the .sub file and editing the XML directly.
Building from Source
- Install Rust
- Clone the project
cargo build --release
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License. See LICENSE for the full license text.
Credits
This project was inspired by Jlobblet/Barotrauma-Save-Decompressor, which is a GUI that does the same thing as this project. I wanted to make a CLI version that doesn't depend on .NET, and thus this project was born.