babalae/better-genshin-impact · error · HandledException

目标距离过远,可能是当前点位无法识别,放弃此路径!

Error message

目标距离过远,可能是当前点位无法识别,放弃此路径!

What it means

Sibling of [281], thrown from the same retry block when distanceTooFarRetryCount > 50 but the position WAS recognized (non-origin). It logs the exact from→to coordinates and distance, then aborts the path because, despite knowing where the avatar is, it never closed the >500-unit gap after 50 iterations. Typically indicates the pathing logic or movement simulation is fighting an obstacle.

Source

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

            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);
                            Logger.LogInformation($"重置到上次正确识别的坐标 ({prevNotTooFarPosition.X},{prevNotTooFarPosition.Y})");
                            Navigation.SetPrevPosition(prevNotTooFarPosition.X, prevNotTooFarPosition.Y);
                            // 淡入淡出特效
                            await Delay(500, ct);
                        }

View on GitHub (pinned to a7cb36712d)

Solutions

  1. Inspect the logged from→to coordinates and relocate the offending waypoint in the path JSON to an accessible tile.
  2. Verify the avatar is not in combat/swimming/climbing state at the failure point (close combat, stand on flat ground first).
  3. Recalibrate movement by restarting the route from a closer teleport point.
  4. Increase game FPS / disable vsync stalls so Sleep(50) movement steps deliver full input.
  5. If the route is known-good, retry once — transient physics stalls do occur.
Defensive patterns

Strategy: try-catch

Try / catch

try { await pathExecutor.Execute(ct); }
catch (HandledException e) when (e.Message.Contains("目标距离过远"))
{ Logger.LogWarning("路径受阻跳过:{Msg}", e.Message); /* record waypoint, continue */ }

Prevention

When it happens

Trigger: Avatar stuck against terrain/wall/cliff the straight-line tracker cannot route around; underwater/in-combat forced slow walk; waypoint placed inside an inaccessible cell; anti-cheat or animation lock preventing movement; mouse-move rotation drift from miscalibrated angleOffset.

Common situations: Custom JSON path authored with a waypoint inside terrain; character encumbered (glider deployed, swimming, climbing); FPS drops causing SendInput movement to underdeliver; game running at low frame rate so Sleep-based delays misfire.

Related errors


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