diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 243b2c7..a79d1ea 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -471,6 +471,12 @@ above, including: but make it about what's on screen, so anything the player can see and aim at builds directly and anything beyond stays a blueprint built when the bot comes near. No limit at all would let players build in places they've never been and link far claims instantly. Not built yet. +- **Sticky materials slide freely on built surfaces (t61, 2026-10-27).** Stickiness (STICK) is the + chance per tick a grain takes a diagonal step, which made clay lumps, snow, wood chunks, ash and + dirt creep down sloped walls (a single clay grain never got down a 20-piece slope). The owner + chose to make stickiness grain against grain only: on anything built, every material slides + freely, so slopes are useful for every material, while heaps keep their shape. Real chutes clog + with sticky material and need cleaning, but that is micromanagement the game doesn't need. ## Ideas not built yet diff --git a/docs/agent-log.md b/docs/agent-log.md index 3cad090..a14e293 100644 --- a/docs/agent-log.md +++ b/docs/agent-log.md @@ -4,6 +4,16 @@ 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-27: t61 sticky materials slide freely on built surfaces (Claude Code) + +- The owner's video showed clay lumps creeping down a sloped wall; removing a piece was + unrelated. Cause: STICK gates every diagonal step, so cohesive materials crawl on 45°. In + `powder()` (`src/sim/cells.js`) a grain resting on a built solid (not F_NAT) now always tries + the diagonal; the random draw is unchanged, so generated worlds are identical. +- Measured: a clay grain down a 20-piece built slope took 77 ticks, same as sand (before: never + arrived in 2000 ticks). Heaps on a built floor and on natural ground are unchanged. +- Test: `t_slopes.js` clay vs sand transit. `python3 test/run_all.py --browser`: ALL PASSED. + ## 2026-10-27: Unremovable one-cell belt left after cutting slopes (Claude Code) - The owner's exported save had a lone belt cell no block owned, so nothing could build there or diff --git a/src/sim/cells.js b/src/sim/cells.js index a05c00d..a11c479 100644 --- a/src/sim/cells.js +++ b/src/sim/cells.js @@ -95,7 +95,9 @@ function powder(i, x, y, m, barriers = cleatChunks[(y >> 5) * CW + (x >> 5)]) { return; } } - if (rnd() < STICK[m]) { + // stickiness is grain against grain: on anything built (a wall, a slope, a belt) every material + // slides freely, so a chute carries clay as well as sand while clay heaps stay steep + if (rnd() < STICK[m] || (PH[t] === PH_SOLID && !(flags[b] & F_NAT))) { const d = (RS & 2) ? 1 : -1; let nx = x + d; if (nx >= 0 && nx < W && (!CORNER_SEAL || (PH[mat[b]] !== PH_SOLID && (!barriers || !cleatMask[b])) || (PH[mat[i + d]] !== PH_SOLID && (!barriers || !cleatMask[i + d]))) && (!barriers || (!cleatMask[i] && !cleatMask[b + d])) && enterFree(m, PH_POWDER, b + d, d, 1)) { move(i, b + d, x, y, nx, y + 1); return; } diff --git a/test/t_slopes.js b/test/t_slopes.js index 94602b0..276524c 100644 --- a/test/t_slopes.js +++ b/test/t_slopes.js @@ -114,4 +114,9 @@ globalThis.legacySlopeSave = legacy; run('deserializeWorld(legacySlopeSave.meta,legacySlopeSave.buffers)'); check('old save loads all four slope corners unchanged',run('Array.from({length:4},(_,k)=>{const b=6*BW+2+k*3;return blockP[b]===15+k && blockV[b]===RSTONE && blockIntegrity(b)===10 && PIECE_BY_CODE[blockP[b]].id===\'wall\';}).every(Boolean)')); delete globalThis.legacySlopeSave; +// Stickiness is grain against grain: on a built slope sticky clay lumps run as fast as sand. +const slide=m=>{flatWorld(run,256,224,208);run('for(let k=0;k<20;k++)placeBlock(BP_SLOPE_BL,RSTONE,10+k,10+k,true);'); + return run(`(()=>{setCell(39*W+42,${m},20,0);for(let t=0;t<2000;t++){simTick();for(let i=0;i=118)return t;}return -1;})()`);}; +const sandT=slide('SAND'),clayT=slide('LCLAY'); +check('clay lumps slide down a built slope as fast as sand',clayT>0 && clayT<=sandT+4,JSON.stringify([sandT,clayT])); done();