Skip to content

brainit-consulting/chess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

305 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scorpion 3D Chess

Two-player 3D chess with standard rules, a rotatable board, and a pure rules engine powered by the Scorpion Chess Engine.

Live demo: https://brainit-consulting.github.io/chess/ Shareable play link: https://brainit-consulting.github.io/chess/

GitHub Pages: Settings -> Pages -> Source: GitHub Actions Current UI version: v1.1.66

The UI shows player names (including AI labels) and a running captured-material score. You can hide the UI panel or collapse it to a compact view from the header controls. Sound effects are available with a Sound toggle, and the camera adds subtle polish.

Public Transparency Note (ScorpionHeart vs ScorpionCore)

Scorpion can operate in two distinct engine modes:

  • ScorpionHeart: a Stockfish-based UCI binary integration (renamed ScorpionHeart.exe).
  • ScorpionCore: the in-repo TypeScript engine that we are actively developing.

How to interpret benchmarks and Elo:

  • Heart-powered results and Core-powered results are reported separately.
  • Heart results demonstrate integration strength; Core results demonstrate native engine progress.
  • Results are explicitly labeled “(Heart)” or “(Core)” and never combined.

What to expect:

  • Some builds may default to ScorpionHeart for playing strength while ScorpionCore continues to improve.
  • The long-term goal is a strong, fully native ScorpionCore.

How to cite results:

  • Use “Scorpion (Heart)” for Stockfish-based runs.
  • Use “Scorpion (Core)” for native TypeScript engine runs.

Licensing note:

  • ScorpionHeart is Stockfish-based; distributions must comply with GPL/attribution requirements.

Run

npm install
npm run dev

Test

npm run test

Single run (no watch):

npm run test:run

Controls

  • Left click: select piece / move
  • Right click or Escape: cancel selection
  • Right drag: rotate camera
  • Scroll: zoom
  • Snap buttons: White / Black / Isometric / Top-Down views
  • Force Move Now (Max Thinking only): force the current best AI move immediately
  • Mode selector: Human vs Human / Human vs AI / AI vs AI
  • Difficulty selector: Easy / Medium / Hard / Max Thinking
  • Play as selector (Human vs AI): choose White or Black
  • Coordinate Display: Fixed (White) / Fixed (Black) / Hidden
  • Show Coordinate Debug Overlay: mark a1/h1/a8/h8 for verification

Modes

  • Mode selector: Human vs Human, Human vs AI, or AI vs AI.
  • AI vs AI includes Start/Pause/Resume, an AI move delay slider, and Play for Win.
  • Draws include stalemate, insufficient material (e.g., K vs K, K+N/B vs K), and threefold repetition.
  • Hard uses a depth-3 search with a gameplay time cap (~1000ms) for responsiveness.
  • Max Thinking uses iterative deepening with a 10s cap and supports Force Move Now.

Analyze Your Games

  • Export PGN from the Game History panel or the game-over summary.
  • Use the Analyzer dropdown (Scorpion Chess Game Analyzer, Chess Analysis Pro, Chess Engine AI) or the game-over "Analyze Game" button, then paste or import the PGN to replay and analyze.

Benchmarks

  • Quick benchmark harness: npm run bench:quick -- --stockfish "C:\path\to\stockfish.exe" --batch 10 --movetime 200 --mode hard
  • "Timed out moves" in the report mean the harness forced a fallback because a best move did not arrive before movetime + grace.
  • bin batch helpers (Windows): convenience wrappers that lock in known-good settings for repeatable runs without retyping long commands.
    • bin/run_scorpion_baseline.bat: baseline Scorpion vs Stockfish run used for progress tracking.
    • bin/run_scorpion_sf_ladder.bat: main Stockfish time ladder to find a comparable strength point.
    • bin/run_scorpion_sf_ladder_weak10.bat: very weak Stockfish ladder with fewer games for fast sanity checks.
    • bin/run_scorpion_sf_ladder_weak6_swap.bat: same weak ladder with color swapping enabled.

Structure

  • src/rules: pure chess rules engine (no rendering dependencies)
  • src/client: Three.js scene, camera, picking, highlights
  • src/ui: DOM overlay for status, buttons, promotion UI
  • src/ai: AI move selection (heuristics + minimax)

Learn more: Dreaming About Becoming a Grand Master Chess Engine Invitation

About

chess 3d game

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •