From 57faab9349ba218b1fc72b2d7357df77a899b3e5 Mon Sep 17 00:00:00 2001 From: averagenative Date: Sat, 12 Sep 2026 11:57:31 -0400 Subject: [PATCH] Disable the oscillator correction: it makes the preview jump at every turn c3b3479 shipped this unvalidated and it is worse than what it replaced. On a real run the preview leaps between the strongest and weakest shot, which makes the thing it exists to help -- knowing when to release -- harder, not easier. Measured on a recording of that run: 34 sign flips in cos between consecutive frames and 17 jumps of over 0.5, the worst going +0.946 to -0.955 across one frame boundary as the platform reversed. The reasoning in that commit was wrong in a specific way. It argued the failure was self-limiting -- "near the turning points the direction cannot be read, but that is also where cos is near zero, so falling back costs almost nothing". That holds only if y0 and amp are right. They are taken from observed min/max, which is outlier-sensitive and drifts as the detector picks different rows of the sliding platform, so at the observed reversal sin was 0.288 rather than ~1, |cos| was 0.957, and the sign flip cost the entire correction twice over. Recovering cos as sign(dy)*sqrt(1-sin^2) is the wrong shape of estimator for this: it is discontinuous exactly where the platform spends most of its visible time. The physics in c3b3479 is still right -- platform height and release velocity really are one oscillator in quadrature -- but the phase has to be estimated as a phase. The period is known exactly (G16[0] += 1.3 per 20ms and phi = 1.1*G16[0] deg, so 5.035 s), which makes platY = y0 + A*sin(wt) + B*cos(wt) a linear least squares fit over a window, with cos(phi) falling out of A and B continuously and with no sign to guess. shotA stays derived and the per-flight fit stays on the probe, so the data needed to validate the replacement is still being collected. Co-Authored-By: Claude Opus 5 (1M context) --- idleon-hoops.user.js | 17 +++++++++++++++-- idleon-suite.user.js | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/idleon-hoops.user.js b/idleon-hoops.user.js index b972aeb..0d49c8a 100644 --- a/idleon-hoops.user.js +++ b/idleon-hoops.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name IdleOn Hoops Helper // @namespace nativerobot -// @version 1.11 +// @version 1.12 // @downloadURL https://raw.githubusercontent.com/averagenative/idleon-userscripts/main/idleon-hoops.user.js // @updateURL https://raw.githubusercontent.com/averagenative/idleon-userscripts/main/idleon-hoops.user.js // @description Dotted-line shot preview + live ball arc for the Swishy Hoops minigame in Legends of IdleOn @@ -1090,7 +1090,20 @@ // exactly when you need it to line up the next shot. if (cfg.ghost && plat && ready) { const dir = lastRim ? Math.sign(lastRim.x - plat.x) || 1 : 1; - const curve = shotCurve(plat.x, plat.y, dir, W, cosPhi); + // DISABLED pending a correct phase estimate -- see platCos(). Deriving + // cos from |sin| plus a direction-of-travel sign makes the arc JUMP at + // every turning point: measured on a real run, 34 sign flips and 17 + // jumps of over 0.5 in cos, the worst going +0.946 -> -0.955 between two + // frames. That is the preview leaping between the strongest and weakest + // shot, which is worse than no correction at all. + // + // The reasoning that said this was safe -- "near the turning points cos + // is near zero, so a wrong sign costs little" -- was wrong. It holds only + // if y0 and amp are right, and they are not: taken from observed min/max + // they are outlier-sensitive, and the detector picks different rows of + // the platform as it slides. At the observed reversal sin was 0.288, so + // |cos| was 0.957 and the flip cost everything. + const curve = shotCurve(plat.x, plat.y, dir, W, null); // Start the line directly above the platform rather than at the curve's // left crossing: that crossing is ~0.18 of a screen to the left, which // ran off the edge and made the arc appear to fly in from nowhere. diff --git a/idleon-suite.user.js b/idleon-suite.user.js index b825af9..b765e7a 100644 --- a/idleon-suite.user.js +++ b/idleon-suite.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name IdleOn Helper Suite // @namespace nativerobot -// @version 1.32 +// @version 1.33 // @downloadURL https://raw.githubusercontent.com/averagenative/idleon-userscripts/main/idleon-suite.user.js // @updateURL https://raw.githubusercontent.com/averagenative/idleon-userscripts/main/idleon-suite.user.js // @description All-in-one: autoclicker + Hoops, Fishing and Darts minigame helpers for Legends of IdleOn, each one individually switchable @@ -1515,7 +1515,20 @@ // exactly when you need it to line up the next shot. if (cfg.ghost && plat && ready) { const dir = lastRim ? Math.sign(lastRim.x - plat.x) || 1 : 1; - const curve = shotCurve(plat.x, plat.y, dir, W, cosPhi); + // DISABLED pending a correct phase estimate -- see platCos(). Deriving + // cos from |sin| plus a direction-of-travel sign makes the arc JUMP at + // every turning point: measured on a real run, 34 sign flips and 17 + // jumps of over 0.5 in cos, the worst going +0.946 -> -0.955 between two + // frames. That is the preview leaping between the strongest and weakest + // shot, which is worse than no correction at all. + // + // The reasoning that said this was safe -- "near the turning points cos + // is near zero, so a wrong sign costs little" -- was wrong. It holds only + // if y0 and amp are right, and they are not: taken from observed min/max + // they are outlier-sensitive, and the detector picks different rows of + // the platform as it slides. At the observed reversal sin was 0.288, so + // |cos| was 0.957 and the flip cost everything. + const curve = shotCurve(plat.x, plat.y, dir, W, null); // Start the line directly above the platform rather than at the curve's // left crossing: that crossing is ~0.18 of a screen to the left, which // ran off the edge and made the arc appear to fly in from nowhere.