A modern, browser-based re-implementation of the 2011 G53IDS dissertation project: chess extruded into the time dimension, played on a growing stack of boards where each layer is one turn. Pieces move through space and time, capture their opponents' pasts, and occasionally get Lost in Time.
See REPORT.md for what changed relative to the 2011 original — bugs found and fixed, rules clarifications, architecture, and performance.
No build step and no dependencies to install (Three.js is vendored). ES modules need to be served over HTTP, so from this directory:
python3 -m http.server 8621
# then open http://localhost:8621/(or npx serve, or any static file server.)
The whole directory is plain static files — no build step, no server-side code, all paths relative — so it can be published anywhere that serves files, including GitHub Pages project sites (which serve under a subpath):
- Copy the contents of this directory into the repository (root or
docs/), includingvendor/and the.nojekyllfile (it stops GitHub running the site through Jekyll). - In the repository settings, enable Pages for that branch/folder.
That's the complete deployment. Visitors get the 3D board and the AI opponent (playing Black by default) with nothing to install; the AI runs entirely in the visitor's browser, in a Web Worker.
| Input | Effect |
|---|---|
| left-drag | orbit the camera |
| right-drag | pan |
| wheel | zoom |
| click a piece in the top layer | select it; legal moves highlight (green = move, red = capture) |
| click a highlighted square | make that move |
type in the move box (key: /) |
make a move by notation: algebraic (e4, Nf3, exd5, Nbd2), coordinate (e2e4), or full TCECP (a2t0a4t0); add tN to the destination for time travel (Nf3t2, or Nf3t+2 relative to now) |
n / r / a |
show Now only / Recent turns / All turns |
s |
cycle stereo 3D: red/blue anaglyph (as in the original), then cross-eye side-by-side, then off |
l |
cycle the layout: a vertical 3D stack of turns; a horizontal 3D line with each new board to the right of the last; or a flat 2D view with ordinary chess symbols, boards left to right as time progresses |
u |
undo (against the AI it takes back its reply and your move together) |
c |
AI move: the built-in AI plays one move for the side to move |
h |
the how-to-play guide (also opens automatically on first visit) |
Esc |
close the guide / deselect |
By default the page is set to AI plays Black: make a move as White and the AI answers by itself. The dropdowns in the panel choose who the AI plays for (Black, White, both, or nobody) and how long it thinks per move. The search runs in a Web Worker, so the page stays fully interactive while the AI is thinking.
Semi-transparent "ghost" pieces mark where forward time travellers will re-enter the timeline. Hover anything for a readout of what it is and where (and when) it stands.
A debug handle is exposed in the browser console:
timeChess.move('a2t0a4t0'), timeChess.engine.prettyPrint(3), etc.
The rules engine is a single pure ES module, src/engine.js, with no
dependencies — the same file runs in the browser and in Node.
node --test test/engine.test.js # 29 tests: ports of the 2011 suite + regression tests
node --test test/ai.test.js # 9 tests for the AI player
node bench.js # rough performance numbers
node tcecp.js # the original's TCECP protocol over stdin/stdout
node aiplay.js --white=ai --black=random --ms=1000 # watch the AI playsrc/ai.js is an alpha-beta game-playing AI for Time Chess — the
dissertation's headline further-work item. See
AI-REPORT.md for what a standard chess-engine approach
does and does not survive in this game.
Two draw rules the 2011 design left out, added so games always end:
- Threefold repetition of the reachable past. No move reaches more than 7 turns back, so the last 8 board layers (plus the future queue and side to move) are the complete game state; the third occurrence of the same window is a draw. Full histories never repeat in Time Chess — this window is the only repetition that means anything.
- Fifty-move rule. Fifty moves per side without a capture, a loss to time, or a pawn move is a draw (repetition alone cannot adjudicate a dead K-vs-K wander on a board this big).
tcecp.js speaks the Time Chess Engine Communication Protocol from the
dissertation appendix (new, ping N, a1t0, a2t0a4t0, getState ...),
so anything written against the 2011 engine interface still works.
index.html the game page (UI shell, import map)
GUIDE.md the in-game how-to-play guide (edit this to change the guide text)
src/engine.js rules engine — pure, dependency-free, browser + Node
src/ai.js AI player — alpha-beta search + evaluation (see AI-REPORT.md)
src/ui.js Three.js interface
test/ node:test suites (engine + AI)
tcecp.js TCECP stdin/stdout adapter (Node)
aiplay.js AI vs AI / AI vs random games from the terminal (Node)
bench.js benchmark (Node)
vendor/ Three.js r170 + the addons used (vendored; works offline)
