chess

mcts with piece-square evaluation

Pure random rollouts are useless for chess — random play produces meaningless noise. Instead, the AI uses a hybrid approach: short capture-biased rollouts (25 ply) terminated with a static evaluation function.

The evaluation combines material counting (pawn=100, knight=320, bishop=330, rook=500, queen=900) with piece-square tables that encode positional knowledge — central pawns score higher, knights prefer the center, kings hide in corners during the middlegame.

eval = Σ (material + PST[piece][square]) per piece

With ~3,000 MCTS iterations per move, the AI plays at roughly 1000–1200 Elo. It understands basic tactics (captures, forks) and positional concepts (center control, king safety) but can miss deep combinations.

references

Browne et al. "A survey of Monte Carlo tree search methods." IEEE Transactions on Computational Intelligence and AI in Games, 2012.

Silver et al. "Mastering chess and shogi by self-play." Science, 2018.

live · mcts
moves
moves will appear here
white to play

how the search tree works

Each move the AI considers becomes a node in a tree. MCTS repeats four steps thousands of times:

1
Selection — walk down the tree picking the most promising branch using UCB1, balancing exploitation (high win rate) and exploration (low visit count).UCB1 = w̄ + c · √(ln N / n)
2
Expansion — at a node with untried moves, add one as a new child.
3
Simulation — play out a random game from the new node (biased toward captures), then evaluate with piece-square tables if not terminal.
4
Backpropagation — send the result back up to the root, incrementing visit counts and win tallies at each ancestor node.

The most-visited branch becomes the chosen move — more visits means more confidence.