Terkwood/BUGOUT

🔙AI play: allow the human to UNDO their last move

Terkwood opened this issue · 1 comments

motivation

Adding an undo button in AI play will help the human player learn.

sketch

  • only available in katago
  • only available when it is the human player turn (browser)
  • gateway must be altered
  • create a new service UNDO service which can determine whether an UndoMove request is valid, and then emits a GameState event that is consumed by judge and changelog.
  • changelog : no changes needed. it will receive the updated GameState event
    (entry_id, StreamData::GS(gs)) => {
  • judge: no changes needed. it will receive the updated GameState event
  • botlink: second layer of verification that this can happen? or nothing needed?

browser

Add the button if it looks nice on desktop&tablet&cell, otherwise bury it in the menu

DO NOT MOVE THE EXISTING BUTTONS

Use browser state to validate that an undo is possible - must occur during human turn

Send UndoMoveCommand

Ignore UndoMoveRejected & log

Receive MoveUndone and alter game tree

gateway

Receive UndoMoveCommand empty struct and hydrate it for the backend:

pub struct UndoMove {
   pub game_id: GameId,
   pub player: Player,
}

undo service

New microservice which listens to game states, bot attached events, undo move commands

on UndoMove, it must emit a new game state, and it must emit MoveUndone

Related #257