• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login
FAForever Forums
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Login

[Guide] : fake-fullscreen and optimisation

Scheduled Pinned Locked Moved Frequently Asked Questions
91 Posts 18 Posters 32.0k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    SamSon
    last edited by 29 Nov 2020, 03:48

    Quality! Appreciated!

    1 Reply Last reply Reply Quote 1
    • A
      arma473
      last edited by 29 Nov 2020, 08:58

      I have 2 monitors. Is it accurate to say that if I use "fake fullscreen," I have to choose between "treat both screens together as 1 monitor" or "just don't use your second monitor"?

      Without using fake fullscreen, I am able to use my second monitor to display the map (like having a giant mini map that I never look at because my first monitor is so wide that it takes up all my vision anyway).

      T 1 Reply Last reply 29 Nov 2020, 14:28 Reply Quote 0
      • T
        tatsu @arma473
        last edited by 29 Nov 2020, 14:28

        @arma473 no it's not accurate.

        you just use the ui party mod as stated. you'll see it's ideal. and the screens truly behave as two independent screens even though you're in fake fullscreen.

        How to setup FAF on linux

        A 1 Reply Last reply 29 Nov 2020, 17:03 Reply Quote 1
        • A
          arma473 @tatsu
          last edited by 29 Nov 2020, 17:03

          @tatsu said in [Guide] : fake-fullscreen and optimisation:

          @arma473 no it's not accurate.

          you just use the ui party mod as stated. you'll see it's ideal. and the screens truly behave as two independent screens even though you're in fake fullscreen.

          According to that thread, I'm supposed to use UI-Festival instead of UI-Party. Do you know if that's true? So I have to get UI-Festival through github because it's not in the mod vault.

          Or does UI-Party currently support different-size screens?

          1 Reply Last reply Reply Quote 0
          • T
            tatsu
            last edited by 29 Nov 2020, 22:52

            the point of UI-festival the way I see it is only if you have two screens of different resolutions.

            if your two screens are of the same resolution UI-Party is the one for you.

            How to setup FAF on linux

            1 Reply Last reply Reply Quote 1
            • A
              arma473
              last edited by 29 Nov 2020, 23:21

              one is landscape, the other one is portrait. So it probably just won't work for me. I'm doing okay without fake fullscreen so I guess i will just stick with that. Thanks for your help though.

              Is there a way to get any kind of optimization without fake fullscreen? Can I use AHK to prioritize the thread, without fake fullscreen?

              T 1 Reply Last reply 30 Nov 2020, 09:14 Reply Quote 0
              • S
                Sir-Prize
                last edited by 30 Nov 2020, 08:34

                Is there a benefit to doing it the way outlined in the OP over using an app like Game Companion?

                1 Reply Last reply Reply Quote 0
                • T
                  tatsu
                  last edited by 30 Nov 2020, 09:12

                  well yes,

                  1. this is more optimized, lower consumption of resources than Game companion and
                  2. this allows to execute our optimization of FA itself.

                  How to setup FAF on linux

                  1 Reply Last reply Reply Quote 0
                  • T
                    tatsu @arma473
                    last edited by 30 Nov 2020, 09:14

                    @arma473 well that's where you would need UI-Festival.

                    anyways it's up to you

                    How to setup FAF on linux

                    1 Reply Last reply Reply Quote 0
                    • S
                      Sir-Prize
                      last edited by 1 Dec 2020, 02:01

                      @tatsu said in [Guide] : fake-fullscreen and optimisation:

                      There are multiple versions of the script depending on your monitor setup, and whether you just want the windowed fullscreen, the optimization, or both.

                      This makes it seem like you shouldn't need fake fullscreen for the optimisation. As it is, I couldn't get the fake fullscreen to work this way for some reason (probably user error) so I will just switch back to what I was doing before I guess.

                      1 Reply Last reply Reply Quote 0
                      • A
                        arma473
                        last edited by 1 Dec 2020, 02:36

                        Just so no one has to look for it, from the prior thread, here is the script given if you want to use AHK for optimization, without using it for Fake Fullscreen. There are other examples of scripts people used in the prior thread (https://forums.faforever.com/viewtopic.php?f=2&t=9778)

                        #NoEnv
                        SendMode Input
                        SetWorkingDir %A_ScriptDir%
                        #Persistent
                        
                        procName := "ForgedAlliance.exe"
                        SetTimer, CheckProc, 2000
                        Return
                        
                        
                        CheckProc:
                            If (!ProcessExist(procName))
                                Return
                        
                            WinGet Style, Style, % "ahk_exe " procName
                            If (Style & 0xC40000)
                            {
                        Run, %comspec% /c process -a forgedalliance.exe 111111111110    ;remember to edit this to fit you thread count!!
                        Run, %comspec% /c process -p forgedalliance.exe high
                            }
                            Return
                        
                        ProcessExist(exeName)
                        {
                           Process, Exist, %exeName%
                           return ERRORLEVEL
                        }
                        
                        return
                        

                        (And remember to edit the thread count where the comment in the code indicates, e.g. 1110 for 4 logical cores, 11111110 for 8 cores)

                        1 Reply Last reply Reply Quote 1
                        • R
                          RikuTengu
                          last edited by 23 Dec 2020, 21:05

                          This post is deleted!
                          1 Reply Last reply Reply Quote 0
                          • T
                            tatsu
                            last edited by tatsu 24 Dec 2020, 16:04

                            yeah I had that too.

                            check the spacing.

                            it's space sensitive for where it begins and ends the loops.
                            mine looks like this :

                            1ed264e8-1055-4573-9393-24cda1998ab7-image.png

                            How to setup FAF on linux

                            1 Reply Last reply Reply Quote 0
                            • SpikeyNoobS
                              SpikeyNoob Global Moderator
                              last edited by 30 Mar 2021, 15:38

                              Can the fake full screen / multi monitor thing be done on linux?

                              T 1 Reply Last reply 30 Mar 2021, 16:43 Reply Quote 0
                              • T
                                tatsu @SpikeyNoob
                                last edited by 30 Mar 2021, 16:43

                                @SpikeyNoob said in [Guide] : fake-fullscreen and optimisation:

                                Can the fake full screen / multi monitor thing be done on linux?

                                no.

                                I don't think so.

                                I gave up but if you find a way let me know!

                                look here : https://forum.faforever.com/topic/123/guide-fake-fullscreen-and-optimisation/2

                                what’s the Linux step by step

                                How to setup FAF on linux

                                1 Reply Last reply Reply Quote 0
                                • SpikeyNoobS
                                  SpikeyNoob Global Moderator
                                  last edited by 31 Mar 2021, 14:29

                                  ok worth a shot ig. Ill let u know if I ever figure it out.

                                  1 Reply Last reply Reply Quote 1
                                  • IO_NoxI
                                    IO_Nox
                                    last edited by Deribus 17 Jun 2021, 14:50

                                    Made anower variant of AHK script.
                                    Using Win 10, AutoHotkey, Steam version of game and Downlord's FAF Client.
                                    For some reason Steam runs "SupremeCommander.exe", FAF Client runs "ForgedAlliance.exe".

                                    I made some manipulations to make AHK script

                                    • stop or pause by itself if game haven't started after 2 minutes or right after script done all things,

                                    • do things only once on each game start,

                                    • do nothing then nothing is needed and also

                                    • run singleplayer from descktop shortcut made by Steam,

                                    • run multyplayer from descktop shortcut for Downlord's FAF Client.

                                    Lets start from Steam descktop sortcut:
                                    Just right click game shortcut , go to Properties and change URL (I had steam://rungameid/9420, we will start it in script) and insert full file path to your script, Save. Old URL insert into script.
                                    To check it, simply open sortcut in any notepad you have. You will see somethig like that:
                                    File "Supreme Commander Forged Alliance.url":

                                    [{000214A0-0000-0000-C000-000000000046}]
                                    Prop3=19,9
                                    [InternetShortcut]
                                    IDList=
                                    IconIndex=0
                                    URL=file:///D:/Program%20Files/FAF%20borderleess%20fullscreen%20window.ahk
                                    IconFile=D:\Steam\steam\games\540979be595a41206b56a2e427c29dce1c212ad2.ico
                                    HotKey=0
                                    

                                    Note: just Ctrl+C -> Ctrl+V full file path, Windows will add "file:///...%20..." staff by itself if done in Properties.

                                    Next is doing the same for FAF Client:
                                    Right click this time Downlord's FAF Client sortcut (it is standard *.lnk, no url staff) go to Properties and change Object path from "D:\Program Files\Downlord's FAF Client\downlords-faf-client.exe" to "D:\Program Files\Downlord's FAF Client\FAF borderleess.ahk". Old Object run in script.

                                    So, it is time for scripts!

                                    Scrip file "FAF borderleess fullscreen window.ahk" in "D:/Program Files/" directory for singleplayer:

                                    #NoEnv
                                    SendMode Input
                                    SetWorkingDir %A_ScriptDir%
                                    #Persistent
                                    
                                    Run, steam://rungameid/9420
                                    procName := "SupremeCommander.exe"
                                    
                                    Process, Wait, %procName%, 120 ; Waits for process to start, no more then 120 seconds
                                    NewPID := ErrorLevel
                                    if not NewPID
                                    {
                                        MsgBox The specified process did not appear.
                                        ExitApp ; Stop this script
                                    }
                                    
                                    SetTimer, CheckProc, 2000
                                    return
                                    
                                    CheckProc:
                                        if (!ProcessExist(procName))
                                            return
                                         
                                        WinGet Style, Style, % "ahk_exe " procName
                                        if (Style & 0xC40000)
                                        {
                                            WinSet, Style, -0xC40000, % "ahk_exe " procName ; remove the titlebar and border(s)
                                            WinMove, % "ahk_exe " procName , , 0, 0, 1920, 1080 ; move the window to 0,0 and resize it to fit across 1 or 2 monitors.
                                            WinMaximize, % "ahk_exe " procName
                                            WinRestore, % "ahk_exe " procName
                                    
                                            ; set High priority and cores affinity 
                                            Process, Priority, %procName%, H
                                            ProcessHandle := DllCall("OpenProcess", "UInt", 0x1F0FFF, "Int", false, "UInt", NewPID)
                                            DllCall("SetProcessAffinityMask", "UInt", ProcessHandle, "UInt", 14 ) ; 1110x2 = 14x10 CPU 0 unchecked, CPU 1-3 checked
                                            DllCall("CloseHandle", "UInt", ProcessHandle)
                                    
                                            ExitApp  ; Stop this script
                                        }
                                    return
                                    
                                    ProcessExist(exeName)
                                    {
                                       Process, Exist, %exeName%
                                       return !!ERRORLEVEL
                                    }
                                    return
                                    

                                    This one starts before singleplayer, calls Steam to run the game, waits for game, does borderleess fullscreen and optimisation and stops right after that. No script running while you are playing.

                                    Scrip file "FAF borderleess.ahk" in "D:\Program Files\Downlord's FAF Client" directory for multyplayer:

                                    #NoEnv
                                    SendMode Input
                                    SetWorkingDir %A_ScriptDir%
                                    #Persistent
                                    
                                    Run, downlords-faf-client.exe
                                    
                                    procName := "ForgedAlliance.exe"
                                    procNameClient := "downlords-faf-client.exe"
                                    
                                    Process, Wait, %procNameClient%, 120 ; Waits for process to start, no more then 120 seconds
                                    NewPID := ErrorLevel
                                    if not NewPID
                                    {
                                        MsgBox The specified process did not appear.
                                        ExitApp ; Stop this script
                                    }
                                    
                                    SetTimer, CheckProc, 2000
                                    
                                    ; Stop then FAF Client stoped
                                    Process, WaitClose, %procNameClient%
                                    ExitApp
                                    
                                    CheckProc:
                                        if (!ProcessExist(procName))
                                            return
                                    
                                        WinGet Style, Style, % "ahk_exe " procName
                                        if (Style & 0xC40000)
                                        {
                                            WinSet, Style, -0xC40000, % "ahk_exe " procName ; remove the titlebar and border(s)
                                            WinMove, % "ahk_exe " procName , , 0, 0, 1920, 1080 ; move the window to 0,0 and resize it to fit across 1 or 2 monitors.
                                            WinMaximize, % "ahk_exe " procName
                                            WinRestore, % "ahk_exe " procName
                                    
                                            ; set High priority and cores affinity 
                                            Process, Priority, %procName%, H
                                            NewPID := ErrorLevel
                                            ProcessHandle := DllCall("OpenProcess", "UInt", 0x1F0FFF, "Int", false, "UInt", NewPID)
                                            DllCall("SetProcessAffinityMask", "UInt", ProcessHandle, "UInt", 14 ) ; 1110x2 = 14x10 CPU 0 unchecked, CPU 1-3 checked
                                            DllCall("CloseHandle", "UInt", ProcessHandle)
                                    
                                            Process, WaitClose, %procName%
                                        }
                                    return
                                    
                                    ProcessExist(exeName)
                                    {
                                       Process, Exist, %exeName%
                                       return !!ERRORLEVEL
                                    }
                                    return
                                    

                                    This starts before FAF Client and waits for FAF Client to run the game. Script is checking for game in loop every 2 seconds. On every game start it does borderleess fullscreen and optimisation BUT does NOT stop after that. Script pauses the loop while you are playing, but is still running while doing nothing. Then the game is over script will resume the loop to catch your next game start. Once you stops FAF Client, sript will stop automaticully.

                                    Now :

                                    • sortcurts will run AHK scripts,

                                    • scripts will run game in Steam or run FAF Client,

                                    • scripts do nothing while you are in game

                                    • you don't need to stop scripts and

                                    • you can hide script file anywhere (well, for FAF Client better keep it in client's dir, maybe becase of ' in directory name).

                                    • Oh, and you need only AutoHotkey for this to work.

                                    If all worked fine you will see in task manager high priority and unchecked first core (CPU 0) affinity for game process, "fake fullscreen mode" in game and no Alt+Tab issues.

                                    Note:
                                    In case your taskbar don't want to hide at all (rarely happens when very actively using other soft at game start, so I don't fix it) you may add hotkey or auto hiding like this:

                                    Process, Wait, %procName%, 120
                                    NewPID := ErrorLevel
                                    if not NewPID
                                    {
                                        MsgBox The specified process did not appear.
                                        ExitApp
                                    }
                                    ; hide taskbar on process start
                                    HideShowTaskbar(true)
                                    
                                    ; here do anythig like SetTimer, CheckProc, 2000
                                    
                                    Process, WaitClose, %procName%
                                    ; show taskbar on process stop and stop this script
                                    HideShowTaskbar(false)
                                    ExitApp
                                    
                                    ; set action to true to hide or false to show Taskbar
                                    HideShowTaskbar(action) {
                                       static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
                                       VarSetCapacity(APPBARDATA, size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
                                       NumPut(size, APPBARDATA), NumPut(WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
                                       NumPut(action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
                                       DllCall("Shell32\SHAppBarMessage", UInt, ABM_SETSTATE, Ptr, &APPBARDATA)
                                    }
                                    
                                    taskBarIsHidden = false
                                    ; ["ctrl" + "win" + "z"] hotkey to toggle taskbar
                                    ; this should be in the end of the script, nothing else worked otherwise...
                                    ^#z:: HideShowTaskbar(taskBarIsHidden := taskBarIsHidden = true ? false : true)
                                    
                                    MostLostNoobM 1 Reply Last reply 26 Aug 2021, 11:23 Reply Quote 1
                                    • T
                                      tatsu
                                      last edited by 19 Jun 2021, 07:53

                                      wow well done @IO_Nox !

                                      How to setup FAF on linux

                                      IO_NoxI 1 Reply Last reply 19 Jun 2021, 12:51 Reply Quote 0
                                      • IO_NoxI
                                        IO_Nox @tatsu
                                        last edited by 19 Jun 2021, 12:51

                                        @tatsu

                                        Not that well it seems)
                                        Thanks for you comment I reread post and found one significant error:
                                        It seem I Copy-pasted not the latest version, multipleer script neend one extra line to make it pause the loop
                                        " Process, WaitClose, %procName%" in the end of "if" section. Without this line script do not pause the loop...

                                        1 Reply Last reply Reply Quote 1
                                        • IO_NoxI
                                          IO_Nox
                                          last edited by 19 Jun 2021, 13:50

                                          One more error fix: in "NewPID" remain procces ID of FAF Client, not the game, so process affinity was set for FAF Client, not for game 😕
                                          Fixed by adding "NewPID := ErrorLevel" after setting high priority:

                                          ; set High priority and cores affinity 
                                                  Process, Priority, %procName%, H
                                                  NewPID := ErrorLevel
                                                  ProcessHandle := DllCall("OpenProcess", "UInt", 0x1F0FFF, "Int", false, "UInt", NewPID)
                                                  DllCall("SetProcessAffinityMask", "UInt", ProcessHandle, "UInt", 14 ) ; 1110x2 = 14x10 CPU 0 unchecked, CPU 1-3 checked
                                                  DllCall("CloseHandle", "UInt", ProcessHandle)
                                                  
                                                  Process, WaitClose, %procName%
                                              }
                                          

                                          Hope it was last one...

                                          1 Reply Last reply Reply Quote 1
                                          • First post
                                            Last post