# 3D Chess Sanctum

> A playable 3D chess game in your browser, in a setting of your choice: a moonlit courtyard, a candle-lit hall or a frozen lake at dawn. Sculpted stone armies walk, fight and shatter; every capture cuts to a duel shot and the losing king topples.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Game creation](https://www.sandbase.ai/skills/games)
- Version: 0.2.3
- Runs online: yes
- Page: https://www.sandbase.ai/skills/games/chess-sanctum

## What you get

Bring a setting, and optionally the two armies, the light and the props around the board. The Skill returns a downloadable Skill (theme-driven chess engine, set builder, CC0 props, verification) and three playable example games.

## Install

Download the Skill package from https://www.sandbase.ai/skills/games/chess-sanctum (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/chess-sanctum build a playable 3D chess game set in <your setting>, with <your armies> and <your light>
```

## How it works

1. **Describe the setting in slots** Chess Sanctum needs one slot, setting, and takes optional armies, light, props and extraPrompt, each at most 2000 characters. Run node scripts/fill-prompt.mjs --slots slots.json --lang en --out prompt.md, with assets/prompts/examples/jade-courtyard.json as a model. Then node scripts/new-project.mjs --out my-chess --theme my-theme creates themes/my-theme/theme.json from a generic starter.
2. **Edit only the theme data** Your coding agent changes the theme: floor, altar, walls, columns, fire bowls, sky, props, piece and board materials, lights, camera room and copy. npm run pack-polyhaven packs a CC0 model from polyhaven.com, and pack-glb packs a GLB you own. The rules, AI, animation and cameras stay untouched. Everything runs locally on Node 22.4 or newer with no model calls.
3. **Build the theme and run shoot** THEME=my-theme npm run build:single writes dist-single/index.html, and npm run shoot needs local Chrome. Look at the screenshots in shots/ or read shots/report.json for select, move, AI reply, capture, checkmate, every view, phone taps and no network. Repeat until shoot passes. Built sizes vary by props: the courtyard is 6.6 MiB and the hall 16.2 MiB.

## FAQ

### What happens in a Chess Sanctum match?

Chess Sanctum is a playable 3D chess game with animated stone statues. Click a piece, then a highlighted square, and the statue strides there. A capture swoops the camera into a duel shot where the attacker swings and the defender bursts into shards. On checkmate the losing king topples and a banner names the winner.

### Which themes come with Chess Sanctum?

Chess Sanctum ships three themes on one engine: gothic-sanctum, a candle-lit hall, jade-courtyard, a moonlit courtyard with jade and red lacquer pieces, and frozen-dawn, a frozen lake at sunrise. Build any of them with THEME set to its id before npm run build:single.

### How strong is the Chess Sanctum AI?

Chess Sanctum's AI looks one move ahead at captures, checks, the centre and hanging pieces, so it is a sparring partner, not a strong engine. En passant is not implemented, and pawns always promote to a queen. It is not suited to rated or online play.

### Can I replace the Chess Sanctum piece models?

Partly. Chess Sanctum themes change the materials of the shared statues, such as jade, lacquer, crystal or obsidian. Replacing the statues themselves needs models with the same skeleton and the Idle, Move, Attack and Shatter clips. Models from another game or a product site are not allowed; use CC0 or your own and list them in CREDITS.json.

### Does Chess Sanctum cost anything to build?

No. Chess Sanctum calls no model or paid service, and an agent does the work locally. npm ci downloads pinned packages from npm, and pack-polyhaven downloads CC0 models from polyhaven.com. The built file then runs with no network.

### Why does Chess Sanctum allow wasm-unsafe-eval?

Chess Sanctum decodes its compressed models with meshoptimizer's WebAssembly decoder. The game's CSP allows compiling WebAssembly but still blocks eval and network access. The size limit for games is 32 MiB, and heavy foliage scans should be packed with --simplify.

### How do I set the Chess Sanctum theme on Windows?

Chess Sanctum's THEME=id syntax is Bash, so run it in Git Bash. In PowerShell use $env:THEME='my-theme'; npm run build:single, and in cmd use set THEME=my-theme&& npm run build:single. Write theme JSON with Node or an editor, because PowerShell's UTF-8 option adds a BOM that breaks JSON.parse.

## Examples

- Jade Courtyard playable chess game (scene)
- Chess Sanctum (scene)
- Frozen Dawn (scene)
- Jade Courtyard (video)
- Chess Sanctum (video)
- Frozen Dawn (video)
