babalae/better-genshin-impact · warning · NormalEndException
首次伐木就未识别到木材数据,已经自动关闭【OCR识别并累计木材数】的功能,请重新启动【自动伐木】功能!
Error message
首次伐木就未识别到木材数据,已经自动关闭【OCR识别并累计木材数】的功能,请重新启动【自动伐木】功能!
What it means
Thrown as NormalEndException by PrintWoodStatistics when OCR returns empty wood statistics text AND _woodMetricsDict is still empty (first attempt). This is treated as a configuration/setup failure: the OCR feature is auto-disabled (WoodCountOcrEnabled = false) and the auto-wood task is terminated gracefully. NormalEndException signals a user-facing 'normal end' rather than a crash.
Source
Thrown at BetterGenshinImpact/GameTask/AutoWood/AutoWoodTask.cs:177
[GeneratedRegex("([^\\d\\n]+)[×x](\\d+)")]
private static partial Regex _parseWoodStatisticsRegex();
public bool WoodStatisticsAlwaysEmpty()
{
return NothingCount >= 3;
}
public void PrintWoodStatistics(WoodTaskParam taskParam)
{
var woodStatisticsText = GetWoodStatisticsText(taskParam);
if (string.IsNullOrEmpty(woodStatisticsText))
{
NothingCount++;
Logger.LogWarning("未能识别到伐木的统计数据");
if (_woodMetricsDict.Count == 0)
{
TaskContext.Instance().Config.AutoWoodConfig.WoodCountOcrEnabled = false;
throw new NormalEndException("首次伐木就未识别到木材数据,已经自动关闭【OCR识别并累计木材数】的功能,请重新启动【自动伐木】功能!");
}
return;
}
ParseWoodStatisticsText(taskParam, woodStatisticsText);
CheckAndPrintWoodQuantities(taskParam);
}
private string GetWoodStatisticsText(WoodTaskParam taskParam)
{
var firstOcrResultList = new List<string>();
// 创建一个计时器,循环识别文本,直到超时
var stopwatch = Stopwatch.StartNew();
while (stopwatch.ElapsedMilliseconds < 3500)
{
// OCR识别木材文本
var recognizedText = WoodTextAreaOcr();View on GitHub (pinned to a7cb36712d)
Solutions
- Restart the AutoWood feature after the OCR toggle is reset (the exception message says to restart).
- Verify PaddleOCR models are correctly installed and the OCR engine initializes without errors.
- Check the wood-count text area crop rect matches the current game resolution and scaling.
- Ensure wood cutting is actually happening (trees nearby, gadget working) so the counter appears.
- Confirm the game language matches the expected OCR language.
Defensive patterns
Strategy: try-catch
Try / catch
try
{
woodCollector.PrintWoodStatistics(taskParam);
}
catch (NormalEndException ex)
{
// NormalEndException signals graceful task termination, not a crash
Logger.LogWarning(ex.Message);
// The OCR feature has been auto-disabled; inform user to restart AutoWood
} Prevention
- Verify PaddleOCR models are correctly installed before starting AutoWood.
- Ensure the wood-count text area crop matches the current game resolution.
- Confirm wood cutting is actually producing visible counters before OCR runs.
- Restart the AutoWood feature after this exception as the message instructs.
When it happens
Trigger: Called from PrintWoodStatistics(taskParam). GetWoodStatisticsText returns empty/null, NothingCount increments, and _woodMetricsDict.Count == 0. The config flag WoodCountOcrEnabled is set to false and NormalEndException is thrown.
Common situations: OCR engine (PaddleOCR) failed to initialize or models not loaded; the wood-count text area rect is misconfigured for the current resolution; game UI elements (wood counter) not visible because wood cutting hasn't actually started; the game language or UI theme differs from expected.
Related errors
- 请先装备小道具「王树瑞佑」!如果已经装备仍旧出现此提示,请重新仔细阅读文档中的《快速上手》!
- 候选文本不能包含空字符串或纯空白字符串
- 图像通道数必须为3,当前为{channels}
- Unable to GetLabelByIndex: index {i} out of range {labels.Co
- 不支持的 OCR 引擎类型
AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13).
Data as JSON: /api/errors/a06aa116d248252a.
Report an issue: GitHub.