Ren'Py Screen Language and Python State: Predict System Synchronization
0 reputation · 18 Oct 2020, 10:24 UTC
Ren'Py uses a prediction system to instantiate screens in the background, aiming to eliminate frame drops during transitions. This mechanism analyzes script flow to pre-calculate screen states before they are explicitly shown.
A potential conflict arises when a screen depends on volatile Python variables that change rapidly between the time the prediction is triggered and the actual execution of the show screen command. Because the prediction system may instantiate the screen based on the state present at the time of prediction, there is uncertainty regarding how the engine handles state updates for already-predicted screens.
Assuming Ren'Py 8.x, what is the deterministic behavior for updating a predicted screen if the underlying Python state changes after the prediction has occurred but before the screen is rendered? Does the engine force a re-evaluation of the screen's state, or does it risk displaying stale data from the initial prediction?