babalae/better-genshin-impact · error · Exception
初始识别失败且切换区域后依然无效
Error message
初始识别失败且切换区域后依然无效
What it means
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.
Source
Thrown at BetterGenshinImpact/GameTask/AutoTrackPath/TpTask.cs:1534
var jumpedCenterPoint = await ForceJumpToTargetArea(x, y, mapName);
if (jumpedCenterPoint != null)
{
return (GetMoveMapState(jumpedCenterPoint.Value, x, y, recoveredState.ZoomLevel), recoveredState.ZoomLevel);
}
if (TryGetRecognizedMoveMapState(mapName, x, y, recoveredState.ZoomLevel, out moveState))
{
return (moveState, recoveredState.ZoomLevel);
}
recoveredState = await TryRecoverMoveMapStateByZoom(mapName, x, y, recoveredState.ZoomLevel);
if (recoveredState.Success)
{
return (recoveredState.MoveState, recoveredState.ZoomLevel);
}
throw new Exception("初始识别失败且切换区域后依然无效");
}
private async Task<(bool Success, MapMoveState MoveState, double ZoomLevel)> TryRecoverMoveMapStateByZoom(
string mapName,
double x,
double y,
double currentZoomLevel)
{
if (!_tpConfig.MapZoomEnabled)
{
return (false, default, currentZoomLevel);
}
var targetZoomLevel = GetMapPositionRecognitionRecoveryZoomLevel(currentZoomLevel, mapName);
if (IsZoomCloseEnough(currentZoomLevel, targetZoomLevel))
{
return (false, default, currentZoomLevel);
}View on GitHub (pinned to a7cb36712d)
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.
Defensive patterns
Strategy: try-catch
Validate before calling
// Before calling, verify the game is on the big map
using var ra = task.CaptureToRectArea();
using var btn = ra.Find(task.GetQuickTeleportRecognitionObject("MapScaleButton", ra));
if (!btn.IsExist())
{
// Open the map first
} Try / catch
try
{
await task.MoveMapTo(x, y, mapName);
}
catch (Exception ex) when (ex.Message == "初始识别失败且切换区域后依然无效")
{
Logger.LogError("Failed to acquire initial map position. Ensure the big map is open.");
throw;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- 多次中心点识别失败或异常,惯性推算失效,重新传送
- 大地图特征点匹配识别位置失败
- 预热图片未找到: {modelType.PreHeatImagePath}
- 无法解析 RecognitionObject 配置文件: {filePath}
- 未找到名称为 {objectName} 的 RecognitionObject 配置
AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13).
Data as JSON: /api/errors/a7be4c58f6fb5264.
Report an issue: GitHub.