Repository navigation
EN Create Working Loop
Français · How-to · Published, reviewed by a person · Applies from: 4.3.0
Write a rule, place it, check it, play it: the loop every change to a game goes through, with the commands for each step in a created project and in the engine repository.
Audience, context, and the statuses of what this page rests on
Audience: author · Context: engine repository, created project
A game running in your browser that reloads as you edit, a placement editor for the geometry, the validator and the solver run after each change, and debug views that start the game at any checkpoint.
- A created project (
quest-n-click create, the game ingame/) or the engine repository (the games ingames/<id>/). The layout page says which scripts exist where. - From 4.3.0. The current game is a link in
.cache/gamesince 4.1.6 (until 4.1.5,npm run devrewrotetsconfig.json).
- Node 22.12 or later, and the project's dependencies installed (
npm installin a created project,npm ciin the engine repository): requirements. - Python 3 with Pillow for
npm run assets(image toolchain). - A game: your first game makes one.
Every command runs at the root of the project, on your machine: the folder that holds package.json (the created
project's folder, or the clone of the engine repository). npm run dev and npm run studio exist in both places;
npm run validate and npm run solve are scripts of the engine repository only, and are npx quest-n-click validate
and npx quest-n-click solve in a created project.
-
Prepare the images and sounds once, and again after you add some:
# in the created project, or in the engine repository npm run assets
-
Start the game. It opens on
http://127.0.0.1:5173/and reloads when a file of the game changes:# in the created project, or in the engine repository npm run devOr start the Studio, the real engine with an editor on top, on
http://127.0.0.1:5173/__studio/(the local Studio):# in the created project, or in the engine repository npm run studio
- Write what happens in
rooms/<room>.ts(props, actors, hotspots, look lines, reactions, topics, hints), with the story instoryboard.json(rooms, the storyboard).
- Place what you wrote: open
?edit=<room>on the dev server, or the Studio's Rooms tab. The editor writeslayout/<room>.json(geometry).
-
Check. The Studio's Check tab runs the validator and the solver after every save; from the terminal:
# in the engine repository npm run validate npm run solve# in the created project npx quest-n-click validate npx quest-n-click solve npm run verify # validate, solve, i18n status, lint, playtests
- Play the room:
/?dev&at=<checkpoint>starts on a checkpoint with the debug layer (URL parameters below). On a phone, see testing over the LAN.
In a created project there is one game, game/, and nothing to choose.
The engine repository can hold several games, each in games/<id>/. The current game is, in this order
(tools/game.ts):
- the
GAMEenvironment variable (GAME=demo npm run dev); - else the game
.cache/gamelinks to (set bynpm run gameornpm run new-game); - else
package.json→"config": { "game": "demo" }; - else
demo.
GAME_DIR=<folder> points the tools at a game folder outside games/ (a test fixture, for instance).
The rule is coded once, in tools/game.ts, and read by vite.config.ts (the @game alias → games/<GAME>/index.ts,
the editor's layouts written to games/<GAME>/layout/), tools/validate.ts, tools/solve.ts, tools/refs.ts;
tools/assets.py does the same reading in Python.
tsconfig.json cannot read an environment variable: its @game and @game/* paths look in .cache/game, a symbolic
link that npm run game (tools/select-game.ts) points at the current game, with games/demo as the fallback when no
link exists yet. npm run dev, npm run studio, npm run check and npm run build run it first;
GAME=<id> npm run game and npm run new-game switch the game. Vite and Vitest do not need the link: they resolve
the alias in vite.config.ts.
# in the engine repository
GAME=heroes npm run game # heroes becomes the current game
npm run dev # plays games/heroesThe engine's tests do not depend on the current game: they run on tests/fixture/ (a tiny game), and a game's own
tests import its files directly (tests/demo.test.ts, tests/walkthrough.test.ts).
# in the engine repository
npm run dev # loopback-only dev server
npm run dev:lan # explicit LAN mode for a phone; prints a one-session capability-token URL
npm run studio # loopback-only Studio
npm run studio:lan # token-protected Studio on the LANURL parameters, dev server only (the production build ignores them; the full list is on dev URL parameters):
| URL | Effect |
|---|---|
/ |
The normal game: title screen, New Game / Continue. |
/?dev |
Starts on the first checkpoint, with the debug layer and the DEV panel. Press D to hide the debug layer. |
/?dev&at=<checkpoint> |
Starts on this checkpoint (defined in the game's checkpoints). |
/?edit=<room> |
The room's placement editor. |
/?edit=<room>&at=<checkpoint> |
The same, in that checkpoint's state (useful to place a prop in a given state). |
- The page reloads with your change; the Studio's Check tab, or
validate, prints no error. -
solveprints a way from New Game to the end, step by step. -
/?devshows the zones of the room (walk area green, hotspots blue, props purple, approach points as dots).
| Symptom | Cause | Fix |
|---|---|---|
npm run validate says "Missing script" |
You are in a created project | npx quest-n-click validate |
| The dev server plays another game than the one you edit |
GAME set in your shell, or .cache/game points elsewhere |
GAME=<id> npm run game, or unset GAME
|
| An image is missing on screen |
npm run assets not run since you added it |
Run npm run assets
|
?dev or ?edit does nothing |
You opened a production build (npm run preview) |
Use the dev server |
| "no layout: nothing will be clickable" | The room was never placed | Open ?edit=<room> and save |
-
npm run assets:public/assets/andassets.gen.json,.cache/refs.json. - The placement editor and the Studio:
layout/<room>.json(and the files you edit in the Studio). -
npm run game,npm run new-game: the.cache/gamelink (engine repository).
Everything the loop writes is a file of your project: commit before a large change, and git restore the files to go
back. public/assets/ is rebuilt by npm run assets.
- Layout of a created project and of the engine repository
- Checking your game, the local Studio
-
tools/game.ts,cli/quest-n-click.mjs,src/engine/dev/index.ts
Generated publication · publication générée — current documentation · documentation courante: quest'n'click 4.5.3 r1, documentation revision · révision de la documentation b061c4ae6fbeb0be47a11ba8a442ba7e23ecb0a1.
Latest documentation · dernière documentation: https://quest-n-click.cleverapps.io/docs · https://quest-n-click.cleverapps.io/fr/docs; earlier versions · versions précédentes: each release's quest-n-click-docs-<version>.tar.gz · l'archive quest-n-click-docs-<version>.tar.gz de chaque release, https://github.com/Quest-n-Click/quest-n-click/releases
An edit made in this wiki is overwritten at the next publication · une modification faite dans ce wiki est écrasée à la publication suivante.
Edit the source · Modifier la source · Report an error · Signaler une erreur
Index (6)
Start (6)
Play (9)
Install (18)
- Requirements
- Install from the release archive
- Install from npm
- Install from the repository to work on the engine
- doctor: checking your machine
- Image toolchain
- Audio toolchain: ffmpeg, fluidsynth, Furnace, uv
- Upgrade
- Upgrade notes: 4.5
- Upgrade notes: 4.4
- Upgrade notes: 4.3
- Upgrade notes: 4.2
- Upgrade notes: 4.1
- Upgrade notes: v3
- Upgrade notes: v2 to v3
- Coming from web-scumm
- Package reference
- Install troubleshooting
Create a game (55)
- Your first game
- Layout of a created project and of the engine repository
- The working loop
- Content principles and the identity contract
- Rooms
- Geometry: placement, walk zones, masks, layers, camera
- Something is visible but unreachable
- Reactions
- Game commands
- Conditions
- Flags, variables and events: which to use
- Custom code
- Characters
- Items and inventory
- World map
- Dialogues
- Scripts and events
- Moving characters: patrols and walks
- Exits
- Chapters and objectives
- State and saves: persistent or temporary, renaming an id, migrations
- Staging: wide rooms and animations
- The stage: lights, particles, floors
- Skin and fonts
- Title and credits
- Heroes: several characters and hero choice
- Built-in minigames
- A custom minigame
- Translations
- Music in stems
- Sound effects
- Voices: per language and per hero
- Images: prompts, cutting sheets, transparency, scale
- Asset provenance
- The storyboard, source of truth
- Puzzle design
- Classic mechanics
- Review pages
- DSL reference
- Checking your game
- What the solver proves
- Solver options
- Playtests
- Remix
- Speedrun for authors
- The sealed ending
- Production template
- Example games
- Working with an AI
- Build and release a game
- Publish on GitHub Pages
- The static game on Clever Cloud
- Other static hosts
- Sub-path, cache and service worker, incomplete deploys, going back
- Testing on a phone over the LAN
Local Studio (24)
- The local Studio: overview and launch
- Edit a room
- Placement and stage
- Preview, apply, undo
- Storyboard
- Assets and cutting
- Check: validator, solver, critical path, heat, health, coverage
- Before and after captures
- Semantic diff
- Play and replay a session
- Rule explainer
- Language and objectives
- Voices and the heroes × languages matrix
- Map
- Notes
- Remix in the Studio
- Music
- The Assistant: bring your own key
- Demo mode and studio-apply
- Local and LAN security
- Studio API
- Local MCP: setting up each client
- MCP tools
- Studio troubleshooting
Team Studio (21)
- What runs where
- Concepts: revision, transaction, span, lease, preview, build
- Starting as an invited dev
- Working together day to day
- Roles and actions: the full matrix
- Invitations
- Managing members
- Write refused on the hosted Studio: stale base revision (409)
- Write refused on the hosted Studio: span locked (423)
- Recovering after a lost lease, a disconnection or a stale preview
- Comments
- Map and semantic diff
- Publishing builds
- Remote MCP
- The game in Git
- Upgrading the engine of a hosted game
- Hosted assets
- The server's command line
- Health and metrics routes
- Trying it locally with compose.yml
- Known limits
Clever Cloud (23)
- Clever Cloud: overview, cost and prerequisites
- Apps and add-ons
- Domains and TLS
- Keycloak
- Generic OIDC and GitLab
- Configuration
- First deployment
- Backups
- RPO and RTO
- Restore the Studio on a fresh installation
- Redeploys
- Upgrading the server and checking state after a migration
- Limits of going back
- Monitoring
- Security
- Rotating keys
- Recovering admin access
- Changing domain or OIDC provider
- Worker, PostgreSQL or Cellar down
- Exporting the game and leaving the installation
- Retention
- Clever Cloud troubleshooting
- Costs and teardown
Reality Bridge and connectors (16)
- The Reality Bridge: what it is
- Quick start
- Guarantees
- Install and run the Bridge
- Backup and restore
- Several tenants
- Signals and the manifest
- The Bridge's command line
- Connectors overview
- Email connector
- Telnet connector
- SSH connector
- Open Badges connector
- The connector SDK
- Security: Biscuit and signatures
- Bridge and connector troubleshooting
Contribute (25)
- Welcome
- Developer setup
- The dev loop
- Before a pull request
- Conventions
- Writing documentation
- Architecture
- Code tour
- Import boundaries
- Which tests run when
- Mutation testing
- The coverage ratchet
- The quality baseline
- CI explained
- Field passes
- Benchmarks
- Releasing
- npm packages
- Decisions and ADRs
- Governance
- Bot pull requests
- Contributing with AI agents
- Security policy
- Code of conduct
- Licences and credits