Klooni1010 icon indicating copy to clipboard operation
Klooni1010 copied to clipboard

Feature request: add a undo button

Open oktomus opened this issue 7 years ago • 27 comments

My phone is fairly small and I often misplace the blocks, that would be nice to add a button that undo only the last one action.

oktomus avatar Apr 13 '17 14:04 oktomus

Someone else also suggested this. And I will use the same argument: this feels slightly cheaty. You can turn on the "snap to grid" feature (looks like a hashtag on the customization menu). Not sure what to do about this.

Lonami avatar Apr 13 '17 16:04 Lonami

Ok or maybe add a tap to confirm the position of the block

oktomus avatar Apr 13 '17 17:04 oktomus

Well… A confirm dialog every time you put a block would be really annoying, plus this is the same as an undo button (cancel is basically undo).

Lonami avatar Apr 13 '17 17:04 Lonami

Yeah you're right. Where can I found the snap to grid feature ? Don't you think it would be great to enable it by default ?

oktomus avatar Apr 13 '17 17:04 oktomus

Don't you think it would be great to enable it by default ?

Not sure, that's not how the original gameplay is meant to be and I find it a bit weird at first, so I made it optional. Also, this feature is only available on v0.5, which is available on F-Droid already!

Lonami avatar Apr 13 '17 18:04 Lonami

Oh I see. Didn't see the option, I will have a look :) Thanks !

oktomus avatar Apr 13 '17 18:04 oktomus

Hi there,

I had the same idea today after moving a tile to the wrong place for the third time. Of course I read this completely and I can understand your feeling about the undo button being "slightly cheaty". Maybe there's just something wrong with my fingers, I don't know. So maybe instead of applying an undo button, you could implement a new mode for handicapped people?! I thought of something like this: As long as you didn't touch a new tile, you can move the last placed tile to a new position.

After all, this game is the best what I have ever been looking for: Doesn't need any rights that could harm my mobile phone or my personal data, doesn't stress me when I don't want it, very good UI, still developed (there are many unfinished and abandoned apps!) and it really makes fun 😃

So thanks for the app!

ghost avatar May 07 '17 10:05 ghost

As long as you didn't touch a new tile, you can move the last placed tile to a new position.

Could you please explain this a bit better? How would it exactly work?

So thanks for the app!

Thanks for the feedback))

Lonami avatar May 07 '17 10:05 Lonami

What he means I think is that when you place a tile, you can still move it until you plance another tile.

oktomus avatar May 07 '17 11:05 oktomus

Could you please explain this a bit better? How would it exactly work?

I meant it almost like Oktomus said, just that you can't move the old tile anymore when you already touched a new one, regardless if it was placed or moved back to the bottom of the play field.

ghost avatar May 07 '17 11:05 ghost

you can still move it until you plance another tile

I just don't like the fact that people could abuse this to think twice after they've placed the piece (something they should do before placing it). But then there's this issue, it might actually have been misplaced. Maybe I could limit this by only allowing the piece to be moved one tile (cell) to the sides, so either moving it one cell above, below, left or right. However this solution could feel "weird" in a sense: "Why can't I place the piece here if I'm moving it?".

Is there any way to detect the user intention (did they really misplace it or do they want to cheat)? ;)

What if I made it cost 1 coin to undo?

Or… I could detect how "accurate" placing the piece was, and if it's not very accurate, don't place it. But it would, again, be weird at times in my opinion. Uhm.

Lonami avatar May 07 '17 11:05 Lonami

That's why I thought about a new mode for disabled people instead of letting anyone "cheat" in one way or the other. It would get its own highscore, of course. That could even help people playing this game when they are in fact disabled and not trying to cheat.

disabled My idea of a symbol for the German saying "he's got two left hands"

ghost avatar May 07 '17 11:05 ghost

Either a button showing "accessibility" (typical single hand) with a tick for enabled/disabled, which would show both a custom score and share image, along with a new stunning undo button, or that button without the tick, which takes you to another window and explains what it does.

Though some other options are also strange (snap to grid is not clear at first), so maybe I could do the first option, and describe them somewhere else (i.e., a FAQ here, a wiki, or something).

Lonami avatar May 07 '17 11:05 Lonami

Whatever you like 😁 Thanks for the fast responses. I think this can be closed again or maybe you should leave it open in the case anybody else wants an undo button :)

ghost avatar May 07 '17 11:05 ghost

Hey there!

I am absolutely against any undo or move-afterwards mechanic as I think it would make the game less fun. I get that people get frustrated and thinking about accessibility is important. But a little bit of frustration (challenge) is part of the game :).

Let me suggest a way to fix this in a cleaner way. This is a classic UI problem.

"How does a human know the consequence of his (inter)action?"

The answer is to hint at what the outcome would be, before a person commits to an action.

Concretely for Klooni this could mean, that the tiles, where the piece would land if the player lifted his/her finger right now would be highlighted. Another option is to show a "ghost" piece on the tiles where the piece would drop. Yet another option is a subtle (slow) move animation of the piece the player is holding to the place it would drop.

My favorite is option 1, implemented a a glow on the tile. The color of the glow could either be part of a theme, or be automatically the inverse of the cell background.

Btw, I love the snap-to-grid feature. It helps me with playing the time based mode !

bugabinga avatar May 08 '17 18:05 bugabinga

I told you my body functions somehow strange. I DEactivated snap to grid. And now I almost never make mistakes. 😃

I like the ghost more, but I think it should be the taste of the programmer here, you can't please everyone.

ghost avatar May 19 '17 22:05 ghost

I like the ghost more

I really doubt I add a ghost when we already have the snap to grid. The snap to grid shows the same as what the ghost would, but with the piece itself. And about the undo, it's not only I feel it cheaty, it's I would have to change a few things (pieces become shapeless pieces once put, so not easy to recover them). But… still open for discussion! Or alternatives.

Lonami avatar May 19 '17 23:05 Lonami

Well I vote for undo button because I have small phone and a fat finger. This is really needed for one or two block piece.

If you worry about cheating just limit it only to move by one or two block radius.

bangzek avatar Aug 16 '17 04:08 bangzek

Why do you (those who want the undo button) misplace the pieces? Is it because the finger covers the piece itself and it's hard to see or is it another reason? If it's the former, I can just pump up the offset value introduced on https://github.com/LonamiWebs/Klooni1010/commit/d31991a7aff6eb536713ba996b1d655f6d0b2940: https://github.com/LonamiWebs/Klooni1010/blob/d31991a7aff6eb536713ba996b1d655f6d0b2940/core/src/io/github/lonamiwebs/klooni/game/PieceHolder.java#L193-L196

Lonami avatar Aug 16 '17 10:08 Lonami

From my experience, when I drag, I see that it will be placed correctly but when I remove my finger they just shifted.

bangzek avatar Aug 18 '17 08:08 bangzek

@Zakaria alright! I believe you just expressed the core issue. If this gets fixed, there should be no need for undo, right?

I am not a fan of undo in games in general. I certainly get why an unintentional move is frustrating. But undo would make the game so easy, that it would take the long term fun out of it. A little challenge is necessary, don't you agree?

If the controls of the game are such that unintentional moves happen frequently, let us fix that instead. Then the game becomes even more fun.

@LonamiWebs this is probably not reproducible with a mouse and happens because a TOUCH_END event is rather ambiguous. Its hard to determine where at the screen precisely a TOUCH stopped because while one lifts his/her squishy finger, the center of the conducting surface moves.

Maybe it is possible to average out the TOUCH_START and TOUCH_END positions to better reflect the intention of the player. Can you link the code that handles that?

Am 18. August 2017 10:22:04 MESZ schrieb Zakaria [email protected]:

From my experience, when I drag, I see that it will be placed correctly but when I remove my finger they just shifted.

-- Oliver Jan Krylow

bugabinga avatar Aug 18 '17 09:08 bugabinga

average out the TOUCH_START and TOUCH_END

TOUCH_START? That sounds like when the piece itself is picked up! But I get your point, averaging maybe the last few positions of the touch. Could this affect time mode though, where you need to do it really quickly?

Can you link the code that handles that?

When the piece is dropped: https://github.com/LonamiWebs/Klooni1010/blob/1b1eb678dba19f6a74dd4f56e73fd6aa444da80e/core/src/io/github/lonamiwebs/klooni/screens/GameScreen.java#L233-L234

takes you to

https://github.com/LonamiWebs/Klooni1010/blob/1b1eb678dba19f6a74dd4f56e73fd6aa444da80e/core/src/io/github/lonamiwebs/klooni/game/Board.java#L150-L157

When the piece actually moves however, is when rendering the scene. The PieceHolder.update() method is called: https://github.com/LonamiWebs/Klooni1010/blob/1b1eb678dba19f6a74dd4f56e73fd6aa444da80e/core/src/io/github/lonamiwebs/klooni/game/PieceHolder.java#L234-L274

Lonami avatar Aug 18 '17 10:08 Lonami

Also experiencing issues with misplaced pieces from the long drag and drop model. Having the option to enable an undo button would seriously cut down on player frustration when those situations occur. Many similar games default to displaying an undo button on the main UI, including 2048.

scribbles avatar Jul 24 '20 01:07 scribbles

Are you using the mentioned align to grid feature?

Lonami avatar Jul 24 '20 09:07 Lonami

I am. Tablets seem especially prone to this issue.

scribbles avatar Jul 24 '20 16:07 scribbles

Tablets? I would expect those to be bigger than the average phone to not make this an issue. I can imagine this being an issue mostly on phones with small displays where a finger can easily cover where the piece would go but not a tablet.

Lonami avatar Jul 24 '20 17:07 Lonami

It only takes one slight spot on your stylus or screen. Repeated drag and drops that could be 5"+ in physical distance will eventually misplace. If the touch deregisters, you're stuck.

scribbles avatar Jul 24 '20 18:07 scribbles