Commit Graph

2 Commits

Author SHA1 Message Date
type-two
35e871599c THE DIET: 214MB of props become 47MB, and nobody can tell
The prop library was costing players more than it was worth. hunyuan3d
hands back ~120,000 triangles and 1024px textures per object, so a
COOKING POT was a 4MB download — and the fryer bench, which loads a pot,
a basket and a rack, made a phone fetch 13MB before it could show you
anything. Right after shipping touch controls, that is the wrong bill.

scripts/optimise-models.sh: simplify to 10% of the triangles with a
0.002 error bound, textures to 512. Across 51 models that is 214MB →
47MB, and at the distance this game frames anything, the before and
after screenshots are indistinguishable — I checked the pot at full
frame before trusting it on the rest. The fryer bench now costs under
3MB.

The script skips anything already under the threshold, so a second run
cannot grind an optimised mesh into mush; delete the file and re-run
gen-assets.sh to go back to an original.

Regression sweep after: toast scene pristine, grill 9.4, pan 8.0, steak
9.4, bruschetta 9.6, air fryer 9.5, chips 10.0, pasta 10.0, eggs 10.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-26 19:00:47 +10:00
monster
67cfe56bb9 M1: toasting — browning sim, toaster, lever, and the pop
Playable: pick a bread, set the dial, drop the lever, watch it brown, pop it
onto the plate. No timer readout — you go by smell.

- toasting.ts: heat map from real toaster behaviour (element stripes, cool top
  edge where the slice stands proud of the slot, edge falloff, per-run noise
  bias). Moisture must boil off before the crust browns at full rate, so
  sourdough stalls then catches up; sugar browns and burns early.
  Rate is measured against the heat map's actual ~0.77 mean, not guessed:
  power 6 -> golden 0.511 at 10s, verified in-browser.
- Props on a real scale (1 unit ~ 11cm, one slice wide) — the toaster is
  meant to dwarf the bread.
- The pop solves a genuine ballistic arc from slot to plate.

Three bugs found by driving it rather than trusting the compile:
- valueNoise2D read one past its grid at x=w-1, so heatBias was NaN along an
  edge, which poisoned mean browning to NaN — i.e. every judge score would
  have been NaN. Clamped.
- erode() clamped at the field border, so border texels could never erode out
  of the mask and kept those NaNs in scope. Off-grid now counts as outside.
- Timer.connect(document) zeroes dt whenever document.hidden is true, which
  froze the sim solid in an embedded browser. Dropped; rAF already pauses for
  hidden tabs. App.step(dt) is now exposed so the game can be driven
  deterministically for verification.

Also: screen shake was mutating the camera permanently instead of offsetting
it per-render, and the plate's lathe profile touched the axis (degenerate
triangles -> starburst normals) — rebuilt from primitives.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 21:29:51 +10:00