The short ball gets chased, intercept gets legs, the vignette gets corners
Second recorded session: 5 wins and a deuce war to 5-6 — the mode is a contest — but all seven losses shared one signature: the ball died in court 1.4-2m short of him while he ran 0.2-0.5m. Three defects: The pace cut created dying rollers. Slow returns bounce and die at z 18-20, outside intercept's near zone, so nothing chased them, and the rolled-dead rule hands the point to the zombie. They also arrive at his feet below legal contact height — the "ball arrives right at the player" feel. intercept keeps an anyHit candidate now: the earliest reachable point on his half where the ball is still at hitting height, so the assist runs forward onto the short ball. Verified: he sprints z 23 -> 16.4 and meets it at gap ~0. intercept computed reachability with autoAssist — 0 on any fine pointer — so a desktop match's planner answered "home" every time. He had legs, his destination was always the baseline. assistK() is shared by mover and planner now. And the vignette was a radial gradient in a portrait canvas: the circle reaches the corners but hits the side edges at fraction zero — "red pulsing from below" was the bottom edge being the only place it got close. Four linear edge fades now, hugging the rectangle on any aspect. 48 tests, 12 seeds clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a789eb2e9
commit
f37fb93875
5 files changed
+93
-16
No files matched your search
+22
-6
@@ -863,17 +863,33 @@ function onBounce() {
|
||||
// Where should a player run to? Simulate the ball forward and take the first point in
|
||||
// their half at hitting height that they can actually REACH IN TIME; otherwise chase the
|
||||
// deepest hittable point. This is the "every ball is catchable, timing is the skill" contract.
|
||||
// The assist's leg speed — the match floors it (matchAssist) because autoAssist is 0 wherever the
|
||||
// pointer is fine. Shared by the movement block AND intercept below: intercept uses it to decide
|
||||
// which points are reachable, and computing that with autoAssist alone meant a desktop match's
|
||||
// intercept thought NOTHING was reachable and sent the player home every time — he had legs but
|
||||
// his destination was always the baseline centre.
|
||||
export const assistK = () => G.match ? Math.max(TUNE.autoAssist, TUNE.matchAssist) : TUNE.autoAssist;
|
||||
|
||||
function intercept(side) {
|
||||
const ch = side === 'O' ? O : P;
|
||||
const spd = side === 'O' ? TUNE.aiSpeed : TUNE.playerSpeed * TUNE.autoAssist;
|
||||
const spd = side === 'O' ? TUNE.aiSpeed : TUNE.playerSpeed * assistK();
|
||||
let { x, y, z, vx, vy, vz } = ball;
|
||||
const g = ball.g || TUNE.gravity, dt = 0.01;
|
||||
const inZone = side === 'O' ? zz => zz <= ZONE_DEPTH : zz => zz >= COURT.L - ZONE_DEPTH;
|
||||
const home = HOME[side];
|
||||
let fallback = null, deepest = null;
|
||||
let fallback = null, deepest = null, anyHit = null;
|
||||
for (let i = 0; i < 300; i++) {
|
||||
vy -= g * dt; x += vx * dt; y += vy * dt; z += vz * dt;
|
||||
if (y <= 0 && vy < 0) { y = 0; vy = -vy * TUNE.bounceY; vx *= TUNE.bounceXZ; vz *= TUNE.bounceXZ; }
|
||||
// THE SHORT BALL (match): a slow return can bounce and DIE at z 18-20, which never enters the
|
||||
// near zone below — so nothing ever chased it, it rolled dead at the player's feet (below the
|
||||
// legal contact height by then) and the point went to the zombie. Seven of seven recorded
|
||||
// losses. Remember the earliest reachable point ON HIS HALF where the ball is still at hitting
|
||||
// height: running forward onto the short ball is the tennis answer, and now it is the assist's.
|
||||
if (side === 'P' && G.match && !anyHit && i > 5 && z > COURT.netZ && y < 1.6 && y > 0.35) {
|
||||
const pt = { x, z: Math.min(24.5, z) };
|
||||
if (Math.hypot(pt.x - ch.x, pt.z - ch.z) / spd <= i * dt) anyHit = pt;
|
||||
}
|
||||
if (i > 5 && inZone(z) && y < 1.6 && y > 0.3) {
|
||||
const pt = { x, z: side === 'O' ? Math.max(0.8, z) : Math.min(24.5, z) };
|
||||
const reachable = Math.hypot(pt.x - ch.x, pt.z - ch.z) / spd <= i * dt;
|
||||
@@ -882,7 +898,7 @@ function intercept(side) {
|
||||
deepest = pt; // last resort: run at the deepest hittable point
|
||||
}
|
||||
}
|
||||
return fallback || deepest || home;
|
||||
return fallback || deepest || anyHit || home; // zone points first: meeting deep is still better
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------- miss diagnostics ----
|
||||
@@ -1316,13 +1332,13 @@ export function update(dt) {
|
||||
// desktop Browser pane (pointer: fine) had NO auto-run at all — the flight recorder showed
|
||||
// Oliver swinging in every lost point while his x never moved: a statue with a racket. The
|
||||
// match is a tap-timing game; footwork is the game's job. Held keys still override (mx/mz).
|
||||
const assistK = G.match ? Math.max(TUNE.autoAssist, TUNE.matchAssist) : TUNE.autoAssist;
|
||||
if (!mx && !mz && assistK > 0 && ball.active && !G.horde && !(G.mgT > 0)) { // auto-fire: you aim by hand, no assist
|
||||
const aK = assistK();
|
||||
if (!mx && !mz && aK > 0 && ball.active && !G.horde && !(G.mgT > 0)) { // auto-fire: you aim by hand, no assist
|
||||
// splatter: anything travelling back toward you is yours to run down — your own rebound
|
||||
// included. The assist puts you there; the volley timing stays honest.
|
||||
const chasing = ball.lastHit === 'O' || (G.mode === 'splatter' && !G.interlude && ball.vz > 0);
|
||||
// no `slow` here: tapping must not freeze your legs, or anticipating a shot loses it
|
||||
const rate = TUNE.playerSpeed * assistK * dt * (chasing ? 1 : 0.55);
|
||||
const rate = TUNE.playerSpeed * aK * dt * (chasing ? 1 : 0.55);
|
||||
// Run to the ball — then recover. WHERE you recover to is mode-specific and each rule exists
|
||||
// for a reason:
|
||||
// GORE SPLATTER recovers in DEPTH ONLY, holding your lane — recovering to HOME.P's x undid
|
||||
|
||||
+19
-9
@@ -1971,16 +1971,26 @@ export function render() {
|
||||
const dmg = 1 - Math.max(0, G.hp) / (G.hpMax || 1);
|
||||
const pulse = G.hurtFlash > 0 ? Math.min(1, G.hurtFlash / 0.3) * 0.3 : 0;
|
||||
if (dmg > 0 || pulse > 0) {
|
||||
// SQRT of the damage, not the damage: the match pool is 8, so a linear curve made the first
|
||||
// hit a 10% alpha nobody can see — "the vignette is basically invisible". sqrt front-loads it:
|
||||
// hit one on 8 hp reads at ~0.3 alpha, and it still deepens all the way to the cap. The inner
|
||||
// radius tightens with damage too, so deep wounds shrink the clean centre.
|
||||
// FOUR EDGE FADES, not a radial. A radial gradient in a tall portrait canvas reaches the
|
||||
// corners but arrives at the side edges at fraction ZERO — Oliver saw "a slight red pulsing
|
||||
// from below" because the bottom edge was the only place the circle got close. Linear fades
|
||||
// hug the actual rectangle on any aspect. sqrt(dmg) front-loads the curve (the match pool is
|
||||
// 8, so linear made hit one an invisible 10%), and the inset DEEPENS with damage so wounds
|
||||
// shrink the clean centre.
|
||||
const a = Math.min(0.85, Math.sqrt(dmg) * 0.8 + pulse);
|
||||
const g = ctx.createRadialGradient(W / 2, H / 2, Math.min(W, H) * (0.5 - dmg * 0.22),
|
||||
W / 2, H / 2, Math.max(W, H) * 0.7);
|
||||
g.addColorStop(0, 'rgba(120,8,12,0)');
|
||||
g.addColorStop(1, `rgba(120,8,12,${a.toFixed(3)})`);
|
||||
ctx.fillStyle = g; ctx.fillRect(0, 0, W, H);
|
||||
const col = k => `rgba(120,8,12,${(a * k).toFixed(3)})`;
|
||||
const D = Math.round(Math.min(W, H) * (0.2 + 0.32 * dmg));
|
||||
for (const [x0, y0, x1, y1, w, h, gx, gy] of [
|
||||
[0, 0, 0, D, W, D, 0, 1], // top
|
||||
[0, H, 0, H - D, W, D, 0, -1], // bottom
|
||||
[0, 0, D, 0, D, H, 1, 0], // left
|
||||
[W, 0, W - D, 0, D, H, -1, 0], // right
|
||||
]) {
|
||||
const g = ctx.createLinearGradient(x0, y0, x1, y1);
|
||||
g.addColorStop(0, col(1)); g.addColorStop(1, col(0));
|
||||
ctx.fillStyle = g;
|
||||
ctx.fillRect(gx < 0 ? W - D : 0, gy < 0 ? H - D : 0, w, h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user