babalae/better-genshin-impact · error · Exception

未找到追踪点

Error message

未找到追踪点

What it means

Thrown by LowerHeadThenWalkToTask.Start when the very first capture does not contain the track-point template above threshold 0.6. The task template-matches _trackPoint inside a centered ROI (excluding 300*scale on each side) and refuses to start walking if no match is found.

Source

Thrown at BetterGenshinImpact/GameTask/Common/Job/LowerHeadThenWalkToTask.cs:54

        _timeoutMilliseconds = timeoutMilliseconds;
        _trackPoint = new RecognitionObject
        {
            Name = "TrackPoint",
            RecognitionType = RecognitionTypes.TemplateMatch,
            TemplateImageMat = GameTaskManager.LoadAssetImage(@"Common\Element", targetMatName),
            RegionOfInterest = new Rect((int)(300 * AssetScale), 0, CaptureRect.Width - (int)(600 * AssetScale), CaptureRect.Height),
            Threshold = 0.6,
            DrawOnWindow = true
        }.InitTemplate();
    }

    public async Task<bool> Start(CancellationToken ct)
    {
        using var initialCapture = CaptureToRectArea();
        if (initialCapture.Find(_trackPoint).IsEmpty())
        {
            Logger.LogInformation("未找到追踪点,停止任务");
            throw new Exception("未找到追踪点");
        }

        return await MakeTrackPointDirectlyAbove(ct);
    }

    private async Task<bool> MakeTrackPointDirectlyAbove(CancellationToken ct)
    {
        try
        {
            double dpi = TaskContext.Instance().DpiScale;
            var startTime = DateTime.Now;
            int prevMoveX = 0;
            while (!ct.IsCancellationRequested)
            {
                using var ra = CaptureToRectArea();
                var trackPointRa = ra.Find(_trackPoint);
                if (trackPointRa.IsExist())
                {

View on GitHub (pinned to a7cb36712d)

Solutions

  1. Pre-orient the camera (look down/around) before invoking Start so the track point is in view.
  2. Verify the template asset Common\Element\{targetMatName} exists and matches the current game art.
  3. Lower the threshold or widen the ROI if the point is near screen edges.
  4. Retry the initial capture a few times before failing, since the first frame may be mid-transition.

Example fix

// before
using var initialCapture = CaptureToRectArea();
if (initialCapture.Find(_trackPoint).IsEmpty())
{
    Logger.LogInformation("未找到追踪点,停止任务");
    throw new Exception("未找到追踪点");
}

// after: retry the initial detection a few times
for (int i = 0; i < 5; i++)
{
    using var c = CaptureToRectArea();
    if (!c.Find(_trackPoint).IsEmpty())
        return await MakeTrackPointDirectlyAbove(ct);
    await Delay(300, ct);
}
throw new Exception("未找到追踪点");
Defensive patterns

Strategy: validation

Validate before calling

// Pre-orient and retry initial detection before starting
for (int i = 0; i < 5; i++)
{
    using var c = CaptureToRectArea();
    if (!c.Find(_trackPoint).IsEmpty()) break;
    await Delay(300, ct);
}

Type guard

bool TrackPointVisible(ImageRegion ra) => !ra.Find(_trackPoint).IsEmpty();

Try / catch

try { await task.Start(ct); }
catch (Exception e) when (e.Message == "未找到追踪点")
{ /* rotate camera / lower view, then retry Start */ }

Prevention

When it happens

Trigger: initialCapture.Find(_trackPoint).IsEmpty() is true on the first frame. The track-point icon (loaded from Common\Element\{targetMatName}) is not visible in the starting view — the player is looking the wrong way, is too far, or the template no longer matches.

Common situations: Camera not pointed at the objective when the task starts; targetMatName asset missing or outdated after a game update; ROI too narrow so the point is in the excluded side bands; threshold 0.6 too strict for the current art/render scale.

Related errors


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