Saves and save states
Credenza keeps your game progress on the server, under your account — not in the browser. Save on your laptop, and the save is there when you pick the game up on your phone. Two people who share a computer each have their own saves.
There are two kinds of saved data, and Credenza handles both.
| Cartridge save | Save state | |
|---|---|---|
| What it is | The save the game itself makes — the in-game “Save” or save point, stored on the cartridge’s battery-backed memory in the original hardware | A snapshot of the whole emulator at one instant, which you can return to at any moment |
| How you make one | Save inside the game, as you normally would | Save State on the emulator’s menu bar, or the 1 key |
| How many | One per game, per account | Nine slots per game, per account |
| Tied to an emulator core | No | Yes |
Cartridge saves
Section titled “Cartridge saves”You don’t have to do anything. When a game writes its save, Credenza uploads it to the server within about ten seconds, and again whenever you switch away from the tab or leave the play page. Nothing is uploaded unless the save has actually changed.
When you start the game, your save is put back a moment after the game boots — the game runs for a few frames against an empty cartridge before it arrives, which is normally too quick to notice.
Save states
Section titled “Save states”The emulator’s menu bar along the bottom of the game has Save State and Load State buttons. Both use the current slot, which you choose under Save State Slot in the emulator’s Settings (slots 1 to 9).
The keyboard does the same without a menu:
| Key | Action |
|---|---|
| 1 | Save a state to the current slot |
| 2 | Load the state in the current slot |
| 3 | Move to the next slot |
Each state is stored on the server with a screenshot of the moment it was taken, and the emulator confirms it with “Saved to slot 4 on this server” (or whichever slot). Saving to a slot that already holds a state replaces it.
Save states and cores
Section titled “Save states and cores”A save state is a copy of one emulator core’s memory, and it only loads back into that same core. NES and Nintendo 64 games can run on either of two cores (see Switching emulator core), so a state saved on one won’t load on the other. Credenza refuses the load rather than let it corrupt the game, with a message such as “Slot 2 was saved with nestopia; switch cores to load it”.
Cartridge saves aren’t affected: every core reads them the same way.
Playing in two places at once
Section titled “Playing in two places at once”If a game is open in two browsers and both write a cartridge save, the second one to upload finds the server’s copy has changed underneath it. A bar appears above the game:
This game was saved somewhere else since you opened it. Which one should this server keep?
- Keep this one keeps the save from the browser you are looking at.
- Load the other replaces it with the version already on the server.
Both are somebody’s play time, so Credenza asks rather than guessing. Save states don’t ask: the most recent Save State to a slot wins.
The Saved data panel
Section titled “The Saved data panel”Each game’s page has a Saved data section showing what your account has stored for that game:
- Cartridge save — whether one exists, with Download to save a copy to your device and Import… (or Replace…) to upload one.
- A card for each filled slot, with its screenshot and the core that made it, and Download and Delete buttons.
- Import save state… to upload a state into a slot.
There is no Load button here. To load a state, start the game and use Load State on the emulator’s own menu bar.
Bringing saves in from another emulator
Section titled “Bringing saves in from another emulator”A cartridge save downloads as a .srm file, which other emulators can read. For importing, the
panel accepts .srm, .sav, .fla, .eep and .mpk files.
A save state’s file name records its slot and the core that wrote it, for example
Chrono Trigger.slot3.snes9x.state. Importing puts the state into the slot its name gives. A
.state file whose name doesn’t include a slot and a core is refused, because Credenza can’t tell
which core would load it — if you know which core made it, rename the file to match the pattern.
Importing replaces what is stored. If something is already there, Credenza asks you to confirm first.
Where saves are stored
Section titled “Where saves are stored”Saves are ordinary files in a save folder on the server, organised by account and by game. By
default this is a game-saves folder inside the server’s data directory:
| Installation | Default save folder |
|---|---|
| Docker | /data/credenza/game-saves inside the container, on the /data volume |
| Linux package | /var/lib/credenza/game-saves |
An administrator can see and change it at Settings → Server → Storage: press Change on the
Game saves row, enter an absolute path (or browse to one) and save. Credenza checks the server can
write there before accepting it, and Use default goes back to the default. It can also be set
before first start with MediaServer__Games__SaveDirectory — see
Configuration.
Size limits
Section titled “Size limits”To stop one account filling the disk, the server caps how large each upload can be. An upload over the cap is refused with “That file is larger than this server accepts.” and the previous save is left untouched.
| What | Default cap | Setting |
|---|---|---|
| Cartridge save | 1 MB | MediaServer__Games__MaxSaveBytes |
| Save state | 16 MB | MediaServer__Games__MaxStateBytes |
| Save state screenshot | 2 MB | MediaServer__Games__MaxScreenshotBytes |
The values are in bytes. See Configuration for how to set them.
Keeping saves safe
Section titled “Keeping saves safe”Back up the save folder. Saves are files, not database rows, so a backup of the database alone
does not include them. The Docker /data volume and /var/lib/credenza on a Linux install already
contain the default save folder; if you moved it elsewhere, back that up too.
Back up the database and the save folder together. The database keeps an index of every save with a checksum of its contents. If a save file doesn’t match its checksum — because it was damaged, or restored from a different point in time than the database — Credenza reports it rather than loading it, and the play page shows “Your saved data could not be read from this server.” The game still plays, but the save needs sorting out before you lose more progress on top of it.
Players can keep their own copies. Download in the Saved data panel gives you files you can keep anywhere and import again later.
What deletes saves
Section titled “What deletes saves”- Remove from library… on a game deletes every account’s saves and play history for it. The ROM on disk isn’t touched, and the next scan adds the game back — without the saves.
- Deleting a library does the same for every game in it.
- Deleting an account removes that person’s saves from Credenza. The files are left behind in the save folder; nothing cleans them up.
A game whose file has gone missing — an unplugged drive, say — keeps its saves, and they are there again once the file is back.