babalae/better-genshin-impact · error · HandledException

重试多次后,当前点位无法被识别,放弃此路径!

Error message

重试多次后,当前点位无法被识别,放弃此路径!

What it means

A HandledException thrown inside PathExecutor's waypoint-approach loop. It fires only when the avatar's recognized position equals Point2f(0,0) — i.e. the navigation system could not localize the player — after distanceTooFarRetryCount already exceeded 50 (>500 units away on every attempt). The 'origin' position is the sentinel for 'localization failed', so this means 50 consecutive iterations where the minimap/template matcher returned nothing usable.

Source

Thrown at BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs:834

            {
                Logger.LogDebug("到达路径点附近");
                break;
            }

            if (distance > 500)
            {
                if (pathExecutorSuspend.CheckAndResetSuspendPoint())
                {
                    throw new RetryNoCountException("可能暂停导致路径过远,重试一次此路线!");
                }
                else
                {
                    distanceTooFarRetryCount++;
                    if (distanceTooFarRetryCount > 50)
                    {
                        if (position == new Point2f())
                        {
                            throw new HandledException("重试多次后,当前点位无法被识别,放弃此路径!");
                        }
                        else
                        {
                            Logger.LogWarning($"距离过远({position.X},{position.Y})->({waypoint.X},{waypoint.Y})={distance},重试多次后仍然失败,放弃此路径点!");
                            throw new HandledException("目标距离过远,可能是当前点位无法识别,放弃此路径!");
                        }
                    }
                    else
                    {
                        // 取余减少日志输出频率
                        if (distanceTooFarRetryCount % 5 == 0)
                        {
                            Logger.LogWarning($"距离过远({position.X},{position.Y})->({waypoint.X},{waypoint.Y})={distance},重试");
                        }
                        // 取余减少判断频率
                        if (distanceTooFarRetryCount % 10 == 0)
                        {
                            await ResolveAnomalies(screen);

View on GitHub (pinned to a7cb36712d)

Solutions

  1. Ensure the game stays on the main world view (no menus/dialogue/cutscenes) during pathing.
  2. Reduce concurrent overlays (transparent mask window, debug drawing) that can occlude the minimap region GetMiniMapMat reads.
  3. Confirm the capture pipeline produces valid frames (check TaskContext capture FPS / hook health) before pathing.
  4. If recurring at a known waypoint, add a manual teleport/suspend point so the route re-localizes earlier.
  5. Tune the retry budget (distanceTooFarRetryCount > 50) or lower the distance threshold (500) for unstable capture environments.

Example fix

// before
if (distanceTooFarRetryCount > 50)
{
    if (position == new Point2f())
        throw new HandledException("重试多次后,当前点位无法被识别,放弃此路径!");
}

// after: re-localize via TpTask to nearest goddess before giving up
if (distanceTooFarRetryCount > 50)
{
    if (position == new Point2f())
    {
        Logger.LogWarning("定位持续失败,尝试传送至最近神像重新定位");
        throw new RetryNoCountException("定位失败,重试整条路线"); // lets outer loop re-TP
    }
}
Defensive patterns

Strategy: try-catch

Try / catch

try { await pathExecutor.Execute(ct); }
catch (HandledException e) when (e.Message.Contains("当前点位无法被识别"))
{ Logger.LogWarning("定位失败,跳过本路径:{Msg}", e.Message); /* skip path, continue task */ }

Prevention

When it happens

Trigger: Avatar is obscured (loading screen, teleport fade, cutscene, dialogue) for the full retry window; minimap occluded by UI overlay; CharacterOrientation / Navigation.GetPosition returning Point2f() because the capture region never matches expected templates; game left the main world view during a long path.

Common situations: Path crosses a domain entrance or cutscene trigger; player manually opened a menu mid-run; anti-aliasing/rendering changes broke the position template; running while a loading screen stalls; capture device/HDR desync producing blank frames.

Related errors


AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13). Data as JSON: /api/errors/f8349df082238fd0. Report an issue: GitHub.