Arcade

This page is to journal my construction of the arcade.

Technology stack

Frontend:

  • React with Typescript
  • Tailwind CSS
  • Zustand (simple state management)
  • Framer Motion (smooth animations)

Backend:

  • Node.js with express
  • Rest API

Steps

mkdir -p backend/src/controllers backend/src/models backend/src/routes
mkdir -p frontend/src/components/games frontend/src/pages frontend/public
  1. create package.json for both backend and frontend
  2. create main backend file, game routes, game controller
  3. pm2 configuration for containerisation
  4. create tailwind config
  5. create App.js in frontend

Resources to work through

Chess

AI-Generated

AI Strength Analysis:

Architecture

Iterative deepening minimax with alpha-beta pruning, running in a Web Worker. The search deepens incrementally (depth 1, 2, 3, …) until the time budget expires, always keeping the best result from the last fully completed depth.

Per-difficulty estimates

┌────────┬─────────────┬───────────────────────┬──────────────────────┬─────────────┐ │ Level │ Time budget │ Typical depth reached │ Est. nodes evaluated │ Approx. Elo │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Easy │ 1s │ 4-5 ply │ ~50k-200k │ ~1200-1400 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Medium │ 2s │ 5-6 ply │ ~200k-800k │ ~1400-1600 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Hard │ 3s │ 6-7 ply │ ~500k-2M │ ~1600-1800 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Expert │ 4s │ 7-8 ply │ ~1M-5M │ ~1800-2000 │ ├────────┼─────────────┼───────────────────────┼──────────────────────┼─────────────┤ │ Master │ 5s │ 7-9 ply │ ~2M-10M │ ~1900-2100 │ └────────┴─────────────┴───────────────────────┴──────────────────────┴─────────────┘

What makes it strong

  1. Piece-square tables (PST) — It knows positional chess: control the center, develop knights away from edges, castle the king, advance passed pawns. Even at depth 4 it plays principled chess.

    1. MVV-LVA move ordering — Captures are searched in Most Valuable Victim / Least Valuable Attacker order,

    which makes alpha-beta pruning very effective (prunes ~90%+ of the tree).

    1. PV move ordering — The best move from the previous iteration is searched first at the next depth, which is a huge speedup.
    2. Endgame awareness — Switches king PST from “hide in the corner” to “march to the center” when material

    drops below ~2600cp (roughly when queens are off).

    1. Auto-queen promotion — It always promotes to queen, which is correct 99%+ of the time.

    What it lacks (potential weaknesses to exploit)

    1. No quiescence search — This is the biggest weakness. The search evaluates positions at a fixed depth

    with no extra capture-chain resolution. This means it has a horizon effect: it can’t see that a sequence of exchanges ending 1 ply beyond its depth is losing. Exploit this by initiating complex tactical exchanges — it may miscalculate the outcome.

    1. No transposition table — It re-evaluates the same positions multiple times. This limits depth but

    doesn’t create an exploitable weakness per se.

    1. No opening book — It calculates everything from scratch. You can gain a small early advantage by

    playing well-known strong openings (e.g. Italian Game, Ruy Lopez, Queen’s Gambit) while it burns time recalculating known theory.

    1. Simple evaluation — No understanding of: pawn structure (doubled/isolated/passed pawns beyond PST),

    bishop pair bonus, rook on open files, king safety beyond PST, or connectivity. You can exploit positional themes it doesn’t understand — e.g. create a passed pawn on the side it’s not watching.

    1. Random tiebreaking — When two moves evaluate equally, it picks randomly with 50/50. This means it

    occasionally makes suboptimal choices in quiet positions.

    Tips to beat it on Easy/Medium

    • Play solid openings — 1.e4 e5 2.Nf3 Nc6 3.Bc4 (Italian) gives you natural development
    • Trade queens early — the endgame evaluation is weaker, and you remove its tactical sharpness
    • Create long-term positional advantages — passed pawns, bishop vs knight in open positions, rook on the

    7th rank. It can’t plan strategically, only tactically within its horizon

    • Avoid sharp tactical positions — even at 4-5 ply depth, it calculates accurately within that window.

    Don’t leave pieces hanging or set up tactics it can see

    • Push into the endgame — its endgame play is the weakest phase due to no specialized endgame knowledge

    (no opposition, no Lucena/Philidor patterns, etc.)