Back to ElijahOS
gen ai browser game · 2026

Sketch Island

A floating island you shape with brushes. Type any word and it appears, built in the island's own style. The model writes a small recipe format; code repairs, builds, keeps, and replays it.

By Elijah Leung · Updated

The magic brush

Sketch Island is a floating island you shape by hand: brushes carve rivers, raise mountains, and plant forests. The magic brush is the heart of it. Type any word, tap, and that thing appears, built in the island's own style.

It aims for the rush of an image generator, but the person stays the author. They draw the world; the model only fills in what they ask for.

The hard part is letting a model design 3D objects in real time, in one art style, on a public site, without breaking the scene, the budget, or the tone. The rule throughout: the model proposes, code decides.

See it move

Recorded from the real island: a new word in the factory card, the brushes, and postcards of islands the site made.

A word not in the library, built from a recipe a model wrote earlier (no model call for this clip). Double speed.
Magic brush: type a word, then tap, hold, or drag.
River: tap for a pond, hold to grow it, drag a river.
Mountain: a hill, a peak, or a ridge.
Forest: a tree, a grove, or a whole tree line.
Eraser and undo.
A Sketch Island postcard reading “Greetings from The Harbour”: a floating island with a village of colorful cottages, a striped market, a red-and-white lighthouse, and a harbor of sailboats under a stone bridge.
The Harbour
A Sketch Island postcard reading “Greetings from Ledger Bluffs”: a floating island with a castle between rocky peaks, a lake, a town square with a fountain, and a waterfall pouring off the cliff.
Ledger Bluffs
A Sketch Island postcard reading “Greetings from Orchard Rise”: a farm island with a windmill, rows of wheat, an orchard, a red barn, sheep, and a pond.
Orchard Rise

A small language for the model

The model never makes a mesh. It writes a recipe, and code compiles it. Cheap paths run first, in plain code: known words, a 162-object library, color prefixes like “a red cow”, and fuzzy matches. Only a word none of those can place reaches the model.

  • Shapes — a small kit of primitives and coded behaviors, not free-form geometry.
  • Colors — palette names only. A hex code can't be expressed.
  • Symmetry — declared, not computed; code does the math.
  • Limits — hard caps on parts, colors, triangles, and size.
  • Examples — the closest hand-made objects, picked in code.
  • Input — cut to plain letters before the model sees it. “Ignore your rules” comes back as nothing.

The format is shaped so most mistakes can't be written, and the prompt is generated from the same code as the checks, so the two never drift.

Repair, don't re-ask

A near miss is still wrong on a 3D island: a part floats, a roof is too big, the triangle count runs over. Re-asking doubles the wait and the cost, so code repairs instead. Of 24 failed first answers, 22 were only over the triangle budget, which code fixes exactly. Only an empty or unreadable answer is asked again, once.

  • Clean — drop broken and duplicate parts, clamp sizes.
  • Ground — set the object on the ground; scale it down if it's slightly too big.
  • Connect — close tiny gaps, then move floating clusters onto the body.
  • Budget — merge to five colors; cut curves coarser, then drop the smallest parts.

Streaming one structured answer

The model writes one structured answer, and the server builds each part the moment it is complete, so the factory card fills in while the model is still writing. Only the finished answer gets the full repair; a failed build puffs away.

  • Strict mode — OpenAI's strict schema boxed the model in at one spot, and it padded the answer with blank space (3 of 13 calls). Reshaping the schema fixed it.
  • Required rotation — when rotation was optional, one model skipped it on all 245 parts, and every roof came out flat.
  • Runaway guard — a stream stops at 200 characters of whitespace or 24,000 total, with up to two fresh re-asks.

One schema serves both providers, adapted to each one's structured-output rules. Two lessons came from real failures:

The wizard reads a map

“Bring my island to life” shows the model a labeled map of the island and asks for a round of additions. The image is never resized, because a resize would shift every coordinate the model reads off it.

  • Checked as it streams — every addition must use an offered word, a real spot, and land that fits.
  • Checked again — the page re-runs the same rules as each addition lands.
  • Free swaps — each addition carries an alternative, so “Try another” needs no model call.
  • Fallback — if the model is slow or away, a rules-only planner takes over.

Every input is untrusted

The brand step fetches any website a visitor names and hands its text to a model. One small module is the only code allowed to make that request; it is hardened against being pointed at internal addresses and held to a tight time budget.

Page text is data, never instructions, and the model can only choose from options the server offers, never write its own. An audit found the color scan could freeze the server for 58 seconds on hostile CSS; the rewrite takes 3 ms.

“No AI on screen” is enforced in code, not trusted to the prompt, and it catches disguised spellings too.

Spending as a correctness problem

Every model call reserves its worst-case cost before it runs, including thinking the model never shows, then settles on what it used. A call with no known price is refused.

Reservations run inside Postgres under a lock, against layered limits. A slow or unreachable database means no. The concurrency test is proven able to fail: it also runs against a deliberately broken copy, which must overspend.

Names and postcards are moderated before anything is shown, an invisible bot check guards the spending routes, and when any of it is down, drawing still works.

The island is a log

An island isn't a saved mesh; it's its inputs. Strokes are recorded so the island replays exactly, and undo just moves a cursor back through the log.

Model output becomes ordinary log events, and made words travel inside the log, so a share link rebuilds the whole island with no model call. Replay is exact on one machine; across Windows and Apple Silicon a float's last digit can differ, so those tests use a tolerance.

Choosing models

Models were picked with a harness: the same words for every model, rendered as close-ups labeled only by letter, for blind scoring.

  • Blind scores — GPT-6.1 Sol (medium) 3.70, Terra (medium) 3.45, Sol (low) 3.45, Claude Sonnet 5.5 (medium) 2.70.
  • The pick — Terra at medium on the Fast tier, ranked first by eye: 12.6 s median per new word, first part at 7.9 s.
  • Thinking matters — with thinking off, Sonnet 5.5 scored 2.50, with five broken objects.
  • Fallback — if the OpenAI credit runs out, calls move to Claude Opus 5.5.

Every result records the prompt version that made it, so a quality change traces back to its cause.

One canvas

Everything renders in one WebGL context, including the factory card's 3D preview, with shared materials, batched drawing, and a frame rate that steps down smoothly instead of stuttering.

  • Tour clips — recorded by a script driving the real app in headless Chrome.
  • Music — composed in code with Web Audio; no audio files.
  • Tests — over 5,800, and none of them call a real model.

How I built it

I built Sketch Island with an AI coding agent, Claude Code, as the engineer, and kept the owner's job: deciding what it's for, playing every build, and reacting in plain words, like “the water's too fast.”

  • One source of truth — a vision document wins any disagreement; one build plan says what's built, what's next, and what's only an idea.
  • Labeled decisions — mine are constraints; the agent's own calls are marked as its own and stay open to change.
  • Checked, not trusted — every change ends with the tests, a type-checked build, and a look in a real browser.
  • Mine to approve — money, the live database, keys, and production wait for my yes.

That only works with structure, so the repository carries it. Every session reads the same rules before it starts, and every decision is written down with who made it and when.

Where it stands

Launched to early testers at sketchisland.io on 2026-11-13. Optional accounts followed on 2026-11-15; playing and sharing never need one.

  • Since launch — new ground (snow, ice, sand, and lava that freezes, thaws, and steams), walking your own island as the wizard, and a security audit whose high and medium findings are all fixed.
  • Next — the phone pass, then a shared universe of islands. The explorer and search are a first step.

Built desktop first. Phones work but aren't polished: a busy island is about 132k triangles against an 80k budget, and it hasn't been measured on a real phone yet.

On November 16, Elijah changed the walking view so you play as the wizard and the camera comes around behind you as you turn. On November 17, a spending budget replaced the fixed quota on new words. That ties the limit to what generation actually costs. The November 19 update gives a shared island a fuller preview image so someone opening the link can see what you made.

Architecture

Two speeds. Plain code handles every frame, so the island never waits on a model. The model is called only on purpose, and everything it returns passes through code first.

Browser

instant hands

  • Island scene — one canvas · batched (Status: live)
  • Event log — seeded strokes · replay (Status: live)
  • Factory card — builds parts as they stream (Status: live)
  • Wizard — map · rules fallback (Status: live)

Words

cheapest path first

  • Word resolver — known · library · fuzzy (Status: live)
  • Library — 162 objects (Status: live)
  • Recipe store — made once, shared (Status: live)
  • Most asked — promoted by hand (Status: live)

Server

one streaming function

  • Recipe route — streams parts (Status: live)
  • Plan route — checked additions (Status: live)
  • Brand reader — safe fetch (Status: live)
  • Spend holds — worst case first (Status: live)

Models

propose, then checked

  • OpenAI + Claude — one schema (Status: live)
  • Repair pass — re-ask only if empty (Status: live)
  • Round rules — server and page (Status: live)
  • Wording check — look-alikes folded (Status: live)

Running it

in public

  • Postgres — holds · recipes · islands (Status: live)
  • Moderation — names · postcards (Status: live)
  • Bot check — Vercel BotID (Status: live)
  • Phone pass — 132k vs 80k triangles (Status: in flight)

If any of it is unavailable, the island is still a working drawing toy.

Decisions

  • A recipe format code compiles — Text-to-3D is slow, costly, and brings its own style. A recipe streams part by part, checks exactly, and always looks like it belongs.
  • Repair in code — 22 of 24 failures had an exact fix. Repairing keeps every word to one call.
  • Blind shortlist, then eye and speed — Blind sheets cut the models that made broken objects; the final pick weighed looks and latency. The Fast tier itself wasn't blind-scored.
  • Nothing on screen says “AI” — The point is the feeling of making something. The rule is enforced in code, not left to the prompt.
  • Act only when asked — Unasked ideas get in the way. The model only adds, and every addition can be removed, so the person stays the author.
  • Instant links, invisible checks — Sharing has to be instant. Moderation, limits, and a bot check hold off spam; accounts are optional.

Stack

  • TypeScript — The whole app: One recipe contract, browser and server.
  • Three.js + R3F — The island scene: Batched meshes, one shared material.
  • Vite + React — Build and interface: Fast builds; same routes in development.
  • Vercel Functions — Product routes: One streaming function.
  • OpenAI + Claude — Model calls: One adapter, metered before every call.
  • zod — Schemas: Checks every answer before it is built.
  • Postgres — Holds, recipes, islands: Spend holds under one lock.
  • BotID + moderation — Abuse protection: Bot check; names and postcards screened.
  • Vitest + CI — Verification: Fake providers, real Postgres, smoke test.