Repository navigation
EN Contribute Code Tour
Français · Tutorial · Published, reviewed by a person · Applies from: 4.1.11
Half an hour with the code open: eight stops, from a tiny game to the test that proves each part. Each stop names the files to read and the test that shows them at work. Architecture is the same map seen from above.
Audience, context, and the statuses of what this page rests on
Audience: contributor · Context: engine repository
Not a feature: a picture of the engine in your head, made by reading real code and running the test of each stop. You need a prepared repository (Developer setup) and an editor. Every test of a stop runs alone:
# in the engine repository
npx vitest run <file>The tour follows the code of 4.4.0; its stops date from 4.1.0 (and 4.1.1 for the signal).
Read tests/fixtures/classics.ts: five tiny games after the classics (insults,
grog, dott, mansion, stan), each a GameDef of a few rooms and rules. A rule is { verb, a, b, if, do };
do is a list of commands (Cmd, in src/engine/core/types/content.ts).
The types of a whole game are in src/engine/core/types/game.ts. The demo,
written the same way but larger, is games/demo/.
# in the engine repository
npx vitest run tests/classics.test.tsYou see each classic mechanic played to its end by the real engine.
compileGame in src/engine/core/define.ts clones the content, fills the
defaults, freezes it and gives each rule, choice, topic, listener and script step a stable id
(src/engine/core/content-ids.ts). Saves and sessions speak in those ids, so
renaming a line does not break a save.
# in the engine repository
npx vitest run tests/compile.test.ts tests/stable-ids.test.tsnew Engine(game, layouts, presenter, store) then newGame()
(src/engine/core/engine.ts). In the tests the presenter is FakePresenter and the
store MemoryStore (src/engine/core/ports.ts); in the browser App
(src/engine/dom/app.ts) composes the engine with the DomPresenter, and bootGame
(src/engine/boot.ts) wires everything.
# in the engine repository
npx vitest run tests/core.test.ts -t "fixture game"Engine.act walks there, opens a session entry and calls resolve
(src/engine/core/interactions.ts): the rule findRule picks, else a kind,
else a fallback. Its commands run in exec and step
(src/engine/core/command-runtime.ts), each through its handler in
src/engine/core/command-handlers.ts; events and scripts in
src/engine/core/event-runtime.ts and
src/engine/core/script-runtime.ts.
# in the engine repository
npx vitest run tests/core-runtime.test.tsEach runtime module is called on its own there, with the engine as its first argument.
saveEnvelope and parseSave (src/engine/core/save.ts) write and check a save;
migrate (src/engine/core/migrate.ts) carries an old one forward;
tests/save-v3.test.ts loads one save per release since 3.0 and plays it to the ending. The session
(src/engine/core/session-runtime.ts) records every input with a digest of
the state after it; replay (src/engine/tools/replay.ts) plays it again and
names the first entry that differs.
# in the engine repository
npx vitest run tests/replay.test.ts -t "a recorded session"solve (src/engine/tools/solve/search.ts) takes a state from the
frontier; makeExpander (src/engine/tools/solve/expansion.ts) runs every
action worth trying on a real Engine, records each transition (TryRecord,
src/engine/tools/solve/model.ts) and what it read and wrote; the search merges
them and gives its verdict. What a state is made of for the search is in
src/engine/tools/solve/abstractions.ts.
# in the engine repository
npx vitest run tests/solver-contract.test.ts
npm run quality:baseline -- --checktests/memo.test.ts is a heavy test (minutes): it runs in the nightly and the candidate, or alone with
npx vitest run tests/memo.test.ts. The behaviour of every game is frozen by tests/quality-baseline.json, which
quality:baseline -- --check compares (The quality baseline).
tests/fixtures/signals.ts declares three signals;
src/engine/reality/protocol.ts checks a signed one before it is read;
src/engine/reality/client.ts verifies it, hands it to Engine.receive
(src/engine/core/reality-runtime.ts: applied at most once, a session
entry), waits for the durable save, then acknowledges. The solver offers signals under a policy
(src/engine/tools/solve/scenarios.ts). The reference Bridge is
bridge/src/.
# in the engine repository
npx vitest run tests/reality-engine.test.ts tests/reality-proof.test.ts tests/bridge.test.tstests/reality-engine.test.ts crashes the engine at each boundary. In the browser, scripts/e2e-reality.mjs plays the
same path (npm run e2e:reality).
-
A command: grep its key in
tests/cmds.test.tsandtests/core.test.ts. -
A layer rule:
tests/boundaries.test.ts. -
The public names:
tests/api-surface.json. -
A browser behaviour: the scripts
scripts/e2e*.mjs(npm run e2e,e2e:taps,e2e:pwa,e2e:a11y…), which CI runs in Chromium and WebKit (and Firefox for the PWA).
Which suite runs where, and when, is Which tests run when.
Limit ·
tour-scopeThe tour stays inside the engine. The Studio, the Studio Server and the connectors have their own entry points (src/studio/,studio-server/src/,connectors/src/), not walked here.
- A game is data, compiled and frozen with stable ids: Architecture.
- One engine runs in the player, the tests and the solver, behind the
Presenterport. - Each part has its test, and the baseline freezes the whole: The quality baseline.
- The dev loop: change a command end to end.
- Import boundaries: what each folder may import.
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