Standard variables in Ren'Py reset when a player starts a new game. Persistent variables do not. They are bound to the persistent object and remain saved on the user's computer even after closing the software or starting a fresh file. Common Uses for Persistent Variables : persistent.unlocked_ending_01 = True Gallery Unlocks : persistent.seen_images = []
file with a standard text editor is risky. Because Ren’Py uses Python pickling
Implementing persistent data allows for advanced features that improve game quality: Content Patches : Use a persistent flag (e.g., persistent.patch_enabled ) to toggle additional dialogue or images. Unlockable Galleries renpy persistent editor extra quality
Ren'Py includes built-in tools designed specifically to clear or alter persistent data without requiring external software. 1. Deleting the Persistent File
# Initialize variables systematically in an early init block init -1 python: if persistent.gallery_unlocks is None: persistent.gallery_unlocks = {} if persistent.achievement_matrix is None: persistent.achievement_matrix = [] if persistent.game_completion_count is None: persistent.game_completion_count = 0 Use code with caution. Standard variables in Ren'Py reset when a player
Screen for editing (very small example): screen persistent_editor(): tag persistent_editor frame: has vbox text "Persistent Editor (Dev only)" for key, default in PERSISTENT_DEFAULTS.items(): hbox: text key if isinstance(default, bool): textbutton "[getattr(persistent, key)]" action Function(toggle_bool, key) else: input value Field: # Use text input; validate on apply changed True hbox: textbutton "Reset to defaults" action Function(reset_persistent) textbutton "Close" action Hide("persistent_editor")
Because persistent variables are stored as standard Python attributes, you can manipulate them using direct commands: Common Uses for Persistent Variables : persistent
By default, Ren'Py separates standard game variables from persistent variables. Standard variables reset whenever a player starts a new game. Persistent variables, prefixed with persistent. , save directly to a dedicated file ( persistent ) in the local app data folder. Common use cases for persistent data include:
If you are creating a series, Ren'Py supports MultiPersistent objects, allowing you to carry data (like player names or choices) from one game to the next.
Are you looking to build an rather than an in-game screen?
A Persistent Editor is a dedicated developer tool—built either as an in-game screen or a specialized script plugin—that provides a graphical user interface (GUI) to view, modify, and delete persistent variables in real-time.