Dhayam

o antigo jogo de tabuleiro de estratégia tâmil de rolar e mover

Documentação

✺ Dhayam (தாயக்கட்டை)

Play live GitHub Pages mirror Tests License

An open-source web version of Dhayam, a Tamil race-and-capture board game. Play locally, against the computer, or online through Cloudflare Durable Objects and WebSockets.

The browser client is a static, zero-runtime-dependency application. The authoritative TypeScript engine also powers the Cloudflare backend and MCP tools used for state inspection, move evaluation, and automated matches.

Features

  • 7×7 board, 44-position rotational routes, six pieces per player
  • Traditional dice values, bonus rolls, captures, safe squares, inner track, and exact-finish winning
  • Solo, pass-and-play, and synchronized online matches for 2–32 players
  • 14 dynamic themes with festival aesthetics, custom tokens, and motifs (Diwali, Pongal, Dasara, Holi, Eid, Christmas, Hanukkah, Halloween, Heritage Wood, Royal Bronze, Midnight Nebula, Wall Street, and US Elections)
  • Cryptographic dice randomness with optional user-supplied roll secret salt
  • Global Hall of Champions leaderboard with Google/GitHub OAuth, automatic 10-player population with realistic computer entries and dynamic reduction as real players join
  • In-game player feedback dialog and durable database table capturing feedback text, timestamp, user details, and IP address
  • Optimized social media sharing preview cards with rich board thumbnail and succinct messaging
  • White-label single-script embed integration (/embed/v1/embed.js) for partner sites
  • Reconnection grace period, automatic retry, turn auto-pass, and WebSocket join rate limiting
  • Accessible responsive UI, full keyboard controls (Space/R to roll, M/Enter to move, 1–6 for piece selection, N for solo match, Esc/X to exit), optional hands-free voice command recognition, animated 3D brass dice, piece destination highlights, voice commentary, scoring, and ordered audit events
  • Full MCP catalog across Cloudflare Edge HTTP and Python stdio for state inspection, tactical evaluation, automated AI turns, leaderboard rankings, and feedback auditing

How to Play & Controls

Dhayam supports three interchangeable ways to play: Mouse/Touch, Keyboard-Only, and Hands-Free Voice Commands.

Game Rules

  1. Roll Dice: Roll two brass Dayakattai dice. Rolls of 1, 5, 6, or 12 yield bonus throws.
  2. Enter Pieces: Roll a 1 to enter a pawn from reserve onto your home entrance square (first round features an entry allowance on any roll).
  3. Capture: Land on an opponent's lone piece on an unsafe square to capture it back to reserve. Squares marked with floral motifs are safe squares where pieces cannot be captured.
  4. Inner Circuit: A player must complete at least one capture before entering the inner circuit toward the center goal.
  5. Exact Finish: Guide all six pieces into the central destination by exact roll count to win.

Alternate Ways to Play

⌨️ Keyboard-Only Navigation

Play the entire game without touching a mouse:

KeyActionDescription
Space or RRoll DicePrimary action during roll phase
M or EnterMove PieceMoves active piece or enters board during move phase
1 – 6Move Specific PieceDirectly moves piece number 1 through 6
NNew Solo GameStarts a new match vs computer (2 players, 1 AI)
Esc or XExit Game / DismissCloses active modal, exits demo, or prompts to exit match
VToggle Voice CommandsTurns voice recognition on or off
? or HShortcuts HelpOpens controls and shortcuts reference dialog

Note: Keyboard shortcuts automatically yield when typing inside text inputs, textareas, or select dropdowns.

🎤 Optional Hands-Free Voice Commands

Control matches entirely with your voice via the Web Speech API:

  1. Click the 🎤 Voice: Off button in the header or press V.
  2. Your browser prompts for microphone permission (strictly opt-in; no audio is captured when disabled).
  3. Speak commands clearly into your microphone:
    • "Roll" / "Roll dice" / "Throw dice" — Rolls the Dayakattai dice
    • "Move" / "Enter piece" — Steps the highest-priority piece or enters the board
    • "Move piece [1-6]" (e.g. "Move piece 2") — Directly steps the numbered piece
    • "New game" / "Solo game" / "Play computer" — Starts a new solo match vs computer
    • "Pass" / "Skip" — Passes turn when no legal moves remain
    • "Exit" / "Quit" — Exits current match or closes dialogs
    • "Help" / "Shortcuts" — Opens the controls modal
  4. A floating HUD toast confirms recognized commands on screen. Echo cancellation ensures computer voice commentary never triggers self-commands.

Run locally

npm install
npm test
npm run test:coverage
python3 -m http.server 8000 --directory site

Open http://localhost:8000. To run the Cloudflare worker locally:

npx wrangler dev

Project map

PathPurpose
src/game.tsImmutable rules engine and game state
site/Static browser UI
cloudflare/worker.jsDurable Object multiplayer backend and MCP endpoint
mcp/server.pyLocal MCP adapter
test/Engine, browser, multiplayer, and MCP regression tests

More detail is in Architecture, Development workflow, Test plan, Cloudflare deployment, MCP guide, White-label embed design, and the Project roadmap.

Contributors and acknowledgements

Built by Sethu Srinivasan with assistance from Kiro, OpenAI Codex, Google Gemini/Antigravity, and Claude Sonnet 4.6 (Thinking). Kiro contributed fixes during the November 1, 2026 development session. See AI-assisted development acknowledgements for scope and runtime notes.

Distributed under the MIT License.