Save, load, and rollback
This page is part of the GenPy Ren'Py learning path. It focuses on practical Ren'Py 8.x production and links each concept back to the GenPy workflow.
Learning goals
- Know what belongs in save-state variables.
- Avoid side effects that rollback cannot handle cleanly.
- Test save/load around important route changes.
Core syntax
saveloadrollbackdefaultconfig.rollback_enabled
Runnable example
text
label after_load:
$ rebuild_runtime_caches()
returnStudy outline
- Start with the smallest example for save, load, and rollback.
- Test the key terms in a clean Ren'Py project: save, load, rollback, default.
- Move the pattern back into your real project only after the example runs.
- Use GenPy docs and validation to keep the feature connected to story, assets, and export readiness.
Common pitfalls
- Test the smallest working script before layering on visual or UI complexity.
- Run Ren'Py Lint before release builds, even when the script appears to run locally.
- Keep examples in standard .rpy files so they remain editable outside GenPy.
Official references
- Ren'Py official reference: https://www.renpy.org/doc/html/save_load_rollback.html
How this fits in GenPy
- Use Variables and State Registry to reason about save-state data.
- Use Validation and manual preview before release.
Recommended GenPy docs:
