ClementSparrow / Pattern-Script

Open Source HTML5 Game Engine based on PuzzleScript
20 stars 2 forks source link

Undoing and again can be confusing #23

Open ClementSparrow opened 3 years ago

ClementSparrow commented 3 years ago

In this example from the unit tests (source code), with the mechanics of Draknek's Boxes Love Boxing Gloves, if we do DOWN, DOWN, UNDO, RIGHT, RIGHT, UNDO, we get back to the start position. Here is the whole sequence in pictures:

START: 0 DOWN: 1 DOWN: 2 UNDO: image RIGHT: 3

The animation in the last picture (showing the whole sequence from the beginning) ends in the same state than the picture with the black border. Undoing from there brings the player back to the state of the first image.

This may be confusing for the player because:

The rationale behind this behavior of PuzzleScript is that undoing to the previous frame would simply trigger the again command again, and it would just redo what we just undid. So we need to UNDO back at least to the last frame before all the again commands. But in this example, that would lead us in exactly the same level configuration than before the UNDO, and the player would think that the UNDO did not work, or even that it is disabled in that game/level. So we go back to the last frame that was not triggered by an again command AND that has a different level configuration.

Game devs can alleviate this issue by designing their games such that undoing a move cannot look like performing a move (e.g., by using an avatar sprite facing the last direction of movement: undoing would look like walking backward). If I extend the engine to actually show sprites moving continuously from one cell to another (instead of disappearing from a cell to reappear in the neighbor cell), that could also help. As would playing backward the animations for the creation/destruction of objects (if I implement such animations).

But we can also go further and play backward the various frames triggered by again commands. It could look strange, so that would require some parameters that the game devs can play with:

ClementSparrow commented 3 years ago

Feedback received from Rekiron on the Thinky Puzzles discord:

a concern i came across was that my effect slowed down the speed at which you can undo, making it kinda annoying when you need to undo a lot. i tried making it as quick as possible but it was still annoying, so my (bad) solution was that if you hold the undo button, it gets faster and skips the animation should have just made the effect independent from the speed

My answer: Yes, the time required to play backward the changes is an issue. But I feel it's a more general question about queuing inputs and skipping animation frames when the queue is not empty, which is something that affects 'forward' inputs as well as 'backward' (undo) ones... => This is also a point where PuzzleScript can be improved, but a separate issue (#26).

Rekiron also suggests using shaders or particle systems to create undo visualizations. You can't do that in PuzzleScript, but you can in javascript, so I could add support for it in Pattern:Script, but I don't think it's in the spirit of the engine... What I could do, however, is implement myself a small number of screen effects that people would want to use, and provide them as commands or as event-triggered effects => This is also a separate issue (#27), although if I go into that direction, I need to make sure these effects can be applied to undo events.