Skip to content

About

Alembic — a paint-and-watch falling-sand alchemy vessel.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Alembic

A brass alembic holding molten sand and fire

Charge the vessel. Let go. Watch what the glass decides.

A paint-and-watch falling-sand toy dressed as an alchemist's retort. There is no score. The garden runs whether you touch it or not. New reagents are transmuted, not picked from a warehouse palette. A few doors only open if you build them.

480×270 grains, stepped in TypeScript, drawn through a Three.js nearest-neighbour upscale — heat haze, water caustics, gold spark, blast shake, Magnum Opus aurora.

Play

Play Alcubemy: V2 Playground opens the original V2 experience, with its discoveries, weather, flasks and atmospheric rendering. A visible mode switch leads to Matter Lab, the experimental workshop. Paint from 72 materials, rotate gravity from zero to 4g, place working buildings and habitats, or capture your own blueprints. Heat and velocity lenses explain the chaos. Worlds and blueprints can be saved and exported. See the physics and consolidation notes for the model's limits.

This checkout also includes the three-chapter Waterworks campaign at /v2/catch/index.html and the latest seasonal Turning Valley at /v3/index.html. The original vessel remains at /classic.html, and V2 remains at /v2/index.html. Root navigation opens V2 Playground on Netlify and GitHub Pages. Build all three portable HTML games with node scripts/pack-lab.mjs <output-directory>.

Play the original Alembic — no account or installation needed.

Try Alembic v2 — the next iteration, shipped alongside the original:

  • Velocity-based grain physics, so pours, flings and splashes carry momentum.
  • Per-material feel: powders, liquids and gases each move and settle differently.
  • Storms and visitors that stir the vessel on their own.
  • Simulation runs in a worker, with touch pour and two-finger pinch/pan.
  • Phone controls stay compact: swipe materials, pause, cycle brush size, or open More for tools, speed, saves, sound, and reset.
  • Rotate for a wider vessel. Fullscreen expands the canvas with an overlay toolbar; browsers without native fullscreen use the same immersive layout. Tap exit screen to return. The world and discoveries survive rotation.

Read the V2 release log or GitHub releases for additions, fixes and known limits. The log also explains why ice now freezes only already-cold water.

V2's physics/timing update ports tested fixes from the independent Godot V2 project (currently private): cell-resolution high-speed collisions, bounded velocity restoration, fixed 60 Hz catch-up, simulation-timed held tools and elapsed-time fling response. Current browser weather and creature behavior stays intact. The two runtimes have different save formats; this is not Godot running in the browser.

V2 also has a native growth cycle: supported plants and blooms can decay to ash, freshwater-fed mud can seed new growth or hatch mites near food, and local mite births are capped. Material IDs, checkpoint arrays, save format and the physics framework remain unchanged. See the growth-cycle note for the probability averages, finite-scene checks and long-run profile.

To run it locally:

npm install
npm run dev      # http://localhost:5173/
npm test
npm run typecheck

Living Valley (v3)

Open /v3/index.html on the local dev server. Break the reservoir dam, dig a channel, and watch retained soil moisture grow plants. Wet roots favor reeds; burned ground favors fireflowers. Seeds generate broad basins, twin hollows or terraces with different flood habitats. The options menu accepts a decimal Landscape seed, saves complete valleys, and imports/exports JSON files.

Same seed and terrain version reproduce starting ground; full saves preserve an evolved valley. Original experimental seed links and version 1 valley files remain readable and replay their original generator. New files record terrain version in a version 2 envelope and require this updated page. Variation can repeat; every playthrough is not guaranteed unique. V1/V2 routes and flasks stay available. This is surface-soil ecology, not inherited evolution or groundwater.

Run npm run test:v3 alongside the existing checks. Mobile controls support keyboard tools, touch painting, pinch/pan, overview, pause and rotation.

Living Ground foundation (v2)

The v2 world owns its arrays, random streams and committed simulation ticks. Rendering and worker polling do not advance weather or ambient ember rain. New flask saves and exported JSON checkpoints preserve the complete world, including velocities, heat, wind, weather, visitors, random streams and queued commands. The tiny explorer is session-only and is not saved in flasks. Exact simulation continuation is scoped to the same engine version and runtime. Older flask saves and existing share URLs remain readable as scene stamps: they carry material cells only. World dimensions stay 480×270; the explorer update appended beetle and newt IDs without renumbering existing materials. This foundation does not add the later water or soil solvers.

Run the release checks and deterministic host benchmark:

npm test
npm run test:v2
npm run build
npm run lint
npm run bench:v2
npm run bench:v2 -- --scene storm --seed 73

The benchmark emits one JSON report with four fresh fixtures by default:

Scene Workload
settled Supported, flat sand bed
falling Suspended sand blocks and 24 tick-scheduled pours
wet Contained water/oil pool with mud and seeds
storm Wet pool under active weather

Each fixture starts at tick zero and runs 120 warmup ticks, then 600 measured ticks. --scene accepts one scene or all; --seed accepts a decimal or hexadecimal unsigned 32-bit integer. JSON includes Node/V8/platform/architecture, seed, scene, warmup and measurement counts, final tick count, nearest-rank p50/p95/p99 step times in milliseconds, and a SHA-256 hash of every authoritative captured field, including typed-array bytes, queues and random states. Fixture version 1 has a finite command budget; measured step time includes any queued edits and world events. Setup, rendering, worker transport, checkpoint encoding, storage and hashing are outside that timing interval. Invoke node scripts/bench-v2.mjs directly when stdout must contain JSON alone; npm prints its own command preamble.

Timings are informational host measurements with no pass/fail performance threshold. Browser and phone acceptance, worker/local fallback, controls and rotation, import/export and quota recovery, and phone serialization latency remain pending. Node timings do not establish a phone frame budget or a device baseline. Later solver stages still require their own conservation and real-device performance gates.

The vessel draws at 480×270 grains. Chrome nearest-neighbour upscales that buffer — it should not shade a 4K framebuffer for a pixel grid. In Chrome: ⋮ → Cast, save, and share → Install page as app, or More tools → Create shortcut → Open as window. That is the standalone window; no Electron.

The vessel boots charged: dunes that crawl if you wait, a trough with a silver thought, ice, a glass cup of lava, two red casks by the wood, and an unlit obsidian frame in the sky. Don't sneeze.

Hand Work
Hold / drag left Pour. A still hold keeps dripping.
Right-click Name the grain under the cursor.
Hold right + drag Pan once zoomed.
Scroll Zoom toward the cursor. Double-click resets.
Alt-click Sample that grain onto the brush (and unlock it).
Space The vessel holds.
[ ] Brush size. 1–0 the first ten reagents.
½× / 1× / 2× Clock.

Clear empties the glass. Reset restores the opening scene. Discoveries stay.

The Work

Start with sand, water, stone, seed, oil, fire, air, ice, wood, salt, lava, acid, lead, and tnt. Everything else is earned in the vessel.

  • Seed + water (or mud) → plant. Wet thickets drop more seed. Ash is bone-meal.
  • Fire + sand → glass. Fire without fuel → ash. Fire + water → steam.
  • Ash + water → mud. Mud + fire → brick. Moss creeps along wet stone.
  • Oil floats and burns. Salt drinks and becomes brine; hot brine leaves crystal.
  • Ice freezes water; fire and ember melt ice. Crystal hanging over air, beside ice, drips.
  • Heat is a field: T' = T + (α/32)∇²T, Newton's cooling, latent heat on phase change. Metals conduct; glass and wood hold still. Hot water rises. Warm sand reads amber.
  • Wood throws ember. An ember melts ice even in a wet pool, then quenches to steam. Lava quenches in water as obsidian + steam.
  • Steam + crystal → aether. Acid + lead → mercury. Mercury + lead + fire → gold.
  • Gold + aether + crystal → azoth. Azoth turns nearby lead to gold without the fire.
  • Salt + ash → powder, a fuse that burns one hop a tick.
  • Fire boxed in eight obsidian → void. It spreads through living stuff; azoth keeps it back.
  • Acid eating stone sometimes yields lead, rarely gold.
  • Sand that settles on brine petrifies. Sand falling into a pool splashes.
  • A gold column six high, kissed by aether at the tip, strikes fire at the base.
  • An obsidian frame (inner hole at least 2×2) lit with fire becomes a rift. What touches it forgets its name.
  • Tnt on the bench. Fire, ember, lava, or a fuse. Obsidian / azoth / rifts hold. Nearby casks chain. Sand gets thrown.
  • Oil + powder → nitro. Meaner hole.
  • The dune keeps mites. They graze plant and bloom, flee heat, and steal gold grain by grain — a laden mite walks the colour of the king. Mud against plant hatches more. They are not on the bench; they were already here.
  • The trough keeps minnows. They school, eat a mite that touches the water, and die in oil. Beside crystal they sometimes leave a pearl.
  • A wet thicket opens bloom. Steam that gathers as a cloud against the ceiling falls as dew.

There are rites. The name on the page can be struck. Old sequences still work. A few words from the art, typed into the dark, are answered.

Layout

File Role
src/grid.ts Cell ids, shade, occupancy, line stamps.
src/materials.ts Palette, colour, density, kind.
src/sim.ts Motion, reactions, blast kick.
src/secrets.ts Title strikes, konami, named rites.
src/codex.ts Whispered lines on first sight.
src/feel.ts Boom and chime.
src/render.ts blitGrid, flicker, sparkle, occlusion.
src/stage.ts Three.js DataTexture quad + 2d fallback.
src/view.ts Zoom / pan math.
src/world.ts Size, brushes, opening scene.
src/main.ts Hands, HUD, curtain, RAF.
src/rng.ts Seedable PRNG.

About

Alembic — a paint-and-watch falling-sand alchemy vessel.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages