Skip to content
PN Scripts

Game dev tools

Stashwright by PN Scripts

Players never lose progress to a crash or a damaged file: versioned slots, atomic writes, checksums, self-healing backups, JSON migrations, AES encryption, async API. Unity editor not run; core tested with .NET.

  • C#
  • .NET Standard 2.1
  • Newtonsoft.Json
  • Unity Package Manager
  • xUnit
  • Coming soon

Coming soon

Not published on its store yet, so there is no buy or download link. PN Scripts does not take payment for it here.

Three save slot cards with their backup files and sizes, next to the JSON content of slot1.save

What it solves

The gap

Simple save code writes straight over the only copy of the player's progress, cannot tell a damaged file from a good one, and breaks old saves as soon as the data classes change.

What it is

Stashwright writes atomically, checksums every payload, keeps rotating backups and recovers from them, and upgrades old saves through explicit JSON migrations, behind an async slot API.

How you use it

Players do not lose progress to a crash or a damaged file, and you can change your save data between updates without breaking old saves.

A compact, source-included save layer for Unity developers who want crash-safe, versioned saves without adopting a large data framework.

Who it is for

Use it when

  • Save slots for RPGs, adventure and management games
  • Shipping updates that change the save format without breaking old saves
  • Detecting edited or damaged save files on PC and mobile

Built for

  • Unity developers who write their own save code today
  • Small teams shipping updates to games with persistent progress

What is inside

Slots and the file format

Each slot is one JSON file with a format marker, the slot name, the save version, a UTC time, a sequence number, your metadata (area, level, playtime), a SHA-256 checksum and the payload. ListSlotsAsync reads only these headers, newest first, so a load menu can show every slot without loading or decrypting the data.

Crash-safe writes and backups

SaveAsync writes to slot.save.tmp, flushes it to the physical disk and renames it over the slot. Before that, the current file is copied to slot.save.bak1 and older backups move down to the configured count. A write interrupted before the rename leaves the old save in place, and CleanUpInterruptedWrites removes the leftover temp file.

Damage detection and recovery

Loading checks the envelope, the slot name, the checksum and, for encrypted saves, the HMAC. A rejected file is reported with its reason, the newest good backup is used and written back as the slot, and the result says RecoveredFromBackup. If every copy is bad the result is Corrupt and nothing is overwritten.

Migrations and encryption

Raise the save version when your data changes and register one migration per step; each receives the raw JSON and returns the upgraded JSON, and the result reports the path, for example 1, 2, 3. Encryption is optional: AES-256-CBC with a fresh salt and IV per save, HMAC-SHA256 over the ciphertext, and keys from your passphrase with PBKDF2-SHA256. It stops casual editing; a key inside a build can be extracted.

Specs

Availability
Coming soon
Vendor
PN Scripts
Type
Package
Pricing
One-time purchase Price to be announced.
License
Proprietary
Deployment
Download (UPM tarball and ZIP with C# source)
Maturity
v1.0.0

Compatibility

Platform or runtime Supported versions Tested up to
.NET (core library) netstandard2.1 or newer .NET 8.0
Unity 2021.3 or newer compiled against 6000.5.4, not run

Stack

  • C#
  • .NET Standard 2.1
  • Newtonsoft.Json
  • Unity Package Manager
  • xUnit

Stashwright is coming soon

It is finished and tested. It is not on sale yet; this page will say where to get it when it is.

Coming soon

Not published on its store yet, so there is no buy or download link. PN Scripts does not take payment for it here.

Questions

A save system for Unity: versioned save slots as JSON with migrations, atomic writes, checksums, rotating backups with recovery, optional AES encryption and an async API, with full C# source.

The package declares Unity 2021.3 or later and the official Newtonsoft JSON package. The core targets netstandard2.1 and was tested on .NET 8 on Linux. The Unity editor was not run for this release: the Unity scripts were compiled against the Unity 6000.5.4 assemblies, nothing ran inside Unity.

No cloud saves or platform storage (Steam, consoles, iCloud), no binary serialiser, no WebGL-specific storage, and no visual save browser beyond the editor menu. IL2CPP stripping settings were not tested.

It was written in C# with Newtonsoft.Json and the .NET cryptography APIs. Created with AI assistance; the core was checked by PN Scripts with 38 xUnit tests on .NET 8 and a scenario run against real files, which also produced the preview images.

It is not on sale yet. When it is, this page will link to the store; PN Scripts does not take payment on this site.