3.3.0 update: improved display resolution selection

Started by Crimson Wizard, Sun 30/03/2014 15:22:03

Previous topic - Next topic

Radiant

Yes, it would be nice if these two options worked similar. So that would mean renaming force letterbox to "enable" (and maybe call it top/bottom borders instead of letterbox), and it would be nice if disabling sideborders would try the resolutions without borders first, and if failed try all the rest (just like how disabling letterboxing works now). And maybe make these the top two under 'graphics options' so that they're adjacent to one another.

Crimson Wizard

Quote from: Radiant on Wed 09/04/2014 14:58:54
Yes, it would be nice if these two options worked similar. So that would mean renaming force letterbox to "enable" (and maybe call it top/bottom borders instead of letterbox), and it would be nice if disabling sideborders would try the resolutions without borders first, and if failed try all the rest (just like how disabling letterboxing works now). And maybe make these the top two under 'graphics options' so that they're adjacent to one another.
Yes, I agree it is a right thing to do, because "force letterbox" now works in a more "liberal" way (prior to these changes this option really forced borders, now it simply allows them).

Gurok

Can we call "sideborders" pillarboxing? That's the official term. From what CW has posted about the algorithm, it sounds like "prefer letterboxing" or the inverse "avoid letterboxing" might be appropriate verbs.

I think I was encountering that same 0x0 error too. I'll update from your branch when I get a chance and do some more testing.
[img]http://7d4iqnx.gif;rWRLUuw.gi

Radiant

Quote from: Gurok on Thu 10/04/2014 04:24:00
Can we call "sideborders" pillarboxing? That's the official term.

I'd rather not, as I've never heard of that and it barely even shows up on google. I'd prefer a clear and widely-used term over an "official" one.

Gurok

Quote from: Radiant on Thu 10/04/2014 07:49:10
Quote from: Gurok on Thu 10/04/2014 04:24:00
Can we call "sideborders" pillarboxing? That's the official term.

I'd rather not, as I've never heard of that and it barely even shows up on google. I'd prefer a clear and widely-used term over an "official" one.

I don't know if that's a good test or not. I mean, try applying that test to the term "side borders". I have no trouble finding pillarboxing and letterboxing. I guess our mileage differs.

Ehh... I'm not trying to start a fight. If people love "side borders", I guess it's not that bad.

Do we even need these options? Pillarboxing is the least desirable effect. A screen that's filled with content is most desirable. Is this perhaps just a question of picking an order in which to do things and removing the configuration options?
1. Try all video modes without tolerating letterboxing or pillarboxing
2. Try all video modes tolerating letterboxing
3. Try all video modes tolerating letterboxing and pillarboxing
Similar to, but not quite that same as "Don't force letterbox, enable sideborders" under the current schema. Perhaps that's too narrow an approach. I might just not be seeing the use case for those options. If you end up with a video mode that has non-square pixels, I guess it would throw things out a bit.
[img]http://7d4iqnx.gif;rWRLUuw.gi

Radiant

Quote from: Gurok on Thu 10/04/2014 08:51:58
Do we even need these options?
I think that's a very good question.

As far as I can tell, there are two kinds of players here. One kind prefers to have a full screen without any borders, and one kind that prefers to retain the game's aspect ratio (and, of course, there's a third kind who doesn't care either way). Since AGS games run in 16:10 aspect ratio and most contemporary monitors are 16:9, the second kind of player likes to have borders. I believe top/bottom borders are a remnant from the time when most monitors were 16:12, and most people probably haven't used that option for several years.

Problem

Quote from: Gurok on Thu 10/04/2014 08:51:58
Pillarboxing is the least desirable effect. A screen that's filled with content is most desirable.
I have to disagree here. As a player I have no problem with small sideborders, but I don't like it at all when the graphics are stretched in an unnatural way just to fit the screen size, it just looks wrong.
So there should always be an option to keep the correct aspect ratio that will use sideborders to prevent distorted graphics.

Crimson Wizard

#27
First, please keep in mind, that this is an intermediate state. Custom resolutions feature will have slightly different options: no division between vertical & horizontal borders, but a choice between "stretch", "proportional stretch" and "place in center", with last two allowing borders (these options could be presented differently on setup dialog).

Second, I believe options do not hurt anyone, because they are options. ;)

Third, I myself hate playing a stretched game, it hurts my eyes and feelings :).
I am a happy owner of a wide-screen 16:10 monitor with built-in "4:3" mode support that creates "pillarboxed" image on hardware level (I think). And I was very glad to find a device with such feature, because it lets me to play old 4:3 games in their original look.

Gurok

Oh whoops. I definitely hate distorted aspect ratios too. In my mind, if there were no options to toggle it, the aspect ratio would always be preserved. The coming custom resolutions version sounds like it has a much more sensible set of options anyway.
[img]http://7d4iqnx.gif;rWRLUuw.gi

Adeel

Quote from: Radiant on Thu 10/04/2014 07:49:10
Quote from: Gurok on Thu 10/04/2014 04:24:00
Can we call "sideborders" pillarboxing? That's the official term.

I'd rather not, as I've never heard of that and it barely even shows up on google. I'd prefer a clear and widely-used term over an "official" one.

Or perhaps, we should go full retard and collectively name 'pillarboxing' and 'sideboxing' as: 'ugly-black-boxing' :P

Crimson Wizard

#30
Updated with 3.3.0 hotfix-2:
http://www.mediafire.com/download/rdzu8zaacmt2065/ags_3.3.0_scaling_update.7z

Please, test again if that works (it has slightly modified code).

By the way, Gurok, did it work for you? I'd really wish to know. I've recreated the branch in my repository, but it still has same name.
Quote from: Gurok on Thu 10/04/2014 08:51:58
1. Try all video modes without tolerating letterboxing or pillarboxing
2. Try all video modes tolerating letterboxing
3. Try all video modes tolerating letterboxing and pillarboxing
It now does about that.

Radiant

Ok, I'm a bit confused now what does what. The options are still called "side borders on widescreen monitors" (does this actually detect whether a monitor is widescreen?) and "force alternate", but apparently they've changed now? It would help if these options were worded in the same way and were placed adjacent in the setup screen.

Crimson Wizard


Radiant

Thanks, that's much clearer. So if I understand correctly, if borders are enabled then AGS will attempt for a resolution with borders first, and if none are found, it will find a resolution without borders; whereas if borders are disabled then AGS will only look for resolutions without borders. Is that correct?

Crimson Wizard

Quote from: Radiant on Sat 12/04/2014 20:16:18
Thanks, that's much clearer. So if I understand correctly, if borders are enabled then AGS will attempt for a resolution with borders first, and if none are found, it will find a resolution without borders; whereas if borders are disabled then AGS will only look for resolutions without borders. Is that correct?
No. It will look for all resolutions always, as was requested, so that SOME resolution is found in the end.

If borders option is enabled: it will look for resolution with or without borders, the one that matches better. The desktop aspect ratio is preferred.
If borders option is disabled: it will look for resolution without borders first, and for resolution with borders only if failed.

Gurok

Okay, I did a re-merge. Now I get a crash trying to initialise a high (16-bit) colour game. Let me know if you need more info.

Spoiler

>   acwin.exe!AGS::Common::Bitmap::GetColorDepth()  Line 101 + 0x3 bytes   C++
   acwin.exe!prepare_characters_for_drawing()  Line 1858 + 0x15 bytes   C++
   acwin.exe!draw_screen_background(AGS::Common::Bitmap * ds=0x034867a8)  Line 2123   C++
   acwin.exe!construct_virtual_screen(bool fullRedraw=false)  Line 2543 + 0x9 bytes   C++
   acwin.exe!render_graphics(AGS::Engine::IDriverDependantBitmap * extraBitmap=0x00000000, int extraX=0, int extraY=0)  Line 2575 + 0x7 bytes   C++
   acwin.exe!game_loop_do_render_and_check_mouse(AGS::Engine::IDriverDependantBitmap * extraBitmap=0x00000000, int extraX=0, int extraY=0)  Line 566 + 0x11 bytes   C++
   acwin.exe!mainloop(bool checkControls=true, AGS::Engine::IDriverDependantBitmap * extraBitmap=0x00000000, int extraX=0, int extraY=0)  Line 717 + 0x11 bytes   C++
   acwin.exe!main_game_loop()  Line 840 + 0xd bytes   C++
   acwin.exe!do_play_game()  Line 143   C++
   acwin.exe!initialize_start_and_play_game(int override_start_room=0, const char * loadSaveGameOnStartup=0x00000000)  Line 182 + 0x5 bytes   C++
   acwin.exe!initialize_engine(int argc=1, char * * argv=0x00970490)  Line 1467 + 0x12 bytes   C++
   acwin.exe!_mangled_main(int argc=1, char * * argv=0x00970490)  Line 488 + 0xd bytes   C++
   acwin.exe!__WinMain()  + 0x216 bytes   C
[close]

Spoiler

AGS: Created graphics driver: Direct3D 9
AGS: Initializing screen settings
AGS: Game native resolution: 320 x 200 (16 bit), letterbox optional, side borders enabled
AGS: Initializing gfx filters
AGS: Requested gfx filter: max
AGS: Chosen gfx resolution: 1600 x 1000 (16 bit), game frame: 320 x 200
The thread 'Win32 Thread' (0x146c) has exited with code 0 (0x0).
AGS: Applying scaling filter: StdScale5
AGS: Switching to graphics mode
AGS: Attempt to switch gfx mode to 1600 x 1000 (16-bit) windowed, game frame 320 x 200, gfx filter: StdScale5
'acwin.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\3D Vision\nvSCPAPI.dll'
AGS -- InitializeD3DState()AGS: Succeeded. Using gfx mode 1600 x 1000 (16-bit) windowed, game frame 320 x 200, gfx filter: StdScale5
AGS: Preparing graphics mode screen
AGS: Initializing colour conversion
AGS: Check for preload image
AGS: Initialize sprites
AGS: Set up screen
AGS: Initialize game settings
AGS: Prepare to start game
AGS: Audio is processed on the main thread
AGS: Cursor mode set to 0 ()
AGS: Checking replay status
AGS: Engine initialization complete
AGS: Starting game
AGS: Cursor mode set to 0 ()
AGS: Playing music 0 ()
AGS: Game speed set to 40 (G 32)
AGS: Loading room 1
AGS: Mouse bounds constrained to (0,0)-(319,199) ()
AGS: Now in room 1 ()
First-chance exception at 0x00bdc836 in acwin.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x00bdc836 in acwin.exe: 0xC0000005: Access violation reading location 0x00000000.
[close]

It is better though! I managed to run a windowed/full-screen 32-bit colour game!
[img]http://7d4iqnx.gif;rWRLUuw.gi

Crimson Wizard

#36
No. Something is very wrong with this version. It displays a weird black strip across the screen in fullscreen mode. I need to fix this.
E: this occurs only for 640x480 and 320x240 games.

Also, 16-bit games run fine for me.
The error like that usually happen if you build both Editor and Engine, then start engine having output folder as a working dir: the engine then accepts generated default "acsprset.spr" as a resource for your game, and fails to load sprites.

Radiant

Quote from: Crimson Wizard on Sat 12/04/2014 20:20:18
No. It will look for all resolutions always, as was requested, so that SOME resolution is found in the end.

If borders option is enabled: it will look for resolution with or without borders, the one that matches better. The desktop aspect ratio is preferred.
If borders option is disabled: it will look for resolution without borders first, and for resolution with borders only if failed.

Excellent. Thank you very much!

Crimson Wizard

Fixed two bugs, mostly related to 640x480 games:
http://www.mediafire.com/download/rdzu8zaacmt2065/ags_3.3.0_scaling_update.7z

E: Now that I notice this, mediafire.com allows to replace file while keeping original share link... good to know.

Gurok

Quote from: Crimson Wizard on Sat 12/04/2014 23:17:18
Also, 16-bit games run fine for me.
The error like that usually happen if you build both Editor and Engine, then start engine having output folder as a working dir: the engine then accepts generated default "acsprset.spr" as a resource for your game, and fails to load sprites.

Right you are. Ignore me and my flawed testing process then. :/ I've now tested it outside of the build folder and everything appears to be working well.
[img]http://7d4iqnx.gif;rWRLUuw.gi

SMF spam blocked by CleanTalk