{"record":{"id":"68cd7d6ac8b87c7b","repo":"babalae/better-genshin-impact","slug":"16-9-68cd7d","errorCode":null,"errorMessage":"游戏窗口分辨率不是 16:9","messagePattern":"游戏窗口分辨率不是 16:9","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtTask.cs","lineNumber":812,"sourceCode":"        LogScreenResolution();\n        if (_taskParam.SpecifyResinUse)\n        {\n            Logger.LogInformation(\"→ {Text} 指定使用树脂\", $\"{Name}，\");\n        }\n        else\n        {\n            Logger.LogInformation(\"→ {Text} 用尽所有浓缩树脂和原粹树脂后结束\", $\"{Name}，\");\n        }\n    }\n\n    private void LogScreenResolution()\n    {\n        var gameScreenSize = SystemControl.GetGameScreenRect(TaskContext.Instance().GameHandle);\n        if (gameScreenSize.Width * 9 != gameScreenSize.Height * 16)\n        {\n            Logger.LogError(\"游戏窗口分辨率不是 16:9 ！当前分辨率为 {Width}x{Height}\",\n                gameScreenSize.Width, gameScreenSize.Height);\n            throw new Exception(\"游戏窗口分辨率不是 16:9\");\n        }\n\n        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","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoStygianOnslaught/AutoStygianOnslaughtTask.cs#L794-L830","documentation":"Generic Exception from AutoStygianOnslaughtTask.LogScreenResolution when the game client rect is not 16:9 (width*9 != height*16). Unlike the PathExecutor variant, this one hard-fails on aspect ratio alone (the <1920x1080 branch only warns). The combat CV scripts assume a 16:9 frame for Q/E/burst icon localization.","triggerScenarios":"Game running at an ultrawide (21:9) or 4:3 resolution; windowed mode with a non-standard aspect; letterboxed/pillarboxed client rect; multi-monitor span. SystemControl.GetGameScreenRect returns the raw GetClientRect so any non-16:9 window trips it.","commonSituations":"Ultrawide monitor user; game set to a 16:10 or 5:4 resolution; windowed mode resized by the user; DPI mismatch producing a slightly off client rect.","solutions":["Set Genshin Impact to a 16:9 resolution (1920x1080, 2560x1440, 3840x2160, etc.).","On ultrawide displays, use a 16:9 fullscreen resolution with black bars rather than the native aspect.","Avoid manually resizing the windowed client; restore default size.","Confirm display scaling is 100% if the rect is being DPI-skewed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var r = SystemControl.GetGameScreenRect(TaskContext.Instance().GameHandle);\nif (r.Width * 9 != r.Height * 16)\n    return Result.Fail($\"分辨率 {r.Width}x{r.Height} 非 16:9，斯根斯特赖特任务不可用\");","typeGuard":null,"tryCatchPattern":"try { StartStygianTask(); }\ncatch (Exception e) when (e.Message.Contains(\"16:9\"))\n{ /* prompt user to switch to a 16:9 resolution */ }","preventionTips":["Surface the 16:9 requirement in the task's UI before launch.","Detect ultrawide/windowed-non-16:9 and warn the user up front.","Gate combat CV tasks behind the same resolution preflight as pathing."],"tags":["resolution","game-window","aspect-ratio","stygian","combat"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}