Skip to content

A standalone GUI app is created and supports all core gameplay features of the PlayCMHMEngine class. #38

@Phillyclause89

Description

@Phillyclause89

Standalone GUI App Development

Description:
This issue focuses on building the standalone GUI app that allows users to play against the chess engine. Unlike the broader goals outlined in the parent issue (#34), this issue will concentrate solely on the implementation details required to develop the GUI application. Testing, usability validation, and other broader aspects will be addressed in the parent issue.

The GUI design will draw inspiration from the ChessHeatMapApp class in main.py. However, many features of main.py are unnecessary for this standalone app. Specifically:

  • The visualization of heatmaps on the chessboard will be omitted, as the pick_move method of the engine is computationally expensive (especially at high depths).
  • Features such as tooltips and heatmap-specific functionalities will not be included.

Key Objectives:

  1. Design the GUI Framework:

    • Create a new class that extends tk.Tk and serves as the foundation for the application.
    • Implement a clean and intuitive interface that allows users to play against the engine.
  2. Core Features to Implement:

    • A chessboard display with interactive capabilities for user moves.
    • Basic game controls, such as starting a new game, resetting the board, and undoing moves.
    • Support for CMHMEngine and CMHMEngine2 for move calculations.
    • Options for users to configure engine depth and player color.
  3. Simplify the Scope:

    • Focus solely on gameplay functionality without additional visualizations or performance metrics.
    • Avoid features like heatmap rendering, tooltips, or move intensity labels.
  4. Leverage Existing Code:

    • Use main.py as a model for constructing the GUI, adapting its board rendering logic and event handling where applicable.
    • Ensure compatibility with the existing chess engine API for move selection and game state management.

TODOs:

  • Show legal move indicators for a selected piece (e.g., dots or rings on valid destination squares).
  • Highlight the currently hovered square (e.g., subtle glow or border).
  • Draw an arrow or line from the selected square to its target when a move is selected or hovered.
  • Display move annotations based on evaluation scores (e.g., “?!” for dubious moves, “!!” for brilliant ones).
  • Add a heatmap overlay indicating potential move desirability or learned Q-values (e.g., from your CMHMEngine2).
  • Show an evaluation bar (white/black balance) to indicate advantage at a glance.
  • Display net material imbalance (e.g., mini scoreboard or difference bar).
  • Show search depth (e.g., “searching depth 5”) while the engine is computing.
  • Show the best move found so far in real-time while the engine is thinking.
  • Add an evaluation trendline or small Q-value graph over recent moves.
  • Display square labels (a–h along files, 1–8 along ranks) on board edges.
  • Add subtle move confirmation animations (e.g., brief square highlight or motion).
  • Provide a theme toggle for switching visual styles (e.g., dark/light mode, retro, high contrast).
  • Use captured piece display areas (e.g., left/right of the board) to show off taken material.
  • Highlight check, checkmate, or stalemate visually (e.g., red border or icon).
  • Show pinned pieces or attacked pieces with subtle overlays.
  • Add hover-tooltips showing piece type, square name, or evaluation impact.
  • Allow toggling UI overlays (e.g., with hotkeys or checkboxes).
  • Visually distinguish en passant and castling moves (e.g., special symbols or paths).
  • Play move sounds: Add distinct sounds for piece movements, captures, checks, and checkmates.
  • Announce moves via text-to-speech: Implement a feature that reads out moves as they occur, enhancing accessibility.
  • Provide audio alerts for special events: Use sounds to indicate events like engine blunders, time warnings, or game conclusions.
  • Enable voice commands: Allow users to make moves or control the game using voice input.
  • Integrate verbal analysis: Offer spoken commentary or explanations for moves, similar to features in some chess software.

References:

Sub-issues

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions