{"record":{"id":"a7be4c58f6fb5264","repo":"babalae/better-genshin-impact","slug":"error-a7be4c","errorCode":null,"errorMessage":"初始识别失败且切换区域后依然无效","messagePattern":"初始识别失败且切换区域后依然无效","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs","lineNumber":1534,"sourceCode":"\n        var jumpedCenterPoint = await ForceJumpToTargetArea(x, y, mapName);\n        if (jumpedCenterPoint != null)\n        {\n            return (GetMoveMapState(jumpedCenterPoint.Value, x, y, recoveredState.ZoomLevel), recoveredState.ZoomLevel);\n        }\n\n        if (TryGetRecognizedMoveMapState(mapName, x, y, recoveredState.ZoomLevel, out moveState))\n        {\n            return (moveState, recoveredState.ZoomLevel);\n        }\n\n        recoveredState = await TryRecoverMoveMapStateByZoom(mapName, x, y, recoveredState.ZoomLevel);\n        if (recoveredState.Success)\n        {\n            return (recoveredState.MoveState, recoveredState.ZoomLevel);\n        }\n\n        throw new Exception(\"初始识别失败且切换区域后依然无效\");\n    }\n\n    private async Task<(bool Success, MapMoveState MoveState, double ZoomLevel)> TryRecoverMoveMapStateByZoom(\n        string mapName,\n        double x,\n        double y,\n        double currentZoomLevel)\n    {\n        if (!_tpConfig.MapZoomEnabled)\n        {\n            return (false, default, currentZoomLevel);\n        }\n\n        var targetZoomLevel = GetMapPositionRecognitionRecoveryZoomLevel(currentZoomLevel, mapName);\n        if (IsZoomCloseEnough(currentZoomLevel, targetZoomLevel))\n        {\n            return (false, default, currentZoomLevel);\n        }","sourceCodeStart":1516,"sourceCodeEnd":1552,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs#L1516-L1552","documentation":"Thrown by GetInitialMoveMapState when all strategies to obtain the starting map position fail: initial recognition, zoom-based recovery, force-jump to the target area, then a second round of recognition and zoom recovery all return failure. This is the initial state acquisition before panning begins, so if the map can't be located at all, the operation cannot proceed.","triggerScenarios":"Called from MoveMapToCore → GetInitialMoveMapState. TryGetRecognizedMoveMapState fails, TryRecoverMoveMapStateByZoom fails (or MapZoomEnabled is false), ForceJumpToTargetArea returns null, and the second attempt at both recognition and zoom recovery also fails.","commonSituations":"Game is not on the big map screen when the method starts; map area assets are corrupted or outdated; the target map region is in an area not covered by assets; display resolution/scaling prevents recognition.","solutions":["Ensure the big map is fully open and rendered before invoking the teleport task.","Verify map assets are up to date for the current game version.","Enable MapZoomEnabled in the teleport config so zoom-based recovery can be attempted.","Check that the target coordinates fall within a known/loaded map region.","Restart the task after ensuring the game is in the correct map UI state."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before calling, verify the game is on the big map\nusing var ra = task.CaptureToRectArea();\nusing var btn = ra.Find(task.GetQuickTeleportRecognitionObject(\"MapScaleButton\", ra));\nif (!btn.IsExist())\n{\n    // Open the map first\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await task.MoveMapTo(x, y, mapName);\n}\ncatch (Exception ex) when (ex.Message == \"初始识别失败且切换区域后依然无效\")\n{\n    Logger.LogError(\"Failed to acquire initial map position. Ensure the big map is open.\");\n    throw;\n}","preventionTips":["Ensure the big map UI is fully open before starting navigation.","Keep map assets updated for the current game version.","Enable MapZoomEnabled for zoom-based recovery options.","Verify the target coordinates are in a loaded map region."],"tags":["map-navigation","initialization","recognition","zoom-recovery"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}