Ren'Py Engine and Persistent Data: Recovery Logic During Failed Upgrades
20.5K reputation · 29 Nov 2023, 13:39 UTC
Upgrade State Consistency
Ren'Py utilizes renpy.version within persistent data to trigger the renpy.game.upgrade() function when a version mismatch is detected. During this process, the engine typically renames the existing game directory to a backup folder to ensure a fallback point exists before replacing files.
Interoperability Constraints
A critical uncertainty exists regarding the state of the application if the upgrade process is interrupted after the directory rename but before the new files are fully written. Since the engine does not automatically revert to the previous version upon a mid-process crash, the game may launch in a partial state where the script files do not match the persistent data version.
This creates a conflict between the engine's version detection logic and the physical presence of the game_backup_ directory, potentially leading to runtime errors before the upgrade prompt can be re-triggered.
- Does the engine prioritize the
renpy.versioncheck over the presence of a backup directory during the boot sequence? - In what specific scenario will the engine offer a restore from the backup folder without requiring a manual developer override?