{"record":{"id":"5962b770f9ce9ab6","repo":"babalae/better-genshin-impact","slug":"1920x1080-5962b7","errorCode":null,"errorMessage":"游戏窗口分辨率小于 1920x1080 ！无法使用地图追踪功能！","messagePattern":"游戏窗口分辨率小于 1920x1080 ！无法使用地图追踪功能！","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs","lineNumber":400,"sourceCode":"        WeakReferenceMessenger.Default.Send(new PropertyChangedMessage<object>(this,\n            \"UpdateCurrentPathing\", new object(), task));\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} , 非 16:9 分辨率的游戏无法正常使用地图追踪功能！\",\n                gameScreenSize.Width, gameScreenSize.Height);\n            throw new Exception(\"游戏窗口分辨率不是 16:9 ！无法使用地图追踪功能！\");\n        }\n\n        if (gameScreenSize.Width < 1920 || gameScreenSize.Height < 1080)\n        {\n            Logger.LogError(\"游戏窗口分辨率小于 1920x1080 ！当前分辨率为 {Width}x{Height} , 小于 1920x1080 的分辨率的游戏地图追踪的效果非常差！\",\n                gameScreenSize.Width, gameScreenSize.Height);\n            throw new Exception(\"游戏窗口分辨率小于 1920x1080 ！无法使用地图追踪功能！\");\n        }\n    }\n\n    /// <summary>\n    /// 切换队伍\n    /// </summary>\n    /// <param name=\"partyName\"></param>\n    /// <returns></returns>\n    private async Task<bool> SwitchParty(string? partyName)\n    {\n        bool success = true;\n        if (!string.IsNullOrEmpty(partyName))\n        {\n            if (RunnerContext.Instance.PartyName == partyName)\n            {\n                return success;\n            }\n","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs#L382-L418","documentation":"Thrown by PathExecutor when the Genshin Impact client window's client rect (via User32.GetClientRect on the game HWND) reports a width below 1920 or height below 1080. The 16:9 aspect-ratio check runs first (PathExecutor.cs:389), so this only fires for windows that are already 16:9 but too small. The path-tracking CV pipeline is calibrated against 1920x1080 templates, so sub-1080 captures produce unusable matches.","triggerScenarios":"Running a map pathing/auto-pathing task while the game renders at 1600x900, 1280x720, borderless-windowed scaled by DPI, or any sub-1080 laptop panel. TaskContext.Instance().GameHandle must already resolve to the live Genshin window. Windowed mode where GetClientRect differs from the configured render resolution.","commonSituations":"Laptop with a 1366x768 or 1600x900 panel; DPI scaling >100% shrinking the client area; game set to windowed 720p; HDR/secondary monitor with lower resolution; user changed in-game resolution but did not restart the task.","solutions":["Set the Genshin Impact in-game graphics resolution to 1920x1080 (or higher) and re-run the task.","Switch the game display mode to fullscreen or borderless fullscreen at 1920x1080 so GetClientRect returns the full render area.","Log off Windows / set display scaling to 100% if DPI virtualization is shrinking the client rect.","Verify TaskContext.Instance().GameHandle points at the actual Genshin window (not a launcher/secondary process) before the check runs."],"exampleFix":"// before: hard fail\nif (gameScreenSize.Width < 1920 || gameScreenSize.Height < 1080)\n    throw new Exception(\"游戏窗口分辨率小于 1920x1080 ！无法使用地图追踪功能！\");\n\n// after: degrade gracefully with a warning instead of aborting\nif (gameScreenSize.Width < 1920 || gameScreenSize.Height < 1080)\n{\n    Logger.LogWarning(\"游戏窗口分辨率 {W}x{H} 低于 1920x1080，地图追踪精度可能下降\", gameScreenSize.Width, gameScreenSize.Height);\n    return; // or continue with reduced accuracy mode\n}","handlingStrategy":"validation","validationCode":"var r = SystemControl.GetGameScreenRect(TaskContext.Instance().GameHandle);\nif (r.Width < 1920 || r.Height < 1080 || r.Width * 9 != r.Height * 16)\n    return Result.Fail($\"游戏分辨率 {r.Width}x{r.Height} 不满足 1920x1080 16:9，请调整后重试\");","typeGuard":null,"tryCatchPattern":"try { ExecutePathing(); }\ncatch (Exception e) when (e.Message.Contains(\"1920x1080\"))\n{ /* prompt user to raise resolution, do not retry */ }","preventionTips":["Gate pathing tasks behind a pre-flight resolution check that surfaces a user-facing dialog instead of an exception.","Document the 1920x1080 16:9 requirement in the task's startup banner.","Detect DPI scaling and warn before starting CV-based tasks."],"tags":["resolution","game-window","map-tracking","validation","cv"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}