in the BD engine (at least): if you die and then undo, snapping at any point in the level is treated as "quit to menu"

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
ncrecc
Posts: 365
Joined: Thu Jul 12, 2018 12:59 am

in the BD engine (at least): if you die and then undo, snapping at any point in the level is treated as "quit to menu"

Post by ncrecc »

in normal gameplay if you die, the "snap" key (also "tas snap" keys!) makes you return to the menu (or is treated as a "yes, try again" input if "ask on game over" is enabled)

this state does not seem to be reset if you undo! so you can die, undo the move that caused you to die, then a while later try to snap something and find the game kicks you back to the menu without confirmation.
User avatar
Holger
Site Admin
Posts: 4533
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: in the BD engine (at least): if you die and then undo, snapping at any point in the level is treated as "quit to men

Post by Holger »

That sounds crazy -- will have a closer look that what you described! :shock:
User avatar
Holger
Site Admin
Posts: 4533
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: in the BD engine (at least): if you die and then undo, snapping at any point in the level is treated as "quit to men

Post by Holger »

OK, now I see.

The problem is that the game is in a "game has stopped" mode after the player has died. In this mode, the tape is stopped, but the game engine itself is still running (so you can see monsters still moving and rocks still falling, for example).

In this game mode, certain keys and buttons (like Space, Return, the Snap and Drop keys, the two joystick buttons, and the Escape key) will end the "game has stopped" mode and return to the main menu (unless you have "Ask on Game Over" enabled, which will cause the game to do just that).

Pressing "undo" in this game mode warps back the game engine one step (that is, to the last snapshot taken), but without leaving this "game has stopped" mode (even though the game now looks a little bit like "everything's fine again", at least if you don't look too close at the tape recorder, which is still stopped -- but then, recording a game to tape is always optional, and a game can also be played with the tape recorder in "stopped" mode, so this may not necessarily look like a problem).

The real problem here is that undoing a step after the player has died is currently not really supported.

I will check what would be the best way to fix this...
User avatar
Holger
Site Admin
Posts: 4533
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: in the BD engine (at least): if you die and then undo, snapping at any point in the level is treated as "quit to men

Post by Holger »

Just forget what I wrote in my last post.

The reason for the strange behavior you have observed is simply because major game engine values of the BD engine are not saved in the snapshots used for undo/redo! :shock:

Of course, it should work just like in all other game engines: If the player has died (and "ask on game over" is disabled), going back with "undo" should restore the complete game state, including tape state and everything else. This works as it should in all other game engines, but apparently not in the BD engine!

After some debugging, I had to find out that major game engine values of the BD engine are simply not stored here.

I have fixed this terrible bug, and the BD engine works as expected now in situations like those you have described.

I have no idea how such a horrible bug could have existed for quite that long time without somebody stumbling about earlier, but apparently it only shows up in situations like "undo after player has died".

Thanks for pointing me towards this problem!
Post Reply