Skip to content

Chess

A full-featured chess app with three opponent modes and multiplayer support.

Game Modes

ModeDescription
StockfishPlay against the Stockfish engine (depth 1-20)
Aurora AIPlay against Aurora with Stockfish-assisted hints
HumanPlay against other Niuton users

Features

  • Full chess rules — Using chess.js for move validation
  • SVG pieces — cburnett piece set
  • Drag and drop — Move pieces by dragging or click-click
  • Promotion dialog — Choose piece on pawn promotion
  • Move list — Full game notation
  • Captured pieces — Display with material advantage
  • PGN export — Export games in standard PGN format
  • Resign / Draw — In-game options

Multiplayer

  • Challenge system — Send challenges to online users
  • HTTP polling — 3-second polling for real-time play
  • Game list — View active and completed games

Stockfish Integration

The chess app communicates with Stockfish via proc_open() using the UCI protocol:

position fen <FEN>
go depth <DEPTH>
→ bestmove <MOVE>

Configurable depth from 1 (beginner) to 20 (master).

Aurora AI Mode

Aurora receives the current position (FEN), move history (PGN), and list of legal moves. For stronger play, Aurora is assisted by Stockfish's top 3 move suggestions (MultiPV 3 at depth 6).

Data Export

Games are automatically synced to the filesystem:

  • ~/Dokumente/Schach/Spiele.md — Game summaries
  • ~/Dokumente/Schach/{Game_ID}.pgn — Individual PGN files

v3.9 Fixes v3.9

Multiplayer Timing Fix

Fixed a bug where the chess board was blank after accepting a multiplayer challenge. The loadGame() function now:

  1. Shows the game area first
  2. Forces a DOM reflow (offsetHeight)
  3. Uses double requestAnimationFrame for safe rendering

PGN in Game List

The list_games API now includes the pgn field for consistency with get_game.

v3.12 Fixes v3.12

Zug-Autorisierung

Der Server validiert jetzt, dass der anfragende Spieler tatsaechlich am Zug ist. Zuvor konnte ein Client theoretisch Zuege fuer den Gegner senden.

Polling Pause

Das Multiplayer-Polling wird bei Inaktivitaet (Tab im Hintergrund) pausiert und bei Fokus automatisch fortgesetzt. Spart Server-Ressourcen bei inaktiven Spielen.

AI-Powered Cloud Desktop OS