babalae/better-genshin-impact · error · Exception

游戏窗口分辨率不是 16:9

Error message

游戏窗口分辨率不是 16:9

What it means

Error "游戏窗口分辨率不是 16:9" thrown in babalae/better-genshin-impact.

Source

Thrown at BetterGenshinImpact/GameTask/AutoDomain/AutoDomainTask.cs:267

        if (_config.SpecifyResinUse)
        {
            Logger.LogInformation("→ {Text} 指定使用树脂", "自动秘境,");
        }
        else
        {
            Logger.LogInformation("→ {Text} 用尽所有浓缩树脂和原粹树脂后结束", "自动秘境,");
        }
    }

    private void LogScreenResolution()
    {
        var gameScreenSize = SystemControl.GetGameScreenRect(TaskContext.Instance().GameHandle);
        if (gameScreenSize.Width * 9 != gameScreenSize.Height * 16)
        {
            Logger.LogError("游戏窗口分辨率不是 16:9 !当前分辨率为 {Width}x{Height} , 非 16:9 分辨率的游戏无法正常使用自动秘境功能 !",
                gameScreenSize.Width, gameScreenSize.Height);
            throw new Exception("游戏窗口分辨率不是 16:9");
        }

        if (gameScreenSize.Width < 1920 || gameScreenSize.Height < 1080)
        {
            Logger.LogWarning("游戏窗口分辨率小于 1920x1080 !当前分辨率为 {Width}x{Height} , 小于 1920x1080 的分辨率的游戏可能无法正常使用自动秘境功能 !",
                gameScreenSize.Width, gameScreenSize.Height);
        }
    }

    private void RetryTeamInit(CombatScenes combatScenes)
    {
        if (!combatScenes.CheckTeamInitialized())
        {
            combatScenes.InitializeTeam(CaptureToRectArea());
            if (!combatScenes.CheckTeamInitialized())
            {
                throw new Exception("识别队伍角色失败,请在较暗背景下重试,比如游戏时间调整成夜晚。或者直接使用强制指定当前队伍角色的功能。");
            }

View on GitHub (pinned to a7cb36712d)

Solutions

  1. 将游戏窗口分辨率调整为 16:9(如 1920x1080、2560x1440、1600x900)
  2. 避免使用带鱼屏或 4:3 等非 16:9 分辨率
  3. 调整后重新启动自动秘境任务

Example fix

将游戏分辨率调整为16:9(推荐1920x1080及以上),使用无边框窗口或全屏模式后重试。

When it happens

Trigger: 自动秘境启动时 LogScreenResolution 检查游戏窗口矩形,宽*9 != 高*16 即判定非16:9,记录错误后直接抛出。

Common situations: 游戏窗口为16:10、4:3、带鱼屏等非16:9分辨率,或窗口被拉伸/带边框导致客户区比例不对。


AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13). Data as JSON: /api/errors/b487a26ed6a1291b. Report an issue: GitHub.