{"record":{"id":"e958338257424415","repo":"babalae/better-genshin-impact","slug":"error-e95833","errorCode":null,"errorMessage":"识别队伍角色失败！","messagePattern":"识别队伍角色失败！","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtTask.cs","lineNumber":833,"sourceCode":"        if (gameScreenSize.Width < 1920 || gameScreenSize.Height < 1080)\n        {\n            Logger.LogWarning(\"游戏窗口分辨率小于 1920x1080 ！当前分辨率为 {Width}x{Height}\",\n                gameScreenSize.Width, gameScreenSize.Height);\n        }\n    }\n\n    private async Task<CombatScenes> InitializeCombatScenesLoop()\n    {\n        CombatScenes? result = null;\n        var found = await NewRetry.WaitForAction(() =>\n        {\n            result = new CombatScenes().InitializeTeam(CaptureToRectArea());\n            return result.CheckTeamInitialized();\n        }, _ct, 10, 500);\n\n        if (!found || result == null)\n        {\n            throw new Exception(\"识别队伍角色失败！\");\n        }\n        Logger.LogInformation($\"{Name}：队伍初始化成功\");\n        return result;\n    }\n\n    private async Task<List<CombatCommand>> PrepareForBattleLoop(CombatScenes combatScenes)\n    {\n        var combatCommands = FindCombatScriptAndSwitchAvatar(combatScenes);\n        await Delay(1500, _ct);\n\n        Simulation.SendInput.SimulateAction(GIActions.MoveForward, KeyType.KeyDown);\n        await Delay(1200, _ct);\n        Simulation.SendInput.SimulateAction(GIActions.MoveForward, KeyType.KeyUp);\n\n        return combatCommands;\n    }\n\n    private List<CombatCommand> FindCombatScriptAndSwitchAvatar(CombatScenes combatScenes)","sourceCodeStart":815,"sourceCodeEnd":851,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtTask.cs#L815-L851","documentation":"Exception from AutoStygianOnslaughtTask.InitializeCombatScenesLoop when NewRetry.WaitForAction fails to produce a team-initialized CombatScenes within 10 attempts at 500ms intervals. CombatScenes.InitializeTeam runs AssertUtils.CheckGameResolution then classifies avatar side icons; CheckTeamInitialized returns false when Avatars.Length != ExpectedTeamAvatarNum.","triggerScenarios":"Team/avatar sidebar not visible on screen during the retry window (wrong UI state, overlay blocking the sidebar, in a cutscene/loading); avatar classifier returning empty names for all slots so BuildAvatars produces fewer Avatars than ExpectedTeamAvatarNum; ExpectedTeamAvatarNum detected as 0 because PartyAvatarSideIndexHelper found no index rects.","commonSituations":"Task started while not on the combat/pre-battle screen; resolution not 1920x1080 so icon templates don't match; team slot detection misreads in co-op; HDR capture producing washed-out frames; team config (TeamNames) left empty so OCR path is used and fails.","solutions":["Start the task only when the game shows the normal in-world team view (avatars visible in the bottom-right).","Run at 1920x1080 16:9 (the side-icon classifier is resolution-calibrated).","Optionally set AutoFightConfig.TeamNames manually to bypass OCR classification.","Disable HDR or fix capture color so avatar icons match templates.","Retry after closing any overlay/menu that occludes the avatar sidebar."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { scenes = await InitializeCombatScenesLoop(); }\ncatch (Exception e) when (e.Message.Contains(\"识别队伍角色失败\"))\n{ /* return to main UI, confirm team visible, then retry once */ }","preventionTips":["Start combat tasks only on the in-world screen with the avatar sidebar visible.","Optionally set TeamNames in AutoFightConfig to bypass OCR classification.","Run at 1920x1080 and disable HDR for reliable avatar-icon classification."],"tags":["combat","avatar-recognition","team-init","cv","stygian"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}