-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add button to submit moves #214
base: main
Are you sure you want to change the base?
Conversation
Nice, looks good to me!
One possibility to consider may be to not push the moveToSubmit into gameResponse.moves, but then add some logic to the computed function of game. That may allow us to avoid certain UI aspects being updated (e.g. game result, next to play indicator) if we want that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. What we need here is like a "move preview", and taking the normal move transition is kind-of conflicting with hidden information variants, where moves might reveal new information. |
Yeah, but the hidden information should never be shared with the client in the first place, so I think that's another issue. I agree about the "move preview" though. |
I agree, I was just thinking that for variants with hidden information, we can't use the normal move transition as a move preview. But all that doesn't need to hold this PR back, I think. |
I think this actually does make it a lot easier to cheat. For parallel games, if someone has a setting on and ends the round, they can see opponent moves without submitting. Granted, you can already do this by looking at your network tab. But yeah I think if we could land on a solution that doesn't involve moves, it will make our lives easier when it we push this stuff to the server. |
And it could put users into an uncomfortable position, even without the intent to cheat. So now I think it would be better not to merge this currently. |
Converted to draft given the concern for simultaneous variants. Happy to discuss design - these are what I have in mind, but probably not the only options:
|
Another option would be to apply the game logic to the information the client is allowed to know about. If a player wants to capture a stone by playing K10, but there is already a stone there which is unknown to the player, their new stone will be shown at K10 and the stone that is about to be captured disappears. Then the player submits K10 and only after that the collision is handled according to the game rules.
|
I like this idea. Given (#48), maybe we can make it so a new instance of AbstractGame can be created from the game state. For hidden information games, that may be a partial state of sorts, and we can think of the move transition from a partial state instance as a move preview. |
This has potential to give the user the highest quality experience. A couple of thoughts - nothing blocking:
We actually had an
Oh one more thought:
We actually don't yet preview the captures in this way after submission. See this Fractional game, where I try to capture a stone in the bottom left: https://www.govariants.com/game/6608a41233149f0bd9a1f055 It would be kind of strange to preview the capture, then undo it after clicking the button. Of course this can be updated to give the preview, but it does make me wonder if this would be an oversized burden for variant implementers. |
Good point. I didn't really consider Fractional when composing the example above. It feels natural not to show the stone as captured in this case, because the moves of the other players aren't decided yet. So nothing happens until all moves of the current round are known, just as the game logic does too. We probably also don't want to show previews for one color go. |
Adds a client-side option to protect against misclicks by adding a move to the GameResponse before it's sent to the server. That's a bit problematic, because it leads to side effects which need special treatment, as the usage of the
resetMoveToSubmit()
method shows.It might be better to do this with the board components, because those have to display the move, but then we'd have to implement it for different variants.