[Guide] : fake-fullscreen and optimisation

1.03
Fix an issue with FAF client games where the loading Image timer was not turned back on resulting in the auto fullscreen not working after the first game.

multiMonitor.txt

1.04
Fix an issue where when using the downlords-faf-client the auto dual screen was not working correctly when playing the second game.

Rename multiMonitor.txt to multiMonitor.ahk
multiMonitor.txt

Universal Sortcut Parser
Version 1.0
Universal Sortcut Parser.rar

  • Launch multiple applications from one shortcut.
  • Call usp.ahk with launch parameters and it will run sortcuts and scripts for this parameters.

I tryed to divide command line arguments parsing, app starting and scripts. That way scripst may be more clean and reusable and you can ran many independent scripts and files for each option.
I haven't compiled it, so AutoHotkey shold be installed.
So it now works like

  • you call this proxy with command line arguments,
  • proxy launches files, links, scripts with predefined commandline arguments.

Easiest way to create new option myOpt (if you will call scripts without any args) is to create dirs myOpt in both scripts and shortcuts dirs (or only one of them if you don't care, division of scrips and other files is made for scripts reusage in different options) and place your shortcuts, files and scripts there. And then create shortcut for usp.ahk and add command line argument myOpt in Object value like "usp.ahk" myOpt

I now have 3 normal sortcuts (.lnk) on desctop for (Object values bellow):

  • Downlord's FAF Client
"D:\Program Files\Universal Sortcut Parser\usp.ahk" faf
  • Supreme Commander Forged Alliance
"D:\Program Files\Universal Sortcut Parser\usp.ahk" sc
  • FAForever Map Editor
"D:\Program Files\Universal Sortcut Parser\usp.ahk" maps

Note:

"D:\Program Files\Universal Sortcut Parser\usp.ahk" faf sc maps
  • this will call all 3 options at once 🙂

Options may be written in file and/or inerpreted from file names: files (and all files in folders) named for option in shortcuts and scripts folders will be called.

Example for options.txt:

test script blank testArg1 arg2
test run C:\Program Files\Notepad++\notepad++.exe --help

faf file D:\Program Files\Downlord's FAF Client\downlords-faf-client.exe
faf script borderlessOptimisation ForgedAlliance.exe downlords-faf-client.exe


sc run steam://rungameid/9420
sc script borderlessOptimisation SupremeCommander.exe -

maps file D:\Program Files\fafmapeditor_alpha_v0704_WIP1\FAForeverMapEditor.exe
maps script borderlessOptimisation ForgedAlliance.exe FAForeverMapEditor.exe

About options in file:

  • file will test if file (or dir) exsists and call it (or all files in dir),
  • run will just call anything, USE IT to call files with command line arguments,
  • scripts will search for all matching files and folders in scripts folder and can run them with normal and "additional" command line arguments.

Note:

  • base script name can't contain spaces because spaces are dividers in string parsing, but it does not mater for files in folders.

For example I have adapted my old script and placed it in
scripts/borderlessOptimisation 0 0 1920 1080 folder and I'm calling it for sc option by string

sc script borderlessOptimisation SupremeCommander.exe -

This means that in scripts folder will be called all files named like borderlessOptimisation.exe, borderlessOptimisation second file.ahk, etc. and all files in directories named like borderlessOptimisation and borderlessOptimisation more args.
If I have borderlessOptimisation second file.ahk it will be called with 2 args SupremeCommander.exe - (game and client proccees names for my script, "-" as second arg is to make it run normally if more args are added later).
I have SC FAF borderleess ARGS.ahk in folder named borderlessOptimisation 0 0 1920 1080 so it will be called with 4 more args (6 args total), same as

sc run scripts/borderlessOptimisation 0 0 1920 1080/SC FAF borderleess ARGS.ahk SupremeCommander.exe - 0 0 1920 1080

and same may be done by copy-pasting original Supreme Commander Forged Alliance.lnk shortcut to shortcuts dir and remnaming it into "sc borderlessOptimisation SupremeCommander.exe -.lnk" or just placing shortcut in folder named this way.

Read README.txt for more understending about the naming and some other things.

Added compiled script (usp.exe) here, but if you want to run AHK scripts(*.ahk) AHK instalation is still needed.

Universal Sortcut Parser.rar

@thecore, may I ask If you had issue with game image freezing (but blind play is possible) and/or gray screen on game resize?

I'm trying to test your 1.04 script modifided for command line arguments usage (may be a little broken in process) on single screen and resizing brakes the game even without any script...

My current setup is here:
Universal Sortcut Parser.rar

01.png 02.png
Notes:

  • first screensort - playable
  • second - after resize - musick works, mouse clicks works, menu works and units are moving, but image is broken - it is sctatic and you can esily broke game to gray sceen by colapsing and reopening the window, and I can't close the game window in normal way so only task manager helps.
  • Hm, white space at the bottom of the screensort isn't normal, looks like I have properly f*cked up resizing...
This post is deleted!

Also i am working on an interface in python
2.jpg

3.jpg

@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.

This looks like a wonderful effort.

@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

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

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

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...

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

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

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:

Full example: Universal Sortcut Parser.rar

@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

@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.

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.

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.