Jibble

Author Topic: Fullscreen mode offset on 'gaming' laptops using OpenGL  (Read 576 times)

I've started the beta testing for Guard Duty (with a small sample group initially) and I've received a report of a scaling issue that is something I've experienced on my own laptop too.


I'm not sure if this has been reported before, but I've yet to find any information when searching the forums.


This issue isn't exclusive to Guard Duty, it's something I've experienced when playing both Unavowed and Lamplight City. This makes me think it hasn't been reported before (or is something that we aren't able to fix?).


I am able to resolve the issue by switching graphics driver to Direct3D, but seeing as most commercial AGS games are set to OpenGL as default I thought it was worth starting a discussion.


Here's how Lamplight City looks running fullscreen:


https://i.imgur.com/tMekNUI.jpg


and Unavowed:


https://i.imgur.com/4I7ctXD.jpg


It doesn't matter how you set the Fullscreen Scale or Scaling Method, the results are the same.


However, with Unavowed, when you drop the resolution down to 1680x1050 you get a result like this:


https://i.imgur.com/1HinUgC.jpg


(note, the screen is now centred but not stretching.)


A similar result for Lamplight City too.


So, I've had two machines do this: My own Laptop (a HP Omen with Intel(R) HD Graphics 630 & NVIDIA GeForce GTX 1050) and a testers laptop (A MSI gaming laptop with presumably similar onboard graphics and a GTX 1070)


I'm guessing this is something to do with the laptop switching from the Intel Graphics chip to the NVIDIA chip when the game is launched in fullscreen? However it doesn't happen with the other steam (non AGS) games I've tested.


I'd be interested in hearing other peoples experiences with this. What are the downsides of Direct3D rendering mode? I am considering setting that as default but I would assume Direct3D is more widely compatible.


(apologies for gaps in text, the forums are acting strangely when typing posts!)





Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #1 on: 14 Dec 2018, 16:56 »
Could you provide following info for the both cases (clipped and centered):
- desktop resolution you have on related computer(s);
- actual config settings;
- graphic initialization log.

You may get the log by putting following in acsetup.cfg:
Code: Text
  1. [misc]
  2. log=1
  3.  
the ags.log file should be found in %USERPROFILE%/Saved Games/.ags/


Quote
However, with Unavowed, when you drop the resolution down to 1680x1050 you get a result like this:

To clarify, dropping resolution of what - game or desktop?

Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #2 on: 14 Dec 2018, 17:05 »
To clarify: Dropped resolution of game.


Here's the contents of the log file:


Spoiler: ShowHide
Adventure Game Studio v3.4 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2018 others
ACI version 3.4.1.15


Installing exception handler
Initializing allegro
Initializing game data
Looking for the game data file
Located game data file: d:/Applications/Steam/steamapps/common/Lamplight City/Lamplight City.exe
Opened game data file: game28.dta
Game data version: 49
Compiled with: 3.4.1.15
Setting up game configuration
Setting up window
Initializing TTF renderer
Initializing mouse: number of buttons reported is 5
Checking memory
Data directory: d:/Applications/Steam/steamapps/common/Lamplight City
Initializing speech vox
Voice pack found and initialized.
Initializing audio vox
Audio vox found and initialized.
Initializing keyboard
Install timer
Initialize sound drivers
Sound settings: digital driver ID: 'AXA ' (0x41584120), MIDI driver ID: 'Auto' (0xffffffff)
Installed digital driver ID: 'AXA ' (0x41584120), MIDI driver ID: 'W32M' (0x5733324d)
Install exit handler
Initialize path finder library
Load game data
Game GUI version: 118
Requested script API: v3.4.1 (5), compat level: v3.2.1 (0)
Built library path: agsteam-unified.dll
Plugin 'agsteam-unified' loading succeeded, resolving imports...
Game title: 'Lamplight City'
Checking for disk space
Initializing MOD/XM player
Initializing resolution settings
Game native resolution: 640 x 400 (32 bit)
Device display resolution: 1536 x 864
Game settings: windowed = no, screen def: explicit, screen size: 1920 x 1080, match device ratio: ignore, game scale: proportional
Using graphics factory: OGL
Created graphics driver: OpenGL
Supported gfx modes (32-bit):
   320x200;320x240;400x300;512x384;640x400;640x480;800x600;1024x768;
   1152x864;1280x600;1280x720;1280x768;1280x800;1280x960;1280x1024;1360x768;
   1366x768;1400x1050;1440x900;1600x900;1680x1050;1920x1080;
Attempting to find nearest supported resolution for screen size 1920 x 1080 (32-bit) fullscreen
Attempt to switch gfx mode to 1920 x 1080 (32-bit) fullscreen
Running OpenGL: 4.5.0 - Build 22.20.16.4749
Succeeded. Using gfx mode 1920 x 1080 (32-bit) fullscreen
Render frame set, render dest (96, 0, 1823, 1079 : 1728 x 1080)
Requested gfx filter: StdScale
Graphics filter set: 'StdScale', filter dest (96, 0, 1823, 1079 : 1728 x 1080)
Using gfx filter: StdScale
Mouse control: on, base: 1.000000, speed: 1.000000
Mouse confined: (96,0)-(1823,1079) (1728x1080)
Check for preload image
Initialize sprites
Initialize game settings
Prepare to start game
Audio is processed on the main thread
Checking replay status
Engine initialization complete
Starting game
Game.SetAudioTypeVolume: type: 1, volume: 75, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
Game.SetAudioTypeVolume: type: 4, volume: 100, change: 1680
***** ENGINE HAS SHUTDOWN



and here's the settings:



Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #3 on: 14 Dec 2018, 17:19 »
Device display resolution: 1536 x 864
Game settings: windowed = no, screen def: explicit, screen size: 1920 x 1080, match device ratio: ignore, game scale: proportional
Using graphics factory: OGL
Created graphics driver: OpenGL
Supported gfx modes (32-bit):
   320x200;320x240;400x300;512x384;640x400;640x480;800x600;1024x768;
   1152x864;1280x600;1280x720;1280x768;1280x800;1280x960;1280x1024;1360x768;
   1366x768;1400x1050;1440x900;1600x900;1680x1050;1920x1080;
Attempting to find nearest supported resolution for screen size 1920 x 1080 (32-bit) fullscreen
Attempt to switch gfx mode to 1920 x 1080 (32-bit) fullscreen
Running OpenGL: 4.5.0 - Build 22.20.16.4749
Succeeded. Using gfx mode 1920 x 1080 (32-bit) fullscreen

So, looking at this lets me make a preliminary guess.
OpenGL cannot go into "real" fullscreen mode like DirectX does, so what it does: it tries to change the desktop resolution to necessary size and then create a large borderless window around all the desktop.
The above result may occur in theory if it failed to set new desktop resolution but still proceeded and created a window of larger size.


If this guess is correct, then the fix should be to fallback to using current desktop resolution instead. But I need to make sure it can realize that setting it failed first.


EDIT: on a side note, you probably should not have explicit resolution in the default setup because every player's computer is different. Something has to be done to let AGS store not explicit value but for example "choose current desktop resolution" in config.
« Last Edit: 14 Dec 2018, 17:23 by Crimson Wizard »

Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #4 on: 15 Dec 2018, 12:10 »
On Windows 10, if the dpi of the monitor is above a value it does a 150% rescale of things it consider old - for lack of better definition. I think this is what is happening here.


Edit: my guess is because the winsetup looks blurry and bigger than it should. Segoe UI font is naturally really sharp.


Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #6 on: 15 Dec 2018, 14:19 »
That's weird, I'm making my game on a laptop, and it's set to OpenGL and plays fine, however my game's resolution is 640 x 400.

I haven't played Unavowed or Lamplight city, but I have played most of WE's games with no issues, and A Golden Wake.
(I've stopped playing games on my laptop whilst I'm working on it most of the day)

So I am both curious and concerned if this will occur to users with my game, maybe it's the age of my laptop. (Windows 8)

Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #7 on: 17 Dec 2018, 20:02 »
I tested eriOo's hypothesis as suggested by tzachs and it has resolved the issue. In windows 10 I right clicked the game's exe, clicked Properties, clicked the compatibility tab then 'Change high DPI settings', ticked the box for 'Override high DPI scaling behaviour' and set the drop down 'Scaling performed by:' to Application.

So it seems this is a Windows thing causing the issue, however I've not had the issue with any other games on this laptop and neither has the tester who also experienced it. It's good to know there's a fairy straightforward fix but it's still a bit of a poor first impression for those affected when booting the game. Maybe I've just been unlucky (one out of seven testers experiencing the issue) but is it something that can be fixed on the AGS side of things? Or would you recommend just setting it to 'Scaling performed by: Application' before deploying the game?

Apologies if these are dumb questions, just want to make sure I've covered all bases ready for releasing the game!
« Last Edit: 17 Dec 2018, 20:29 by Chicky »

Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #8 on: 17 Dec 2018, 20:21 »
How does it decide on whether application needs it or not? Maybe there is a way to integrate some info into executable?

Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #9 on: 17 Dec 2018, 20:35 »
Or would you just recommend just setting it to 'Scaling performed by: Application' before deploying the game?
I doubt this would work, it probably wrote a setting to the registry on your computer and didn't modify anything to do with the game.

Unless it is related to whether you start the game with winsetup or not, I think it is likely that either the OpenGL implementation for AGS or the OpenGL driver is not doing something it should, but even if there were no issues in testing I think you'd be better releasing  your game with the option set to Direct3D. I think other than one round of bad Windows 10 updates, Direct3D is the most compatible choice, and stuff like Surface tablets have previously been launched with completely broken OpenGL support.

Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #10 on: 17 Dec 2018, 20:36 »
How does it decide on whether application needs it or not? Maybe there is a way to integrate some info into executable?
I think this is the relevant info: https://docs.microsoft.com/en-gb/windows/desktop/hidpi/high-dpi-desktop-application-development-on-windows

« Last Edit: 19 Dec 2018, 14:01 by eri0o »

tzachs

  • Parking Goat- games that goats like!
    • I can help with translating
    • tzachs worked on a game that was nominated for an AGS Award!
Re: Fullscreen mode offset on 'gaming' laptops using OpenGL
« Reply #12 on: 19 Dec 2018, 18:01 »
It might be possible to fix this without actually changing the engine code.
You might be able to convert the binary from Win32 to UWP using the Desktop App Converter.
I'm not sure if it will work, though, the game needs to meet all of these conditions specified here, I don't know if AGS breaks any one of them.
If it works, then the UWP application would come with a manifest file which you can just edit and set the dpi awareness flag, one of the links erloo put has this example.
If it doesn't work, then maybe modifications can be made to the engine to allow this conversion to work (having a UWP app also allows you to put your game on the Windows Store, which is another reason for wanting to support this in the engine).

Anyway, regarding an engine fix and the links erloo put, there are different APIs to be used depending on the Windows version, see here.

Quote
How does it decide on whether application needs it or not?
Just a guess here, but I'm guessing (wildly) the reason it works fine with DirectX but not with OpenGL, is that you're using an old version of OpenGL (I remember CW mentioned that you're using immediate mode which was deprecated a long time ago), and so Windows assumes it's need the scaling?