{"record":{"id":"f8349df082238fd0","repo":"babalae/better-genshin-impact","slug":"error-f8349d","errorCode":null,"errorMessage":"重试多次后，当前点位无法被识别，放弃此路径！","messagePattern":"重试多次后，当前点位无法被识别，放弃此路径！","errorType":"exception","errorClass":"HandledException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs","lineNumber":834,"sourceCode":"            {\n                Logger.LogDebug(\"到达路径点附近\");\n                break;\n            }\n\n            if (distance > 500)\n            {\n                if (pathExecutorSuspend.CheckAndResetSuspendPoint())\n                {\n                    throw new RetryNoCountException(\"可能暂停导致路径过远，重试一次此路线！\");\n                }\n                else\n                {\n                    distanceTooFarRetryCount++;\n                    if (distanceTooFarRetryCount > 50)\n                    {\n                        if (position == new Point2f())\n                        {\n                            throw new HandledException(\"重试多次后，当前点位无法被识别，放弃此路径！\");\n                        }\n                        else\n                        {\n                            Logger.LogWarning($\"距离过远（{position.X},{position.Y}）->（{waypoint.X},{waypoint.Y}）={distance}，重试多次后仍然失败，放弃此路径点！\");\n                            throw new HandledException(\"目标距离过远，可能是当前点位无法识别，放弃此路径！\");\n                        }\n                    }\n                    else\n                    {\n                        // 取余减少日志输出频率\n                        if (distanceTooFarRetryCount % 5 == 0)\n                        {\n                            Logger.LogWarning($\"距离过远（{position.X},{position.Y}）->（{waypoint.X},{waypoint.Y}）={distance}，重试\");\n                        }\n                        // 取余减少判断频率\n                        if (distanceTooFarRetryCount % 10 == 0)\n                        {\n                            await ResolveAnomalies(screen);","sourceCodeStart":816,"sourceCodeEnd":852,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs#L816-L852","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the game stays on the main world view (no menus/dialogue/cutscenes) during pathing.","Reduce concurrent overlays (transparent mask window, debug drawing) that can occlude the minimap region GetMiniMapMat reads.","Confirm the capture pipeline produces valid frames (check TaskContext capture FPS / hook health) before pathing.","If recurring at a known waypoint, add a manual teleport/suspend point so the route re-localizes earlier.","Tune the retry budget (distanceTooFarRetryCount > 50) or lower the distance threshold (500) for unstable capture environments."],"exampleFix":"// before\nif (distanceTooFarRetryCount > 50)\n{\n    if (position == new Point2f())\n        throw new HandledException(\"重试多次后，当前点位无法被识别，放弃此路径！\");\n}\n\n// after: re-localize via TpTask to nearest goddess before giving up\nif (distanceTooFarRetryCount > 50)\n{\n    if (position == new Point2f())\n    {\n        Logger.LogWarning(\"定位持续失败，尝试传送至最近神像重新定位\");\n        throw new RetryNoCountException(\"定位失败，重试整条路线\"); // lets outer loop re-TP\n    }\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await pathExecutor.Execute(ct); }\ncatch (HandledException e) when (e.Message.Contains(\"当前点位无法被识别\"))\n{ Logger.LogWarning(\"定位失败，跳过本路径：{Msg}\", e.Message); /* skip path, continue task */ }","preventionTips":["Keep the game on the main world view (no menus/cutscenes) during pathing.","Add suspend/teleport waypoints at points where localization historically fails.","Monitor capture FPS; abort pathing early if frames drop, before retry exhaustion."],"tags":["path-tracking","position-recognition","retry-exhaustion","cv"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}