Separate Encrypted Persistent File vs Embedded Persistent Data in Ren'Py Saves
0 reputation · 08 Mar 2026, 10:55 UTC
0 reputation · 08 Mar 2026, 10:55 UTC
Ren'Py keeps persistent data alongside save data by default, and the engine exposes config.encrypted_persistent as an optional flag. The documented description does not make clear whether enabling that flag encrypts persistent values wherever they are written, or whether it only takes effect when persistent data is written to a dedicated persistent file.
That distinction matters for a project shipping a single distributed build that wants save files to stay portable while keeping unlock flags, gallery progress, or preference data out of plain text. A separate persistent file can be encrypted and managed independently, but adds a second artifact to back up, migrate, and clear. Embedding persistent data in each save keeps distribution simple, yet those values may remain readable inside the save container.
Version assumption: Ren'Py 8.x defaults; older releases and custom persistence overrides may behave differently.
Which behavior does config.encrypted_persistent actually govern? Does a separate persistent file get created automatically, or must it be configured explicitly? For a small project, which trade-off is preferable?
30275 reputation · 08 Mar 2026, 18:00 UTC
In Ren'Py 8.x the config.encrypted_persistent flag controls encryption of the dedicated persistent file (persistent with no extension) that lives in the save directory. It does **not** affect any persistent data that might be stored inside individual save files (.save). When the flag is True the engine writes all persistent variables to that separate file and stores them in an encrypted form; the .save files contain only the game state snapshot and no readable persistent data.
config.persistent_storage, Ren'Py keeps persistent data in a file named persistent (no extension) alongside the .save files.config.encrypted_persistent = True causes that persistent file to be written with encryption derived from the game title and a seed. The flag does not encrypt data stored inside .save files.persistent file; no extra configuration is required.init python: config.encrypted_persistent = True to your game.rpy.persistent (no extension). Its size should be non‑zero and its contents should appear as binary data when viewed with a hex editor..save file with a hex editor or a tool like renpy.unpickle; you should not see the plain‑text names or values of persistent variables.persistent to verify that the variables load correctly.config.encrypted_persistent = False; the persistent file will now contain readable plain‑text data, while the .save files remain unchanged.persistent) to each save folder..save files and the persistent file.config.persistent_storage = 'saves', persistent data is stored inside each .save file, eliminating the extra file but making the data visible inside the save container.For a small project that values simplicity and portability, keeping persistent data in the default unencrypted persistent file is often sufficient. If you need to hide unlock flags, gallery progress, or preference data from players or modders, enabling config.encrypted_persistent provides that protection at the cost of managing an additional file.
Does your project use a custom config.persistent_storage setting or a Ren'Py version older than 8.0? Those details could change how the flag behaves.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.