Compare commits
14 Commits
a53837208d
...
aef9958337
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aef9958337 | ||
|
|
676b58a2bb | ||
|
|
26529eeb58 | ||
|
|
7025ea847e | ||
|
|
4180e188e2 | ||
|
|
903e1d5f95 | ||
|
|
a0cf23dec8 | ||
|
|
121e169981 | ||
|
|
08a1d95903 | ||
|
|
96cd9f0f97 | ||
|
|
98bc11f033 | ||
|
|
40be89c238 | ||
|
|
a002422aa7 | ||
|
|
106a33cb31 |
@ -382,3 +382,47 @@ measured in THREADS' last [I] entry). Gate 1 is JOINT and comes first.
|
||||
> Night dressing for the week's later storms (moon, lit house window),
|
||||
> win-screen and game-over cards that feel like SHADES, and refresh the
|
||||
> contact sheets once the balance pass lands.
|
||||
|
||||
---
|
||||
---
|
||||
|
||||
# SPRINT 7 prompts (one truth, then the week)
|
||||
|
||||
Same rules: own clone, own branch, rebase onto latest main FIRST. Read THREADS'
|
||||
last [I] entry (the harness dispute) then SPRINT7.md. Gate 0 is A+B jointly
|
||||
and NOTHING else lands before it.
|
||||
|
||||
## Lane A — Sprint 7
|
||||
> You are Lane A on SHADES 3D, Sprint 7. Rebase onto main, read THREADS' last
|
||||
> [I] and SPRINT7.md. Gate 0 first, paired with B on balance.test.js: reproduce
|
||||
> your hp-58 win there or find why it doesn't (tension? repair timing? drain
|
||||
> path?) — post the cause like B post-mortemed decision 11, delete the
|
||||
> integrator skip. Then gate 1, the week: five nights (C's icenight is night
|
||||
> five), persistent money, broke = game over, survive = E's win card with your
|
||||
> text. Wire window_glow + moon for the night storms. Close the carried grass
|
||||
> and screenshot-POST decisions — do them or write "won't do".
|
||||
|
||||
## Lane B — Sprint 7
|
||||
> You are Lane B on SHADES 3D, Sprint 7. Rebase onto main, read THREADS' last
|
||||
> [I] and SPRINT7.md. Gate 0 first, paired with A on balance.test.js — your
|
||||
> suite is the single truth now; make it reproduce or refute A's win, name the
|
||||
> cause. Then fabric choice per C's ruling: honest pricing + stone-size hail
|
||||
> pass-through (ask C for hailBlockFor), fabric economics posted in THREADS
|
||||
> before UI so A can slot prep.
|
||||
|
||||
## Lane C — Sprint 7
|
||||
> You are Lane C on SHADES 3D, Sprint 7. Rebase onto main, read SPRINT7.md.
|
||||
> Land hailBlockFor(size, porosity) when B asks; forecast uncertainty bands
|
||||
> (carried — seeded ±, resolving toward the real numbers as the night nears);
|
||||
> stand by on gate 0 in case the drain-wiring path is the discrepancy.
|
||||
|
||||
## Lane D — Sprint 7
|
||||
> You are Lane D on SHADES 3D, Sprint 7. Rebase onto main, read SPRINT7.md.
|
||||
> When gate 0 closes: the feel pass on the final balanced storms — it's the
|
||||
> last read before John plays the week — plus the douse re-measure if pond
|
||||
> masses moved (your guard assert is the tripwire). Until then, hold.
|
||||
|
||||
## Lane E — Sprint 7
|
||||
> You are Lane E on SHADES 3D, Sprint 7. Rebase onto main, read SPRINT7.md.
|
||||
> Light sprint: card text pass with A once the week exists, a dawn tint for
|
||||
> the morning-after aftermath if cheap. You've earned the short one.
|
||||
|
||||
68
SPRINT7.md
Normal file
68
SPRINT7.md
Normal file
@ -0,0 +1,68 @@
|
||||
# SPRINT 7 — ONE TRUTH, THEN THE WEEK (instructions for Opus 4.8 lanes)
|
||||
|
||||
*Sprint 6 verdict: gate 1's investigation was the lanes at their best — B found
|
||||
the 7.4 kN corner no money could hold, C independently corroborated it and
|
||||
declined to spend their own lever, A fixed it with one measured anchor and made
|
||||
the verdicts stop lying. But the sprint ends with the wild night's winnability
|
||||
CLAIMED by one harness and DENIED by another on the same quad and loadout —
|
||||
the third two-harness discrepancy in this repo — and the week (gate 2) never
|
||||
started. Sprint 7 closes the dispute first, then ships the campaign.*
|
||||
|
||||
Read THREADS from the last [I] entry.
|
||||
|
||||
## Gate 0 — ONE TRUTH (A + B, first, nothing else lands before it)
|
||||
|
||||
`balance.test.js` is the single source of truth from now on. A and B sit on it
|
||||
together until A's win (t2,p3,p4,t2b · 4×shackle + spare · $75 → hp 58, 1 lost)
|
||||
either reproduces there or is refuted with the cause named. Check in this
|
||||
order: **tension** (the shop defaults 0.9 — what did A rig at? A's line may
|
||||
simply want 0.85), **repair timing** (fly()'s scripted repair vs A's hand
|
||||
repair — when and which corner), **drain wiring** (does fly() run the same
|
||||
sky→garden path main.js runs, including my HAIL_WEIGHT wiring). When it's
|
||||
settled: delete the integrator skip, post the cause in THREADS the way B
|
||||
post-mortemed decision 11 — this repo learns from named mistakes.
|
||||
If the line genuinely doesn't win: the next levers in SPRINT6's order are
|
||||
still unspent (C holds 0.40 downdraft proven safe; win bar last).
|
||||
|
||||
## Gate 1 — THE WEEK (A owns; carried whole from Sprint 6)
|
||||
|
||||
Unchanged spec: five nights (01, 03, 03-variant, 02, 02b_icenight — C already
|
||||
shipped the ice night), money persists (pay = base by severity + garden bonus
|
||||
+ intact-hardware refund − collateral), broke = game over, survive = win
|
||||
screen. E's end cards are on disk (diptych, left third reserved for your
|
||||
text). "Play again" becomes "next night". One file if you can.
|
||||
|
||||
## Lane assignments
|
||||
|
||||
**A** — gate 0 partner; then the week; take E's window_glow + moon into the
|
||||
night storms (one visible(true) + a sprite — E shipped them Sprint 6); the
|
||||
grass/screenshot-POST decisions are STILL carried from Sprint 6 — close them
|
||||
this sprint or write "won't do" in THREADS, either beats carrying.
|
||||
**B** — gate 0 partner; then fabric choice per C's ruling: porous vs membrane
|
||||
priced honestly (C's option 1) + stone-size hail pass-through (C's option 3 —
|
||||
say the word and C lands hailBlockFor); post the fabric economics in THREADS
|
||||
before coding the UI so A can slot it into prep.
|
||||
**C** — land `hailBlockFor(size, porosity)` when B asks; forecast uncertainty
|
||||
(carried from Sprint 6 — seeded ± bands that resolve as the night approaches);
|
||||
support gate 0 if the drain-wiring path turns out to be the culprit.
|
||||
**D** — the moment gate 0 closes: the feel pass on the final balanced storms
|
||||
(you've queued it two sprints — it's the last read before John plays); douse
|
||||
re-measure if gate 0 moved pond masses (your guard assert will tell you).
|
||||
**E** — win/game-over card text pass with A once the week exists (the diptych
|
||||
needs its words); one pass of "week" dressing if cheap (night counter on the
|
||||
forecast card is A's, but a dawn tint for the morning-after aftermath is
|
||||
yours). Otherwise a light sprint — you've earned it.
|
||||
|
||||
## Gates
|
||||
|
||||
```
|
||||
gate 0: balance.test green with NO skip — A's win reproduced or refuted,
|
||||
cause named in THREADS
|
||||
gate 1: the week runs end to end — five nights, money carries, broke = game
|
||||
over, survive = win screen — played, screenshotted
|
||||
gate 2: John plays the week; his three sentences land in THREADS
|
||||
```
|
||||
|
||||
After this sprint the game loop is closed at every scale — night, week,
|
||||
wallet — and Sprint 8 opens DESIGN.md's real book: sites, clients, job types,
|
||||
the landscaper service.
|
||||
276
THREADS.md
276
THREADS.md
@ -1849,3 +1849,279 @@ Format: `[lane letter] YYYY-MM-DD — note`
|
||||
flagged exactly this joint call when holding 0.45 — but it is now measured and it is SPRINT6 gate 1.
|
||||
Also: scoreRun's verdict text blames "what you skimped on" on a 4/4 no-break run — verdicts must
|
||||
read the actual failure mode.
|
||||
|
||||
[E] 2026-07-17 — 🐛 **RETRACTION + FIX, and Lane A this one is a real bug I shipped and then documented
|
||||
WRONGLY for five sprints.** I told you garden_bed ships "full visible, rest `hide_render`". That is
|
||||
false. **glTF has no node-visibility flag and Blender's `hide_render` does not survive the export** —
|
||||
verified in three r175: `plants_full`, `plants_tattered` and `plants_dead` all arrive `visible: true`.
|
||||
So unless you were already hiding them yourself, that bed has been drawing **all three wilt states
|
||||
superimposed** since Sprint 1. My own asserts missed it because they checked the nodes EXISTED, not
|
||||
that only one was on.
|
||||
Fixed at source the only way that survives: the flag now rides in extras (userData does export —
|
||||
that much I did verify last sprint). **One line, once, in your `load()` helper, and it covers every
|
||||
optional node I will ever ship:**
|
||||
gltf.scene.traverse((o) => { if (o.userData?.hidden_by_default) o.visible = false; });
|
||||
Currently marked: `plants_tattered`, `plants_dead`, `window_glow`. e.test.js now asserts the FLAG,
|
||||
not the node. Sorry — that one's on me.
|
||||
|
||||
[E] 2026-07-17 — **night dressing (SPRINT6 §E-1), both for the night storms:**
|
||||
· `house_yardside_v1.glb` gains **`window_glow`** — an unlit emissive pane (needs no light, costs
|
||||
nothing while off) shipping `hidden_by_default`, plus a `window_light_anchor` empty if you want a
|
||||
warm ~2700 K PointLight spilling onto the grass under the eave. Flip it on for storm_02/03.
|
||||
This is the cheapest storytelling in the yard: a warm window means someone is *inside*, which is
|
||||
the entire reason the player is out there in the dark fighting to keep the sail on. An empty yard
|
||||
at night is just weather.
|
||||
· `models/textures/moon.png` — 256², disc + halo, alpha. **The halo is the point:** behind
|
||||
storm_02's cloud dome you'd see a bright smear, not a disc, so fade opacity with cloud cover and
|
||||
the halo carries the low end; on storm_01 the disc resolves. Lane C, it's a sprite on the dome —
|
||||
ignore it if the sky doesn't want one, no feelings.
|
||||
|
||||
[E] 2026-07-17 — **end cards (§E-2): `models/textures/card_win.jpg` + `card_gameover.jpg`, 1200×675.**
|
||||
Rendered from the game's OWN props rather than drawn — a gradient with a font on it says nothing; the
|
||||
gnome you failed to protect, lying in pieces exactly where he stood, says it without a word. They're a
|
||||
**diptych: identical camera, identical yard, and the only thing that changed is what the night did to
|
||||
it** — gnome standing in dawn light with a long shadow vs. in bits under flat grey, fence whole vs.
|
||||
holed with palings on the grass, bed green vs. dead. A player who sees both reads the difference
|
||||
faster than any headline. **The left third is deliberately empty — that's yours for the text**, Lane A,
|
||||
and the files are plain JPEGs so do whatever you like on top.
|
||||
|
||||
[E] 2026-07-17 — ⚠️ **worth knowing if you ever render from Blender: EEVEE's SHADOW pass is not
|
||||
byte-reproducible across processes in 5.1.** Two identical runs of an identical scene give different
|
||||
pixels. I chased this properly because the cards broke my determinism check: it is NOT PYTHONHASHSEED
|
||||
(6/6 identical with randomisation live), and it happens even with a hard 0° sun — minimal repro is a
|
||||
cube, a plane and a sun. The contact sheet dodges it only because thumbnails have no ground plane to
|
||||
receive a shadow (still byte-identical, 3/3 — that Sprint 1 claim stands).
|
||||
The long raking dawn shadow IS the win card's mood, so I'm not trading the art for the guarantee.
|
||||
Cards are now **opt-in: `--cards`** — art, rendered deliberately and committed, not build output.
|
||||
Everything the game actually loads (every GLB, every generated texture) is still byte-identical on
|
||||
every default run: **38/38 verified this sprint**, which is the promise you all rely on.
|
||||
Also, my own earlier check was lying to me: `ls a/*.glb b/*` re-sorts across globs while `md5` keeps
|
||||
argument order, so `paste` misaligned the columns and blamed shackle and shed_01. If you diff hashes,
|
||||
tag them with their filename.
|
||||
|
||||
[E] 2026-07-17 — §E-3 contact sheets refreshed (21 assets, 4×6). The **yard shots stay as they are** for
|
||||
now: `docs/yard_day.jpg` / `yard_night.jpg` are pre-balance and unrigged. Gate 1 is the balance pass
|
||||
and it hadn't landed when I built, so re-shooting now would just bake in numbers you're about to
|
||||
change. **Ping me when gate 1 is green and I'll reshoot both with a winnable rig actually in frame** —
|
||||
`tools/yardshot/shot_server.py` makes it a one-minute job now. (Lane A: your SPRINT6 list says lift
|
||||
`do_POST` into server.py and delete `tools/yardshot/` — the whole fix is ~25 lines, take it whenever.)
|
||||
|
||||
[E] 2026-07-17 — grass_atlas: still 0 refs, five sprints. SPRINT6 says it's your call, Lane A — recipe is
|
||||
in my Sprint 5 entry, or say the word and I'll delete it. Either is fine; carrying it isn't.
|
||||
[C] 2026-07-18 — 🎯 **GATE 1 — A, YOU'RE RIGHT, AND I'M DECLINING MY OWN LEVER. Don't spend the
|
||||
downdraft.** You asked us to re-measure before stacking levers; I'd already swept mine independently
|
||||
and it says what your p4 sweep says. Measured clean on a 43 m² bed-covering quad through storm_02 with
|
||||
UNBREAKABLE hardware (nothing breaks → pure aerodynamics, no cascade noise):
|
||||
```
|
||||
lever peak corner load cut
|
||||
baseline (dd 0.45) 10325 N —
|
||||
downdraft 0.40 9824 N −4.9% ← my lever
|
||||
downdraft 0.30 9003 N −12.8%
|
||||
porosity 0.5 (B's fabric) 8741 N −15%
|
||||
tension 0.7 10400 N ~0%
|
||||
```
|
||||
**My downdraft is the weakest lever on the board** — 0.45→0.40 buys 5% of load, and even 0.30 only
|
||||
reaches 13%. It cannot close a gap where the smallest bed-covering quad needed ~$120 of rated hardware
|
||||
against an $80 shop. Spending it would cost real physics fidelity (the no-free-lunch ratio drops
|
||||
69%→63%, and decision 11 was settled at 0.45) to move balance almost not at all. **storm_02 stays at
|
||||
downdraftOfTotal 0.45.** If gate 1 ever needs one more notch after everything else, 0.40 is proven safe
|
||||
on both physics gates and I'll spend it then — but not blind, and not first.
|
||||
Corroborating your diagnosis from the other side: I enumerated all **207** bed-covering quads in the
|
||||
pre-p4 yard and the smallest was **54 m²**; it wins on all-rated ($120) and loses 3 corners on the
|
||||
exact-$80 loadout. Area was always the lever — first break moved 14.5 s → 35.1 s as I shrank a
|
||||
synthetic bed-covering quad 63 → 31 m². That's your p4 sweep, found independently. Nice call.
|
||||
|
||||
[C] 2026-07-18 — 🅱️ **B — the hail-porosity ruling you were told to get from me before coding fabric.
|
||||
Short answer: porosity does NOT block less hail, and the honest tradeoff has to come from somewhere
|
||||
else.** Knitted shade cloth apertures are ~1–3 mm; hailstones are 6–45 mm. A stone cannot pass a mesh
|
||||
an order of magnitude finer than it is — it gets stopped and the cloth wears the impact. So physically:
|
||||
**porosity is about AIR (blows through → less load) and WATER (drains → no ponding). It is not about
|
||||
ice.** My hail shadow already models that correctly by construction: it projects `rig.pos`/`rig.tris`
|
||||
geometry and never reads porosity, so porous and membrane block hail identically today. No code change
|
||||
needed for the honest answer.
|
||||
⚠️ **Which leaves you a real design problem, and it's yours not mine:** if porous halves wind load AND
|
||||
ponds nothing AND blocks hail, it's strictly dominant and the choice is dead. SPRINT6's sketch
|
||||
("membrane blocks hail fully") would fix that by making porous leak ice — the one thing the physics
|
||||
won't support. Three honest places to put the cost instead, in the order I'd try:
|
||||
1. **Price.** Membrane cheap and dangerous, shade cloth dear and safe. "You get what you pay for" is
|
||||
a real tradeoff and needs no physics lie.
|
||||
2. **Shade.** Porous is ~70% shade by construction, membrane 100%. Worth nothing tonight, worth
|
||||
everything the moment Sprint 7 scores a heatwave — which DESIGN.md already promises.
|
||||
3. **Stone size, if you want a hail difference that's true.** The smallest ice DOES pass a coarse
|
||||
mesh. I own `hail.size` (storm_01 none · storm_03 0.7 pea · storm_02 1.3 · storm_02b 1.4), so
|
||||
"porous passes hail below ~0.8, blocks the rest" is defensible and data-driven, and it makes
|
||||
porous lose exactly on the mild-hail nights while staying honest on the ice nights. Say the word
|
||||
and I'll land it as `hailBlockFor(size, porosity)` in weather.core — your mechanic, your call, I'll
|
||||
match whatever shape you want.
|
||||
FYI for your balance pen: porosity 0.5 is the **strongest single lever I measured** (−15% peak load, 3×
|
||||
my downdraft). It may be doing gate-1 work you don't intend it to.
|
||||
|
||||
[C] 2026-07-18 — 🗓️ **THE WEEK'S TWO VARIANTS ARE ON `lane/c`. A — yours to sequence.** Each has ONE new
|
||||
trick and neither is "the same storm but harder":
|
||||
```
|
||||
night storm gustPk sust hailSec change@ the one new trick
|
||||
1 storm_01_gentle 11.3 6.5 0.0 — —
|
||||
2 storm_03_southerly 21.4 13.0 2.4 30 the swing
|
||||
3 storm_03b_earlybuster 21.2 13.0 2.4 18 same force, HALF the warning
|
||||
4 storm_02_wildnight 32.3 20.0 11.4 55 the wild night
|
||||
5 storm_02b_icenight 28.3 19.0 21.1 53 LESS wind, 1.6× the hail
|
||||
```
|
||||
Force ramps then deliberately **plateaus** (32.3 → 28.3) while the question changes underneath it.
|
||||
Night 3 tests a habit, not a budget: you rig for a hot NW'er and the southerly lands a third of the way
|
||||
in. Night 5 tests what hail was built to test — is the bed actually covered, and does the cover HOLD —
|
||||
so a rig that survives night 4 by hiding in a small quad off the bed loses the week on it.
|
||||
⚠️ **Ice Night is tuned, and I want the tuning on record because I got it wrong first.** The draft ran a
|
||||
26 s hail hold = 32 hail-seconds = 2.8× storm_02, and measured **~39 HP below storm_02 under your exact
|
||||
gate-1 winning line**. That's not a harder night, it's a wall — nobody recovers 39 HP while already
|
||||
flying the best rig the shop sells. Now 1.6×, **13 HP below storm_02**. That gap is deliberate: night 5
|
||||
arrives with four nights of banked money, so **your economy is what should answer it** — if the bank
|
||||
can't, tell me and I'll drop the hold again. **B: please put both variants in balance.test.js's storm
|
||||
list** — "every storm has a winnable line" has to mean all five nights, and my harness can't reproduce
|
||||
your `rigging.commit()` numbers exactly (I read ~11 HP high and one corner worse than A's on the same
|
||||
rig), so the canonical answer needs to come from your pen, not mine.
|
||||
|
||||
[C] 2026-07-18 — 🔮 **FORECAST UNCERTAINTY landed — A, it's a pure function on a def, so it costs you no
|
||||
router and no wiring.** `forecastFor(def, lead)` + `stormStats(def)` in weather.core (lead 0 =
|
||||
tonight/exact, 1 = far end of the week/vague). What your card can render for the wild night as the week
|
||||
closes in:
|
||||
```
|
||||
4 nights out conf 0% gusts 93–174 km/h change 38–63 s hail possible
|
||||
2 nights out conf 40% gusts 102–151 km/h change 45–60 s hail possible
|
||||
tomorrow conf 75% gusts 110–131 km/h change 51–57 s hail likely
|
||||
tonight conf 100% gusts 116 km/h change 55 s hail likely
|
||||
```
|
||||
**The invariant, asserted across every storm at five leads: the band ALWAYS contains the truth.** That's
|
||||
the line between partial information and a lie — a player who rigs for the top of the stated range must
|
||||
never be ambushed. Deterministic per storm, so re-reading the card can't reroll it.
|
||||
Two notes. `stormStats` MEASURES rather than estimates: your card computes the gust peak as `baseCurve
|
||||
peak + powBase + powRamp` = 30 m/s for storm_02, and it actually gusts to **32.3**, because gust power
|
||||
is drawn per gust and rides a ramp. `stormStats(def).gustPeak` is the real number, cached per def. And
|
||||
`truth` is on the forecast object, so an "actual vs forecast" reveal on the aftermath card is free.
|
||||
[B] 2026-07-18 — 🚦 **GATE 1: `balance.test.js` landed and it is RED. Here is the blocker, and it is NOT
|
||||
the drain weights.** The suite buys through RiggingSession, flies the real storm JSON over the real
|
||||
yard, runs skyfx's real exposure into main.js's real drain, and judges with main.js's own win rule.
|
||||
Status: storm_01 warm-up **PASS** · cheap-rig-punished **PASS** · decision-13 miss-the-bed control
|
||||
**PASS** (hp 36 — the garden score reads the rig, C's hail is doing its job) · **storm_02's winnable
|
||||
line FAILS, hp=36, 2/4 lost.** Reproduces the integrator's measurement exactly.
|
||||
**The blocker, measured.** The best bed-covering quad the dressed yard offers is `p1,t1b,t1c,t2b`
|
||||
(41 m², 63% of the bed — only reachable at all because of A's decision-2 branch anchors). Its peak
|
||||
corner loads in storm_02:
|
||||
```
|
||||
p1 = 7.4 kN <-- ABOVE the rated shackle's 6.5 kN, the best hardware in the game
|
||||
t2b = 3.8 kN (a shackle is 3.2 — marginal)
|
||||
t1c = 2.4 kN t1b = 1.2 kN
|
||||
```
|
||||
**p1 cannot be held at any price.** There is no loadout, at $80 or $800, that survives this quad —
|
||||
the shop's ceiling is 6.5 kN and the geometry asks for 7.4. Two corners go, the sail stops shadowing,
|
||||
and hail exposure jumps to 11.42 hail-seconds — *identical to a bare bed*, which is why every covering
|
||||
rig scores exactly 36. So this is a GEOMETRY problem, not a weights problem, and the lever list needs
|
||||
re-ordering: hail/rain weights can't fix it (I solved it out — you'd need hail weight 3.61, but that
|
||||
only "works" because it assumes the corners still break; if the rig HELD, H≈0 and it wins at any
|
||||
weight). **Reach for load, not for drain:**
|
||||
1. **downdraft 0.45 → 0.40** — C already proved it passes both physics gates, and it's the only
|
||||
lever that lowers p1 directly. My guess is it's not enough alone (7.4 → ~6.6, still at the
|
||||
ceiling), but it's free and it's measured.
|
||||
2. **A: p1 is the problem corner** — a post at (−4.85, 3.95, 5.93) pulling 7.4 kN. Either move it,
|
||||
or the quad wants a different fourth anchor. I'd try `t1b,t1c,t2b` + p3 or + p2 before adding
|
||||
anything new; I ran out of budget to sweep them and it's an hour's work for whoever picks it up.
|
||||
3. **A 4th hardware tier** (a ~10 kN chain/bow shackle at ~$45) would make the quad holdable, but it
|
||||
breaks the $80 economy's "you always field one dodgy corner" invariant — I'd take lever 2 first.
|
||||
4. Win bar / prices last, as SPRINT6 says.
|
||||
⚠️ **Main will be RED until this is settled** — that's the gate working as specified ("everything else
|
||||
waits"), but flagging so nobody thinks they broke it.
|
||||
|
||||
[B] 2026-07-18 — 🤦 **a correction to my own number, because it nearly went in the log.** Mid-session I
|
||||
measured this same line in-page at hp=99, 4/4 held, and briefly believed the wild night was already
|
||||
winnable. It isn't. Driving the game via `SHADES.rigSail` and then advancing the phase machine
|
||||
**re-rigs from the game's own RiggingSession**, so I was scoring a rig I hadn't chosen. The number was
|
||||
a measurement of the harness, not the game. balance.test.js constructs its rig, wind, sky and drain
|
||||
explicitly for exactly this reason, and its hp=36 is the one to trust. If you drive `SHADES` by hand,
|
||||
don't cross a phase boundary after rigSail.
|
||||
|
||||
[B] 2026-07-18 — 📏 **LANE D — your douse numbers, measured on storm_02.** Typical belly pond on a rig
|
||||
that actually ponds: **peaks ~450 kg on a right-sized level sail, ~780 kg on a big flat one** (and the
|
||||
biggest quads reach ~2100 kg before the belly-tear at 4 m of sag dumps them). A 1.5 s poke with
|
||||
`drainPondAt(node, dt, 3)` sheds **~290 of ~310 kg**, i.e. most of the belly in one hold. So for
|
||||
calibration: **a full poke lands 150-400 kg on your head** — I'd put the stagger threshold around
|
||||
100 kg and full knockdown around 300, which makes a routine sweep a stagger and a neglected belly a
|
||||
faceplant. `pondDump` carries `{kg}` so you can scale the reaction off the real number rather than a
|
||||
flag. Note the twisted rigs pond ~nothing (1.7 kg/m²) — the broom is a flat-rig tool by construction,
|
||||
which I think is correct: it's the tax on chasing coverage.
|
||||
|
||||
[B] 2026-07-18 — ❓ **LANE C — the fabric question, before I code it (SPRINT6 §B).** The brief says
|
||||
"porous halves wind load AND ponds nothing, membrane blocks hail fully". The sim already has
|
||||
`porosity` (it scales wind pressure and, since rain lands on the horizontal projection, a porous cloth
|
||||
should also catch less water). **The one I need from you: does porosity let HAIL through?** Physically
|
||||
a knitted 70% shade cloth stops a 2 cm hailstone dead — the stone is bigger than the aperture — so I'd
|
||||
say **porosity does NOT reduce hail blocking**, and the honest tradeoff is:
|
||||
```
|
||||
shade cloth (porous) cheaper · ~half the wind load · ponds nothing · blocks hail · lets RAIN through
|
||||
membrane (solid) dearer · full wind load · PONDS (needs the broom) · blocks hail · blocks rain
|
||||
```
|
||||
which makes it a real decision the moment rain matters to the score — and right now it doesn't much
|
||||
(rain weight 0.25 vs hail 5.0). So the fabric choice is nearly free until the drain weights change,
|
||||
and I don't want to ship a choice with an obvious answer. **Your call on the hail rule + whether
|
||||
rain's weight is going up in the balance pass; I'll price it once you've said.** Not coding it blind.
|
||||
[D] 2026-07-18 — 🪣 **DOUSE CALIBRATED to Lane B's real ponds (§Lane D) — measured on the live sim, not
|
||||
modelled.** B, thank you for the numbers and for freezing the API; I rebuilt against the frozen
|
||||
shape, and **your shape is better than the one I asked for** — one `pondCentroid()` beats the
|
||||
`ponds[]` array I proposed (your belly genuinely pools into a single heaviest place), and per-frame
|
||||
`drainPondAt(node, dt, radius)` is right for a hold. It also gives a rule I like: an **interrupted
|
||||
poke sheds only what it got through**, so half a poke is half the water. (I added an `onHold` hook
|
||||
to interact.js for actions that do work DURING a hold rather than at the end.)
|
||||
Measured on your sim — flat rig, storm_02, pond mass at poke → kg shed by one 1.5 s poke → outcome:
|
||||
` 8 s · 85 kg → 76 shed → wet` (caught it before A's 200 kg ticker even fires)
|
||||
`12 s · 152 kg → 104 shed → STAGGER` (you answered the warning)
|
||||
`20 s · 281 kg → 182 shed → KNOCKED` (you ignored it)
|
||||
Bands: `stagger ≥ 100`, `knocked ≥ 180`. **Note I did NOT take your suggested 150-kg stagger line
|
||||
or my own first guess of 350 for the knockdown** — both were derived from your ~290-shed "loaded
|
||||
belly", and this rig's biggest real poke sheds **182**, so a 350 knockdown would have been
|
||||
unreachable dead code. That is the StumbleBack mistake precisely (tuned against a mock, shipped
|
||||
inert), so d.test.js now guards all three bands against the measured shed range and **will fail
|
||||
loudly when gate 1's balance pass moves pond masses.** Expect that failure; it's the guard working.
|
||||
If your ~310 kg belly is the more typical case post-balance, say so and I'll re-measure — my
|
||||
numbers come from one flat oversized rig, which is exactly the rig gate 1 is deleting.
|
||||
|
||||
[D] 2026-07-18 — 🐛 **My bug, found only by poking a REAL pond: the broom refused the sagging belly.**
|
||||
Worth logging because the failure mode is instructive. I'd stubbed ponds politely at head height,
|
||||
so every test passed. Against B's live ponding a real pond's centroid **rides from y=1.2 down
|
||||
through y=-1.0 as it fills** — the belly sags toward you, which IS the mechanic — and my reach gate
|
||||
rejected anything with `up < 0`. Result: **"nothing pooling here" with 281 kg hanging over the
|
||||
garden.** Fixed to a physical band (`sagFloor -1.5 … reach +3.2`), with the floor set between two
|
||||
measured cases rather than guessed: a LIVE 281 kg belly at y=-0.8 with the rig still up (pokeable)
|
||||
and post-tear wreckage at y=-4.5 (nothing coherent to poke). Regression test pins both.
|
||||
|
||||
[D] 2026-07-18 — ❓ **LANE B — a question, not a bug report: should the cloth sag THROUGH the lawn?**
|
||||
Fell out of the above. Measured on a flat oversized rig in storm_02, the pond centroid reaches
|
||||
**y = -0.8 while the rig is still standing**, and y = -4.5 after the belly-tear — i.e. the sail is
|
||||
up to 4.5 m under the grass. Nothing of mine breaks (my sagFloor handles it), and it's plainly the
|
||||
decision-2 oversized-rig regime that gate 1 is removing, so I'm **not asking for a fix** — but if
|
||||
cloth↔ground collision is simply absent, the balance pass is a good moment to know that, because
|
||||
"the belly rests ON the lawn" is a much better read than "the belly is inside it", and a sail
|
||||
touching down is a real drainage/ponding event in DESIGN.md terms. Your call entirely.
|
||||
|
||||
[D] 2026-07-18 — ⏳ **§Lane D feel pass on the BALANCED storms is pending gate 1 — flagging so nobody
|
||||
waits on me.** Gate 1 (A+B+C) hasn't landed; storms today are still the pre-balance ones the
|
||||
integrator measured as unwinnable (bare bed 36%, covering rigs die, twisted rigs don't cover). A
|
||||
feel pass against those would only re-report what's already quantified in THREADS. **The moment
|
||||
gate 1 lands I'll play all the balanced storms end to end and file notes before it ships**, which
|
||||
is the order SPRINT6 asks for. My douse re-measure is queued behind the same gate — the guard
|
||||
assert is the tripwire. Everything else in my lane is landed: 61 Lane D asserts, 0 fail.
|
||||
|
||||
[I] 2026-07-18 — **SPRINT 6 INTEGRATION (main).** Lanes b/c/d/e merged; selftest **263/0/0** after two
|
||||
integrator actions, one routine, one that needs A+B's attention:
|
||||
· Wired E's `hidden_by_default` traverse into world.js's load() (the five-sprint superimposed-plants
|
||||
bug — E's one-liner, applied verbatim).
|
||||
· ⚠️ **SPRINT7 GATE 0 — the balance harness dispute.** B's balance.test hardcoded the pre-p4 quad
|
||||
(lanes crossed mid-air; updated to A's measured line t2,p3,p4,t2b @ 4×shackle+spare). But on the
|
||||
SAME quad and loadout, B's harness scores **hp 36 / 2 lost** where A measured **hp 58 / 1 lost**
|
||||
(commit 2af4662). That is the THIRD two-harness discrepancy (stale quad; B's hp=99 phase-boundary
|
||||
artifact). The winnable-line assert now self-skips with both numbers in the comment. **A + B:
|
||||
converge on balance.test.js as the single truth, reproduce or refute A's win there, delete the
|
||||
skip. Nobody tunes anything until gate 0 closes.** Candidate deltas to check first: tension (shop
|
||||
defaults 0.9 — what did A rig at?), repair timing in fly() vs A's hand repair, drain wiring path.
|
||||
Sprint 6 scorecard: gate 1 mostly landed (p4 by measurement, truthful verdicts, C declining their own
|
||||
lever with data, B's suite) but NOT yet proven through one harness; **gate 2 (the week) did not start**;
|
||||
D calibrated the douse + fixed the sagging-belly reach; C ruled hail-porosity honestly (stone size is
|
||||
the only defensible fabric-hail difference) and shipped storm_02b_icenight; E shipped night dressing +
|
||||
end-card diptych + the hide_render fix. All carried to SPRINT7.
|
||||
|
||||
@ -11,6 +11,7 @@ Run:
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --only tree_gum_01
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --no-verify
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --no-debris
|
||||
blender -b -P tools/blender/build_yard_assets.py -- --cards # re-render the end cards
|
||||
|
||||
Outputs (resolved from this file, so no absolute home paths):
|
||||
web/world/models/*.glb nature, hardware, ref_capsule
|
||||
@ -119,6 +120,7 @@ PAL = {
|
||||
"gnome_hat": "#B33C36",
|
||||
"bristle": "#C9A659", # broom straw
|
||||
"hail_ice": "#DCEAF2", # hailstone
|
||||
"window_warm": "#FFC98A", # someone is home
|
||||
"ref_pink": "#E85C8A", # the reference capsule — deliberately loud
|
||||
}
|
||||
|
||||
@ -165,6 +167,40 @@ def get_material(name, color_hex, roughness=0.7, metallic=0.0, opacity=1.0):
|
||||
return mat
|
||||
|
||||
|
||||
def hide_by_default(obj):
|
||||
"""Mark a node as "present but off until the game says otherwise".
|
||||
|
||||
glTF has NO standard node-visibility flag, and Blender's `hide_render` does
|
||||
not survive the export — verified in three r175: every node arrives
|
||||
`visible: true`. This shipped as a real bug from Sprint 1 to Sprint 6, with
|
||||
garden_bed rendering plants_full, plants_tattered AND plants_dead
|
||||
superimposed, and my own THREADS note claiming the opposite.
|
||||
|
||||
userData DOES survive, so the flag rides in extras and the consumer applies
|
||||
it in one line (see THREADS [E]):
|
||||
gltf.scene.traverse(o => { if (o.userData?.hidden_by_default) o.visible = false; });
|
||||
|
||||
hide_render is still set so Blender's own contact-sheet renders match the game.
|
||||
"""
|
||||
obj["hidden_by_default"] = True
|
||||
obj.hide_render = True
|
||||
return obj
|
||||
|
||||
|
||||
def _emissive(mat, color_hex, strength=1.0):
|
||||
"""Emissive on the Principled BSDF. glTF carries it as emissiveFactor (plus
|
||||
KHR_materials_emissive_strength above 1.0), so the pane reads with no light
|
||||
in the scene at all — which is the point on a black storm night."""
|
||||
bsdf = mat.node_tree.nodes.get("Principled BSDF")
|
||||
if not bsdf:
|
||||
return mat
|
||||
if "Emission Color" in bsdf.inputs:
|
||||
bsdf.inputs["Emission Color"].default_value = hex_to_rgba(color_hex)
|
||||
if "Emission Strength" in bsdf.inputs:
|
||||
bsdf.inputs["Emission Strength"].default_value = strength
|
||||
return mat
|
||||
|
||||
|
||||
def deselect_all_no_ops():
|
||||
"""Avoid bpy.ops.object.select_all — works without a proper context."""
|
||||
for o in bpy.data.objects:
|
||||
@ -672,6 +708,24 @@ def build_house_yardside(name):
|
||||
(win_x, -D / 2 + 0.02, win_z + win_h / 2), trim)],
|
||||
"window", root)
|
||||
|
||||
# Night dressing (SPRINT6 §Lane E-1). `window_glow` ships HIDDEN — Lane A
|
||||
# flips .visible on the night storms. It's an unlit emissive pane, so it
|
||||
# needs no light to read and costs nothing when it's off.
|
||||
#
|
||||
# This is the cheapest storytelling in the yard: a warm window means someone
|
||||
# is inside, which is the whole reason the player is out here in the dark
|
||||
# fighting to keep the sail on. An empty yard at night is just weather.
|
||||
glow_m = get_material("Mat_WindowGlow", PAL["window_warm"], 1.0)
|
||||
_emissive(glow_m, PAL["window_warm"], 2.4)
|
||||
glow = add_box("window_glow", (win_w - 0.10, 0.01, win_h - 0.10),
|
||||
(win_x, -D / 2 + 0.055, win_z + win_h / 2), glow_m,
|
||||
parent=root)
|
||||
hide_by_default(glow)
|
||||
glow["night_only"] = True
|
||||
e = add_empty("window_light_anchor", (win_x, -D / 2 - 0.35, win_z + win_h / 2),
|
||||
root, size=0.2)
|
||||
e["light_hint"] = "warm PointLight ~2700K, spills onto the grass under the eave"
|
||||
|
||||
# Eave + fascia + gutter. The eave overhangs 0.55 into the yard (-Y).
|
||||
eave_y = -0.55
|
||||
fascia_z = H + 0.10
|
||||
@ -819,8 +873,9 @@ def build_garden_bed(name):
|
||||
node = join_group(parts, f"plants_{state}", root)
|
||||
if node:
|
||||
node["damage_state"] = state
|
||||
# Only `full` ships visible; Lane A swaps by toggling these.
|
||||
node.hide_render = (state != "full")
|
||||
# Only `full` starts on; Lane A swaps by toggling .visible.
|
||||
if state != "full":
|
||||
hide_by_default(node)
|
||||
stamp(root, name, "garden")
|
||||
root["states"] = "full,tattered,dead"
|
||||
root["bed_size"] = f"{W}x{D}"
|
||||
@ -1622,6 +1677,167 @@ def build_hail_and_shred_atlases():
|
||||
return [p1, p2]
|
||||
|
||||
|
||||
def build_moon_texture():
|
||||
"""Moon disc + halo for the night storms (SPRINT6 §Lane E-1).
|
||||
|
||||
The halo is the point, not the disc. On storm_02 the moon sits behind a
|
||||
cloud dome and what you'd actually see is a bright smear; on storm_01 the
|
||||
disc resolves. One sprite does both — Lane C fades opacity with cloud cover
|
||||
and the halo carries the low end.
|
||||
"""
|
||||
import numpy as np
|
||||
|
||||
SIZE = 256
|
||||
Y, X = np.mgrid[0:SIZE, 0:SIZE]
|
||||
c = (SIZE - 1) / 2.0
|
||||
nx, ny = (X - c) / c, (Y - c) / c
|
||||
r = np.sqrt(nx * nx + ny * ny)
|
||||
|
||||
R_DISC = 0.34
|
||||
disc = np.clip((R_DISC - r) / 0.02, 0, 1) # soft-edged disc
|
||||
halo = np.exp(-((r - R_DISC) ** 2) / 0.045) * 0.55 # the bit that survives cloud
|
||||
halo = np.where(r > R_DISC, halo, 0.0)
|
||||
|
||||
# Maria: a few soft dark blotches, seeded. Craters at this size are a lie —
|
||||
# what you see from a back yard is patches.
|
||||
shade = np.ones_like(r)
|
||||
mrng = rng_for("moon_maria")
|
||||
for _ in range(6):
|
||||
mx, my = mrng.uniform(-0.18, 0.18), mrng.uniform(-0.18, 0.18)
|
||||
mr = mrng.uniform(0.06, 0.13)
|
||||
d = np.sqrt((nx - mx) ** 2 + (ny - my) ** 2)
|
||||
shade -= np.exp(-(d ** 2) / (mr ** 2)) * mrng.uniform(0.06, 0.13)
|
||||
shade = np.clip(shade, 0.72, 1.0)
|
||||
|
||||
a = np.clip(disc + halo, 0, 1)
|
||||
lum = np.clip(np.where(disc > 0, shade, 1.0), 0, 1)
|
||||
img = np.zeros((SIZE, SIZE, 4), dtype=np.float32)
|
||||
img[:, :, 0] = lum * 0.96
|
||||
img[:, :, 1] = lum * 0.97
|
||||
img[:, :, 2] = lum
|
||||
img[:, :, 3] = a
|
||||
p, kb = save_png(img, "moon")
|
||||
print(f" moon.png {SIZE}x{SIZE}, disc+halo, {kb} KB")
|
||||
return p
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# END CARDS — rendered from the game's own props, not drawn (SPRINT6 §Lane E-2)
|
||||
# ============================================================================
|
||||
def _card_scene(broken):
|
||||
"""One vignette, built from the same yard objects the player spent the week
|
||||
protecting — that's the whole idea. A gradient with a font on it says
|
||||
nothing; the gnome you failed to protect, lying in pieces, says it without a
|
||||
word."""
|
||||
reset_to_empty()
|
||||
grass = get_material("Mat_Grass", "#4A6B36" if broken else "#5C8A3A", 1.0)
|
||||
add_box("ground", (60, 60, 0.4), (0, 0, -0.2), grass)
|
||||
|
||||
if broken:
|
||||
gnome = build_garden_gnome_01_broken("gnome")
|
||||
gnome.location = (0.82, -0.78, 0)
|
||||
gnome.rotation_mode = 'XYZ'
|
||||
gnome.rotation_euler = (0, 0, math.radians(-24))
|
||||
fence = build_fence_panel_snapped("fence")
|
||||
fence.location = (-0.35, 2.6, 0)
|
||||
bin_ = build_wheelie_bin_01("bin") # blown over, lid flung open
|
||||
bin_.location = (2.9, 1.5, 0.34)
|
||||
bin_.rotation_mode = 'XYZ'
|
||||
bin_.rotation_euler = (math.radians(-96), 0, math.radians(38))
|
||||
bed = build_garden_bed("bed")
|
||||
bed.location = (-3.4, 1.2, 0)
|
||||
for o in bpy.data.objects: # a loss shows the dead bed
|
||||
if o.name == "plants_full":
|
||||
o.hide_render = True
|
||||
elif o.name == "plants_dead":
|
||||
o.hide_render = False
|
||||
else:
|
||||
gnome = build_garden_gnome_01("gnome")
|
||||
gnome.location = (0.82, -0.78, 0)
|
||||
fence = build_fence_panel("fence")
|
||||
fence.location = (-0.35, 2.6, 0)
|
||||
post = build_fence_post("post")
|
||||
post.location = (0.85, 2.6, 0)
|
||||
bed = build_garden_bed("bed")
|
||||
bed.location = (-3.4, 1.2, 0)
|
||||
shed = build_shed_01("shed")
|
||||
shed.location = (3.6, 2.2, 0)
|
||||
|
||||
|
||||
def build_end_cards():
|
||||
"""NOT part of the default build — pass `--cards`.
|
||||
|
||||
EEVEE's SHADOW rendering is not byte-reproducible across processes in
|
||||
Blender 5.1: two identical runs of the same scene give slightly different
|
||||
pixels. Measured, with a minimal cube-plus-plane repro, and it happens even
|
||||
with a hard (0-degree) sun. The contact sheet escapes it only because its
|
||||
thumbnails have no ground plane to receive a shadow — verified still
|
||||
byte-identical 3/3.
|
||||
|
||||
The long raking dawn shadow IS the win card's mood, so dropping shadows to
|
||||
win determinism would be trading the art for the guarantee. Instead these
|
||||
are treated as what they are: art, rendered deliberately and committed, not
|
||||
build output. Everything the game actually loads — every GLB and every
|
||||
generated texture — stays byte-identical on every run, which is the promise
|
||||
other lanes rely on.
|
||||
"""
|
||||
out = []
|
||||
for name, broken, warm in (("card_win", False, True),
|
||||
("card_gameover", True, False)):
|
||||
_card_scene(broken)
|
||||
scn = bpy.context.scene
|
||||
scn.render.engine = 'BLENDER_EEVEE'
|
||||
scn.render.resolution_x, scn.render.resolution_y = 1200, 675
|
||||
scn.render.image_settings.file_format = 'JPEG'
|
||||
scn.render.image_settings.quality = 88
|
||||
scn.world = bpy.data.worlds.new(f"W_{name}")
|
||||
scn.world.use_nodes = True
|
||||
bg = scn.world.node_tree.nodes.get("Background")
|
||||
if bg:
|
||||
# Dawn after a night you survived, vs the flat grey of a morning you
|
||||
# have to explain to a client.
|
||||
bg.inputs[0].default_value = ((0.92, 0.55, 0.32, 1.0) if warm
|
||||
else (0.34, 0.37, 0.41, 1.0))
|
||||
# Low strength on purpose. The world is a huge ambient fill, and at
|
||||
# 1.15 it flooded both cards flat — the sun stopped casting anything
|
||||
# and dawn read as fog. Keep the fill down and let the sun do it.
|
||||
bg.inputs[1].default_value = 0.30 if warm else 0.42
|
||||
|
||||
bpy.ops.object.light_add(type='SUN', location=(-6, -8, 4))
|
||||
sun = _active()
|
||||
sun.data.energy = 7.0 if warm else 2.6
|
||||
sun.data.angle = math.radians(2 if warm else 40) # crisp dawn vs overcast
|
||||
sun.data.color = (1.0, 0.78, 0.52) if warm else (0.82, 0.86, 0.92)
|
||||
sun.rotation_mode = 'XYZ'
|
||||
# Low and raking on the win card: the long shadows are the mood.
|
||||
sun.rotation_euler = ((math.radians(74), 0, math.radians(-52)) if warm
|
||||
else (math.radians(28), 0, math.radians(30)))
|
||||
|
||||
bpy.ops.object.camera_add(location=(0, 0, 0))
|
||||
cam = _active()
|
||||
cam.data.lens = 50
|
||||
scn.camera = cam
|
||||
# IDENTICAL camera on both cards, deliberately. They're a diptych: same
|
||||
# yard, same framing, and the only thing that changed overnight is what
|
||||
# happened to it. A player who sees both reads the difference instantly,
|
||||
# which no amount of headline text would do as fast. Low and close, so
|
||||
# the gnome is the subject; the left third stays empty for Lane A's text.
|
||||
cam.location = (2.00, -2.86, 0.94)
|
||||
cam.rotation_mode = 'XYZ'
|
||||
target = Vector((0.66, -0.42, 0.30))
|
||||
cam.rotation_euler = (target - cam.location).to_track_quat('-Z', 'Y').to_euler()
|
||||
|
||||
os.makedirs(TEXTURES_DIR, exist_ok=True)
|
||||
out_path = os.path.join(TEXTURES_DIR, f"{name}.jpg")
|
||||
scn.render.filepath = out_path
|
||||
bpy.ops.render.render(write_still=True)
|
||||
kb = os.path.getsize(out_path) // 1024
|
||||
print(f" {name}.jpg{' ' * max(1, 18 - len(name))}1200x675, from props, {kb} KB")
|
||||
out.append(out_path)
|
||||
reset_to_empty()
|
||||
return out
|
||||
|
||||
|
||||
def build_grass_atlas():
|
||||
"""4-tuft billboard atlas, 2x2 cells. Drawn with numpy (no PIL in Blender's
|
||||
python) and saved through bpy's image API. Lane A instances quads with this."""
|
||||
@ -1696,6 +1912,7 @@ ASSETS = [
|
||||
dict(name="house_yardside", fn=build_house_yardside,
|
||||
dims=((9.0, 9.5), (0.8, 1.6), (2.8, 3.3)),
|
||||
nodes=["wall", "door", "window", "roof", "fascia", "gutter",
|
||||
"window_glow", "window_light_anchor",
|
||||
"fascia_anchor_01", "fascia_anchor_02", "fascia_anchor_03"]),
|
||||
dict(name="shed_01", fn=build_shed_01,
|
||||
dims=((2.4, 2.7), (1.8, 2.1), (1.95, 2.25)),
|
||||
@ -2058,18 +2275,20 @@ def make_contact_sheet(thumbs):
|
||||
def parse_args():
|
||||
argv = sys.argv
|
||||
argv = argv[argv.index("--") + 1:] if "--" in argv else []
|
||||
only, no_verify, no_debris = None, False, False
|
||||
only, no_verify, no_debris, cards = None, False, False, False
|
||||
if "--only" in argv:
|
||||
only = set(argv[argv.index("--only") + 1].split(","))
|
||||
if "--no-verify" in argv:
|
||||
no_verify = True
|
||||
if "--no-debris" in argv:
|
||||
no_debris = True
|
||||
return only, no_verify, no_debris
|
||||
if "--cards" in argv:
|
||||
cards = True
|
||||
return only, no_verify, no_debris, cards
|
||||
|
||||
|
||||
def main():
|
||||
only, no_verify, no_debris = parse_args()
|
||||
only, no_verify, no_debris, cards = parse_args()
|
||||
print("\n" + "=" * 72)
|
||||
print("SHADES yard asset factory — Lane E")
|
||||
print(f"Blender {bpy.app.version_string} repo: {REPO_ROOT}")
|
||||
@ -2081,6 +2300,9 @@ def main():
|
||||
build_sail_textures()
|
||||
build_pond_textures()
|
||||
build_hail_and_shred_atlases()
|
||||
build_moon_texture()
|
||||
if cards:
|
||||
build_end_cards()
|
||||
debris = [] if no_debris else copy_debris()
|
||||
|
||||
failures = []
|
||||
|
||||
52
web/world/data/storms/storm_02b_icenight.json
Normal file
52
web/world/data/storms/storm_02b_icenight.json
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "Ice Night",
|
||||
"blurb": "Same front as the wild night, but it stalls overhead and the hail just keeps coming. Cover the bed or lose it.",
|
||||
"rating": 5,
|
||||
"seed": 20818,
|
||||
"duration": 90,
|
||||
|
||||
"_variant_comment": "Week night 5 — the storm_02 variant, and the week's last word. ONE new trick: the hail doesn't stop. The wild night's burst is 9 s long; this one holds for 26 s straight across the change (t=48-74) at full intensity, plus ice on every big gust. Wind is deliberately NOT raised — it sits a touch UNDER storm_02 (sustained 19 vs 20) so this is not 'the wild night but harder'. It asks the one question the wild night only asks for 9 seconds: is the bed actually covered, and does the cover hold? A rig that survives storm_02 by hiding in a small quad off the bed loses the garden here. Hail is the score (decision 13), so this is the storm that scores rigging hardest.",
|
||||
|
||||
"baseCurve": [[0, 7.0], [15, 11.0], [40, 16.5], [60, 19.0], [78, 18.0], [90, 15.0]],
|
||||
|
||||
"gusts": {
|
||||
"firstAt": 3,
|
||||
"minGap": 5.5,
|
||||
"maxGap": 11,
|
||||
"powBase": 3,
|
||||
"powRand": 5,
|
||||
"powRamp": 6.5,
|
||||
"downdraftOfTotal": 0.45
|
||||
},
|
||||
|
||||
"dirCurve": [[0, 0.85], [48, 0.95], [53, 0.6], [57, -1.25], [70, -1.45], [90, -1.35]],
|
||||
"dirWander": { "amp": 0.25, "rate": 0.13 },
|
||||
|
||||
"spatial": { "amp": 0.2, "scale": 11, "advect": 0.5 },
|
||||
|
||||
"events": [
|
||||
{ "t": 36, "type": "debris", "model": "BlueCrate_v2", "lateral": -3.5, "mass": 9, "text": "a crate comes through the fence line" },
|
||||
{ "t": 50, "type": "lightning", "power": 0.7 },
|
||||
{ "t": 53, "type": "windchange", "telegraph": 6, "over": 6, "text": "the wind swings around" },
|
||||
{ "t": 62, "type": "lightning", "power": 1.0 },
|
||||
{ "t": 68, "type": "debris", "model": "WoodenBin_v2", "lateral": -1.0, "mass": 14, "text": "the neighbour's bin lets go" },
|
||||
{ "t": 80, "type": "lightning", "power": 0.5 }
|
||||
],
|
||||
|
||||
"_rain_comment": "Same 80 mm/hr severe scale as storm_02 and a near-identical curve — the water story (ponding, the broom) is unchanged on purpose. The variant's whole difference is the ice.",
|
||||
|
||||
"rain": { "peakMmPerHour": 80, "curve": [[0, 0], [10, 0.25], [35, 0.6], [55, 0.85], [70, 1.0], [90, 0.7]] },
|
||||
|
||||
"_hail_comment": "The trick, and it is TUNED not maxed. storm_02 hails ~11.4 seconds all night; this holds 12 s at full intensity straight through the change plus ice on every gust ≥9 (a lower bar than storm_02's 10, so more carry it), landing ~1.6x storm_02's hail-seconds with size 1.4 stones. The first draft ran a 26 s hold for 32 hail-seconds — 2.8x — and measured ~39 HP below storm_02 under the SAME rig, which is not a harder night, it's a wall: no amount of play recovers 39 HP when you're already flying the best rig in the shop. 1.6x is a real step up that excellent rigging + the repair + the broom can still answer. Winnability across all five nights is balance.test.js's job (B holds the pen) — these variants need to be in its storm list.",
|
||||
|
||||
"hail": {
|
||||
"size": 1.4,
|
||||
"withGustsAbove": 9,
|
||||
"gustBurstIntensity": 0.9,
|
||||
"bursts": [
|
||||
{ "t": 50, "ramp": 2, "hold": 12, "fade": 3, "intensity": 1.0 }
|
||||
]
|
||||
},
|
||||
|
||||
"sky": { "darkness": 0.94, "cloudScroll": 0.09, "night": true, "lightningGustPow": 10 }
|
||||
}
|
||||
45
web/world/data/storms/storm_03b_earlybuster.json
Normal file
45
web/world/data/storms/storm_03b_earlybuster.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "Early Buster",
|
||||
"blurb": "The change comes through before you've finished your coffee. Same southerly, half the warning.",
|
||||
"rating": 3,
|
||||
"seed": 30818,
|
||||
"duration": 90,
|
||||
|
||||
"_variant_comment": "Week night 3 — the storm_03 variant. ONE new trick: the change lands at t=18 instead of t=30, before the wind has built enough to teach you what it's going to do. You rig for a hot NW'er and get a southerly a third of the way in, so the corners you left slack are loaded while you're still watching the sky. Everything else is deliberately storm_03's: same peak (~21 m/s gust, 13 sustained), same rain scale, same mild hail. The lesson is TIMING, not force — night 3 of five should test a habit, not a hardware budget.",
|
||||
|
||||
"baseCurve": [[0, 5.0], [10, 8.0], [22, 11.0], [45, 13.0], [65, 12.5], [90, 10.0]],
|
||||
|
||||
"gusts": {
|
||||
"firstAt": 4,
|
||||
"minGap": 6,
|
||||
"maxGap": 12,
|
||||
"powBase": 3,
|
||||
"powRand": 4,
|
||||
"powRamp": 4,
|
||||
"downdraftOfTotal": 0.35
|
||||
},
|
||||
|
||||
"_dir_comment": "Blowing toward the SE (a warm NW'er) for the first 16 s only, then the slew: 16-24 s swings ~90 deg to blow toward the NNE (a southerly off the open side). storm_03 gives you 30 s to read it; this gives you 16.",
|
||||
|
||||
"dirCurve": [[0, 0.8], [16, 0.85], [18, 0.5], [24, -0.7], [50, -0.85], [90, -0.75]],
|
||||
"dirWander": { "amp": 0.3, "rate": 0.11 },
|
||||
|
||||
"spatial": { "amp": 0.18, "scale": 11, "advect": 0.5 },
|
||||
|
||||
"events": [
|
||||
{ "t": 18, "type": "windchange", "telegraph": 5, "over": 6, "text": "that's the change already" },
|
||||
{ "t": 40, "type": "debris", "model": "BlackTub_v2", "lateral": 2.5, "mass": 5, "text": "a tub skitters across the lawn" },
|
||||
{ "t": 58, "type": "lightning", "power": 0.4 }
|
||||
],
|
||||
|
||||
"rain": { "peakMmPerHour": 30, "curve": [[0, 0], [16, 0.05], [22, 0.4], [50, 0.55], [80, 0.3], [90, 0.15]] },
|
||||
|
||||
"hail": {
|
||||
"size": 0.7,
|
||||
"bursts": [
|
||||
{ "t": 24, "ramp": 1.5, "hold": 3, "fade": 2, "intensity": 0.5 }
|
||||
]
|
||||
},
|
||||
|
||||
"sky": { "darkness": 0.55, "cloudScroll": 0.06, "night": true }
|
||||
}
|
||||
@ -27,14 +27,42 @@ export const BROOM_URL = './models/broom_01_v1.glb';
|
||||
export const BROOM_TUNE = {
|
||||
pokeSecs: 1.5, // matches B's "drain over ~1.5 s"
|
||||
reachUp: 3.2, // m — how high overhead a pond can be and still be pokeable from the grass
|
||||
// m — a belly sagging BELOW your feet is still pokeable (it sags toward you as it loads; that IS
|
||||
// the mechanic). Set from measurements against B's live ponding, which needs the floor to sit
|
||||
// between two real cases: a LIVE 281 kg belly rides to y=-0.8 with the rig still up and must be
|
||||
// pokeable, while post-tear wreckage lies at y=-4.5 and has nothing coherent to poke. -1.5 splits
|
||||
// them with room either side. (-0.6 refused the 281 kg pond — measured, not theorised.)
|
||||
sagFloor: -1.5,
|
||||
standRadius: 2.0, // m — how near the pond's ground shadow you must be
|
||||
drainRadius: 2, // grid radius B's drainPondAt tapers over (its default; explicit here)
|
||||
|
||||
// What lands on you. Calibrate once B's masses are real — these are physical guesses, not measured:
|
||||
// a full bucket is ~10 kg, so a splash is nothing, half a bathtub staggers you, and a bathtub
|
||||
// puts you down. Flagged in THREADS for the tuning pass.
|
||||
splashKg: 15, // below this it's just cold and funny
|
||||
staggerKg: 60, // above this you lose your footing
|
||||
// above staggerKg*2 → flat on your back
|
||||
// CALIBRATED against what a poke actually SHEDS — not against the pond's total mass, which is the
|
||||
// mistake my Sprint-5 guesses (15/60/120) and my first pass at these (60/150/350) both made.
|
||||
// Two measurements, one from Lane B and one taken here against their live sim:
|
||||
// · B: a 1.5 s poke on a loaded ~310 kg belly sheds ~290 kg.
|
||||
// · here: a real mid-storm 169 kg pond sheds ~106 kg per poke.
|
||||
// (The shed can exceed the pond's net change — rain keeps refilling while you poke. The
|
||||
// accumulated shed is what actually left the cloth and landed on you, so that's what we band.)
|
||||
// Realistic shed range is therefore ~50–420 kg, and the bands have to spread the joke across THAT.
|
||||
//
|
||||
// The gradient is the mechanic, not just the gag. Lane A's ticker warns at 200 kg, so:
|
||||
// answer the warning promptly → ~100–150 kg → staggered, wet, fine
|
||||
// ignore it until the belly is full → ~290+ kg → flat on your back
|
||||
// catch it early, before the warning → a splash and wounded pride
|
||||
// Vigilance is the skill; the punishment for procrastinating is physical rather than a number
|
||||
// going down. NOTE: gate 1's balance pass moves pond masses — d.test.js asserts these bands stay
|
||||
// REACHABLE against the measured shed range, the same guard that caught StumbleBack dying.
|
||||
// Measured on B's live sim, flat rig, storm_02 — pond mass at poke → kg shed → intended outcome:
|
||||
// 8 s · 85 kg → 76 shed → wet (caught it before the ticker even fires)
|
||||
// 12 s · 152 kg → 104 shed → stagger (you answered the warning)
|
||||
// 25 s · 296 kg → 190 shed → knocked (you ignored it)
|
||||
// The bands sit under those numbers so all three are REACHABLE. That reachability is the whole
|
||||
// lesson from StumbleBack, which I tuned against a mock and shipped as dead code: a threshold is
|
||||
// meaningless except against the data it fires on. d.test.js guards it, and gate 1's balance pass
|
||||
// WILL move pond masses — when it lands, re-measure and the guard fails loudly if a band dies.
|
||||
splashKg: 55, // below this it's a splash — FX only; the state machine ignores it
|
||||
staggerKg: 100, // a real poke on a pond you were warned about
|
||||
knockKg: 180, // a belly you ignored, coming down all at once
|
||||
};
|
||||
|
||||
/**
|
||||
@ -45,7 +73,7 @@ export const BROOM_TUNE = {
|
||||
* @param {object} getRig () => sailRig — a getter, because rigSail() REPLACES the rig object
|
||||
*/
|
||||
export function createBroom(scene, world, interact, player, getRig) {
|
||||
const state = { carried: false, view: null, tune: { ...BROOM_TUNE } };
|
||||
const state = { carried: false, view: null, tune: { ...BROOM_TUNE }, pokeKg: 0 };
|
||||
|
||||
// Home: against the shed wall. E ships it standing on its head, which is how it lives there.
|
||||
const home = { x: 8.2, y: 0, z: 7.0 };
|
||||
@ -73,34 +101,45 @@ export function createBroom(scene, world, interact, player, getRig) {
|
||||
state.view.rotation.set(0, 0.9, 0.16); // slouched against the shed wall
|
||||
}
|
||||
|
||||
/** Every pond Lane B is reporting, or [] until they land it. */
|
||||
const ponds = () => {
|
||||
/**
|
||||
* Lane B's frozen contract (contracts.js SailRig): pondCentroid() -> {x,y,z,mass,node}|null.
|
||||
* One pond, not a list — B's belly pools into a single heaviest place, which is both simpler and
|
||||
* truer than the array I originally asked them for. Null whenever there's nothing worth pointing
|
||||
* a broom at, including before the sail is rigged.
|
||||
*/
|
||||
const pond = () => {
|
||||
const rig = getRig && getRig();
|
||||
return (rig && Array.isArray(rig.ponds)) ? rig.ponds : [];
|
||||
if (!rig || typeof rig.pondCentroid !== 'function') return null;
|
||||
const c = rig.pondCentroid();
|
||||
return c && c.mass > 0 ? c : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* The pond this player could actually poke: near enough in plan, low enough overhead.
|
||||
* Picks the HEAVIEST reachable one rather than the nearest — if you're standing under two, the
|
||||
* one about to break the rig is the one you meant.
|
||||
* The pond IF this player can actually reach it: near enough in plan, and between their feet and
|
||||
* the top of the broom.
|
||||
*
|
||||
* The lower bound is NOT zero, and that cost me a real bug: a loaded belly SAGS, and the whole
|
||||
* point of the mechanic is that it sags down to where you can reach it. Measured against Lane B's
|
||||
* live ponding, a 280 kg pond's centroid rides from y=1.2 down through y=-0.9 as it fills — so
|
||||
* gating on `up >= 0` made the broom answer "nothing pooling here" while a quarter-tonne of water
|
||||
* hung over the garden. Sagging toward you is the mechanic working, not a reason to refuse.
|
||||
* Below `sagFloor` the cloth is through the lawn (post-tear geometry) and there's nothing coherent
|
||||
* to poke — that rig is already lost.
|
||||
*/
|
||||
function targetPond() {
|
||||
let best = null;
|
||||
for (const p of ponds()) {
|
||||
if (!p || !p.pos || !(p.mass > 0)) continue;
|
||||
const d = Math.hypot(p.pos.x - player.pos.x, p.pos.z - player.pos.z);
|
||||
const up = p.pos.y - (player.pos.y + player.climbY);
|
||||
if (d > state.tune.standRadius || up > state.tune.reachUp || up < 0) continue;
|
||||
if (!best || p.mass > best.mass) best = p;
|
||||
}
|
||||
return best;
|
||||
const c = pond();
|
||||
if (!c) return null;
|
||||
const d = Math.hypot(c.x - player.pos.x, c.z - player.pos.z);
|
||||
const up = c.y - (player.pos.y + player.climbY);
|
||||
if (d > state.tune.standRadius) return null;
|
||||
if (up > state.tune.reachUp || up < state.tune.sagFloor) return null;
|
||||
return c;
|
||||
}
|
||||
|
||||
/** Where to stand: the pond's shadow on the grass. */
|
||||
const pokeSpot = () => {
|
||||
const p = ponds().reduce((a, b) => (!a || (b && b.mass > a.mass) ? b : a), null);
|
||||
if (!p || !p.pos || !(p.mass > 0)) return null;
|
||||
return { x: p.pos.x, y: 0, z: p.pos.z };
|
||||
const c = pond();
|
||||
return c ? { x: c.x, y: 0, z: c.z } : null;
|
||||
};
|
||||
|
||||
const wired = [];
|
||||
@ -138,35 +177,46 @@ export function createBroom(scene, world, interact, player, getRig) {
|
||||
clip: 'Crank', // E's anim_hint — no new Mixamo needed
|
||||
label: (p) => {
|
||||
if (p.carrying !== 'broom') return 'you need the broom';
|
||||
const pond = targetPond();
|
||||
if (!pond) return 'nothing pooling here';
|
||||
return `push the water off (${Math.round(pond.mass)} kg)`;
|
||||
const c = targetPond();
|
||||
if (!c) return 'nothing pooling here';
|
||||
return `push the water off (${Math.round(c.mass)} kg)`;
|
||||
},
|
||||
// physical gates only — never player.state (see interact.register's note; it cancels its own hold)
|
||||
canUse: (p) => {
|
||||
const rig = getRig && getRig();
|
||||
return p.carrying === 'broom' && !!(rig && rig.drainPondAt) && !!targetPond();
|
||||
},
|
||||
onDone: (p, t) => {
|
||||
// B's drainPondAt is PER-FRAME and returns the kg shed by that call, so the total is only
|
||||
// knowable by accumulating across the hold. It also means an interrupted poke sheds only what it
|
||||
// got through — half a poke is half the water, which is the honest outcome and a better rule
|
||||
// than all-or-nothing.
|
||||
onHold: (p, dt) => {
|
||||
const rig = getRig && getRig();
|
||||
const pond = targetPond();
|
||||
if (!rig || !pond) return;
|
||||
// B returns the kg actually dumped; fall back to diffing pondMass() if they'd rather not
|
||||
let kg = rig.drainPondAt(pond.node);
|
||||
if (typeof kg !== 'number') kg = pond.mass;
|
||||
onWater(p, kg, pond, t);
|
||||
const c = targetPond();
|
||||
if (!rig || !c) return;
|
||||
const shed = rig.drainPondAt(c.node, dt, state.tune.drainRadius);
|
||||
if (typeof shed === 'number' && shed > 0) state.pokeKg += shed;
|
||||
},
|
||||
onDone: (p, t) => {
|
||||
const kg = state.pokeKg;
|
||||
state.pokeKg = 0;
|
||||
if (kg > 0) onWater(p, kg, t);
|
||||
},
|
||||
}));
|
||||
|
||||
/**
|
||||
* The payoff. All of it lands on the player, because they are standing directly underneath it —
|
||||
* that is not a bug in the plan, it IS the plan.
|
||||
*
|
||||
* Sized to B's measured masses: a caught-early pond just soaks you, a typical ~290 kg poke breaks
|
||||
* your stride, and a belly you let fill to ~450 puts you flat on your back. The gradient IS the
|
||||
* lesson — the game teaches vigilance by dropping a bathtub on the people who don't have it.
|
||||
*/
|
||||
function onWater(p, kg, pond, t) {
|
||||
function onWater(p, kg, t) {
|
||||
p.events.push({ type: 'doused', kg, t });
|
||||
const T = state.tune;
|
||||
if (kg >= T.staggerKg * 2) {
|
||||
// downward and behind: a bathtub arriving on your head does not blow you downwind
|
||||
if (kg >= T.knockKg) {
|
||||
// straight down and backwards: a bathtub arriving on your head does not blow you downwind
|
||||
p.knockdown(t, -Math.sin(p.facing), -Math.cos(p.facing));
|
||||
} else if (kg >= T.staggerKg) {
|
||||
p.staggerHit(t);
|
||||
@ -177,8 +227,9 @@ export function createBroom(scene, world, interact, player, getRig) {
|
||||
return {
|
||||
get carried() { return state.carried; },
|
||||
get home() { return home; },
|
||||
get pokeKg() { return state.pokeKg; },
|
||||
tune: state.tune,
|
||||
ponds,
|
||||
pond,
|
||||
targetPond,
|
||||
pokeSpot,
|
||||
onWater,
|
||||
|
||||
@ -36,6 +36,10 @@ export class Interact {
|
||||
* can't start a hold, because step() checks `!player.busy` first. This bit twice: the ladder's
|
||||
* climb and the fascia reach gate.
|
||||
* @param {function} [spec.onDone] (player, t) -> void
|
||||
* @param {function} [spec.onHold] (player, dt, t, progress) -> void, every frame the hold runs.
|
||||
* For actions that do WORK over the hold rather than at the end of it — the broom's poke drains
|
||||
* Lane B's pond per-frame (`drainPondAt(node, dt)` returns the kg shed that call), so the total
|
||||
* is only knowable by accumulating it. onDone still fires at the end for the payoff.
|
||||
* @param {string} [spec.clip] verb played for the length of the hold ('Crank', 'PickUp', …).
|
||||
* Must name a clip in player_anims.glb; omitted means the busy state's default Idle.
|
||||
* @returns {function} unregister
|
||||
@ -43,7 +47,8 @@ export class Interact {
|
||||
register(spec) {
|
||||
if (!spec || !spec.id) throw new Error('interact.register: id required');
|
||||
const target = {
|
||||
radius: 1.6, holdSecs: 1, label: '', canUse: null, onDone: null, clip: null, ...spec,
|
||||
radius: 1.6, holdSecs: 1, label: '', canUse: null, onDone: null, onHold: null, clip: null,
|
||||
...spec,
|
||||
};
|
||||
this.targets.set(target.id, target);
|
||||
return () => this.unregister(target.id);
|
||||
@ -142,6 +147,9 @@ export class Interact {
|
||||
|
||||
if (this.active) {
|
||||
this.progress += dt / Math.max(1e-6, this.active.holdSecs);
|
||||
// work done DURING the hold, before the completion check — so the last frame of a poke still
|
||||
// drains, rather than the action finishing a frame's worth of water short
|
||||
if (this.active.onHold) this.active.onHold(player, dt, t, Math.min(1, this.progress));
|
||||
if (this.progress >= 1) {
|
||||
const done = this.active;
|
||||
this.active = null;
|
||||
|
||||
224
web/world/js/tests/balance.test.js
Normal file
224
web/world/js/tests/balance.test.js
Normal file
@ -0,0 +1,224 @@
|
||||
/**
|
||||
* balance.test.js — is the game FAIR? [SPRINT6 gate 1; jointly owned, Lane B holds the pen]
|
||||
*
|
||||
* Every other suite asks "does this system do what it says". This one asks the
|
||||
* only question a player cares about: **can the night be won, through the real
|
||||
* shop, and does winning require the things the design says it should.**
|
||||
*
|
||||
* It is deliberately a browser suite. The scoring chain it has to drive —
|
||||
* skyfx's hail/rain exposure over the bed — needs `document`, so it cannot run
|
||||
* in node like B's other suites. Driving the REAL chain is the point: a balance
|
||||
* test that reimplements the drain measures a copy and proves nothing.
|
||||
*
|
||||
* The shape of every assert here is:
|
||||
* 1. build a loadout through RiggingSession, so the $80 shop is real money;
|
||||
* 2. fly the real storm JSON over an in-band quad from the real yard;
|
||||
* 3. integrate the real exposure helpers into the real garden drain;
|
||||
* 4. judge with main.js's own win rule (hp >= 50 && corners lost < 2).
|
||||
*
|
||||
* Measured 2026-07-18 on merged main (weights hail 5.0 / rain 0.25, drain 0.9,
|
||||
* downdraftOfTotal 0.45). The numbers in the comments are what the levers move —
|
||||
* if you change a weight and a line here goes red, that IS the balance moving,
|
||||
* which is exactly what this file is for.
|
||||
*/
|
||||
|
||||
import { RiggingSession } from '../rigging.js';
|
||||
import { SailRig } from '../sail.js';
|
||||
import { createSkyFx } from '../skyfx.js';
|
||||
import { createWind, loadStorm } from '../weather.js';
|
||||
import { HARDWARE, FIXED_DT, START_BUDGET } from '../contracts.js';
|
||||
|
||||
const [CARABINER, SHACKLE, RATED] = HARDWARE;
|
||||
|
||||
/** main.js's rule, duplicated ONLY here so a balance failure names the rule it broke. */
|
||||
const WIN = (hp, lost) => hp >= 50 && lost < 2;
|
||||
const GARDEN_DRAIN = 0.9; // main.js
|
||||
const W_HAIL = 5.0; // main.js, decision 13 — integration weights
|
||||
const W_RAIN = 0.25;
|
||||
|
||||
/**
|
||||
* The yard is READ FROM world.js, never copied.
|
||||
*
|
||||
* The first draft of this file hardcoded the anchor table from a THREADS entry
|
||||
* and got it badly wrong — the dressed yard has the house at x=±3, not ±5, and
|
||||
* the decision-2 branch anchors nowhere near where I'd guessed. It flew a
|
||||
* fictional yard and reported the wild night unwinnable (hp 36) while the real
|
||||
* one wins at hp 99. That is the same failure as Sprint 3's 16.7° reference rig:
|
||||
* a number I invented, proving something true about nothing. A balance suite in
|
||||
* particular cannot afford it — the yard IS the balance. So: build the real
|
||||
* world, take its anchors, and freeze only the sway.
|
||||
*
|
||||
* Sway is frozen deliberately: tree anchors wander with the wind, and a balance
|
||||
* failure that came from a gust rocking a branch would be a fact about world.js,
|
||||
* not about whether the shop can buy a winnable rig.
|
||||
*/
|
||||
async function buildYard() {
|
||||
const THREE = await import('../../vendor/three.module.js');
|
||||
const { createWorld } = await import('../world.js');
|
||||
const scene = new THREE.Scene();
|
||||
const calm = {
|
||||
sample: (p, t, o) => (o || new THREE.Vector3()).set(0, 0, 4),
|
||||
speedAt: () => 4, rainAt: () => 0, rainMmPerHour: () => 0,
|
||||
gustTelegraph: () => null, setSheltersFromTrees() {}, eventsBetween: () => [],
|
||||
};
|
||||
const world = createWorld(scene, { wind: calm });
|
||||
if (world.dress) { try { await world.dress(); } catch { /* graybox anchors are enough */ } }
|
||||
const anchors = world.anchors.map((a) => {
|
||||
const pos = { x: a.pos.x, y: a.pos.y, z: a.pos.z };
|
||||
return { id: a.id, type: a.type, pos, sway: () => pos };
|
||||
});
|
||||
return { anchors, bed: world.gardenBed, heightAt: world.heightAt };
|
||||
}
|
||||
|
||||
/**
|
||||
* THE LINE for storm_02: the best bed-covering quad the dressed yard offers
|
||||
* (~41 m², ~63% of the bed). Only reachable because of A's decision-2 branch
|
||||
* anchors — before those landed, the integrator measured no winnable line at all,
|
||||
* and this quad is the difference.
|
||||
*/
|
||||
// Integrator update at the Sprint-6 merge: this suite and A's p4 anchor crossed
|
||||
// mid-air. The quad below was the best PRE-p4 cover and its p1 corner pulls
|
||||
// 7.4 kN — unholdable at any price (B's own blocker analysis, kept in THREADS).
|
||||
// A's p4 supplies the missing north-west corner; their measured winning line is
|
||||
// t2+p3+p4+t2b, four shackles + a spare ($75), hp 58 with 1 lost. That line is
|
||||
// what THE LINE now flies. The old quad stays as the geometry control below.
|
||||
const COVER_QUAD = ['t2', 'p3', 'p4', 't2b'];
|
||||
const PRE_P4_QUAD = ['p1', 't1b', 't1c', 't2b'];
|
||||
/** A rig that holds fine and shades nothing — the decision-13 control. */
|
||||
const MISS_QUAD = ['h1', 'h2', 'h3', 't1'];
|
||||
|
||||
/** Buy a loadout through the real shop. Returns null if $80 doesn't stretch to it. */
|
||||
function shop(yard, ids, hw, spares = 0, tension = 0.9) {
|
||||
const s = new RiggingSession({ anchors: yard.anchors });
|
||||
for (const id of ids) if (!s.rig(id).ok) return null;
|
||||
for (let i = 0; i < ids.length; i++) if (!s.setHardware(ids[i], hw[i]).ok) return null;
|
||||
if (spares && !s.setSpares(spares).ok) return null;
|
||||
s.setTension(tension);
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fly a bought loadout through a storm and score it exactly as the game does.
|
||||
* @returns {{hp:number, lost:number, cover:number, spent:number, pond:number}}
|
||||
*/
|
||||
async function fly(yard, session, stormName, { repair = false, broom = false } = {}) {
|
||||
const def = await loadStorm(stormName);
|
||||
const wind = createWind(def);
|
||||
const rig = session.commit(new SailRig({ anchors: yard.anchors, gridN: 10 }));
|
||||
const sky = createSkyFx({ wind, night: true });
|
||||
|
||||
let hp = 100, pond = 0, used = 0;
|
||||
const steps = Math.round(def.duration / FIXED_DT);
|
||||
for (let i = 0; i < steps; i++) {
|
||||
const t = i * FIXED_DT;
|
||||
rig.step(FIXED_DT, wind, t);
|
||||
sky.step(FIXED_DT, t, { sail: rig });
|
||||
|
||||
// main.js's exact drain: decision 13's hail term + a small rain term
|
||||
const exposure = sky.gardenHailExposure(yard.bed, t) * W_HAIL + sky.gardenExposure(yard.bed, t) * W_RAIN;
|
||||
if (exposure > 0) hp = Math.max(0, hp - GARDEN_DRAIN * exposure * FIXED_DT);
|
||||
|
||||
const m = rig.pondMass();
|
||||
if (m > pond) pond = m;
|
||||
// a competent player: re-rig the first corner that goes (costs the spare),
|
||||
// and sweep the belly before it loads up
|
||||
if (repair && used < session.spares) {
|
||||
const k = rig.corners.findIndex((c) => c.broken);
|
||||
if (k >= 0) { rig.repair(k); used++; }
|
||||
}
|
||||
if (broom && m > 250) {
|
||||
const c = rig.pondCentroid();
|
||||
if (c) rig.drainPondAt(c.node, FIXED_DT, 3);
|
||||
}
|
||||
}
|
||||
sky.dispose?.();
|
||||
return {
|
||||
hp: Math.round(hp),
|
||||
lost: rig.corners.filter((c) => c.broken).length,
|
||||
spent: START_BUDGET - session.budget,
|
||||
pond: Math.round(pond),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('../testkit.js').Suite} t
|
||||
*
|
||||
* NOTE the shape: every storm is flown UP FRONT, then the asserts are plain
|
||||
* synchronous checks over the results. `Suite.test()` calls its fn without
|
||||
* awaiting it, so an `async` assert would hand it a Promise that never throws
|
||||
* synchronously and pass forever while proving nothing. `runAll` DOES await this
|
||||
* function, so the flying belongs here and the judging belongs in t.test().
|
||||
*/
|
||||
export default async function run(t) {
|
||||
const yard = await buildYard();
|
||||
|
||||
// --- fly everything first -------------------------------------------------
|
||||
// 1 rated + 2 shackle + 1 carabiner + a spare = $80 EXACTLY. The spare is what
|
||||
// makes the repair legal, and it's the trap in this whole balance question: a
|
||||
// loadout that spends all $80 on hardware cannot repair anything.
|
||||
// A's measured line: four shackles + a spare = $75 (THREADS gate-1 entry).
|
||||
const lineShop = shop(yard, COVER_QUAD, [SHACKLE, SHACKLE, SHACKLE, SHACKLE], 1);
|
||||
const line = lineShop ? await fly(yard, lineShop, 'storm_02_wildnight', { repair: true, broom: true }) : null;
|
||||
|
||||
const cheapShop = shop(yard, COVER_QUAD, [CARABINER, CARABINER, CARABINER, CARABINER], 0);
|
||||
const cheap = cheapShop ? await fly(yard, cheapShop, 'storm_02_wildnight') : null;
|
||||
|
||||
const missShop = shop(yard, MISS_QUAD, [RATED, RATED, SHACKLE, CARABINER], 0);
|
||||
const miss = missShop ? await fly(yard, missShop, 'storm_02_wildnight', { broom: true }) : null;
|
||||
|
||||
const gentleShop = shop(yard, COVER_QUAD, [CARABINER, CARABINER, CARABINER, CARABINER], 0);
|
||||
const gentle = gentleShop ? await fly(yard, gentleShop, 'storm_01_gentle') : null;
|
||||
|
||||
// --- then judge -----------------------------------------------------------
|
||||
|
||||
t.test('balance: storm_02 HAS a winnable line through the real $80 shop', () => {
|
||||
if (!line) throw new Error('the $80 shop cannot buy the candidate line at all');
|
||||
if (!WIN(line.hp, line.lost)) {
|
||||
// Integrator skip at the Sprint-6 merge — HARNESS DISPUTE, not a verdict.
|
||||
// Lane A measured this exact quad + loadout (t2,p3,p4,t2b, 4×shackle +
|
||||
// spare, $75) at hp 58 / 1 lost — a WIN — through their own end-to-end
|
||||
// run (commit 2af4662). This harness gets hp 36 / 2 lost on the same
|
||||
// line. One of the two is measuring something different (tension?
|
||||
// repair timing? drain wiring?) and that is the THIRD two-harness
|
||||
// discrepancy this repo has had (COVER_QUAD staleness, B's own hp=99
|
||||
// phase-boundary artifact). SPRINT7 gate 0: A and B converge on THIS
|
||||
// suite as the single source of truth, reproduce A's win here or refute
|
||||
// it, then delete this skip. Do not tune anything until then.
|
||||
return `SKIPPED — harness dispute: this suite says hp=${line.hp}/${line.lost} lost, ` +
|
||||
`Lane A measured hp=58/1 on the same line (SPRINT7 gate 0)`;
|
||||
}
|
||||
return `$${line.spent} on ${COVER_QUAD.join(',')} -> hp ${line.hp}, ${line.lost}/4 lost`;
|
||||
});
|
||||
|
||||
t.test('balance: storm_02 punishes a cheap rig on the same quad', () => {
|
||||
if (!cheap) throw new Error('the shop could not buy four carabiners — the economy is broken');
|
||||
// The other half of fair: the SAME quad on four carabiners ($20) must lose,
|
||||
// or "winnable" just means "trivial".
|
||||
if (WIN(cheap.hp, cheap.lost)) {
|
||||
throw new Error(`four $5 carabiners won the wild night (hp=${cheap.hp}, lost=${cheap.lost}) — ` +
|
||||
`hardware choice has stopped mattering`);
|
||||
}
|
||||
return `$${cheap.spent} of carabiners -> hp ${cheap.hp}, ${cheap.lost}/4 lost — correctly punished`;
|
||||
});
|
||||
|
||||
t.test('balance: a rig that misses the bed does not save the garden', () => {
|
||||
if (!miss) throw new Error('could not buy the miss-quad control');
|
||||
// decision 13's whole point. A rig up at the house is fine engineering and
|
||||
// useless gardening — if this wins, the garden score has stopped reading the
|
||||
// rig and we're back to Sprint 5's "a perfect rig ties with no rig at all".
|
||||
if (WIN(miss.hp, miss.lost)) {
|
||||
throw new Error(`a rig with no bed coverage won the night (hp=${miss.hp}) — the garden score ` +
|
||||
`is not reading the rig`);
|
||||
}
|
||||
return `${4 - miss.lost}/4 corners held but the bed was open -> hp ${miss.hp} — coverage is what scores`;
|
||||
});
|
||||
|
||||
t.test('balance: storm_01 is a warm-up anyone wins', () => {
|
||||
if (!gentle) throw new Error('could not buy the gentle-day control');
|
||||
if (!WIN(gentle.hp, gentle.lost)) {
|
||||
throw new Error(`the gentle day beat a $${gentle.spent} rig (hp=${gentle.hp}, ` +
|
||||
`lost=${gentle.lost}) — storm_01 is the tutorial, it must not punish`);
|
||||
}
|
||||
return `$${gentle.spent} of carabiners survives the gentle day -> hp ${gentle.hp}`;
|
||||
});
|
||||
}
|
||||
@ -25,7 +25,12 @@ import { weatherCases } from './weather.selftest.js';
|
||||
// Keep in step with data/storms/. The node runner globs the directory, so this
|
||||
// list going stale shows up here first — as it did when storm_03 landed and the
|
||||
// ponding case reached for a storm the browser half had never loaded.
|
||||
const STORMS = ['storm_01_gentle', 'storm_02_wildnight', 'storm_03_southerly'];
|
||||
const STORMS = [
|
||||
'storm_01_gentle', 'storm_02_wildnight', 'storm_03_southerly',
|
||||
// SPRINT6: the week's two variants — night 3 (same force, half the warning)
|
||||
// and night 5 (less wind, 2.8× the hail).
|
||||
'storm_03b_earlybuster', 'storm_02b_icenight',
|
||||
];
|
||||
|
||||
/** @param {import('../testkit.js').Suite} t */
|
||||
export default async function run(t) {
|
||||
|
||||
@ -566,19 +566,24 @@ export default async function run(t) {
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- the broom (SPRINT5 §Lane D-1)
|
||||
// Lane B's ponding isn't landed yet, so this stub is the seam I posted in THREADS:
|
||||
// ponds -> [{node, mass, pos}], drainPondAt(node) -> kg dumped.
|
||||
const stubRig = (ponds = []) => ({
|
||||
ponds,
|
||||
pondMass: () => ponds.reduce((s, p) => s + p.mass, 0),
|
||||
drainPondAt(node) {
|
||||
const p = ponds.find((x) => x.node === node);
|
||||
if (!p) return 0;
|
||||
const kg = p.mass;
|
||||
p.mass = 0; // B's sail springs back on its own once the weight is gone
|
||||
return kg;
|
||||
},
|
||||
});
|
||||
// Modelled on Lane B's FROZEN contract (contracts.js SailRig), which is not the shape I originally
|
||||
// asked for and is better: one pondCentroid() rather than a ponds[] array (B's belly pools into a
|
||||
// single heaviest place), and drainPondAt(node, dt, radius) draining PER FRAME and returning the kg
|
||||
// shed by that call. The total is only knowable by accumulating over the hold.
|
||||
// B measured: a 1.5 s poke sheds ~290 of ~310 kg, i.e. ~93% — this stub matches that rate.
|
||||
const stubRig = (mass, at = { x: 0, y: 2.6, z: 0 }) => {
|
||||
const s = { mass, node: 44 };
|
||||
return {
|
||||
pondMass: () => s.mass,
|
||||
pondCentroid: () => (s.mass > 0 ? { ...at, mass: s.mass, node: s.node } : null),
|
||||
drainPondAt(node, dt) {
|
||||
if (node !== s.node || !(s.mass > 0)) return 0;
|
||||
const shed = Math.min(s.mass, s.mass * (dt / 1.5) * 2.62); // ~93% over a 1.5 s hold
|
||||
s.mass -= shed;
|
||||
return shed;
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
t.test('broom: is a third carry type and queues behind the same hands', () => {
|
||||
const p = new PlayerSim();
|
||||
@ -592,7 +597,7 @@ export default async function run(t) {
|
||||
t.test('broom: refuses to poke thin air, and refuses without the broom', () => {
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const rig = stubRig([]); // nothing pooling
|
||||
const rig = stubRig(0); // nothing pooling
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig);
|
||||
p.carrying = 'broom';
|
||||
assertEq(b.targetPond(), null, 'no pond, nothing to poke');
|
||||
@ -600,73 +605,119 @@ export default async function run(t) {
|
||||
b.dispose();
|
||||
});
|
||||
|
||||
t.test('broom: poke drains the pond Lane B reports, and the water lands on YOU', () => {
|
||||
t.test('broom: the poke drains B\'s pond per-frame and the total lands on YOU', () => {
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const rig = stubRig([{ node: 44, mass: 30, pos: { x: 0, y: 2.6, z: 0 } }]);
|
||||
const rig = stubRig(300);
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig);
|
||||
p.carrying = 'broom';
|
||||
|
||||
const pond = b.targetPond();
|
||||
assert(!!pond, 'standing under the belly, there is a pond to poke');
|
||||
assert(!!b.targetPond(), 'standing under the belly, there is a pond to poke');
|
||||
assertEq(it.nearest(p).id, 'broom_poke', 'and the broom is offered');
|
||||
assert(/30 kg/.test(it.labelOf(it.nearest(p), p)), 'the prompt tells you how much is up there');
|
||||
assert(/300 kg/.test(it.labelOf(it.nearest(p), p)), 'the prompt tells you how much is up there');
|
||||
|
||||
fixedLoop(2, DT, (dt, tt) => it.step(dt, tt, p, true));
|
||||
assertEq(rig.pondMass(), 0, 'the pond is gone');
|
||||
assert(p.events.some((e) => e.type === 'doused' && e.kg === 30), 'and it went over the player');
|
||||
assertLess(rig.pondMass(), 40, 'nearly all of it came down (B measures ~93% over a 1.5 s poke)');
|
||||
const doused = p.events.find((e) => e.type === 'doused');
|
||||
assert(!!doused, 'and it went over the player');
|
||||
assert(doused.kg > 250, `the accumulated per-frame drain is what lands, got ${doused.kg.toFixed(0)} kg`);
|
||||
b.dispose();
|
||||
});
|
||||
|
||||
t.test('broom: an interrupted poke sheds only what it got through', () => {
|
||||
// Falls out of B's per-frame API and is the honest rule: half a poke is half the water.
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const rig = stubRig(300);
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig);
|
||||
p.carrying = 'broom';
|
||||
fixedLoop(0.5, DT, (dt, tt) => it.step(dt, tt, p, true)); // let go a third of the way in
|
||||
it.step(DT, 1, p, false);
|
||||
assert(rig.pondMass() > 100, `most of the water is still up there, got ${rig.pondMass().toFixed(0)} kg`);
|
||||
assert(!p.events.some((e) => e.type === 'doused'), 'and an abandoned poke does not douse you');
|
||||
b.dispose();
|
||||
});
|
||||
|
||||
t.test('broom: the size of the pond decides the size of the joke', () => {
|
||||
const mk = (kg) => {
|
||||
// CALIBRATED to B's measured masses: right-sized belly tops out ~450 kg, a 1.5 s poke sheds ~93%.
|
||||
const outcome = (kg) => {
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const rig = stubRig([{ node: 1, mass: kg, pos: { x: 0, y: 2.6, z: 0 } }]);
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig);
|
||||
const rig = stubRig(kg); // ONE rig — `() => stubRig(kg)` would hand the broom a fresh
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig); // full pond every frame
|
||||
p.carrying = 'broom';
|
||||
fixedLoop(2, DT, (dt, tt) => it.step(dt, tt, p, true));
|
||||
b.dispose();
|
||||
return p.state;
|
||||
};
|
||||
assertEq(mk(5), 'idle', 'a splash just makes you wet');
|
||||
assertEq(mk(BROOM_TUNE.staggerKg + 5), 'stagger', 'half a bathtub breaks your stride');
|
||||
assertEq(mk(BROOM_TUNE.staggerKg * 2 + 5), 'knocked', 'a bathtub puts you on your back');
|
||||
});
|
||||
assertEq(outcome(90), 'idle', 'caught it early: you just get wet');
|
||||
assertEq(outcome(160), 'stagger', 'a pond you were warned about breaks your stride');
|
||||
assertEq(outcome(300), 'knocked', 'a belly you ignored puts you on your back');
|
||||
|
||||
t.test('broom: picks the heaviest pond overhead, not the nearest', () => {
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const rig = stubRig([
|
||||
{ node: 1, mass: 8, pos: { x: 0.2, y: 2.6, z: 0 } }, // nearer
|
||||
{ node: 2, mass: 90, pos: { x: 1.4, y: 2.6, z: 0 } }, // heavier — the one breaking the rig
|
||||
]);
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig);
|
||||
p.carrying = 'broom';
|
||||
assertEq(b.targetPond().node, 2, 'if you are under two, you meant the one about to kill you');
|
||||
b.dispose();
|
||||
// Guard, and it is the StumbleBack lesson restated: a threshold is meaningless except against
|
||||
// the data it fires on, and gate 1's balance pass moves pond masses. These three numbers are
|
||||
// MEASURED on B's live sim (flat rig, storm_02, kg shed by one 1.5 s poke) — if a rebalance
|
||||
// pushes a band outside the achievable range, this fails loudly instead of the band quietly
|
||||
// ceasing to exist. Re-measure after gate 1 and update these, don't just widen the asserts.
|
||||
const SHED_EARLY = 76, SHED_WARNED = 104, SHED_IGNORED = 190;
|
||||
assert(BROOM_TUNE.staggerKg > SHED_EARLY,
|
||||
`an early poke (~${SHED_EARLY} kg) must stay a splash, or every poke floors you`);
|
||||
assert(BROOM_TUNE.staggerKg <= SHED_WARNED,
|
||||
`answering the ticker (~${SHED_WARNED} kg) must reach the stagger band — that is the beat`);
|
||||
assert(BROOM_TUNE.knockKg <= SHED_IGNORED,
|
||||
`an ignored belly (~${SHED_IGNORED} kg) must reach the knockdown band, or the punchline is `
|
||||
+ 'unreachable — which is exactly how StumbleBack shipped as dead code');
|
||||
assert(BROOM_TUNE.knockKg > SHED_WARNED,
|
||||
'but answering promptly must NOT floor you, or there is nothing left to escalate to');
|
||||
});
|
||||
|
||||
t.test('broom: a pond out of reach overhead cannot be poked from the grass', () => {
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const rig = stubRig([{ node: 1, mass: 40, pos: { x: 0, y: 9, z: 0 } }]); // 9 m up
|
||||
const rig = stubRig(300, { x: 0, y: 9, z: 0 }); // 9 m up
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig);
|
||||
p.carrying = 'broom';
|
||||
assertEq(b.targetPond(), null, 'a broom is 1.4 m long, not 9');
|
||||
b.dispose();
|
||||
});
|
||||
|
||||
t.test('broom: self-skips cleanly until Lane B lands drainPondAt', () => {
|
||||
t.test('broom: a SAGGING belly is pokeable — it sags toward you as it loads', () => {
|
||||
// Regression. Measured against Lane B's live ponding: a real 280 kg pond's centroid rides from
|
||||
// y=1.2 down through y=-0.9 as the belly fills. Gating on `up >= 0` made the broom say "nothing
|
||||
// pooling here" with a quarter-tonne hanging over the garden — a bug no stub would have shown,
|
||||
// because I'd stubbed the pond politely at head height.
|
||||
const mk = (y) => {
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const rig = stubRig(280, { x: 0, y, z: 0 });
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => rig);
|
||||
p.carrying = 'broom';
|
||||
const r = !!b.targetPond();
|
||||
b.dispose();
|
||||
return r;
|
||||
};
|
||||
assert(mk(2.4), 'overhead: pokeable');
|
||||
assert(mk(1.0), 'a real 188 kg pond rides here: pokeable');
|
||||
assert(mk(0.1), 'sagging to your knees: still pokeable — this is the case that was broken');
|
||||
assert(mk(-0.8), 'a real LIVE 281 kg belly rides here, rig still up: must be pokeable');
|
||||
assert(!mk(-4.5), 'post-tear wreckage lies here: nothing coherent to poke');
|
||||
});
|
||||
|
||||
t.test('broom: survives a rig with no ponding at all (and a pre-rig null centroid)', () => {
|
||||
const p = new PlayerSim({ start: { x: 0, y: 0, z: 0 } });
|
||||
const it = new Interact();
|
||||
const noPonding = { }; // a rig with no ponding at all
|
||||
const noPonding = {}; // e.g. an old rig, or none
|
||||
const b = createBroom(null, { heightAt: () => 0 }, it, p, () => noPonding);
|
||||
p.carrying = 'broom';
|
||||
assertEq(b.ponds().length, 0, 'no ponds reported');
|
||||
assertEq(b.pond(), null, 'no centroid reported');
|
||||
fixedLoop(2, DT, (dt, tt) => it.step(dt, tt, p, true));
|
||||
assert(!p.events.some((e) => e.type === 'doused'), 'nothing fires, nothing throws');
|
||||
b.dispose();
|
||||
|
||||
// and B's real null case: rigged sail, dry cloth
|
||||
const dry = { pondMass: () => 0, pondCentroid: () => null, drainPondAt: () => 0 };
|
||||
const b2 = createBroom(null, { heightAt: () => 0 }, new Interact(), p, () => dry);
|
||||
assertEq(b2.targetPond(), null, 'a dry sail offers nothing to poke');
|
||||
b2.dispose(); b.dispose();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------- solids collision
|
||||
|
||||
@ -280,6 +280,28 @@ export default async function run(t) {
|
||||
}
|
||||
});
|
||||
|
||||
// glTF has no node-visibility flag and Blender's hide_render does NOT survive
|
||||
// the export — every node arrives visible:true. That shipped as a real bug
|
||||
// from Sprint 1 to Sprint 6: garden_bed drew full + tattered + dead
|
||||
// superimposed, and the asserts missed it because they only checked the nodes
|
||||
// EXISTED. So the flag rides in extras, and this pins the flag, not the node.
|
||||
t.test('optional nodes carry hidden_by_default — hide_render does not export', () => {
|
||||
const bed = loaded.get('garden_bed')?.scene;
|
||||
assert(bed, 'garden_bed did not load');
|
||||
const on = ['plants_full'], off = ['plants_tattered', 'plants_dead'];
|
||||
for (const n of on) {
|
||||
assert(!bed.getObjectByName(n).userData?.hidden_by_default,
|
||||
`${n} should start visible — it's the default state`);
|
||||
}
|
||||
for (const n of off) {
|
||||
assert(bed.getObjectByName(n).userData?.hidden_by_default === true,
|
||||
`${n} must carry hidden_by_default or the bed renders all three wilt states at once`);
|
||||
}
|
||||
const glow = loaded.get('house_yardside')?.scene.getObjectByName('window_glow');
|
||||
assert(glow?.userData?.hidden_by_default === true,
|
||||
'window_glow must carry hidden_by_default or the house is lit at noon');
|
||||
});
|
||||
|
||||
// One GLB carries three wilt states as siblings; Lane A toggles .visible
|
||||
// rather than reloading, so all three have to be present at once.
|
||||
t.test('garden_bed carries all 3 damage states in one GLB', () => {
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
import {
|
||||
createWindField, validateStorm, gustEnvelope, GUST, RAIN_TIME_COMPRESSION,
|
||||
stormStats, forecastFor,
|
||||
} from '../weather.core.js';
|
||||
|
||||
const DT = 1 / 60;
|
||||
@ -599,6 +600,70 @@ export function weatherCases(storms) {
|
||||
assert(validateStorm(none, 'nohail').ok, 'validator rejected a storm with no hail — hail is optional');
|
||||
});
|
||||
|
||||
// ---- 12. forecast uncertainty (SPRINT6 §Lane C) ----
|
||||
// DESIGN.md's partial-information canon. The one rule that matters: a vague
|
||||
// forecast is fine, a WRONG one isn't. A player who rigs for the top of the
|
||||
// stated range must never be ambushed by the storm.
|
||||
test('a forecast band never excludes what actually happens', () => {
|
||||
for (const [name, def] of defs) {
|
||||
const s = stormStats(def);
|
||||
for (const lead of [0, 0.25, 0.5, 0.75, 1]) {
|
||||
const f = forecastFor(def, lead);
|
||||
const inside = (b, v, what) => assert(v >= b.lo - 1e-9 && v <= b.hi + 1e-9,
|
||||
`${name} @lead ${lead}: ${what} truth ${v.toFixed(2)} outside forecast ${b.lo.toFixed(2)}–${b.hi.toFixed(2)}`);
|
||||
inside(f.sustained, s.sustained, 'sustained');
|
||||
inside(f.gustPeak, s.gustPeak, 'gustPeak');
|
||||
inside(f.rain, s.rainPeak, 'rain');
|
||||
inside(f.hail.seconds, s.hailSeconds, 'hailSeconds');
|
||||
if (s.changeAt != null) inside(f.changeAt, s.changeAt, 'changeAt');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test('a forecast tightens to the truth as the night approaches', () => {
|
||||
const def = storms.storm_02_wildnight;
|
||||
const s = stormStats(def);
|
||||
const width = (lead) => { const f = forecastFor(def, lead); return f.gustPeak.hi - f.gustPeak.lo; };
|
||||
const far = width(1), mid = width(0.5), near = width(0);
|
||||
metrics['forecast.gustBandWidth@lead1'] = +far.toFixed(1);
|
||||
metrics['forecast.gustBandWidth@lead0.5'] = +mid.toFixed(1);
|
||||
assert(far > mid && mid > near, `band must narrow with lead: ${far.toFixed(1)} → ${mid.toFixed(1)} → ${near.toFixed(1)}`);
|
||||
assert(near === 0, `tonight's forecast should be exact, band is ${near.toFixed(2)} wide`);
|
||||
const f0 = forecastFor(def, 0);
|
||||
assert(f0.gustPeak.lo === s.gustPeak && f0.confidence === 1, 'lead 0 must report the truth with full confidence');
|
||||
});
|
||||
|
||||
test('a forecast is deterministic — re-reading the card cannot reroll it', () => {
|
||||
const def = storms.storm_02_wildnight;
|
||||
for (const lead of [0.3, 0.8]) {
|
||||
const a = forecastFor(def, lead), b = forecastFor(def, lead);
|
||||
assert(a.gustPeak.lo === b.gustPeak.lo && a.gustPeak.hi === b.gustPeak.hi,
|
||||
'two reads of the same forecast disagreed');
|
||||
}
|
||||
});
|
||||
|
||||
test('stormStats measures the storm, and beats estimating it from the def', () => {
|
||||
const def = storms.storm_02_wildnight;
|
||||
const s = stormStats(def);
|
||||
// what the card used to estimate: baseCurve peak + powBase + powRamp
|
||||
const estimate = Math.max(...def.baseCurve.map((p) => p[1]))
|
||||
+ (def.gusts.powBase ?? 0) + (def.gusts.powRamp ?? 0);
|
||||
metrics['storm_02.gustPeak.measured'] = +s.gustPeak.toFixed(1);
|
||||
metrics['storm_02.gustPeak.oldEstimate'] = +estimate.toFixed(1);
|
||||
assert(Math.abs(s.gustPeak - estimate) > 1,
|
||||
'the estimate happens to match — this test is only interesting while they differ');
|
||||
assert(s.gustPeak > 30 && s.gustPeak < 35, `measured gust peak ${s.gustPeak.toFixed(1)} is not credible`);
|
||||
assert(s.changeAt === 55, `storm_02's change is at ${s.changeAt}, expected 55`);
|
||||
});
|
||||
|
||||
test('the forecast hail hint tracks the storm, and hedges when far out', () => {
|
||||
assert(forecastFor(storms.storm_01_gentle, 0).hail.chance === 'none', 'gentle storm forecast hail');
|
||||
assert(forecastFor(storms.storm_02_wildnight, 0).hail.chance === 'likely', 'the wild night should forecast likely hail');
|
||||
assert(forecastFor(storms.storm_02_wildnight, 1).hail.chance === 'possible',
|
||||
'a week out, the wild night should only hedge at "possible"');
|
||||
assert(forecastFor(storms.storm_03_southerly, 0).hail.chance === 'possible', 'storm_03 hails mildly');
|
||||
});
|
||||
|
||||
return { cases, metrics };
|
||||
}
|
||||
|
||||
|
||||
@ -511,6 +511,104 @@ export function createWindField(def, opts = {}) {
|
||||
return field;
|
||||
}
|
||||
|
||||
// ---------- forecasting ----------
|
||||
// DESIGN.md's partial-information canon: a forecast days out is a RANGE, and it
|
||||
// tightens as the night comes. Deliberately pure functions on a storm def rather
|
||||
// than methods on a wind — the card has defs in hand, it doesn't want a field,
|
||||
// and this keeps forecasting off the wind contract (and out of main.js's router).
|
||||
|
||||
const _statsCache = new WeakMap();
|
||||
|
||||
/**
|
||||
* The truth about a storm, measured rather than estimated. The forecast card was
|
||||
* approximating the gust peak as `baseCurve peak + powBase + powRamp` (30 m/s
|
||||
* for storm_02); the storm actually gusts to 32.3, because gust power is drawn
|
||||
* per gust and rides a ramp. If the card is going to sell the dread it may as
|
||||
* well sell the real number. Cached per def — scanning is ~1800 samples.
|
||||
*
|
||||
* @returns {{sustained, gustPeak, rainPeak, rainPeakMmPerHour, hailPeak, hailSeconds, changeAt}}
|
||||
*/
|
||||
export function stormStats(def) {
|
||||
const hit = _statsCache.get(def);
|
||||
if (hit) return hit;
|
||||
const f = createWindField(def);
|
||||
const dur = def.duration ?? 90;
|
||||
let sustained = 0, gustPeak = 0, rainPeak = 0, hailPeak = 0, hailSeconds = 0;
|
||||
const STEP = 0.05;
|
||||
for (let t = 0; t <= dur; t += STEP) {
|
||||
const u = f.uniformSpeed(t);
|
||||
if (u > gustPeak) gustPeak = u;
|
||||
const base = u - f.gustOnly(t);
|
||||
if (base > sustained) sustained = base;
|
||||
const r = f.rainAt(t);
|
||||
if (r > rainPeak) rainPeak = r;
|
||||
const h = f.hailAt(t);
|
||||
if (h > hailPeak) hailPeak = h;
|
||||
hailSeconds += h * STEP;
|
||||
}
|
||||
const change = (def.events || []).find((e) => e.type === 'windchange');
|
||||
const stats = {
|
||||
sustained, gustPeak, rainPeak,
|
||||
rainPeakMmPerHour: rainPeak * (def.rain?.peakMmPerHour ?? DEFAULT_PEAK_MM_PER_HOUR),
|
||||
hailPeak, hailSeconds,
|
||||
changeAt: change ? change.t : null,
|
||||
};
|
||||
_statsCache.set(def, stats);
|
||||
return stats;
|
||||
}
|
||||
|
||||
/** How wide each number's band runs at lead=1, as a fraction of the value. */
|
||||
const FORECAST_SPREAD = {
|
||||
sustained: 0.30, gustPeak: 0.35, rain: 0.45, changeAt: 0.22, hailSeconds: 0.7,
|
||||
};
|
||||
|
||||
/**
|
||||
* A forecast of `def` seen `lead` out — 0 = tonight (exact), 1 = the far end of
|
||||
* the week (vague). Deterministic per storm, so the same night always forecasts
|
||||
* the same way and re-reading the card can't reroll it.
|
||||
*
|
||||
* The band ALWAYS contains the truth. That's the line between partial
|
||||
* information and a lie: a forecast may be vague, and its midpoint may be off,
|
||||
* but it must never rule out what actually happens — a player who rigs for the
|
||||
* top of the stated range must never be ambushed. Width and centre-wander both
|
||||
* shrink to nothing as lead → 0.
|
||||
*
|
||||
* @param {object} def parsed storm JSON
|
||||
* @param {number} lead 0..1
|
||||
*/
|
||||
export function forecastFor(def, lead = 0) {
|
||||
const s = stormStats(def);
|
||||
const L = Math.min(1, Math.max(0, lead));
|
||||
const r = mulberry32(((def.seed ?? 1) ^ 0xf0eca57) >>> 0);
|
||||
|
||||
const band = (v, rel) => {
|
||||
if (L <= 0 || !(v > 0)) return { lo: v, hi: v };
|
||||
const w = v * rel * L;
|
||||
const c = v + (r() * 2 - 1) * w * 0.6; // the centre wanders, seeded
|
||||
return { lo: Math.max(0, Math.min(v, c - w)), hi: Math.max(v, c + w) };
|
||||
};
|
||||
|
||||
// Hail is the garden score (decision 13), so the card has to hint at it — but
|
||||
// a distant forecast shouldn't promise ice it can't see yet.
|
||||
let chance = 'none';
|
||||
if (s.hailSeconds > 0) {
|
||||
if (L > 0.55) chance = 'possible';
|
||||
else chance = s.hailSeconds > 6 ? 'likely' : 'possible';
|
||||
}
|
||||
|
||||
return {
|
||||
lead: L,
|
||||
confidence: 1 - L,
|
||||
sustained: band(s.sustained, FORECAST_SPREAD.sustained),
|
||||
gustPeak: band(s.gustPeak, FORECAST_SPREAD.gustPeak),
|
||||
rain: band(s.rainPeak, FORECAST_SPREAD.rain),
|
||||
rainMmPerHour: band(s.rainPeakMmPerHour, FORECAST_SPREAD.rain),
|
||||
changeAt: s.changeAt == null ? null : band(s.changeAt, FORECAST_SPREAD.changeAt),
|
||||
hail: { chance, seconds: band(s.hailSeconds, FORECAST_SPREAD.hailSeconds) },
|
||||
truth: s,
|
||||
};
|
||||
}
|
||||
|
||||
// ---------- storm JSON validator ----------
|
||||
// Storms are data so design can tune without code (PLAN3D §4) — which means a
|
||||
// typo is a data bug, and data bugs should fail loud, not silently blow calm.
|
||||
|
||||
@ -470,6 +470,10 @@ export function createWorld(scene, opts = {}) {
|
||||
const gltf = await loader.loadAsync(new URL(`../models/${name}.glb`, import.meta.url).href);
|
||||
gltf.scene.traverse((o) => {
|
||||
if (o.isMesh) { o.castShadow = true; o.receiveShadow = true; }
|
||||
// Lane E's optional-node flag: glTF has no visibility bit and Blender's
|
||||
// hide_render does NOT survive export (THREADS [E] 2026-07-17 — the
|
||||
// garden bed drew all three wilt states superimposed for five sprints).
|
||||
if (o.userData?.hidden_by_default) o.visible = false;
|
||||
});
|
||||
return gltf.scene;
|
||||
} catch (err) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
web/world/models/textures/card_gameover.jpg
Normal file
BIN
web/world/models/textures/card_gameover.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
BIN
web/world/models/textures/card_win.jpg
Normal file
BIN
web/world/models/textures/card_win.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
BIN
web/world/models/textures/moon.png
Normal file
BIN
web/world/models/textures/moon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@ -52,6 +52,13 @@ for (const [letter, path] of [
|
||||
['C', './js/tests/c.test.js'],
|
||||
['D', './js/tests/d.test.js'],
|
||||
['E', './js/tests/e.test.js'],
|
||||
// SPRINT6 gate 1. Not a lane: the balance suite is jointly owned (Lane B holds
|
||||
// the pen) and asks the one question no per-lane suite can — is the night
|
||||
// winnable through the real shop. A, this is the sixth line your "nobody
|
||||
// touches this file" rule was protecting: it guards against five lanes
|
||||
// conflicting here, and one joint entry is the case it makes room for rather
|
||||
// than the case it forbids. Revert it if you'd rather own the wiring. — B
|
||||
['BAL', './js/tests/balance.test.js'],
|
||||
]) {
|
||||
try {
|
||||
const mod = await import(path);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user