Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Ren'Py save file

From ReverseEngineering.wiki
Format
Vendor Ren'Py (Tom Rothamel)
Magic PK 03 04 (ZIP)
Extensions .save
On this wiki Facts · Code · Notes · Topics

Save slot of Ren'Py games (<slot>-LT1.save): a ZIP (deflate) holding screenshot.png, extra_info, json, renpy_version, log (a pickle of the game state) and signatures.

Overview

Ren'Py writes each save slot as a ZIP archive named <slotname>-LT1.save (savegame_suffix in renpy/init.py line 154; FileLocation.filename in renpy/savelocation.py line 152). So the file starts with the ZIP local header PK 03 04 (Format:ZIP), and the game state is a Python pickle inside it (Format:Python pickle).

Entries

SaveRecord.write_file in renpy/loadsave.py (lines 106-124) writes with ZIP_DEFLATED, in this order:

Entry Content
screenshot.png PNG of the screen, only when a screenshot was taken
extra_info UTF-8 text, the extra_info argument of renpy.save (the save name)
json JSON metadata, see below
renpy_version text, renpy.version of the engine that wrote it
log the pickled game state
signatures text lines signature <base64 DER public key> <base64 signature> over the bytes of log (renpy/savetoken.py sign_data, encode_line); Unverified: what is stored when the engine has no signing key

The json entry

renpy.save (loadsave.py lines 208-222) builds a dict with _save_name, _renpy_version (list, renpy.version_tuple), _version (config.version, the game's own version), _game_runtime, _ctime, then lets every function in config.save_json_callbacks add fields, and dumps it with json.dumps. Games therefore carry custom metadata (chapter, playtime) here in plain text, readable without unpickling.

The log entry

The log is dump((roots, renpy.game.log), logf) (loadsave.py, in save): a pickle of the frozen store variables and the rollback log. The pickle protocol is pickle.HIGHEST_PROTOCOL of the Python the game runs (renpy/compat/pickle.py line 33 and dump at 378-387), so it depends on the interpreter version. Unverified: older Ren'Py (Python 2 based) writes protocol 2. Unpickling can run arbitrary code: use a restricted Unpickler in a sandbox, never plain pickle.load on a save from the internet.

Signatures

On load, renpy.savetoken.check_load (savetoken.py lines 141-157) returns true at once when the engine has no signing keys; otherwise a save whose signatures do not verify against the keys in the local token file makes the game ask the player to confirm. Unverified: that editing log only costs that confirmation, and what happens when signatures is deleted; also the exact wording of the prompt and where the token file is stored on each OS.

Where the slots are

renpy/savelocation.py (lines 780-790) scans config.savedir (per-user directory), then <game>/saves unless on mobile or the macOS app, then each directory in config.extra_savedirs. The persistent data (unlocked galleries, seen text) is the separate file persistent in the same directory (line 139), a pickle too. Unverified: the per-user directory of each platform (look at the value of config.savedir or the game's save_directory).

See also Library:Ren'Py, Technique:Reverse engineering game save files.

Code & repositories

Source read at renpy/renpy commit 6202e7fb43fd23594ab866af83bf928525a06410 (MIT): renpy/loadsave.py, renpy/savelocation.py, renpy/savetoken.py, renpy/compat/pickle.py.

  • https://github.com/renpy/renpy @ 6202e7fb43fd23594ab866af83bf928525a06410 · license: MIT (declared by the contributor; GitHub's detector did not recognize a license file)
    renpy/loadsave.py, savelocation.py and savetoken.py are the references for the save zip, its locations and signatures.
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries