Fish Tank 1 Month — saltwater reef across 30 days with named fish across generations
A 3D EPOCH demo: 75-gallon reef across 30 days with 12 named fish (Big Mister Tang, Scampi & Tomato, King Reggie, Goldie…) spawning, aging, and being replaced by Scampi II — coral grows polyp-by-polyp, algae bloom and clear, persistent memory across reseeds.
Built with:
three.js r0.160 (single file)Custom water shader with caustics + vertex displacementlocalStorage generational memory across reseeds
Prompt
Build a single-file HTML page that recreates "30 days inside a 75-gallon saltwater reef tank" as a continuous 3D autoplay world. Fish spawn, grow, age, die offscreen, and are replaced by their named descendants. Coral grows. Algae bloom and clear. Persistent across Twitch viewing sessions.
Hard constraints:
- One HTML file, < 200KB.
- three.js r0.160.0 from unpkg, IIFE, strict mode, full disposable cleanup, reseed every ~10 min that ADVANCES the month forward instead of resetting.
- First body line: <!-- ROUND16_EPOCH v1 -->
- localStorage memory under key `fish_tank_memory_v1` — 12 named fish with species + age + state. Reseed advances ages; fish at max age retire to refugium; new fish enter with descendant names ("Scampi II — daughter of original Scampi").
- Generational morph — juvenile color desaturated → adult full color; size scales with age ratio.
- Visible structural change — branching coral starts as 3 polyps and unlocks toward a 30-polyp colony as the month progresses. Algae bloom day 12-18 (sin-curve peak around day 15), then clear by day 22.
- 5+ sub-locations: reef wall left/right, sand bed, cleanup crew zone, anemone garden, refugium tucked behind, surface bubble curtain.
- Mini-map = top-down view of tank with active hotspot.
- 100+ named fish/critters: 12 featured cast (Big Mister Tang, clownfish couple Scampi & Tomato, Royal Gramma King Reggie, Yellow Wrasse Goldie, Cleaner Shrimp Mantis Snip, Hermit Crab Hank, Sandy Pete the goby, Spark the chromis, Mortimer the eel, Comet the anthias, Sir Turbington the snail) + 50 InstancedMesh small fish + 40 InstancedMesh microfauna + 900 InstancedMesh sand grains.
- 15+ director cameras: front pane wide, sand bed bottom, reef cave POV, anemone close, top-down, refugium peek, cleaner shrimp orbit, wrasse chase, surface bubble shimmer.
- Custom water shader with caustics + vertex displacement.
- Chyron rotates: "DAY N/30 — event", "WHO IS [fish name] — [species] — Generation [G]", cross-system events ("Day 14 — Scampi pair lays eggs").
Tone: cozy reef-tank cam vibe. No deaths shown — just "elder Goldie has retired to refugium" off-camera transitions.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- How to fake 30 days in a reef tank by gating coral polyp count + algae density + fish age on a 0-30 progress variable
- How to use a custom shader with caustics and vertex displacement to give a flat tank pane the depth of a real reef without lights doing the work
- How to thread localStorage through three.js disposables so a reseed every 10 min advances the *world's calendar* instead of restarting it