ageekhere / Definitive-Supreme-Commander-Launcher

1 stars 1 forks source link

Launcher Not Working Properly: Game Window Resizing Issue #10

Open magge-faf opened 4 months ago

magge-faf commented 4 months ago

When attempting to start the game via FAF, the game window gets resized to a very tiny size and appears in the top left corner of the screen. I heard it from several people and can confirm it by my own testing.

ageekhere commented 4 months ago

Lets check a few things (make sure you are using 1.0.6.0) Check what the screen width and height values return 1.after the following code

else
{ ;//manually set monitor resolution size
    gResolutionWidth := 1920 ;2560, 3840 ;//Sets the width resolution, for 1080p use (1920), for 1440p use (2560), for 4k use (3840) or use a custom value
    gResolutionHeight := 1080  ;1440, 2160 ;//Sets the height resolution
}

add the message box to print the screen width and height MsgBox, width %gResolutionWidth% height %gResolutionHeight%

  1. A manual fix can be In the launcher under settings deselect "Auto set game window size when in windowed mode (Supported Games: SC,FA,FAF,LOUD Default 1920x1080)"
  2. Then under main.ahk find the line
    { ;//manually set monitor resolution size
    gResolutionWidth := 1920 ;2560, 3840 ;//Sets the width resolution, for 1080p use (1920), for 1440p use (2560), for 4k use (3840) or use a custom value
    gResolutionHeight := 1080  ;1440, 2160 ;//Sets the height resolution
    }

    Change 1920 and 1080 to your screen resolution

My guess is the way i am auto detecting the screen monitor size could not always return the correct value depending on monitor layout.

I will investigate this issue and see if i can find a fix

ageekhere commented 4 months ago

Try this as a simple fix replace

if(gAutoSetMonitorArg = 1)
{
    SysGet, primMon, Monitor ;//Get the current primary monitor that is active
    if(primMonRight != 0 || primMonBottom !="")
        gResolutionWidth := primMonRight ; //set width resolution
    else if(primMonLeft != 0 || primMonBottom !="")
        gResolutionWidth := % primMonLeft
    else 
        gResolutionWidth := %A_ScreenWidth%

    if(primMonBottom != 0 || primMonBottom !="")
        gResolutionHeight := primMonBottom ; //set width resolution
    else if(primMonTop != 0 || primMonBottom !="")
        gResolutionHeight := primMonTop
    else 
        gResolutionHeight := %A_ScreenHeight%

    ;//if the value is negative change it to positive number
    if(gResolutionWidth < 0)
    {
        gResolutionWidth := (-1 * gResolutionWidth)
    }
    if(gResolutionHeight < 0)
    {
        gResolutionHeight := (-1 * gResolutionHeight)
    }   
}

With

if(gAutoSetMonitorArg = 1)
{
    gResolutionWidth := A_ScreenWidth
    gResolutionHeight := A_ScreenHeight
}
magge-faf commented 4 months ago

I have replaced the stuff, and unticked the "Auto set game window size", but I have still the same behavior for my 1440p, but it works with 1080p.

I could swear it was working last version, when I tested it for the Borderless-Guide on FAF.

Changing monitor default resolution to make it work is not a suitable solution IMO. Many people using 1440p by default nowadays. Some even 4k.

By my experience, your target audience are very non-tech-savvy people. In the best case, this tool should work out of the box with one or two clicks, because your average user will be overwhelmed when they have to change anything.

You could even pull the default installation paths into the tool automatically for most of the game-paths, so users do not have to do it manually. It adds another layer of potential complication.

ageekhere commented 4 months ago

if you re enable Auto set game window size and replace if(gAutoSetMonitorArg = 1) with

if(gAutoSetMonitorArg = 1)
{
    gResolutionWidth := A_ScreenWidth
    gResolutionHeight := A_ScreenHeight
}

Does that fix the issue?

"Changing monitor default resolution to make it work is not a suitable solution IMO. Many people using 1440p by default nowadays. Some even 4k." Yeah it should be auto detecting so users do not need to manually change anything, will see where is bug is

ageekhere commented 2 months ago

Test if you still have this issue with version1.07 release

magge-faf commented 2 months ago

Yes, the issue is consistently reproducible on 1440p. Tiny screen when "Auto set game ..." is enabled, and a bit larger window when it is not enabled.

image

"Auto set game ..." disabled:

image

ageekhere commented 2 months ago

keep auto set game window size enabled or else you would need to set that value in the autohotkey script. Ok just tested it on 2 1440p monitors if your main display is in the center and your second monitor is to your left the script only stretches the game to the right of the main monitor and not the left see image.
screen

If you set your monitors up as main monitor to the left like the picture does that work for you? because it does for me on 1440p monitors.

However I do need to work out how to move the game window to the far left if the secondary monitor is to the left of the main monitor.

ageekhere commented 2 months ago

Try this, unzip and replace the main.ahk main.zip I have added a new global gMoveGameToFarLeft:= true ;A_Args[10] you can switch between true and false for testing. I will add into the launcher settings menu a new option "Move game window to the far left, if it is disabled then it will use the main monitor position instead. That way if you have 3 monitors you can pick to either have the game on monitor 1 and 2 or 2 and 3.

ageekhere commented 1 month ago

Check if this issue is fixed in 1.0.8.2