• 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.
  • T
    thecore @IO_Nox
    last edited by 27 Sept 2021, 23:14

    @io_nox
    @io_nox Hi when going from single screen to dual at 1920x1080 it works mostly as intended (though it can get a few hiccups but it normalcy fixes itself when the game starts, sometimes i have to re toggle the full screen hotkey ).

    When testing at 960x540 my clipMouse breaks so i need to fix that (to test set clipMouse = false and autoSetMonitorSize = false) that and the image looks like

    5.jpg

    It kind of looks like the game does not resize the interface, normally this is not an issue if you are switching from 1920x1080 to 3840x1080.

    Hopeful i can improve these issues.

    Never Fear, A Geek is Here!

    1 Reply Last reply Reply Quote 0
    • S
      Sprouto
      last edited by 28 Sept 2021, 02:41

      This looks like a wonderful effort.

      1 Reply Last reply Reply Quote 0
      • T
        tatsu @thecore
        last edited by 28 Sept 2021, 10:43

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

        Also i am working on an interface in python

        nice!

        yuck python, but nice anyways!

        let me know once it's done

        actually you and @io_nox should be collaborating and making something together.

        38437c89-5b5b-4d15-aba7-ec80a85f08b7-image.png

        How to setup FAF on linux

        I 1 Reply Last reply 28 Sept 2021, 11:32 Reply Quote 0
        • I
          IO_Nox @tatsu
          last edited by 28 Sept 2021, 11:32

          For the shortcut proxy an idea was to make it easier for the end users: no digging insides of any scripts, only giving right parameters and/or simply placing in right places. So technically it is same as using *.bat / *.sh files to call many actions from one duble click.

          Will dig into the my window resizing problem later... it happend once in ladder game in the past, but now I'm thinking it was somehow accidetly cased by random resizing (maybe mouse lock can prevent this).

          One little fix and ctrl+f10 kombo (script stopping) deleted, I think this shold work fine with command line arguments:

          definitive args.ahk.txt

          I 1 Reply Last reply 28 Sept 2021, 12:56 Reply Quote 0
          • I
            IO_Nox @IO_Nox
            last edited by 28 Sept 2021, 12:56

            Resize bug update:

            I replaced normal resizing

            WinMaximize, % "ahk_exe " procGame
            WinRestore, % "ahk_exe " procGame
            

            with perverted one

            WinHide , % "ahk_exe " procGame
            WinMaximize, % "ahk_exe " procGame
            WinRestore, % "ahk_exe " procGame
            WinShow  , % "ahk_exe " procGame
            

            and got somethig new:

            • instead of game window I now have debug log
            • resizing of log window works greate
            • if log window is active I can listen game music and sounds
            • if I can find a way to go back to game window it may fix this bug

            Log here: log.txt
            Снимок экрана (8).png Снимок экрана (9).png

            1 Reply Last reply Reply Quote 1
            • I
              IO_Nox
              last edited by 29 Sept 2021, 14:50

              Somehow made both debug and game windows appear at same time:

              • game image frozen on resize
              • debug log on the moment after resize is here:
                WARNING: .\DeviceD3D9.cpp(866) Invalid call
                WARNING: .\DeviceD3D9.cpp(866) Invalid call
                WARNING: Unable to load texture: d:\steam\steamapps\common\supreme commander forged alliance\gamedata\units.scd\units\uel0001\uel0001_albedo.dds
                WARNING: Unable to load texture: d:\steam\steamapps\common\supreme commander forged alliance\gamedata\units.scd\units\uel0001\uel0001_normalsts.dds
                WARNING: Unable to load texture: d:\steam\steamapps\common\supreme commander forged alliance\gamedata\units.scd\units\uel0001\uel0001_specteam.dds
                WARNING: error loading batched texture: .\DeviceD3D9.cpp(779) Not available
                INFO: Unable to load texture from file: /textures/ui/uef/game/drag-handle/drag-handle-ll_btn_over.dds
                WARNING: error loading batched texture: .\DeviceD3D9.cpp(779) Not available
                INFO: Unable to load texture from file: /textures/ui/uef/game/drag-handle/drag-handle-ul_btn_over.dds
                WARNING: error loading batched texture: .\DeviceD3D9.cpp(779) Not available
                INFO: Unable to load texture from file: /textures/ui/common/icons/units/land_over.dds
                WARNING: error loading batched texture: .\DeviceD3D9.cpp(779) Not available
                INFO: Unable to load texture from file: /textures/ui/common/icons/units/amph_over.dds
                WARNING: .\DeviceD3D9.cpp(866) Invalid call
                WARNING: .\DeviceD3D9.cpp(866) Invalid call
                WARNING: unable to lock dynamic texture: Invalid call
                WARNING: Unable to load texture: d:\steam\steamapps\common\supreme commander forged alliance\gamedata\effects.scd\effects\entities\aeonbuildeffect\aeonbuildeffect01_albedo.dds
                WARNING: Unable to load texture: d:\steam\steamapps\common\supreme commander forged alliance\gamedata\effects.scd\effects\entities\aeonbuildeffect\aeonbuildeffect01_normalsts.dds
                WARNING: Unable to load texture: d:\steam\steamapps\common\supreme commander forged alliance\gamedata\effects.scd\effects\entities\aeonbuildeffect\aeonbuildeffect01_specteam.dds
                WARNING: unable to lock dynamic texture: Invalid call
                WARNING: .\DeviceD3D9.cpp(866) Invalid call
                WARNING: .\DeviceD3D9.cpp(866) Invalid call
              • just like changing resolution from game menu it seems game lost traces of my videocard...
              1 Reply Last reply Reply Quote 0
              • T
                thecore
                last edited by 1 Oct 2021, 08:49

                Supreme Commander Definitive Launcher 1.0
                Made in python, i created a stand alone version below, just go to settings and set the game paths.

                Capture.JPG
                Supreme Commander Definitive Launcher.part12.rar Supreme Commander Definitive Launcher.part11.rar Supreme Commander Definitive Launcher.part10.rar Supreme Commander Definitive Launcher.part09.rar Supreme Commander Definitive Launcher.part08.rar Supreme Commander Definitive Launcher.part07.rar Supreme Commander Definitive Launcher.part06.rar Supreme Commander Definitive Launcher.part05.rar Supreme Commander Definitive Launcher.part04.rar Supreme Commander Definitive Launcher.part03.rar Supreme Commander Definitive Launcher.part02.rar Supreme Commander Definitive Launcher.part01.rar

                Here are the files before converting it to a stand alone
                Supreme Commander Definitive Launcher python.part6.rar Supreme Commander Definitive Launcher python.part5.rar Supreme Commander Definitive Launcher python.part4.rar Supreme Commander Definitive Launcher python.part3.rar Supreme Commander Definitive Launcher python.part2.rar Supreme Commander Definitive Launcher python.part1.rar

                Never Fear, A Geek is Here!

                I 1 Reply Last reply 3 Oct 2021, 12:48 Reply Quote 2
                • I
                  IO_Nox @thecore
                  last edited by 3 Oct 2021, 12:48

                  Solved my image freze on resizing bug (lost video adapter):
                  Moved game to the system disc (C:\ in my case, the game was moved in Steam GUI).
                  This solution was found here:
                  https://forums.faforever.com/viewtopic.php?f=3&t=18603

                  @thecore, the mouse clip (from v 1.04) is broken for a not fullscreen window, maybe a Windows 10 ui scaling involved here - it locks mouse but in the area with lesser width and height then actual window and actual window size is more when what I set it to be in args.

                  Here is the working variant for any window size:

                  
                  if(clipMouse = true)
                  {
                  	SetTimer, clipProc, 100 
                  }
                  clipProc: 
                  	if (!ProcessExist(procGame)) 
                  		return
                  	;//checks if the game window is active
                  	if !WinActive("ahk_exe " procGame)
                  	{
                  		return
                  	}
                  	
                  	; this will get your game window size
                  	WinGetTitle, winTitle, ahk_exe %procGame%
                  	WinGetPos, X, Y, W, H, %winTitle%
                  	
                  	;//trap mouse
                  	ClipCursor( true, X, Y, W, H)
                  	
                  return
                  ; //lock the mouse within the game window
                  ClipCursor( Confine=True, x1=0 , y1=0, x2=1, y2=1 ) 
                  {
                  	VarSetCapacity(R,16,0),  NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
                  	return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
                  }
                  

                  full script here (just delete .txt to use it):
                  definitiveResizeAndMouseLock.ahk.txt

                  T 1 Reply Last reply 3 Oct 2021, 22:53 Reply Quote 1
                  • I
                    IO_Nox
                    last edited by 3 Oct 2021, 14:18

                    A Little error in full script:
                    definitiveResizeAndMouseLock.ahk.txt
                    I screwed up at automathic setting for the dual screen size 😉
                    was:

                    	width_2 := width*2
                    	height_2 := height*2
                    

                    now is good one:

                    	width_2 := width*2
                    	height_2 := height
                    

                    Result of the modified definiteve script divide for sortcut proxy:

                    • only the mouse lock to reuse with any app
                      mouseLock.ahk.txt
                    • only the resize hotkeys to reuse with any app
                      definitiveResize.ahk.txt

                    Full example: Universal Sortcut Parser.rar

                    1 Reply Last reply Reply Quote 1
                    • T
                      thecore @IO_Nox
                      last edited by 3 Oct 2021, 22:53

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

                      Windows 10 ui scaling involved here

                      Yes i did not test with Windows 10 ui scaling, the fixed worked, however i found one issue. The mouse would flicker when at the edge of the screen.

                      Here is the fix

                      clipProc: 
                      	if (!ProcessExist(procGame)) 
                      		return
                      	;//checks if the game window is active
                      	if !WinActive("ahk_exe " procGame)
                      	{
                      		return
                      	}	
                      	; this will get your game window size
                      	WinGetTitle, winTitle, ahk_exe %procGame%
                      	WinGetPos, X, Y, W, H, %winTitle%
                      	w := w - 1
                      	h := h - 1
                      	;//trap mouse
                      	ClipCursor( true, X, Y, W, H)
                      	
                      return
                      

                      Never Fear, A Geek is Here!

                      1 Reply Last reply Reply Quote 1
                      • T
                        thecore
                        last edited by 4 Oct 2021, 06:38

                        @IO_Nox
                        Found a bug with SysGet, Mon1, Monitor, 1 and using Mon1Left
                        Sometimes Mon1Left is 0 and Mon1Right has the correct value depending on your screen setup

                        Here is a fix

                        if(autoSetMonitorSize == true)
                        {
                        	SysGet, Mon1, Monitor, 1 ;//get monitor 1 resolution
                        	if(Mon1Right != 0)
                        		width := Mon1Right ; //set width resolution
                        	else if(Mon1Left != 0)
                        		width := % Mon1Left
                        	else 
                        		width := 1920
                        
                        	if(Mon1Bottom != 0)
                        		height := Mon1Bottom ; //set width resolution
                        	else if(Mon1Top != 0)
                        		height := Mon1Top
                        	else 
                        		height := 1080
                        	
                        	;//if the value is negative change it to positive number
                        	if(width < 0)
                        	{
                        		width := (-1 * width)
                        	}
                        	if(height < 0)
                        	{
                        		height := (-1 * height)
                        	}	
                        }
                        

                        I am also improving the Launcher with ui scaling.

                        Never Fear, A Geek is Here!

                        1 Reply Last reply Reply Quote 1
                        • T
                          thecore
                          last edited by 20 Oct 2021, 09:49

                          Definitive Supreme Commander Launcher 1.02
                          It has come a long way but i have decided to create a fun little github project for it.

                          https://github.com/ageekhere/Definitive-Supreme-Commander-Launcher

                          Lots of changes in this update, hopefully there are not too many issues with this version.

                          Never Fear, A Geek is Here!

                          1 Reply Last reply Reply Quote 1
                          • B
                            BUZALBASH
                            last edited by 4 Nov 2021, 13:38

                            Hello everyone, I just came to the game, I want the game to run on two monitors (the monitors are the same, I want to use the second one as a large minimap) tell me, I correctly understood that a completely different story is being discussed in this topic and I don't need this script.

                            T tatsuT arma473A 3 Replies Last reply 4 Nov 2021, 22:30 Reply Quote 0
                            • T
                              thecore @BUZALBASH
                              last edited by 4 Nov 2021, 22:30

                              @buzalbash You can either use the scripts above or try my Launcher at https://github.com/ageekhere/Definitive-Supreme-Commander-Launcher

                              You need to get the following mods from the FAF database
                              Common Mod Tools
                              ui-party enabled

                              You also need to switch the game to windowed mode.

                              Then in the Launcher all you need to do is go to settings and enable the game and set the install location.

                              You can even enable auto dual screen switcher, however it is still work in progress, but getting close.

                              Never Fear, A Geek is Here!

                              1 Reply Last reply Reply Quote 0
                              • tatsuT
                                tatsu @BUZALBASH
                                last edited by 5 Nov 2021, 10:17

                                @buzalbash no this is exactly what this script accomplishes.

                                How to setup FAF on linux

                                1 Reply Last reply Reply Quote 0
                                • T
                                  thecore
                                  last edited by 1 Dec 2021, 00:24

                                  Definitive Supreme Commander Launcher 1.03 autohotkey script update 1.10

                                  • removed loadgame images 9 10 11 because it caused false switches
                                  • replaced some WinMinimizeAll with WinMinimize, A
                                  • disable endgame dualscreen switcher when using the FAF client
                                    https://github.com/ageekhere/Definitive-Supreme-Commander-Launcher/releases/tag/version1.03

                                  Never Fear, A Geek is Here!

                                  1 Reply Last reply Reply Quote 0
                                  • arma473A
                                    arma473 @BUZALBASH
                                    last edited by 1 Dec 2021, 02:28

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

                                    Hello everyone, I just came to the game, I want the game to run on two monitors (the monitors are the same, I want to use the second one as a large minimap) tell me, I correctly understood that a completely different story is being discussed in this topic and I don't need this script.

                                    You should not need this script. I was running a second monitor as a "big minimap" before I got this script.

                                    One tip: instead of having your second monitor show a regular map, with 3D-rendered terrain, change it to a topographical map. That uses less system resources. My setup was smoother once I changed it to that.

                                    1 Reply Last reply Reply Quote 0
                                    • T thecore referenced this topic on 30 Apr 2022, 00:30
                                    • T thecore referenced this topic on 6 Jun 2022, 23:10
                                    • maggeM magge referenced this topic on 8 Jul 2022, 17:07
                                    • T thecore referenced this topic on 9 Jan 2023, 04:21
                                    • T thecore referenced this topic on 23 Jan 2023, 00:27
                                    • AmygdalaA Amygdala referenced this topic on 8 Mar 2023, 19:16
                                    • maggeM
                                      magge Global Moderator
                                      last edited by magge 15 Mar 2023, 17:32

                                      I link this post for the people who are asking me about the fake full screen script, and are having trouble understanding the first post and all the different scripts floating around.


                                      This three-step guide is the most basic setup for one monitor full screen, which should work for nearly all use cases:

                                      1. Set the game to window mode via your in game options menu
                                      2. Install autohotkey https://www.autohotkey.com/
                                      3. Download attached file and extract the .rar → right-click the script ⇾ Run Script

                                      Download: ForgedAlliance_Borderless.rar
                                      (.ahk scripts are not allowed to attach, it is the first script from the first post)


                                      Script explanation:

                                      This AutoHotkey script periodically checks if a process named "ForgedAlliance.exe" is running. The script minimizes and maximizes the window as a way to update the window's appearance and to remove any glitches that may occur due to the removal of the window border.

                                      You can pause/edit the script if you click on the green H icon in your right taskbar.


                                      For any special cases like several monitors, etc. you can still go through this thread to find the scripts to tinker with, you are probably more advanced than anyway.

                                      If any questions, just ask.

                                      9f39c237-13d0-40e1-825f-a2d8a736c176-image.png

                                      707d912b-f219-4307-90e5-94d395951bfe-image.png


                                      Script content:

                                      #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) 
                                              {
                                              WinSet, Style, -0xC40000, % "ahk_exe " procName
                                              WinMinimize , % "ahk_exe " procName
                                              WinMaximize, % "ahk_exe " procName
                                          }
                                          Return
                                      
                                      ProcessExist(exeName)
                                      {
                                         Process, Exist, %exeName%
                                         return !!ERRORLEVEL
                                      }
                                      return
                                      

                                      Join a FAFtastic Team

                                      T 1 Reply Last reply 17 Mar 2023, 10:03 Reply Quote 2
                                      • T
                                        thecore @magge
                                        last edited by 17 Mar 2023, 10:03

                                        @magge You can also tell them to try the Definitive Supreme Commander Launcher where I did all the configurations.

                                        https://github.com/ageekhere/Definitive-Supreme-Commander-Launcher/releases/tag/version1.03

                                        Never Fear, A Geek is Here!

                                        T_R_U_putinT 1 Reply Last reply 11 Feb 2024, 18:44 Reply Quote 1
                                        • E
                                          ElOhTeeBee
                                          last edited by 22 Apr 2023, 11:02

                                          Is there any way, at all, to both run FAF in a borderless window AND still be able to scroll by moving the mouse to the edge of the screen? The script in the OP doesn't do it, magge's script doesn't do it, and thecore's launcher doesn't do it.

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