Renpy rollback error (perhaps the script changed in an incompatible way?)

swimsoot

Member
Game Developer
Mar 14, 2020
314
714
Hi! I'm a dev who has had no major problems until my latest update. Although I have used the same version of Renpy to create each version, I have recently been getting a rollback error that won't allow a save from the last update to move forward in the new update.

If I hit IGNORE, the game restarts from the beginning.
If I continue with this restarted game, everything including the new content plays smoothly, saves smoothly, etc.

Not sure what has changed (I don't think I'm using any new commands that should mess things up.)

[I read past troubleshooting on this site for similar issues, but those all seem to be for players playing games with the issue, not for devs trying to fix the issue before uploading.]

Any thoughts? Thanks so much!

Here is the traceback:

Code:
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00action_file.rpy", line 452, in __call__
    renpy.load(fn)
Exception: Couldn't find a place to stop rolling back. Perhaps the script changed in an incompatible way?

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/ast.py", line 914, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/python.py", line 2028, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/core.py", line 3518, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/transition.py", line 47, in event
    return self.new_widget.event(ev, x, y, st)  # E1101
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/screen.py", line 714, in event
    rv = self.child.event(ev, x, y, st)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 244, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 244, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/layout.py", line 244, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/behavior.py", line 962, in event
    return handle_click(self.clicked)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/behavior.py", line 897, in handle_click
    rv = run(action)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/display/behavior.py", line 320, in run
    return action(*args, **kwargs)
  File "renpy/common/00action_file.rpy", line 452, in __call__
    renpy.load(fn)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/loadsave.py", line 770, in load
    log.unfreeze(roots, label="_after_load")
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/python.py", line 1983, in unfreeze
    self.rollback(0, force=True, label=label, greedy=greedy, on_load=True)
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/python.py", line 1815, in rollback
    self.load_failed()
  File "/Users/neilalsip/Desktop/renpy-7.3.5-sdk/renpy/python.py", line 1733, in load_failed
    raise Exception("Couldn't find a place to stop rolling back. Perhaps the script changed in an incompatible way?")
Exception: Couldn't find a place to stop rolling back. Perhaps the script changed in an incompatible way?

Darwin-18.7.0-x86_64-i386-64bit
Ren'Py 7.3.5.606
Camp Klondike 1.0
Wed May 25 09:43:58 2022
 

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,178
Seems like renpy.load can't figure out where exactly to continue from the old save.

This is something that happens, especially when you make major changes in between updates. If that was the case then starting a new save is the safest solution to avoid errors, usually devs just state something like "saves before version X aren't compatible with the new version".
 
  • Like
Reactions: swimsoot

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,236
Code:
Exception: Couldn't find a place to stop rolling back. Perhaps the script changed in an incompatible way?
It's so rare that Ren'Py errors are explicit and tell you precisely what the problem is.

[Note: I haven't looked at this since a long time, it can possible have changed, but not too drastically]
When you load a save file, Ren'Py will do this, in this order:
  • Search for the exact line where you saved, accordingly to its magic number ;
  • Try to find the line X in the label where the save file was created ;
  • Search for the label where the save file was created and load at the start of it ;
  • Use the rollback stack to find a line that still exist outside of this label ;
  • Use the rollback stack to find a label that still exist and load at the start of it ;
  • Throw the error you get.


Not sure what has changed [...]
Well, apparently: Most part of the code near the place where the save file was created.
 
  • Like
Reactions: swimsoot

swimsoot

Member
Game Developer
Mar 14, 2020
314
714
Interesting. Should I try disabling rollback? Or limiting rollback? I tried making rollback 1000 and it didn't work.
 

swimsoot

Member
Game Developer
Mar 14, 2020
314
714
I took your advice and I think I fixed it. I took the old version and made sure all the line numbers were exactly as they had been before. Then I cut and pasted in the new stuff. Seems to work!
Thanks so much!!