guide

The workshop

Build a world in your browser, tune every prop, edit it as JSON or live TSX, put one component in the lab, customise a person in the avatar studio, and share it all as a link.

⌖ Explore the library in 3D → · View as Markdown

The workshop is Runek’s in-browser workbench: the room next to the library, where the world you build renders live and the tools float over it. Nothing is installed and nothing leaves your browser. The whole session is a WorldData value, so a share link is just that value, compressed into the URL.

You can also walk there: in the library, the door on the right wall with the green ring leads to it.

Four modes

The avatar studio

Behind the door in the hall’s west wall is a room for one job: customising a person. Select a Person and press customize in the inspector (or click the doorway, press 4, or pick Studio), and it stands on a turntable platform under good light. Edits land on the figure in your scene as you make them, so undo works as usual and revert puts back what you came in with. With no person selected you start a new figure, then add to scene.

The Avatar panel has a tab per part of the figure, and the camera frames that part:

Every trait shows where its value comes from: set by you, from the skin or kind, seeded, or the component’s default. ⟲ clears what you set, so the skin, kind or seed decides again. 📌 pins what the seed chose, so it stays when the seed changes. 🎲 shuffle rerolls only the open tab (on Looks, it picks a new seed). Choices you make are written into the figure’s part objects (body, face, hair), the canonical form.

export .look.json downloads the look (who the figure is and what it wears, not where it stands) as a Person node, and import… puts one on the figure. use as play avatar gives the world’s Player body the same look, adding a Player if the world has none.

Every prop, generated

The inspector is not hand-written. At build time the docs site reads each component’s TypeScript (its props interface, the defaults in its signature, the JSDoc) and turns it into a schema. Numbers get sliders, colors get swatches that show the palette slot they fall back to, string unions become segmented choices or dropdowns, [x, y, z] gets three scrubbable fields, and nested specs (a Person’s clothes, a Wall’s openings) get list editors. A dot marks props you changed, and ⟲ resets one to its default (it disappears from the file). Drag a number’s label sideways to scrub it.

Callbacks, React children, and live three.js objects (a Screen’s texture) can’t live in a world file; the inspector lists them under Code-only props, to use from App.tsx. Export → Prop schema downloads the whole schema as JSON.

world.json and App.tsx

The world.json tab is the world itself, two ways: edit the room and the file updates; edit the file and the room follows (after a short pause). Completion knows component names, props, enum values and palette slots; inside a nodes array, type node: for a node or snippet: for a group. If the JSON is broken, the room keeps the last good world and the error is marked in the gutter. minimal hides props equal to their defaults.

App.tsx is a real React file that runs live. It starts generated from your world, either rendering the JSON with WorldRenderer (the data style) or spelled out component by component (the JSX style). import world from './world.json' always gives the current world, so the inspector keeps working while your code runs. Export a registry with your own components and the outliner accepts them as node types. The new ▾ menu has examples: a custom seeded component, a useFrame animation, interactions and click handlers, and a world generated in a loop.

The code runs in a sandboxed iframe with its own origin: it can’t read this site’s storage, cookies or page, and it can import only React, three.js, React Three Fiber, drei, Rapier, @runek/core and @runek/components. A loop that never yields is stopped. Links that carry code ask before running it.

Stages

The room around your world is a stage, not part of it, and it is never exported:

Walk it

▶ Play (or p) hides the tools and drops a first-person Player where the camera was looking (or uses your world’s own Player). Esc brings you back. In the Room stage, walking out of the door leads back to the library.

Take it home

Your work autosaves in the browser. Templates start you from a reading room, a village square, an island cove, an office, a campsite at dusk, or a line-up of people.

Keyboard

Keys
⌘K Command palette: add anything, load templates, jump to a node
⌘Z · ⇧⌘Z Undo · redo
g · r Move · rotate
W A S D · Q E Pan the view across the ground · down and up. With a node selected, step it along the nearest axis instead (⇧ for bigger steps)
← → ↑ ↓ Orbit the view around its focus
f · Home Frame the selection · frame everything
⌘D · ⌫ Duplicate · delete
⌘C · ⌘V Copy · paste nodes as JSON (paste a whole world too)
p · Esc Play · back
Tab Hide or show all panels
1 2 3 4 Build, Lab, Code, Studio
⌘↵ Run App.tsx
? All shortcuts