A robust, zero-configuration background service and launch wrapper for Barony on Windows. This script protects your save files from the game's strict perma-death mechanics by seamlessly intercepting death events and automatically resurrecting your characters, while correctly allowing you to permanently delete saves from the game's UI.
- Seamless Steam Integration: Runs automatically when you launch Barony through Steam. No need to start background scripts manually.
- Deterministic Death Detection: Parses the Barony engine's
log.txtin real-time to definitively tell the difference between an in-game death and an intentional UI save deletion. - Ultra-Fast, Zero-Impact Polling: Monitors your save files every 2 seconds without wasting CPU or I/O. It tracks the file's modification time (
mtime) and only processes data when the game engine actually writes to the disk. - Automated Graveyard: Every time a character dies, a permanent backup is archived in a
Graveyardfolder along with a clickableResurrect_Character.commandtool to easily restore them to an empty save slot. - The Fallen Chronicles: Automatically maintains a lore-friendly text log of your fallen heroes, tracking their Cause of Death, Class, Race, Level, Floor reached, and total kills.
- Smart Storage Limits: Automatically prunes old backups and logs to prevent your hard drive from filling up. Keeps up to 10 rolling backups per active character, 100 total characters in the Graveyard, and 1200 lines in The Fallen Chronicles.
- Interactive Dashboard: Launches a persistent terminal window alongside the game that displays ASCII art and a live rolling log of all save operations, character deaths, and staging injections as they happen in real-time.
- Fail-Safely Enforcement: If the script cannot confidently determine why a save file vanished (e.g., the game crashed or the logs rotated), it defaults to resurrecting the character to ensure saves are never lost by mistake.
-
On this GitHub page, click the green Code button and select Download ZIP.
-
Open your
Downloadsfolder and unzip the file. It will create a folder called something likeBarony-main. -
Rename that folder to exactly
Barony. -
Move your new
Baronyfolder into your Documents directory (e.g.C:\Users\YOUR_USERNAME\Documents\Barony). -
Open Steam.
-
Right-click Barony in your library and select Properties...
-
In the General tab, scroll down to Launch Options.
-
Paste the following command.
[!IMPORTANT] Ensure you replace
YOUR_USERNAMEwith your actual Windows username in the path below. If you placed the folder anywhere other than your Documents, update the path accordingly!"C:\Users\YOUR_USERNAME\Documents\Barony\launcher.bat" %command%
Just launch Barony from Steam. The Save Protector will launch alongside the game, opening a persistent Dashboard window that monitors your saves in real-time. Play the game normally!
- If you die, you will receive a notification that your character was saved. The save file will be instantly restored to the main menu.
- If you delete a save manually from the Barony main menu, the script will permanently delete the backups for that slot.
The script automatically generates a Graveyard folder in the same directory as the script.
- Inside you'll find
Solo_RunsandMultiplayer_Runscontaining permanent backups of every death. - You'll also find
The_Fallen_Chronicles.txtwhich tracks the stats and causes of death for every fallen hero.
When your character dies, the script automatically catches it and instantly stages the save file for resurrection.
- You do not need to do anything manually. Simply close the game and restart it from Steam. The Staging Injector will intercept the launch and restore the file to its original save slot before Steam Cloud can overwrite it.
- A permanent copy is also sent to the
Graveyardfor your records.
If you ever want to replay an older dead character that has been archived in your Graveyard:
- Fully quit Barony. (The engine will overwrite the save if you do this while the game is running).
- Open the
Graveyardfolder and double-click theResurrect_Character.batfile. - Select the old character's
.baronysavefile from the prompt. - The character will be instantly staged. Launch the game from Steam to inject them back into their original slot.
- Windows 10/11
- Steam installation of Barony
This script handles execution handoffs cleanly to preserve the native Steamworks environment. It parses JSON saves natively with PowerShell for extreme speed and does not require Python or any external dependencies. It uses atomic file operations to prevent data corruption during power loss.
If you ever want to stop using the Save Protector:
- Open Steam, go to Barony's Properties > General.
- Delete the command from the Launch Options text box.
- The game will now launch normally. You can safely delete the
Baronyfolder from your PC if you no longer want the Graveyard backups.
- Turning Wheel LLC for creating Barony, an incredible and unforgiving dungeon crawler.
- Tink and JewcyJay for the invaluable help with multiplayer testing and debugging.
- Google Antigravity for assisting with the code review of this project.
Created by Raven Lord — Happy dungeon crawling!