-
Notifications
You must be signed in to change notification settings - Fork 0
.STA File Format (SaveTracker Archive)
The .STA format is a custom archive container designed specifically for game save synchronization. It wraps a standard ZIP payload with a binary header and JSON metadata to enable "peekable" properties without downloading the entire file.
An .STA file consists of three sequential parts:
[ 128 Bytes Header ] + [ Variable Length Metadata ] + [ ZIP Payload ]
The first 128 bytes are reserved for critical identification and parsing info.
| Offset | Size | Type | Value | Description |
|---|---|---|---|---|
| 0 | 6 | ASCII | STARCH |
Magic signature to identify file type |
| 6 | 2 | UInt16 | 1 |
Format Version (currently 1) |
| 8 | 8 | Int64 | Size |
Length of the JSON metadata in bytes |
| 16 | 112 | Bytes | 0x00 |
Reserved padding for future use |
Immediately following the header is a UTF-8 encoded JSON string containing game and file information. This allows the client to know exactly what's inside without downloading the ZIP body.
Key Metadata Fields:
-
GameName: Name of the game -
PlayTime: Total playtime at moment of upload -
Files: Dictionary of all files included (Paths, Hashes, Sizes) -
Timestamp: When the archive was created
The remainder of the file is a standard ZIP archive containing the actual save files.
- Compression: Deflate (Optimal)
- Directory Structure: Preserved relative to the game's save root
Legacy sync methods required downloading a file to know its contents or relying on fragile timestamp comparisons. With .STA, SaveTracker reads just the first few kilobytes of a remote file to parse the header and metadata.
- Benefit: Instantly check if a cloud save is newer or different without downloading 500MB of data.
Many games use multiple files for a single save (e.g., save.dat, save.idx, thumb.png). Uploading them individually is slow and risks partial syncs if the network cuts out.
- Benefit: .STA bundles them into one atomic unit. Either you get the whole save state, or nothing.
Uploading 1,000 small files (common in games like Minecraft or Skyrim) to Google Drive triggers 1,000 API calls, hitting rate limits instantly.
- Benefit: .STA counts as 1 API call, speeding up large syncs by over 50%.
The archive carries its own context (Playtime, Last Played Date) within it, making it self-describing. This enables features like "Cloud Playtime Display" even on a fresh PC before any sync occurs.