Sand AISand AI MAGI-2MAGI-2 現已登上 SandBase:支援原生音訊的 1080p 影片立即試用

Grain Garden: Six Terraces of Falling-Sand Puzzles

Paint soil, water, seeds, ember, magma, frost, acid and more into a live falling-sand simulation and solve six terraces, in one offline HTML file: drain a reservoir onto a dry bed, grow sprouts past a line, burn through a log gate, melt an ice plug, seal a leak and contain an acid spill, or play in a free garden. No terrace solves itself, and a gauge shows how close you are. Ported from sandspiel by Max Bittker (MIT), keeping its Rust/wasm cell simulation, with a new layout, palette, renderer and goals.

範例

Grain Garden falling-sand puzzle
在新分頁開啟

Grain Garden falling-sand puzzle

此範例會在沙箱框架中執行,無法存取此頁面。

線上執行

在 SandBase sandbox 中執行,並在 Lab 中查看結果。

在 Lab 中開啟 ↗

您可獲得什麼

Bring the terraces and their goals, and optionally the palette, the element tray, the layout and the text. The Skill returns a downloadable Skill (the simulation game project with its wasm core, a customize guide, headless verification) and one playable example run.

運作方式

  1. 01

    Create the garden project

    Grain Garden starts with node scripts/new-project.mjs --out my-garden and npm ci. references/customize.md maps each request to files and symbols. Most start in src/config.js under LOOK, ELEMENTS, BRUSHES and STR, while levels and goals live in src/game/levels.js and src/game/goals.js. A prompt such as "Use grain-garden to make a falling-sand puzzle with flooded rice terraces" sets the theme.

  2. 02

    Paint elements on terraces

    Pick an element in the bottom tray and drag on the canvas. Water pools, sand piles into slopes, seeds sprout in wet soil, embers creep along a wood fuse and acid eats everything but brick. Six terraces each state a goal, such as guiding water to the dry bed, and a gauge fills as you approach it. A Rust cellular automaton compiled to WebAssembly runs the 288 by 192 grid.

  3. 03

    Shoot every terrace

    npm run build:single writes dist-single/index.html, at most 8 MiB, with the wasm inlined as base64 and no network, fonts, storage or workers. npm run shoot needs local Chrome and covers painting, opening a wall, water reaching the bed, sprouting, burning, melting, acid, breeze, undo, reset and a phone game. Check that each terrace stays unsolved after 900 ticks without input.

常見問題

Can I add an element to Grain Garden?

Grain Garden adds an element only if its wasm core already simulates it. The engine knows more species than the twelve in the tray, such as Oil, Fungus and Mite; add an entry to ELEMENTS in src/config.js and the tray and palette pick it up. New physics need a rebuilt wasm from the Rust source in crate/.

How do I make a Grain Garden level?

Copy a block in src/game/levels.js. Grain Garden levels draw the scene in sim cells with setup(paint) and name a win check in goal, such as speciesInRegion, speciesAbove or speciesBelowCount with optional holdTicks. Then add a verify.json step that solves it, because goal regions count cells and level switches inside a step break comparisons.

Does Grain Garden save my garden?

No. Grain Garden has no save beyond one Undo stack, which keeps one snapshot per stroke up to 50 deep. Inside the sandbox a reload starts over. An open garden mode drops the goals for free play, and Reset restores the current terrace.

Is Grain Garden a fluid simulation?

No. Grain Garden is a cellular automaton on a grid of cells, and its breeze tool is a splat, not a GPU fluid solver. Very fast strokes can leave gaps when they exceed the interpolation budget, so use a larger brush. It does not support multiplayer or shared canvases.

Does Grain Garden call a model?

No. Grain Garden loads nothing and calls no model; an agent edits the code locally, so it is free to run. Rendering is raw WebGL, and WebAssembly compiles inside the page under wasm-unsafe-eval. The simulation core keeps its MIT licence file in the package.

Does Grain Garden work on phones?

Yes. Grain Garden lets a finger drag paint on a phone, and the tray and header buttons are at least 44 px. It is verified under touch emulation, not on real devices. The UI ships in English and Chinese using the system font stack.

Lab Skill · Games

Seagull Swoop

Build a 3D flight-and-delivery game with light fries, heavy fish, crosswinds and optional ring routes. The gull must bring lunch home; cargo weight changes which openings it can safely reach.

Lab Skill · Games

Wedding Cake Wobble

Build a 3D fragile-cargo delivery game around a wobbling wedding cake. Brake before turns, avoid crossing guests and steer around tables. Lost tiers change the score, while a partial delivery can still succeed.

Lab Skill · Games

Hermit Tide

Build a 3D route-and-timing game where a hermit crab changes shells to cross a tidal shore. Narrow gaps favour the cap, stronger shells resist waves, and dry stones provide shelter and checkpoints.

Lab Skill · Games

Clover Circuit: Estate Cut

Drive a coral ride-on mower through a fenced estate garden. Steering, braking and the moving blade cut actual grass tufts; Overview reveals the genuine trail. Edit three gardens and three scene palettes offline. Coverage counts trimmed tuft centers rather than continuous ground area.

Lab Skill · Games

Glide Gates: Lagoon Run

Flap a golden bird through emerald pipe pairs above a turquoise lagoon. Actual fixed-step gravity, swept circle contacts and full-gate scoring power both manual flight and clearly labeled practice. Edit three courses and three scene palettes offline.

Lab Skill · Games

3D Interactive Garden Islands

Walk a curved garden, harvest fruit, share gifts, catch butterflies, fish, grow flowers and craft furniture. Four lighting states and one offline HTML with bilingual keyboard and touch controls.