babalae/better-genshin-impact · error · MapPositionNotRecognizedException
大地图特征点匹配识别位置失败
Error message
大地图特征点匹配识别位置失败
What it means
Thrown by GetBigMapCenterPoint(private overload) when RecognizeBigMapCenterPoint returns an empty Point2f (IsEmpty() true). The MapScaleButton was found (confirming the map interface is open), but the underlying feature-point matching (GetBigMapPosition) could not locate the current map center position.
Source
Thrown at BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs:2143
}
public Point2f GetBigMapCenterPoint(string mapName)
{
return GetBigMapCenterPoint(mapName, null);
}
private Point2f GetBigMapCenterPoint(string mapName, Point2f? expectedCenterPoint)
{
// 判断是否在地图界面
using var ra = CaptureToRectArea();
using var mapScaleButtonRa = ra.Find(GetQuickTeleportRecognitionObject("MapScaleButton", ra));
if (mapScaleButtonRa.IsExist())
{
var p = RecognizeBigMapCenterPoint(mapName, ra.CacheGreyMat, expectedCenterPoint);
if (p.IsEmpty())
{
throw new MapPositionNotRecognizedException("大地图特征点匹配识别位置失败");
}
return p;
}
else
{
throw new InvalidOperationException("当前不在地图界面");
}
}
private Point2f RecognizeBigMapCenterPoint(string mapName, Mat greyMat, Point2f? expectedCenterPoint = null)
{
Point2f p;
try
{
var map = MapManager.GetMap(mapName, _mapMatchingMethod);
p = expectedCenterPoint is Point2f expectedCenter
? map.GetBigMapPosition(greyMat, map.ConvertGenshinMapCoordinatesToImageCoordinates(expectedCenter))View on GitHub (pinned to a7cb36712d)
Solutions
- Update map feature-point assets to match the current game version.
- Provide an accurate expectedCenterPoint to narrow the search area.
- Pan the map to a more feature-rich area before calling.
- Switch _mapMatchingMethod to a more robust algorithm if multiple are available.
- Retry after ensuring the map is fully rendered (no loading animation).
Defensive patterns
Strategy: try-catch
Try / catch
try
{
var center = task.GetBigMapCenterPoint(mapName, expectedCenter);
}
catch (MapPositionNotRecognizedException ex) when (ex.Message == "大地图特征点匹配识别位置失败")
{
// Pan to a feature-rich area or provide a more accurate expectedCenter
throw;
} Prevention
- Provide an accurate expectedCenterPoint to constrain feature matching.
- Keep map feature assets updated with the current game version.
- Avoid calling on low-feature map areas (open water, uniform terrain).
- Ensure the map is fully rendered with no loading overlays.
When it happens
Trigger: Called from GetBigMapCenterPoint(mapName, expectedCenterPoint). The MapScaleButton exists, so we are on the map. But RecognizeBigMapCenterPoint → map.GetBigMapPosition returns an empty point, indicating no feature match.
Common situations: The current map view is over a low-feature area (open water, featureless terrain); map matching assets are outdated; the expectedCenterPoint hint is inaccurate causing the search to look in the wrong area; capture quality issues (blur, compression).
Related errors
- 多次中心点识别失败或异常,惯性推算失效,重新传送
- 初始识别失败且切换区域后依然无效
- 多次重试后,识别大地图位置失败
- 大地图特征点匹配引发异常:{ex.Message}
- 无法解析 RecognitionObject 配置文件: {filePath}
AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13).
Data as JSON: /api/errors/a90a3a382d3672e9.
Report an issue: GitHub.