Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

Night mode: the saplings are sleeping (animation flowing into a multiplayer game with a leaderboard), and Wake up / Good night for the owner with a morning check-in (water, sprout count) #632

shipped merged opened this has it
opened this

Owner, 2026-10-27 02:50Z: "close the app with a fun saplings are sleeping message with an inspiring animation that seamlessly flows the user into an engaging game. this will be the latest offline screen. of course i need to be able to login to turn on the wakeup phase when I wake up and turn on the lights. this should turn on the cameras too. i will check water and can do any logging as well. like sapling count or something" … "the game should have a leaderboard and be multiplayer!"

The app is closed right now with the note "The saplings are sleeping…" (set by the steward through /admin, so the resting state already works). This issue makes night a designed experience.

1. The sleeping screen (the new offline/closed screen)

  • An animation: a night sky over the grow box. The seedlings breathe slowly, and stars drift. It's calm and quick to load (canvas or CSS, no heavy assets), and respects prefers-reduced-motion.
  • It shows the note (the owner's words) and "Back at sunrise: about 7:00" from the light schedule, plus a soft countdown.
  • It flows into the game, no click wall. After about 4 s (or on scroll or tap), the camera pans down into the soil and the same scene becomes the game.

2. The game: Night Garden (multiplayer, leaderboard)

  • Theme: the seeds are germinating in the dark. Players guide water drops and air bubbles down through the rockwool to the seeds, dodging rot spores (warmth plus no air = Pythium; the biology from the Learn page, made playable). A minute per round. Mobile first (tap/drag), keyboard too.
  • Multiplayer: everyone on the sleeping screen is in one shared night. Each player's drops count toward the shared garden: a global "seeds germinated tonight" meter that fills for everyone. Players see each other's drops as soft lights. Use the app's existing lobby/WebSocket (src/lobby.ts) and server-authoritative scoring, with rate limits per browser id.
  • Leaderboard: tonight's top gardeners (the display name, or guest-xxxx), the all-time best, and the shared total. It resets each "night" (the closed period). Server-side scores with sanity checks (max score per round). Guests can play; signed-in names are kept.
  • Seeds are real: the "sprouts" counter in the game header shows the real sprout count the owner logs in the morning (§3), so the game and the grow are one story.

3. Wake up (the owner only)

  • When the owner is signed in, the sleeping screen shows a big "Wake up the garden" button. It also stays reachable while closed (sign-in and /admin work when closed, #578).
  • Wake up does, in order:

1. Opens the app. 2. Turns the grow light on through the light switch (#582) when one is set up; until then a checklist line, "Turn the light on (no switch yet)". 3. Turns the cameras on. 4. Opens the morning check-in.

  • The morning check-in is one screen, each item one tap, and each writes to the care log (#585):

- Water: "cubes moist" / "topped up (bottom)" / "too wet". - Sprout count: a stepper (0–20), stored as a measurement (kind: "sprouts"), charted per day on the grow card. - The lid: "on" / "cracked" / "off". - An optional photo note.

  • "Good night" (the reverse) closes the app with the sleeping note, turns the light off (if a switch exists), and keeps the cameras off until wake. It can be scheduled from the light schedule (19:00) or tapped.

Done when

  1. The sleeping screen, the animation and the flow into the game.
  2. Multiplayer play with a shared meter and the leaderboard (server-side).
  3. Wake up and Good night as owner actions, with the morning check-in writing typed care-log entries (including the new sprouts measurement).
  4. Tests: the closed screen renders for a guest with the note; the game server rejects impossible scores and caps the rate; two fake clients share the meter; Wake up opens the app, calls the switch (fake) and writes the check-in entries; Good night closes it; the sprout count appears on the grow card chart.

Files: Software/so101/src (closed screen, game server and client, admin actions, care log), tests

commented

Owner, 2026-10-27: "somehow be able to see others live and maybe their ghosts like best run or something. depending on what the game is but somehow make it fun so like my friends could see each other."

Social play is the core of this:

  • Live presence: every player in tonight's garden shows as a small named light (their name, or guest-xxxx) moving in real time. Positions are throttled to about 10 Hz and interpolated on the client. Friends see each other's drops land and get a short "nice!" burst when someone saves a seed.
  • Ghosts: each finished run is recorded as its input trace (about 20 samples/s, compressed; a few KB). Players race ghosts alongside the live players:

- their own best run, translucent; - tonight's top run; - a friend's best ("race {name}'s ghost" from the leaderboard).

Ghosts replay deterministically from a seeded round: the same seed gives the same spores and seeds, so a ghost is a fair rival. The server re-simulates a submitted trace to validate the score (anti-cheat for free).

  • Friends:

- A share link (/play?with=<name> or a short room code) drops friends into the same night and pins each other on the leaderboard. - "Friends" filter on the leaderboard: people you've played with or invited. - A tiny emote wheel (🌱 💧 🌙 👏), rate-limited; no free text, to stay safe for a public page.

  • Fairness and abuse: server-authoritative scoring through re-simulation; names follow the existing account rules (src/accounts.ts); per-browser rate limits; a ban hides a player's light and ghosts.
  • Tests:

- the same seed and trace re-simulate to the same score; - a forged trace is rejected; - two fake clients see each other's presence; - a ghost replays in sync; - the share link joins the same room.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs