# Photon Forge: A Quantum-Optics Puzzle Board

> Route photons to their detectors, in one small offline HTML file: sixty-two levels across tutorials, a full arc, concept demos and a sandbox — drag twenty kinds of optical tiles onto the grid, fire the laser and read the same amplitudes the win check reads. A tensor engine over polarization × direction × position makes superposition, interference and entanglement real, not scripted.

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

## What you get

Bring the board and the tile set, the levels and the win rule, and optionally the sandbox, the palette and the UI text. The Skill returns a downloadable Skill (the optics puzzle project, a customize guide, headless verification) and one playable example level.

## Install

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

```text
/photon-forge make an optics puzzle where the player places <your tiles> to route <your photons> to <your detectors>, under <your rules>
```

## How it works

1. **Describe tiles, levels and rules** Photon Forge takes a prompt such as 'Use photon-forge to make an optics puzzle where the player places mirrors and splitters to route photons to two detectors, under a no-mine rule.' node scripts/new-project.mjs --out <dir> copies the game, which needs Node 22.4 or later. The example has 62 levels across tutorials, a game arc, concept demos and a sandbox.
2. **Edit levels and tile physics** Your coding agent follows references/customize.md. Levels are JSON in src/data/levels_*.json, tile physics in src/game/tile.js and src/game/const.js and UI strings in src/i18n.js. A tensor engine computes amplitudes over polarization, direction and position, and the win check reads the same probabilities. Twenty tile kinds include mirrors, beam splitters, polarizers, phase plates, absorbers, detectors and mines.
3. **Build and solve level one** npm ci && npm run build:single writes dist-single/index.html, about 0.8 MiB, with no fetch, storage, workers or external URLs. npm run shoot writes shots/report.json and screenshots; verify.json solves level 1 by placing two mirrors and firing. Release 0.1.0 passed 11 interactions, including a win, the level selector, the next level, the sandbox, reload and a 390 by 844 phone.

## FAQ

### What is Photon Forge?

Photon Forge is a quantum-optics puzzle board. Each level gives a grid, a photon source and a goal such as feeding detectors or dodging mines. You drag tiles from the stock, rotate them into place and fire the laser to watch superposition, interference, entanglement and measurement play out. A built-in encyclopedia explains the concepts.

### Is the Photon Forge physics real?

Yes. Photon Forge runs a genuine tensor simulation of amplitudes over polarization, direction and position in CPU JavaScript, and the win check reads the same probabilities shown on screen. The beams themselves are drawn schematically, not as photorealistic optics.

### Can I add a level or tile to Photon Forge?

Yes. Photon Forge adds a level by appending it to the right src/data/levels_*.json group, and it appears in the level selector automatically. A tile needs transition tensors in src/game/const.js, a description in src/game/tile.js and a stock entry in each level that offers it. New levels get no win proof unless you add a verify step.

### Does Photon Forge save progress?

No. Photon Forge keeps save data in memoryStore only, so refreshing the page starts a fresh level-unlock table. That is deliberate for the sandbox, which blocks storage. Per-board state export and import are available inside a session.

### Does Photon Forge need a key or paid service?

No. Photon Forge needs no keys, and its built file calls no network at all, so a puzzle session never reaches a SandBase bill. npm ci downloads pinned lodash, Vite and playwright-core from the public registry, and no GPU is needed.

### Is Photon Forge in Chinese?

Partly. Photon Forge switches its UI to Simplified Chinese with ?lang=zh-CN, but level intro and hint popups and encyclopedia entries stay English by design, because they are puzzle content. Photon Forge includes MIT-licensed code, and its licence and copyright notices ship in LICENSE and the build's notices comment.

## Examples

- Photon Forge optics puzzle (scene)
- First Beam (video)
