UNDO and deadlock detection functional.

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

Caveat: with a bug or two!

In this version I demonstrate the UNDO system. Essentially long-hold of the button and you enter :UNDO mode". The number of moves to undo are shown at the top. You cannot move the man, but each button press will auto-rewind to the last pushed box.  You can keep doing this until there are no undo moves left. Or, you can long-press again to return to normal play.

Every now and then you see "DEADLOCK" on the screen. This is when the game finds one of the easier "cannot complete this screen" situations and lets you know.  At that point, of course, you should enter UNDO mode and reverse the move that caused the deadlock. The warning will disappear when it's OK again, and you can exit UNDO mode. There are currently 50 levels of UNDO - that is, the last 50 player moves are recorded. Running short of RAM.

The currently detected deadlocks; blocks in corners, and blocks in square groups. I will add others later, depending on the difficulty of implementation. I won't get all situations, but they're a nice aid for gameplay even when simple.

It's all still "couch compliant" -- a long-press on the button will enter UNDO mode.  You can still single-press or double-press to change view/zoom resolution.  You can also super-long-press to exit screen.  In UNDO mode, a single-press will reverse to before the last box push (or first move if none). A long-press will exit UNDO and return to gameplay.  As noted, you can't move around in UNDO mode. It still feels pretty natural to me, once you get used to it.

As I have literally *just* coded this, recording the video higlilghted a bug or two. Firstly, the target counter is not correctly updated when you undo. So it thinks the room is complete, when it isn't. Secondly, I have a crash on viewing in overview. Wouldn't be as much fun without bugs to fix; next version, though!

I'll release a binary once I iron out the bugs.



Andrew Davie


Andrew Davie

#2
I still wasn't happy with how the UNDO looked, and just because I could, I spent some time refining how it all looks. Now, the next box to be moved/undone is highlighted with an animating circle. Also, each button press will undo a single box move - but ALL of the non-box moves that happened after that box move. So you see the man zooming around wildly to get to the actual undo. I kinda like the look. Also you occasionally see "2 STUCK" or similar popping up. This message is shown whenever the "deadlock" count changes; that is, boxes in positions where they cannot be moved.

To address those against undo; there are a couple of issues here...
1) you don't have to use it
2) This *particular* room takes over 1000 box pushes to solve, and well over 4000 actual joystick moves to get that done. You don't want to have to restart that just because you pushed a box incorrectly. Really there's no alternative in the higher sokoban levels than having/allowing an undo.

I found a neat website that sorts Sokoban levels (over 40000 of them!) into difficulty based on the number of box pushes, and the number of moves, required to complete them. I expect to choose a nice subset of these for this game; I can most certainly have a finely graded list of rooms in increasing difficulty.