From 1a0a6376e0965126fe407f33b3b92db015aac473 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Tue, 4 Aug 2026 18:48:52 -0700 Subject: [PATCH] Cull off-camera OSKIEWAR ball triangles --- xbox/live/hello.js | 7 +++++++ xbox/live/tests/hello.test.mjs | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/xbox/live/hello.js b/xbox/live/hello.js index f28626067e..503225a50e 100644 --- a/xbox/live/hello.js +++ b/xbox/live/hello.js @@ -2547,6 +2547,13 @@ function paint() { const accent = players[ball.spawnOwner]?.color || [255, 105, 190]; const point = projectPoint(ball.x, ball.y, ball.z); const radius = Math.max(8, ball.radius * cameraScale()); + // Death-camera perspective can put a distant ball behind the camera and + // produce enormous projected coordinates. It is intentionally allowed to + // leave frame, so cull it before submitting triangles to the native GPU. + if (!Number.isFinite(point.x) || !Number.isFinite(point.y) || + !Number.isFinite(radius) || point.x + radius < 0 || + point.x - radius > 1920 || point.y + radius < 0 || + point.y - radius > 1080) continue; const palette = [accent, [255, 105, 190], [111, 232, 210], [255, 232, 92], [130, 150, 255], [245, 248, 255]]; const sides = 12; diff --git a/xbox/live/tests/hello.test.mjs b/xbox/live/tests/hello.test.mjs index 6a16733bae..6bc800c6bb 100644 --- a/xbox/live/tests/hello.test.mjs +++ b/xbox/live/tests/hello.test.mjs @@ -20,7 +20,7 @@ function createFight(startImmediately = true, enterGame = true, }; const fight = new Function( "runtime", "gamepad", "capabilities", "telemetry", "gameSignal", "saveReplay", "publishLive", "drum", "wipe", "box", "line", "triangle", "write", "systemWrite", - `${source}\nreturn { boot, sim, paint, controlLocale, players, ball, balls, bullets, grenades, gunPickups, grenadePickups, runnerWorldGeometry, runnerDistanceToPoint, disableBall: () => { ballEnabled = false; for (const item of balls) item.active = false; }, enableBall: (index = 0) => { ballEnabled = true; const item = balls[index]; item.active = true; item.serveAt = 0; item.safeUntil = 0; item.safePlayers = 0; }, setWind: (value) => { windAcceleration = value; }, windState: () => ({ direction: windDirection, mph: windMph }), nextRound: () => resetRound(runtime().monotonicUs, false), wackBall: () => { players[0].attackKind = "KICK"; returnBall(ball, players[0], runtime().monotonicUs, false); }, shieldBall: () => returnBall(ball, players[0], runtime().monotonicUs, true), crossWackBall: (contact = 1) => crossWackBall(ball, players.map((player) => ({ player, contact })), runtime().monotonicUs), enterGame: () => enterShellMode("GAME", runtime().monotonicUs), shellState: () => ({ mode: shellMode, choice: shellChoice, lab: labPlayers.map((player) => ({ ...player })) }), startFight: () => { shellMode = "GAME"; selecting = false; startReplay(runtime().monotonicUs); resetRound(runtime().monotonicUs, true); }, selectionState: () => ({ selecting, ready: selectionReady.slice() }), cameraState: () => ({ cameraWidth, cameraCenter, cameraCenterY }), roundState: () => ({ roundResult, roundElapsedUs, matchOver }), instantReplayState: () => instantReplay ? { active: true, paused: instantReplay.paused, cursor: instantReplay.cursor, frames: instantReplay.frames.length } : { active: false }, replayFrameCount: () => roundReplayFrames.length };` + `${source}\nreturn { boot, sim, paint, controlLocale, players, ball, balls, bullets, grenades, gunPickups, grenadePickups, runnerWorldGeometry, runnerDistanceToPoint, disableBall: () => { ballEnabled = false; for (const item of balls) item.active = false; }, enableBall: (index = 0) => { ballEnabled = true; const item = balls[index]; item.active = true; item.serveAt = 0; item.safeUntil = 0; item.safePlayers = 0; }, setWind: (value) => { windAcceleration = value; }, windState: () => ({ direction: windDirection, mph: windMph }), nextRound: () => resetRound(runtime().monotonicUs, false), knockOut: () => killPlayer(players[1], 0, runtime().monotonicUs, "KO"), wackBall: () => { players[0].attackKind = "KICK"; returnBall(ball, players[0], runtime().monotonicUs, false); }, shieldBall: () => returnBall(ball, players[0], runtime().monotonicUs, true), crossWackBall: (contact = 1) => crossWackBall(ball, players.map((player) => ({ player, contact })), runtime().monotonicUs), enterGame: () => enterShellMode("GAME", runtime().monotonicUs), shellState: () => ({ mode: shellMode, choice: shellChoice, lab: labPlayers.map((player) => ({ ...player })) }), startFight: () => { shellMode = "GAME"; selecting = false; startReplay(runtime().monotonicUs); resetRound(runtime().monotonicUs, true); }, selectionState: () => ({ selecting, ready: selectionReady.slice() }), cameraState: () => ({ cameraWidth, cameraCenter, cameraCenterY }), roundState: () => ({ roundResult, roundElapsedUs, matchOver }), instantReplayState: () => instantReplay ? { active: true, paused: instantReplay.paused, cursor: instantReplay.cursor, frames: instantReplay.frames.length } : { active: false }, replayFrameCount: () => roundReplayFrames.length };` )( () => ({ monotonicUs: now, unixMs: 1785870000000 + Math.floor(now / 1000) }), (index = 0) => ({ ...pads[index], down: pads[index].down.slice() }), @@ -145,6 +145,20 @@ test("perspective intro never submits invalid ground triangles", () => { assert.equal(triangles.length % 144, 0); }); +test("death camera culls balls that project outside native triangle bounds", () => { + const { fight, tick } = createFight(); + fight.enableBall(); + fight.ball.x = 100; + fight.ball.y = 11958; + fight.ball.z = 0; + fight.knockOut(); + tick(); + for (let frame = 0; frame < 120; frame++) { + tick(16667); + fight.paint(); + } +}); + test("melee and movement edges emit bounded Ableton signals", () => { const { signals, tap } = createFight(); tap(0, "A"); -- 2.51.2