GNOME Bugzilla – Bug 723425
Reconsider options in "There are no more moves" dialogue
Last modified: 2018-05-22 12:21:10 UTC
There are Undo, Restart, and New Game buttons. It would be nice to have a Quit button.
Makes sense. Bug #680928 is related
Created attachment 274428 [details] [review] Add quit button to no more moves dialog
Mario, what do you think about this dialog? It does make sense to me, but five options is rather a lot.
Yeah, 5 is a lot. I haven't seen the version with the Shuffle option. What does it do? Could you put the Quit button on the left side of the dialog, away from the other options?
> Mario, what do you think about this dialog? > It does make sense to me, but five options is rather a lot. I agree and I am thinking about it. Were the number of options an even number, we could split it in three stacks of two. Could be a bit overwhelming though. We could also think about fitting a button or two in a headerbar. > I haven't seen the version with the Shuffle option. It gives you the opportunity, once you're out of moves, to reshuffle the game to maybe generate a state to still finish the game without undoing your progress. Casual players prefer this instead of going back and finding the one valid solution the puzzle generator already provides.
I don't think a header bar would be appropriate for a message dialog. Maybe we should take it down to just two options: Keep Trying (Undo) and Shuffle? The others are just there for convenience.
We'd have to keep one quit-opportunity though (even if it was the x-Button). With shuffle we destroy any guaranteed solution and also reset undo. If you get to a state where shuffle cannot give you a solution (two remaining tiles on top of each other, for example) and you already shuffled, you cannot undo and shuffling again is not useful. You will be stuck in that dialog. Also, if no more moves are left, the game is, one might see it like that, at an end and we want to give people the chance to quit there. So we can't have shuffle without "continue/close dialog" without doing anything. This is a hard one. I might try some combinations over the next few days and see what works. And what doesn't. Shuffle really messes up our game state. But we have now way to generate a new puzzle from the point the game ends where a solution is guaranteed. The remaining tiles might not be in a solvable position at all and they could be shuffled any way you like and you'd still lose.
Shuffle doesn't have to destroy a guaranteed solution. Instead of a random shuffle, it could just use the same logic a new game uses, but with only the remaining pieces.
Maybe put them in order of least-to-most destructive? Undo Shuffle Restart New Game Quit
> Shuffle doesn't have to destroy a guaranteed solution. Instead of a random > shuffle, it could just use the same logic a new game uses, but with only the remaining pieces. This doesn't work for every board position. Think two remaining tiles on top of each other. Or two stacks with a height difference of two. And there could be more. I don't know whether we can algorithmically determine the general solvability of a field.
There are board positions that are unsolvable (trivial). The question is: can we decide whether a position is unsolvable and not show a shuffle button (the current generator would stop working in that case, but not tell us about it)? The trivial unsolvable position is when only one piece is visible. But the position could be an arbitrary amount of steps away from that case. A board is unsolvable if there doesn't exist a Permutation of tiles in that Position where there exists a path through the decision tree of that Permutation so that this path leads to a solution. I've done a proof on paper and as I see it, this problem is in general undecidable and specifically a special case of the halting problem. So I guess there wold be no "proper" way of doing this. We could only try to brute-force in a smart way. ----------------------------------- Also, we may want to save a copy of the starting positions because once the game is shuffled, the original solution is destroyed and "Restart" is useless.
Sounds like your definition of Shuffle has the pieces all stay in the same places and only move around within those positions. I was thinking that the New Game logic probably starts with a game board and a set of pieces, and that Shuffle could do the same thing: place pieces on the board in a way that's solvable, and, when you run out of pieces, you're done. This might not be as much fun, as you might end up with one layer of pieces on the board after a shuffle. So you might want to have Shuffle favor the middle of the board when placing pieces or something. This is probably a bigger problem than you were trying to solve.
If determining whether an arbitrary position is solvable is undecidable, how do we know there exists a guaranteed solution to the initial position? What's special about the initial position that makes it decidable? (Or is the original position really guaranteed to be solvable at all?) And holy heck, have we strayed from the original question... how about Keep Trying (Undo), Shuffle, and Give Up (New Game).
> how do we know there exists a guaranteed solution to the initial position? We don't. We take that as a given from the "map designer" and our generator will, through backtracking, try to generate a permutation that has a solution. But it doesn't see a difference between having itself generated into a corner and there not being a valid permutation at all. > What's special about the initial position that makes it decidable? They still aren't decidable in a computer-sciency-way. We would just know from at least one counterexample that they are solvable. Besides the obvious equivalent solutions (switching one kind of tile with another), we would then have no way to decide whether there are other permutations that are still solvable. > Or is the original position really guaranteed to be solvable at all? Not arbitrarily. The larger a position gets, the harder it is to have no solution at all. But you could always make a pyramid with one tile blocking at the top. This could be arbitrarily large. The top tile could be arbitrarily large stacked as long as the sum of all other available tiles is smaller than the top stack. One would think that there are a few more rules and ways to generate unsolvable puzzles. > And holy heck, have we strayed from the original question... We were looking at what options to keep and I suggested, that any kind of quit-button would provably be neccessary. :D > how about Keep Trying (Undo), Shuffle, and Give Up (New Game). With shuffle blocked after one fully unsuccessful shuffle (still no match visible)? We might have to block undo as well because we discard undo-information after shuffle. We also decided a few months ago that we would like to have a way to see the winning/losing position again. So we could have those three and add an X to the dialog that simply closes it without doing anything else.
It'd be better for each choice to be a real button, so the user doesn't have to worry about what will happen if he closes that important prompt. (Also, it might genuinely be confusing: I don't think other GNOME apps allow closing message dialogs.) How about Keep Trying (Undo), Shuffle, and Give Up (closes dialog)? I guess the disadvantage of that is that you have to go into the app menu to start a new game, but perhaps that's OK... or using Give Up could result in the control buttons across the top being hidden and replaced with a New Game button....
If we have "new game" in the header bar of the game like we thought for some other games, this might work. Let's do that and then think about disabling shuffle and undo where appropriate?
I like this plan: New Game packed into the start of the header bar, *before* the linked undo/redo buttons, then the message dialog has three options: Undo Move, Shuffle Tiles, and Cancel.
Review of attachment 274428 [details] [review]: Code looks fine, but we're leaning towards removing buttons rather than adding them
Also Shuffle needs to not be DELETE_EVENT since that occurs when you hit Escape to cancel the dialog, which should be non-destructive.
(In reply to comment #17) > I like this plan: New Game packed into the start of the header bar, *before* > the linked undo/redo buttons Should be a text button like in Chess, since if there is an icon that works for new game, I have yet to find it. With the new game button added, all the buttons on both ends of the header bar will need to be added to a vertical size group.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-mahjongg/issues/6.