babalae/better-genshin-impact · error · Exception

多次中心点识别失败或异常,惯性推算失效,重新传送

Error message

多次中心点识别失败或异常,惯性推算失效,重新传送

What it means

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.

Source

Thrown at BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs:1404

                double actualDeltaY = newCenterPoint.Y - moveState.CenterPoint.Y;
                double actualMoveLen = Math.Sqrt(actualDeltaX * actualDeltaX + actualDeltaY * actualDeltaY);
                double moveRatio = expectedMoveLen > 0 ? actualMoveLen / expectedMoveLen : 0;
                double moveDirectionCos = GetMoveDirectionCos(predictedDeltaX, predictedDeltaY, actualDeltaX, actualDeltaY);
                // 如果识别结果和本次拖动的距离/方向明显不一致,则判定为低特征区域误识别,进入盲走推算。
                if (IsMapMoveRecognitionAnomaly(expectedMoveLen, actualMoveLen, moveRatio, moveDirectionCos, jumpDistance))
                {
                    throw new MapPositionNotRecognizedException("中心点识别坐标异常跳跃");
                }

                moveState = GetMoveMapState(newCenterPoint, x, y, currentZoomLevel);
                exceptionTimes = 0;
            }
            catch (MapPositionNotRecognizedException)
            {
                exceptionTimes++;
                if (exceptionTimes > 5)
                {
                    throw new Exception("多次中心点识别失败或异常,惯性推算失效,重新传送");
                }

                moveState = GetMoveMapState(predictedPoint, x, y, currentZoomLevel);
            }
        }
    }

    private MapMoveState GetMoveMapState(
        Point2f mapCenterPoint,
        double x,
        double y,
        double currentZoomLevel)
    {
        var xOffset = x - mapCenterPoint.X;
        var yOffset = y - mapCenterPoint.Y;
        double totalMoveMouseX = _tpConfig.MapScaleFactor * Math.Abs(xOffset) / currentZoomLevel;
        double totalMoveMouseY = _tpConfig.MapScaleFactor * Math.Abs(yOffset) / currentZoomLevel;
        double mouseDistance = Math.Sqrt(totalMoveMouseX * totalMoveMouseX + totalMoveMouseY * totalMoveMouseY);

View on GitHub (pinned to a7cb36712d)

Solutions

  1. Update map matching assets/resources to match the current game version.
  2. Increase the feature-matching search radius or use a different _mapMatchingMethod if available.
  3. Reduce panning step size to keep recognizable features in view.
  4. Enable MapZoomEnabled with appropriate zoom settings so the map shows more detail.
  5. Catch this exception at a higher level and re-initiate the teleport from scratch.
Defensive patterns

Strategy: try-catch

Try / catch

try
{
    await task.MoveMapTo(x, y, mapName, finalZoomLevel);
}
catch (Exception ex) when (ex.Message.Contains("多次中心点识别失败"))
{
    // Re-teleport to a known position and retry the whole navigation
    throw; // or handle by re-initiating teleport from a higher level
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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