Skip to content

Introducing an advanced chess bot that effortlessly automates gameplay on virtually every board configuration, delivering a seamless and immersive experience.

License

Notifications You must be signed in to change notification settings

OTAKUWeBer/ChessPilot

Repository files navigation

ChessPilot Logo


ChessPilot — v2.0.0

A fully offline chess position evaluator and autoplayer for Windows and Linux, powered by ONNX and Stockfish.



🚀 What's new in v2.0.0 — PyQt6 UI (minor, polished)

This release advances the project to v2.0.0 and keeps the previously introduced PyQt6 frontend while remaining intentionally minimal in behavioral changes. The core functionality is unchanged; the update focuses on a more polished, stable PyQt6 experience and small fixes under the hood.

Highlights:

  • Version bumped to v2.0.0.
  • PyQt6 GUI (continued — replaces Tkinter) — improved stability and polish.
  • ✅ No workflow changes: FEN extraction, Stockfish analysis, auto-move execution, board flipping, castling toggles, depth control, retry logic, and ESC shortcut remain the same.
  • ⚠️ Source-build users: ensure PyQt6 is installed (see prerequisites).

🚀 Features

  • Automatic Stockfish Download: Detects your CPU and downloads the best Stockfish build automatically.
  • FEN Extraction: Local ONNX model (Zai-Kun’s 2D Chess Detection).
  • Stockfish Analysis: Integrates Stockfish for optimal move suggestions.
  • Auto-Move Execution: Plays the chosen move on your screen automatically.
  • Manual Play: Click “Play Next Move” when you want to proceed manually.
  • Board Flipping: Play as Black by flipping the board.
  • Castling Rights: Toggle Kingside/Queenside castling.
  • Depth Control: Slider to adjust analysis depth (default: 15).
  • Retry Logic: Retries failed moves up to three times.
  • ESC Shortcut: Press ESC to reselect playing color at any time.
  • Cross-Platform GUI: Built with PyQt6 for a modern desktop UI.
  • 100% Offline: No external API calls — all processing stays local.

📦 Download

👉 Download the latest release

The ONNX model (chess_detectionv0.0.4.onnx) is bundled in official AppImage, EXE, and DEB builds. Stockfish will be downloaded automatically on first run.


🔧 Engine Configuration (v1.0.1)

You can fine-tune Stockfish’s performance using an engine_config.txt file next to the ChessPilot executable:

# ================================
# ChessPilot Engine Configuration
# ================================
# Memory used in MB (64–1024+ recommended)
setoption name Hash value 512

# CPU threads to use (1–8; match your CPU core count)
setoption name Threads value 2
  1. Edit Hash to adjust RAM (in MB) Stockfish uses.
  2. Edit Threads to match your CPU cores.
  3. Save and restart ChessPilot to apply settings.

⚙️ Prerequisites (For Source Builds / Raw File Users)

PyQt6 is required when running from source.

Linux

# system packages (examples — adapt to your distro)
sudo apt install python3-pyqt6        # Ubuntu / Debian
sudo pacman -S python-pyqt6           # Arch Linux
sudo dnf install python3-qt6          # Fedora (package name may vary)

Windows

Install PyQt6 via pip in your virtualenv:

pip install PyQt6

General (Python packages)

pip install -r requirements.txt

Assets Needed (Source only):

  • chess_detectionv0.0.4.onnx — included in binaries; if running from raw files, download from the detector release.

Windows Raw File Users Only: You may still need the Microsoft Visual C++ Redistributable if not already installed. Microsoft VC++ Redistributable


🛠️ Installation (From Source)

git clone https://github.com/OTAKUWeBer/ChessPilot.git
cd ChessPilot
pip install -r requirements.txt
# Add ONNX model if not using binary

▶️ Usage

From the project root:

python src/main.py

Workflow:

  1. Choose White or Black.
  2. Enable castling rights if needed.
  3. Adjust analysis depth.
  4. Select Manual or Auto play.

(Behavior and shortcuts are unchanged — ESC still reopens color selection.)


💻 Platform Support

  • Windows: ✅ Tested
  • Linux: ✅ Tested (including Wayland via grim)
  • macOS: ❌ Untested (no macOS build; contributions welcome!)

⌨️ Shortcuts

See SHORTCUTS.md for a full list of hotkeys and actions.


🤝 Contributing

Contributions welcome! Open an issue or submit a pull request. If you'd like to help port or test macOS builds, let us know.


📜 License

This project is licensed under the MIT License. See LICENSE for details.


🙏 Acknowledgments

  • Zai-Kun for the ONNX chess piece detector.
  • Stockfish Team for the world’s strongest open-source engine.