From 54af0e51ada11ae6b6428c97043e45a3190bfa09 Mon Sep 17 00:00:00 2001 From: 44r0n7 <44r0n7+gitea@pm.me> Date: Sat, 24 Oct 2026 18:54:06 -0400 Subject: [PATCH] Progress bar and steps while generating, loading, opening claims and travelling; saving chip (t30) Co-Authored-By: Claude Opus 5.5 --- docs/DESIGN.md | 7 ++++++ docs/PROJECT_MAP.md | 16 ++++++------- docs/agent-log.md | 13 +++++++++++ src/shell.html | 3 ++- src/sim/worldgen.js | 28 ++++++++++++++++++----- src/styles/style.css | 7 ++++++ src/ui/claims.js | 12 ++++++---- src/ui/loop.js | 5 +++-- src/ui/saves.js | 26 +++++++++++++++------ src/ui/session.js | 36 +++++++++++++++++++++++++----- src/ui/state.js | 2 +- tasks/t30_progress_meters_while.md | 17 +++++++++----- test/play.py | 32 ++++++++++++++++++++++++++ test/t_world.js | 9 ++++++++ 14 files changed, 174 insertions(+), 39 deletions(-) diff --git a/docs/DESIGN.md b/docs/DESIGN.md index ff3d427..023e4d5 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -252,6 +252,13 @@ above, including: career and come along; buildings stay on their claim and wait (they don't run) until you travel back from the notebook's Claims page. +- **Long waits show what's happening (t30, 2026-10-24).** Generating, loading, opening a claim + and travelling show the loading overlay with a title, a moving bar and the current step + ("Laying rock and ore", "Unpacking", "Building the world"...). Generation runs as steps that + give the browser a frame every 30 ms, producing exactly the same world as before. A small + "Saving…" chip shows bottom right only when a save takes longer than 150 ms. The owner found big + worlds froze on a 0% bar with no sign of progress. + - **Clay bricks come from a Brick press (t28, 2026-10-24).** A hopper block like the Saw: every 8 clay lumps on top become a Green brick below, and a Green brick fires into a Brick above about 900°C (any fire). 2 Bricks build a brick wall block; builders order them. The owner found it odd diff --git a/docs/PROJECT_MAP.md b/docs/PROJECT_MAP.md index a2cb185..cc33159 100644 --- a/docs/PROJECT_MAP.md +++ b/docs/PROJECT_MAP.md @@ -324,9 +324,9 @@ Weather: clouds from steam, rain and snow, and the world water count. simTick: one simulation step, in order. - functions: simTick -### src/sim/worldgen.js (326 lines) +### src/sim/worldgen.js (344 lines) World generation: noise, layers, ores, caves, water, trees, and clearing tiny hard specks. -- functions: makeNoise, fbm, clearHardSpecks, generateWorld +- functions: makeNoise, fbm, clearHardSpecks, generateWorld, generateWorldAsync - variables: SPECK_MIN ### src/sim/save.js (126 lines) @@ -376,19 +376,19 @@ The title screen art. - functions: buildTitleCells, drawTitle - variables: FONT5, TITLE -### src/ui/saves.js (212 lines) +### src/ui/saves.js (224 lines) Saves in IndexedDB, world files (export / import) and the blueprint library. - functions: newWorldId, worldWrite, listWorlds, putWorldEntry, worldNewest, deleteWorld, cleanWorldName, renameWorld, migrateWorlds, saveWorld, newestSave, b64FromBytes, bytesFromB64, gz, packBuffers, unpackBuffers, exportWorld, importWorldFile, libLoad, libSave, bpEncode, bpValid, bpDecode -- variables: DB, worldIdTime, worldIdCounter, worldWrites +- variables: DB, worldIdTime, worldIdCounter, worldWrites, savingCount -### src/ui/claims.js (141 lines) +### src/ui/claims.js (145 lines) Shared player state; the world save remains a complete standalone fallback. - functions: careerState, validCareer, applyCareerState, loadCareer, claimName, openNewClaim, travel, renderClaimsTab - variables: career, claimBusy -### src/ui/session.js (133 lines) +### src/ui/session.js (157 lines) Starting, loading and quitting a game; modal dialogs; the pause menu. -- functions: showLoading, enterGame, setupNewWorld, startNewWorld, startFromSave, quitToTitle, refreshContinue, anyModal, openModal, closeModal, closeAllModals, topModal, dialog, openPause, renderWorlds +- functions: showLoading, enterGame, setupNewWorld, startNewWorld, startFromSave, loadSavedWorld, quitToTitle, refreshContinue, anyModal, openModal, closeModal, closeAllModals, topModal, dialog, openPause, renderWorlds ### src/ui/settings.js (124 lines) The settings screen. @@ -442,7 +442,7 @@ Previews drawn under the cursor: build ghosts, drill aim and pulses, selections, Events from the simulation (emit) turned into sounds, toasts and cards. - functions: drainEvents -### src/ui/loop.js (126 lines) +### src/ui/loop.js (127 lines) The frame loop and boot. - functions: scanVisible, frame, boot - variables: lastT, acc, lastRender, frameMs, simMs, fpsSm, ambientT diff --git a/docs/agent-log.md b/docs/agent-log.md index 6ea3936..733249e 100644 --- a/docs/agent-log.md +++ b/docs/agent-log.md @@ -4,6 +4,19 @@ What agents have done, newest first. Add an entry for every piece of work: the d note or request it was for, what changed, the files touched, the tests run, and anything left open or not verified. Keep each entry short; the git history has the details. +## 2026-10-24: t30: progress while generating, loading and saving (Claude Code, Codex) + +- `worldgen.js`: `worldSteps` generator yields `[fraction, label]`; `generateWorld` (sync, tests) + and `generateWorldAsync` (yields every 30 ms) run it. Small and Medium mat/temp/flags hashes + match the old generator exactly. +- `session.js` `showLoading(on, p, label, title)` with `#loadstep`; `GAME.loading` stops the + frame loop's sim and drawing while worlds swap. `loadSavedWorld` for Continue and the world + list; `worldNewest`/`unpackBuffers`/`startFromSave` report progress; travel and new claims too. + `#saving` chip after 150 ms of saving. +- Tests: t_world progress labels and identical worlds; play.py overlay, responsiveness during + async generation, Continue labels, saving chip. All pass except t_smooth half-resolution + (fails under load, as before). Screenshots `shots/t30-loading.png`, `shots/t30-saving.png`. + ## 2026-10-24: t3 follow-up: claim names; t30 added (Claude Code, Codex) - New claims get a camp name from their seed ("Cinder Gulch"; `claimName` in `src/ui/claims.js`, diff --git a/src/shell.html b/src/shell.html index b49f61f..e4539b2 100644 --- a/src/shell.html +++ b/src/shell.html @@ -41,6 +41,7 @@
+
@@ -71,7 +72,7 @@
Prototype v0.1 · keyboard + mouse or gamepad · all graphics and sound are generated in code
- +