{"record":{"id":"fd32684db1c0ac44","repo":"babalae/better-genshin-impact","slug":"error-fd3268","errorCode":null,"errorMessage":"多次中心点识别失败或异常，惯性推算失效，重新传送","messagePattern":"多次中心点识别失败或异常，惯性推算失效，重新传送","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs","lineNumber":1404,"sourceCode":"                double actualDeltaY = newCenterPoint.Y - moveState.CenterPoint.Y;\n                double actualMoveLen = Math.Sqrt(actualDeltaX * actualDeltaX + actualDeltaY * actualDeltaY);\n                double moveRatio = expectedMoveLen > 0 ? actualMoveLen / expectedMoveLen : 0;\n                double moveDirectionCos = GetMoveDirectionCos(predictedDeltaX, predictedDeltaY, actualDeltaX, actualDeltaY);\n                // 如果识别结果和本次拖动的距离/方向明显不一致，则判定为低特征区域误识别，进入盲走推算。\n                if (IsMapMoveRecognitionAnomaly(expectedMoveLen, actualMoveLen, moveRatio, moveDirectionCos, jumpDistance))\n                {\n                    throw new MapPositionNotRecognizedException(\"中心点识别坐标异常跳跃\");\n                }\n\n                moveState = GetMoveMapState(newCenterPoint, x, y, currentZoomLevel);\n                exceptionTimes = 0;\n            }\n            catch (MapPositionNotRecognizedException)\n            {\n                exceptionTimes++;\n                if (exceptionTimes > 5)\n                {\n                    throw new Exception(\"多次中心点识别失败或异常，惯性推算失效，重新传送\");\n                }\n\n                moveState = GetMoveMapState(predictedPoint, x, y, currentZoomLevel);\n            }\n        }\n    }\n\n    private MapMoveState GetMoveMapState(\n        Point2f mapCenterPoint,\n        double x,\n        double y,\n        double currentZoomLevel)\n    {\n        var xOffset = x - mapCenterPoint.X;\n        var yOffset = y - mapCenterPoint.Y;\n        double totalMoveMouseX = _tpConfig.MapScaleFactor * Math.Abs(xOffset) / currentZoomLevel;\n        double totalMoveMouseY = _tpConfig.MapScaleFactor * Math.Abs(yOffset) / currentZoomLevel;\n        double mouseDistance = Math.Sqrt(totalMoveMouseX * totalMoveMouseX + totalMoveMouseY * totalMoveMouseY);","sourceCodeStart":1386,"sourceCodeEnd":1422,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs#L1386-L1422","documentation":"Thrown inside MoveMapToCore when MapPositionNotRecognizedException is caught more than 5 times during the iterative map-panning loop. Each iteration attempts to re-recognize the map center via feature matching; when recognition fails or returns an anomalous jump, the exception counter increments. After 6 failures, inertial prediction alone is deemed unreliable and the method aborts to trigger a re-teleport.","triggerScenarios":"Called from MoveMapToCore's panning loop (up to _tpConfig.MaxIterations). GetPositionFromBigMap throws MapPositionNotRecognizedException repeatedly, or IsMapMoveRecognitionAnomaly detects coordinate jumps. After 6 consecutive failures (exceptionTimes > 5), the Exception is thrown.","commonSituations":"Panning through a low-feature map area (water, uniform terrain) where template matching fails; map assets don't match the in-game appearance due to game version change; display scaling or resolution mismatch corrupting recognition; the map view is partially occluded.","solutions":["Update map matching assets/resources to match the current game version.","Increase the feature-matching search radius or use a different _mapMatchingMethod if available.","Reduce panning step size to keep recognizable features in view.","Enable MapZoomEnabled with appropriate zoom settings so the map shows more detail.","Catch this exception at a higher level and re-initiate the teleport from scratch."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try\n{\n    await task.MoveMapTo(x, y, mapName, finalZoomLevel);\n}\ncatch (Exception ex) when (ex.Message.Contains(\"多次中心点识别失败\"))\n{\n    // Re-teleport to a known position and retry the whole navigation\n    throw; // or handle by re-initiating teleport from a higher level\n}","preventionTips":["Keep map assets updated with the current game version.","Avoid panning through large featureless areas when possible.","Enable MapZoomEnabled so zoom adjustments aid recognition.","Monitor exceptionTimes in logs to detect degrading recognition quality."],"tags":["map-navigation","feature-matching","recognition","retry-exhausted"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}