Fog of war: unexplored is black, fades ease into it with no stepped rim (t17)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 12:59:00 -04:00
co-authored by Claude Opus 5.5
parent a18dcda8a4
commit 14194cb4be
7 changed files with 36 additions and 17 deletions
+1
View File
@@ -239,6 +239,7 @@ above, including:
the ground, so the owner couldn't see what was around them or where to dig.
As tuned: clear to 12 grains, fading out by 24, with a grainy edge; the owner found the first
version's narrow fade too sharp.
Unexplored ground is pure black, not dark grey (the owner: "should be black anyway").
## Ideas not built yet
+2 -2
View File
@@ -221,7 +221,7 @@ World state: the per-cell typed arrays, alloc(), ambient temperature by depth, w
- functions: emit, bagCap, discover, alloc, depthU, depthY, computeAmbient, fillNoise, wakeXY, wakeHeatXY, wakeIdx, wakeHeatIdx
- variables: W, H, N, CW, CH, NCH, mat, temp, life, flags, stamp, part, mach, digp, noiseB, airS, netId, isPow, occ, surfY, dirtY, graniteY, basaltY, magmaY, roofY, AMB, worldSeed, surfBase, underD, shallowD, lapse, BW, BH, NB, blockP, blockV, ents, bgm, flyers, ghostBlocks, ghostMolds, awake, hot, hotLvl, tick, tickStamp, machines, molds, nets, pcells, powerDirty, beltL, beltR, tubeLists, brokenMachines, ghostMachines, ghostBlocked, EV, bot, bag, bagTotal, player, seen, ledger, stats
### src/sim/fog.js (51 lines)
### src/sim/fog.js (52 lines)
Exploration only: never changes grains or the random stream.
- functions: fogAlloc, fogMark, fogSeen, fogInit, fogLook, fogRevealAround, fogRevealAll
- variables: FOG, FOG_SENSE, FOG_SENSE_FADE, fog, FW, FH
@@ -343,7 +343,7 @@ Drawing (src/render/): browser only. This file: the renderer state R, colour tab
Propagated coloured light from glowing and burning cells.
- functions: computeLight
### src/render/world.js (299 lines)
### src/render/world.js (304 lines)
Scale colour without changing the smooth-look class.
- functions: fogColor, drawWorld
- variables: TUBE_CLASS
+12
View File
@@ -4,6 +4,18 @@ 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: t17 follow-up: no jagged rim, unexplored is black (Claude Code)
- The owner still saw a jagged grey edge. Causes found by sampling pixels: the fade went to 0
(black) while unexplored was drawn (12, 10, 10), leaving a dark stepped rim; the ±40 noise lit
the faintest cells; rays that reached rock already dim dropped to 0 in 2–3 grains.
- `src/render/world.js`: unexplored and off-map are pure black (`OUT`, smooth-look buffers);
partial fog eases into black along a smoothstep, with noise scaled by s·(1−s). `src/sim/fog.js`:
sight into rock fades over 8 grains as a fraction of its brightness.
- `test/play.py`: the three unexplored-colour checks expect black (owner's decision).
`docs/systems/fog.md` updated. Screenshots `shots/fog-dig-black-{pixel,smooth,nolight}.png`.
- Tests: `run_all.py --browser` passed except `t_smooth` once at load 7 (passed on rerun).
## 2026-10-24: t17 follow-up: softer fog edges (Claude Code, Codex)
- The owner found the edges sharp and stepped. `src/sim/fog.js`: sense ring 24 grains with a
+4 -4
View File
@@ -28,10 +28,10 @@ immediately from the bot.
## Drawing and setting
Both looks and the thermal lens sample fog bilinearly. Partial values get stable per-grain
noise of about ±40, clamped to 1–255, to break up stepped edges. Unseen and fully seen
grains are unchanged. Seen grains use the usual drawing;
unseen grains use the out-of-world colour and smooth-look buffers, hiding their shapes.
Both looks and the thermal lens sample fog bilinearly. Partly seen grains darken toward black
along a smoothstep curve, with stable per-grain noise (up to about ±38 mid-fade, none at either
end) to break up the half-resolution steps. Fully seen grains use the usual drawing; unseen
grains are pure black (as is everything off the map) in both looks, hiding their shapes.
Partial values dim foreground, background and trees. Bloom sources need at least 128;
bars, flyers, rain and particles need at least 64. Hover info and the cursor label say
only “Unexplored” below 64.