Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_rollback() and in_fixed_rollback() broken in multiple places #5492

Open
paranormalized-encryptid opened this issue Apr 29, 2024 · 0 comments

Comments

@paranormalized-encryptid
Copy link

paranormalized-encryptid commented Apr 29, 2024

Hello. For a few years now I've been using Ren'Py to build a sort of hybrid VN/point-and-click type game that relies heavily on fixing rollback, but unfortunately I've encountered a litany of game-breaking issues with it:

  1. fix_rollback completely breaks when looping over a label, menu, etc. multiple times. Rolling all the way back and then forward again either breaks rollforward and causes the game to "forget everything" after the first loop* (see note below), or inappropriately releases the game from fixed rollback as soon as it passes through the first label/menu/whatever. As far as I can tell, the problem is that the game does not distinguish between these iterations when comparing the current context to fixed_rollback_boundary.
  • I managed to re-enable rollforward by enclosing renpy.fix_rollback in an 'if not renpy.in_fixed_rollback()' condition, but it's still broken otherwise.
  1. Concerningly, fix_rollback does not appear to be saved; the fixed rollback state is completely discarded and forgotten when the player rolls back, saves the game, and reloads the file. There is no easy way to forcibly skip/roll the player forward to their most recent point and save there either, which makes this a very difficult problem to get around.

  2. fix_rollback breaks menus which have captions, either blocking the player from advancing at all (if config.fix_rollback_without_choice is true) or forcing them to click on the first option regardless of which choice they previously made (if false).

  3. fix_rollback also breaks menus when fast skipping - all of the options are grayed out with no way to advance (at least if config.fix_rollback_without_choice is false, I haven't tried the other way). Curiously this does not seem to be a problem for 'slow skip'.

  4. fix_rollback seems to be broken when entering and exiting the developer console (although this is less of an issue since it won't affect players).

Code example:

label this_is_a_label:

        init python:

            def fix_rollback2():

                if not renpy.in_fixed_rollback():

                    self = renpy.game.log

                    if not self.rollback_is_fixed and len(self.log) > 1:
                        self.fixed_rollback_boundary = self.log[-2].context.current

                renpy.game.context().force_checkpoint = True

            #renpy.fix_rollback = fix_rollback2 # Uncomment this to re-enable
            # rollforward.

        default num_loops = 1

        default show_menu = True # Set to False to remove the menu
        $ kind = "menu" if show_menu else "label"

        $ fixed = renpy.in_fixed_rollback()
        "Entering [kind] [num_loops]. Are we in fixed rollback?: [fixed]"

        if show_menu:

            menu this_is_a_menu:

                # "This is a caption" # Uncomment this and the menu will break completely

                "Choice 1":
                    "You selected choice 1."

                "Choice 2":
                    "You selected choice 2."

                "Choice 3":
                    "You selected choice 3."

        $ num_loops += 1
        $ renpy.fix_rollback()
        "We fix rollback and loop over the menu again..."

        if show_menu:
            jump this_is_a_menu

    jump this_is_a_label

    # Once you've looped around a few times, roll all the way back and start
    # rolling forward to see the problems emerge

(Insert 'jump this_is_a_label' into your script, don't jump to it from the console or it'll break in a different way)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant