{"record":{"id":"e0dcc164b33baba1","repo":"babalae/better-genshin-impact","slug":"error-e0dcc1","errorCode":null,"errorMessage":"多次重试后，识别大地图位置失败","messagePattern":"多次重试后，识别大地图位置失败","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs","lineNumber":2114,"sourceCode":"                catch (Exception)\n                {\n                    rect = default; // 发生异常视为识别失败\n                }\n\n                if (rect == default)\n                {\n                    throw new RetryException(\"识别大地图位置失败\");\n                }\n            }\n            else\n            {\n                throw new RetryException(\"当前不在地图界面\");\n            }\n        }, TimeSpan.FromMilliseconds(BigMapRectRetryIntervalMs), 5);\n\n        if (rect == default)\n        {\n            throw new InvalidOperationException(\"多次重试后，识别大地图位置失败\");\n        }\n\n        // 提瓦特大陆由于用的256的图，需要做特殊逻辑\n        if (mapName == MapTypes.Teyvat.ToString())\n        {\n            const int s = TeyvatMap.BigMap256ScaleTo2048; // 相对2048做8倍缩放\n            rect = new Rect(rect.X * s, rect.Y * s, rect.Width * s, rect.Height * s);\n        }\n\n        return MapManager.GetMap(mapName, _mapMatchingMethod).ConvertImageCoordinatesToGenshinMapCoordinates(rect)!.Value;\n    }\n\n    public Point2f GetBigMapCenterPoint(string mapName)\n    {\n        return GetBigMapCenterPoint(mapName, null);\n    }\n\n    private Point2f GetBigMapCenterPoint(string mapName, Point2f? expectedCenterPoint)","sourceCodeStart":2096,"sourceCodeEnd":2132,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs#L2096-L2132","documentation":"Thrown by GetBigMapRect after NewRetry.Do exhausts 5 retry attempts (each at BigMapRectRetryIntervalMs interval) and the recognized rect is still default. The retry body throws RetryException for two reasons: either the MapScaleButton isn't found (not on map interface) or MapManager.GetMap(...).GetBigMapRect returns default. After all retries, the outer check throws InvalidOperationException.","triggerScenarios":"Called from GetBigMapRect(mapName). The retry callback either finds no MapScaleButton (not on map screen) or GetBigMapRect returns default rect due to feature matching failure, for 5 consecutive attempts.","commonSituations":"Game not navigated to the big map before calling; map UI animation still loading; map assets mismatched with current game version; low-resolution or scaled capture preventing template matching; the wrong mapName is passed.","solutions":["Ensure the big map UI is fully loaded and visible before calling GetBigMapRect.","Verify mapName matches a loaded/available map type.","Increase BigMapRectRetryIntervalMs or retry count if the game is slow to render.","Check that map recognition assets are current for the installed game version.","Ensure the capture resolution matches the expected game window size."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    var rect = task.GetBigMapRect(mapName);\n}\ncatch (InvalidOperationException ex) when (ex.Message == \"多次重试后，识别大地图位置失败\")\n{\n    Logger.LogError($\"Big map rect recognition failed for {mapName}. Ensure the map is open.\");\n    throw;\n}","preventionTips":["Ensure the big map is fully rendered before calling GetBigMapRect.","Keep map recognition assets current with the game version.","Verify the capture resolution matches expected dimensions.","Increase retry interval if the game renders slowly."],"tags":["map-navigation","feature-matching","retry-exhausted","game-ui"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}