{"record":{"id":"e307d1438735442e","repo":"babalae/better-genshin-impact","slug":"16-9-e307d1","errorCode":null,"errorMessage":"游戏窗口分辨率不是 16:9 ！无法使用地图追踪功能！","messagePattern":"游戏窗口分辨率不是 16:9 ！无法使用地图追踪功能！","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs","lineNumber":393,"sourceCode":"        return true;\n    }\n\n    private void InitializePathing(PathingTask task)\n    {\n        LogScreenResolution();\n        InitHurryOnConfig();\n        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;","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs#L375-L411","documentation":"Thrown by PathExecutor.LogScreenResolution when the game window's captured rect does not have a 16:9 aspect ratio (gameScreenSize.Width * 9 != gameScreenSize.Height * 16). Map tracking depends on 16:9 coordinate assumptions, so a different ratio is rejected outright.","triggerScenarios":"SystemControl.GetGameScreenRect(handle) returns a rect whose W*9 != H*16 — e.g. a windowed or borderless size like 2560x1080, 3440x1440, or a non-standard client area.","commonSituations":"Ultrawide/4:3 monitor; windowed mode resized to a non-16:9 size; DPI/border miscalculation making the client rect non-16:9.","solutions":["Set the game to a 16:9 resolution (1920x1080, 2560x1440, 3840x2160) in fullscreen or borderless.","If windowed, resize the window so the client area is exactly 16:9.","Disable DPI scaling overrides that distort the captured rect.","Avoid ultrawide resolutions for map-tracking tasks."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var rect = SystemControl.GetGameScreenRect(TaskContext.Instance().GameHandle);\nif (rect.Width * 9 != rect.Height * 16)\n{\n    throw new InvalidOperationException($\"游戏窗口分辨率非 16:9 ({rect.Width}x{rect.Height})，请设置为 1920x1080 等 16:9 分辨率\");\n}","typeGuard":"static bool Is16by9(System.Drawing.Size s) => s.Width * 9 == s.Height * 16;","tryCatchPattern":null,"preventionTips":["Set the game to a 16:9 resolution (1920x1080 / 2560x1440 / 3840x2160) before map-tracking tasks.","Check the captured client rect at task start and fail fast with a clear message.","Avoid ultrawide/windowed-non-16:9 sizes for pathing."],"tags":["resolution","environment","validation","pathing"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}