Hot loads: visible melt damage, rebuild-over repair, warning glow (t69)

This commit is contained in:
2026-10-29 18:30:26 -04:00
parent b655d754b9
commit 5fd8110470
14 changed files with 246 additions and 15 deletions
+15 -9
View File
@@ -284,7 +284,7 @@ Pipes, pumps and outlets: each joined line holds one liquid as a count, not as g
- functions: sideOf, pipeClosedSide, pipeJoins, rebuildPipes, pipeNetOf, pipeTakeShare, faceCell, pumpDraw, outletPour, pipesTick
- variables: PIPE_CAP, PUMP_RATE, OUTLET_RATE, PUMP_MAX_T, SIDE_V, PUMP_V, OUTLET_V, pipeNets, pipeNetAt, pipesDirty
### src/sim/machine-tick.js (157 lines)
### src/sim/machine-tick.js (158 lines)
Per-tick machine work: steam engines, fans, belts, filters, screw conveyors (machinesTick).
- functions: engineIntake, fanBlow, machinesTick
@@ -308,9 +308,9 @@ Cleats are rubber ribs standing up from a sloped belt's face, one every CLEAT_SP
- functions: ribMove, cleatFoot, ribCells, slopeUphill, slopeFaceAt, pushRow, scoop, pocketRoom, advanceCleat, slopeRunKey, slopeCleatsTick, rebuildCleatMask, expelFromRib, screenNudge, wakeCleatLoad
- variables: CLEAT_SPACING, CLEAT_HEIGHT, CLEAT_REACH, SCREEN_NUDGE_TICKS, cleatChunks, cleatMask, cleatCells, slopePhase, ribLog
### src/sim/blocks.js (237 lines)
### src/sim/blocks.js (268 lines)
Building blocks: placing, integrity, removing, lines and rectangles of blocks.
- functions: blockOf, blockCellList, pieceCost, setSlopeSeal, slopeSeal, slopeSealOwner, blockOwnsCell, clearStraySeals, wallCells, canPlaceBlock, placeBlock, blockIntegrity, removeWallCell, removeBlock, diagonalDrag, blockLine, blockRect, blockInReach, blockIs, placeBlocks
- functions: blockOf, blockCellList, pieceCost, setSlopeSeal, slopeSeal, slopeSealOwner, blockOwnsCell, clearStraySeals, wallCells, screwDamageMask, screwLoadHeat, canPlaceBlock, placeBlock, blockIntegrity, removeWallCell, removeBlock, diagonalDrag, blockLine, blockRect, blockInReach, blockIs, placeBlocks
### src/sim/molds.js (317 lines)
Molds: cavities for castings; ingot troughs empty themselves below. Removal returns set metal.
@@ -350,9 +350,9 @@ Player actions on built things: take back, place a machine or mold, gates, F to
Blueprints: copy, cut, flip, cost and paste (as ghosts) a region of built pieces.
- functions: copyRegion, flipBlueprint, bpCost, pasteGhost, cutRegion, footprintBlocker, clearFootprint
### src/sim/undo.js (93 lines)
### src/sim/undo.js (103 lines)
Undo (Ctrl+Z) for building, and the bot building ghosts.
- functions: undoNote, undoPush, undoRecord, undoLast, clearAllGhosts, ghostTick, ghostTick0
- functions: undoNote, undoPush, undoRecord, undoScrewRepair, undoLast, clearAllGhosts, ghostTick, ghostTick0
- variables: UNDO_MAX, undoStack, undoRec, ghostMissing, ghostIter
### src/sim/bot.js (99 lines)
@@ -487,6 +487,10 @@ Other overlays: floating text, rain and snow, flow arrows, filter tags, molds, t
- functions: spawnFloater, drawRain, drawFlowArrows, drawJoinMark, drawJoinMarks, flowLoaded, drawFlowRates, pingImage, drawPing, drawHoveredVein, drawPingRecharge, drawRunOutline, drawFilterTags, drawFloaters, moldLabel, drawMolds, drawBot, spawnDebris, spawnSpark, spawnSuck, drawParticles
- variables: PING_SPEED, PING_HOLD, PING_FADE, PING_BANDS, PING_GLINTS, GLINT_MS
### src/render/screw-heat.js (29 lines)
Persistent scorch and broken casing, or a warning before the 1000°C limit, in both looks.
- functions: drawScrewHeat
### src/ui/audio.js (230 lines)
Audio: chiptune effects and generative music that changes with depth. Everything is synthesized with WebAudio, no samples.
- functions: auInit, auVolumes, rateOk, tone, noiseBurst, sfxPlace, playSfx, auAmbient, mtof, zoneForDepth, scaleNote, musicScheduler
@@ -568,7 +572,7 @@ Hover work is shared by the cursor label and the vein outline.
- functions: oreLike, bitNeeded, pingVisible, cursorVein, hoveredVein, cursorLabelAlpha
- variables: CURSOR_ORES, cursorVeinCache, cursorLabelKey, cursorLabelSince
### src/ui/info.js (208 lines)
### src/ui/info.js (216 lines)
Discovery cards, hover info (I) and the cursor label.
- functions: showCard, howText, discoveryCard, reactionsOf, hoverInfo, renderInfo, drawCursorLabel, pipeContentsText
@@ -582,7 +586,7 @@ Keyboard and mouse listeners.
- functions: isTyping
- variables: canvas
### src/ui/actions.js (256 lines)
### src/ui/actions.js (258 lines)
What input does: overlays, F, pick, copy / cut / paste, undo, building and tool use each frame. Which overlays are on, shown as a coloured frame round the screen and a named badge
- functions: updateOverlayUI, toggleLens, doInteract, pickUnderCursor, aimBlock, stampOrigin, selModeHeld, startPaste, stopSelectAndPaste, plural, piecesIn, doUndo, endRmbRecord, dragDirFor, blockLabel, primaryPress, primaryRelease, secondaryPress, pingWait, firePing, toolTick
- variables: ovShown, PING_RECHARGE
@@ -605,7 +609,7 @@ Selection previews: labelled tags, copy and cut boxes, and paste ghosts. a small
- functions: drawTag, drawSelection, drawPastePreview
- variables: SEL_COL
### src/ui/events.js (42 lines)
### src/ui/events.js (43 lines)
Events from the simulation (emit) turned into sounds, toasts and cards.
- functions: drainEvents
@@ -618,7 +622,7 @@ Shared world colours, minimap and full map.
Browser-only clocks; simulation code stays usable without a browser or a clock.
- variables: PERF_MARKS, PERF_FRAME, perfMarks, perfTimes, perfLast
### src/ui/loop.js (149 lines)
### src/ui/loop.js (150 lines)
The frame loop and boot.
- functions: scanVisible, frame, boot
- variables: lastT, acc, lastRender, frameMs, simMs, fpsSm, ambientT
@@ -670,6 +674,8 @@ The frame loop and boot.
- `test/t_pipes.js`: Pipes, pumps and outlets move liquids; the Grinder grinds waste rock for trace ore.
- `test/t_racks.js`: Rack intake, FIFO storage, gate, removal and saved-state validation.
- `test/t_render_dirty.js`: Render invalidation must not depend on whether a grain moved or the chunk stayed awake.
- `test/t_screw_heat.js`: t69: melt feedback, full-cost repair without disturbing the load, and repair undo.
- `test/t_screw_heat.py`: t69 only: both looks, persistent damage, hover, first message and real click/G repair.
- `test/t_silo_contents.js`: Stored snow keeps its identity and remains in the world's water budget.
- `test/t_sim_optimizations.js`: Optimized paths must match the full roof scan and the original heat loop exactly.
- `test/t_slope_belt_art.js`: Drawing geometry against real parts, without changing transport.
+6
View File
@@ -14,6 +14,12 @@ prints the failing checks.
## Headless suites
For t69, `node test/t_screw_heat.js` checks full-cost repair, load preservation, undo,
all screw directions, the unchanged melt threshold, and saved damage/message state.
`python3 test/t_screw_heat.py` is the focused browser check for both looks, hover,
first-melt message, fog, and real click/G repair with keyboard undo. It saves
`shots/t69-{pixel,smooth}.png` (cold tube, orange heat warning, cooled fractured tube).
Each suite is a plain Node script:
```js
+13
View File
@@ -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-29: t69 hot-load warning, visible damage and build-over repair (Codex)
- Added persistent scorched/fractured screw overlays in both looks, 900°C load warnings,
hover explanation and one first-melt card per world. Repair costs the full $25, keeps the
direction/load, and supports immediate/queued repair undo. Melt rule, worldgen and save format unchanged.
- Files: src/sim/{blocks,machine-tick,undo}.js, src/render/screw-heat.js,
src/ui/{actions,events,info,loop}.js, src/manifest.json, test/t_screw_heat.{js,py},
docs/{PROJECT_MAP,TESTING}.md, tasks/t69* and this log.
- Regressions failed first; all headless suites passed (22 heat/repair checks; /tmp/t69-headless-final.log).
Only browser test: python3 test/t_screw_heat.py (both looks, hover/card/fog, real click/G repair,
Ctrl+Z; no page errors). Inspected shots/t69-{pixel,smooth}.png: cold/warning/cooled broken
tube and first-melt card. Owner playtest pending. No commit.
## 2026-10-29: t72 rescue the bot from buried natural rock (Codex)
- Added explored nearest/up-first nudges, a 256-point typed-array trail and messaged