mancala/docs/specs/game-bot/tasks.md
Halit Aksoy f0b75e5cee feat(backend): play games against the bot
new_bot_game starts a game against the bot at the chosen level and ends the
search for an opponent. BotPlayer works out the bot's moves on its own thread
pool and plays them on the game loop after the previous move's animation and a
thinking time. Bot games keep their settings across restarts.
2026-10-16 14:18:45 +03:00

1.7 KiB

Game bot: tasks

Work through the tasks in order; each ends with its tests passing and a commit. Tick a task when it is committed.

  • 1. Spec: requirements, design and tasks.
  • 2. Compact board: Position in the engine package; tests against MancalaGame with the recorded parity games and random games.
  • 3. Search and strength: BotLevel, BotSettings, BotStrength, BotSearch, BotPolicy with unit tests; BotTournamentTest (tag calibration) and its quick version; tune the evaluation weights and the strength table until R2.4 holds, and write the final values into design.md.
  • 4. Bot games in the backend: new_bot_game, BackendGame.bot, playMove split out of onGameMove, onTurnStarted, bot ids in GameStore, PublicIds and the connection info; BotPlayer and its executor in Backend, BOT_SEARCH_THREADS; bot in snapshots and their restore; unit tests.
  • 5. Saving: bot in GameRecord, migration 003_bot, the repository; integration tests.
  • 6. Core: channel_new_bot_game, BotLevel, BOT_LEVELS, BOT_OFFER_DELAY_MS, isBotId, getBotLevel, getPlayerDisplayName for bots, texts in English and Turkish; unit tests.
  • 7. Web app: BotLevelPicker, the home page button, the lobby offer and ?bot=, "Play again" after a bot game, bot names everywhere players are shown.
  • 8. Mobile app: lobby offer and botLevel, home screen button, bot names; type check and bundle.
  • 9. End to end and docs: the Chrome tests from design.md; README.md, apps/backend/README.md, AGENTS.md (the specs list, bot ids, the calibration test) and TODO.md (the out of scope items).