P17.3: organic fall — per-round landing squash-&-settle (sx, iOS sim)

Give each landing gem a wide-and-short squash-&-settle bounce as it touches
its destination, applied WITHIN the fall so EVERY cascade round bounces
(staggered per column), not only the final whole-move settle.

One envelope, one bounce: land_squash is now LAND_SQUASH_A * squash_envelope
(P15.1) over its normalized window, so the per-round fall bounce and the
settle bounce are the exact same shape. render_fall/render_clear age a
per-column bounce from each column's touch-down instant (fall_landing_frac *
FALL_ANIM_DUR) via the shared rest_squash + delivering_round helpers, so a gem
still in the air draws unsquashed and only a landed gem flattens; the squash
carries across the fall->clear seam.

Double-bounce reconciliation (approach a): drive the bounce from the per-round
fall and DROP the old whole-move "stamp at age 0" settle. The settle stamp is
now BACK-DATED per column (clock - (total - round_land_time)) so render_gems
resumes land_squash exactly where render_fall left off at the render_anim ->
render_gems seam — one continuous bounce, no double-pop.

Amplitude tuned 0.13 -> 0.18 (~13% peak) so the bounce reads while staying
tasteful; durations unchanged, so the cascade-cue snapshots don't churn.
M3TE_ANIM_TIME=0 still reproduces goldens/p6_idle_t0.png (a resting board
carries no landing stamp). New goldens/p17_land.png pins a staggered landing
mid-pour (M3TE_FX=11 ANIM_TIME=1.94). tests/easing.sx gains a landing-instant
section pinning fall_landing_frac / round_land_time; tests/gem_pose.sx stays
green (land_squash values are identical).
This commit is contained in:
swipelab
2026-06-06 12:29:11 +03:00
parent eeffe7a7db
commit 00b126d44c
8 changed files with 197 additions and 16 deletions

View File

@@ -176,6 +176,40 @@ main :: () -> s32 {
if !stg_cascade { fails += 1; }
if !stg_mono { fails += 1; }
// 7. Per-column landing instant (P17.3): `fall_landing_frac` is the LOCAL fall
// progress at which each column finishes its drop — exactly the seam where
// `fall_stagger_t` reaches 1, the moment the landing squash-bounce begins.
// Lock: column 0 lands first at `1 - FALL_STAGGER_MAX`, the last column at
// 1.0; it rises monotonically across columns; at that instant the column's
// stagger progress IS 1 (landed) while a hair earlier it is still < 1 (in
// air). `round_land_time` then maps it onto the move timeline — later for
// each later column, and round k+1's first landing strictly after round k's
// last — so the per-round bounces never run before their gems touch down.
print("== landing instant ==\n");
lf_first := approx(fall_landing_frac(0), 1.0 - FALL_STAGGER_MAX);
lf_last := approx(fall_landing_frac(BOARD_COLS - 1), 1.0);
lf_mono := true;
lf_seam := true;
for 0..BOARD_COLS: (c) {
if c >= 1 and !(fall_landing_frac(c) > fall_landing_frac(c - 1)) { lf_mono = false; }
lf := fall_landing_frac(c);
if !approx(fall_stagger_t(lf, c), 1.0) { lf_seam = false; } // landed at lf
if fall_stagger_t(lf - 0.05, c) >= 1.0 { lf_seam = false; } // still in air just before
}
rlt_col_mono := true;
for 1..BOARD_COLS: (c) {
if !(round_land_time(0, c) > round_land_time(0, c - 1)) { rlt_col_mono = false; }
}
rlt_round_after := round_land_time(1, 0) > round_land_time(0, BOARD_COLS - 1);
print("landing_first {} landing_last {} landing_mono {} landing_seam {} landtime_col_mono {} landtime_round_after {}\n",
lf_first, lf_last, lf_mono, lf_seam, rlt_col_mono, rlt_round_after);
if !lf_first { fails += 1; }
if !lf_last { fails += 1; }
if !lf_mono { fails += 1; }
if !lf_seam { fails += 1; }
if !rlt_col_mono { fails += 1; }
if !rlt_round_after { fails += 1; }
if fails == 0 {
print("ok: easing toolkit endpoints locked + amplitudes bounded\n");
return 0;

View File

@@ -10,4 +10,6 @@ squash_moves true squash_two_sided true squash_bounded true
bounce_ends true peak_amp true peak_loc true overshoots true overshoot_bounded true settles true
== fall stagger bounded ==
stagger_t0 true stagger_t1 true stagger_cascade true stagger_mono true
== landing instant ==
landing_first true landing_last true landing_mono true landing_seam true landtime_col_mono true landtime_round_after true
ok: easing toolkit endpoints locked + amplitudes bounded