Author Topic: Better Widescreen Borders - Testing Needed!  (Read 3639 times)

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Better Widescreen Borders - Testing Needed!
« on: 04 Jun 2013, 19:38 »
Hello! I've just moved to a new computer and widescreen borders are no longer working in my game. I seem to be having this problem.

From DebugView:
Quote
[2832] AGS: Widescreen side borders: game resolution: 800 x 600; desktop resolution: 1920 x 1080
[2832] AGS: Widescreen side borders: gfx card does not support suitable resolution. will attempt 1066 x 600 anyway
[2832] AGS: Attempt to switch gfx mode to 1066 x 600 (32-bit)
[2832] AGS: Failed, resolution not supported

What I'm wondering is, why doesn't AGS try standard resolutions like 1366x768 or 1280x720 and add borders on the top and bottom, as well as the left and right?

Like the first, instead of the second screen:


I did try to tinker with the AGS source code, but Visual Studio 2008 doesn't support Solution Folders, so I couldn't open it. (I probably would have been stumped anyway, but I'm keen to find a solution for this!)

Any help or suggestions would be hugely appreciated!
« Last Edit: 06 Jun 2013, 10:21 by Ali »

Ghost

  • AGS Baker
  • Rottwheelers
  • Simple plans can work.
    • Ghost worked on a game that was nominated for an AGS Award!
      Ghost worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #1 on: 04 Jun 2013, 19:47 »
I know of (at least) one case where fullscreen widescreen borders were available in DirectDraw but not in D3D. I don't know if Nelly has any features that enforce the use of D3D, so maybe try changing the driver?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #2 on: 04 Jun 2013, 20:02 »
This is the reason I keep running AGS games in window :(.

BTW, this is Engine issue, not Editor one.

Eric

  • Rottwheelers
    • I can help with story design
    •  
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #3 on: 04 Jun 2013, 20:05 »
Have you tried updating your graphics card drivers? That worked for me when I had this issue.

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #4 on: 04 Jun 2013, 20:23 »
This is the reason I keep running AGS games in window :(.

BTW, this is Engine issue, not Editor one.

Whoops! I meant to post this in the Engine forum. Could a mod move it, please?

Does that mean that what I'm asking for is very difficult to implement? I'd imagined that it wouldn't be much more complicated than the current widescreen borders.


Have you tried updating your graphics card drivers? That worked for me when I had this issue.

Downloading now...

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #5 on: 04 Jun 2013, 20:27 »
Does that mean that what I'm asking for is very difficult to implement?
Maybe not... I don't know. Someone should address this problem :).

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #6 on: 04 Jun 2013, 21:58 »
Unfortunately, new drivers and switching to DX5 have no effect.

I'd keen to rummage around, however inexpertly, to try to solve this. But because Visual Studio 2008 Express doesn't support Solution Folders, I'm not able to edit or compile the source code.

Is an Express-friendly version of the source in existence, or do I need to find a full version of Visual Studio?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #7 on: 04 Jun 2013, 22:06 »
I'd keen to rummage around, however inexpertly, to try to solve this. But because Visual Studio 2008 Express doesn't support Solution Folders, I'm not able to edit or compile the source code.

Is an Express-friendly version of the source in existence, or do I need to find a full version of Visual Studio?

I never heard about express edition not allowing solution folders... If I understand correctly, these are folders on the root level, not inside project? In such case we may easily remove solution folders from Engine solution (they contain only reference materials) and move 2 projects up from the folder in Editor solution.
What source code do you use?

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #8 on: 04 Jun 2013, 22:19 »
Yes, my understanding of it is that VS Express can have folders within the project, but not actual folders. Here's someone with the same issue http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvc/thread/2a8e62c8-e14f-4027-8704-7d943c99303e

I downloaded the source code from here:
https://github.com/adventuregamestudio

Is that the right version to work from?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #9 on: 04 Jun 2013, 23:26 »
Here I quickly fixed an Engine solution:
http://www.mediafire.com/download/35tlbak049mu8gf/Engine.sln

Does it work for you?
I want to be sure this solves the Express issue before updating repository.

You won't be able to build Editor.Full.sln with Express edition anyway, because it does not support linking C++ and C#. You may try Editor.NoNative though if you want to.
« Last Edit: 04 Jun 2013, 23:27 by Crimson Wizard »

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #10 on: 04 Jun 2013, 23:58 »
I'm afraid it doesn't seem to work. I get messages saying Common.Lib, Compiler.Lib and Engine.app can't be loaded. (That is fewer errors than the existing Engine.sln.)

Editor.NoNative does open. What's the difference between it and Editor.Full? If that's possible to summarise?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #11 on: 05 Jun 2013, 08:12 »
I'm afraid it doesn't seem to work. I get messages saying Common.Lib, Compiler.Lib and Engine.app can't be loaded.
Errrmmmm.... weird. where did you put it? Are there any details in those error messages?

Editor.NoNative does open. What's the difference between it and Editor.Full? If that's possible to summarise?
It does not have AGS.Native project in the solution.
The Editor is a C# program, and AGS.Native is a mixed C++/CLR library which Editor uses. But Editor may be safely compiled without latter. You just need to put the AGS.Native near editor exe before running it.
Express edition can compile C# program, but it can't compile mixed code, that's why there's a solution without one.
You may compiled Editor with Editor.NoNative you may take the ready AGS.Native.dll from the latest beta build, for example.

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Re: [REQUEST] More Flexible Widescreen Borders?
« Reply #12 on: 05 Jun 2013, 09:32 »
I was opening it in C#, but opening it as C++ works. Forgive my ignorance!

I suspect I'll be back with more questions, but thanks so far.

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Re: Better Widescreen Borders - Testing Needed!
« Reply #13 on: 06 Jun 2013, 10:21 »
Well it took my about 16 hours to compile AGS! But luckily, it turns out to be quite easy to adjust the resolution settings.

I cobbled together a version of the editor which has the effect I want. Please test! It currently applies only to 800x600 games, with desktop resolutions of 1280x720, 1600 x 900, 1920x1080, 1360 x 768, 1280x768  or 1440 x 900.

http://ali.agser.me/ags_better_borders_test.zip
Includes: custom acwin.exe, test game (3.3 beta), modified .cpp files.


What I'm wondering is:

1) Can I safely use a customised acwin.exe with a stable build of AGS (like 3.12)?
2) How should I make the resolution more adaptable to different systems?
3) How should I give the player control over resolution:
                - for instance, a player might prefer to play 1920x1080 bordered rather than 1280x720 bordered, if they prefer things sharper.


I'm certain my scripting is very naive and inefficient. From graphics_mode.cpp:
Code: C
  1. if (gameHeight == 600) // ALI
  2.                         {
  3.                                 if (screenRatio >= 1777) // 1280x720, 1600 x 900, 1920x1080 (16:9)
  4.                                 {
  5.                                         supportedRes = gfxDriver->FindSupportedResolutionWidth(1280, 720, firstDepth, 110);
  6.                                         Out::FPrint("ALI: Attempt 1280 x 720. Supported = %d.", supportedRes);
  7.  
  8.                                         if (supportedRes > 0)
  9.                                         {
  10.                                                 Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1280, 720);
  11.                                                 failed = init_gfx_mode(1280, 720, firstDepth);
  12.                                         }
  13.                                         else
  14.                                         {
  15.                                                 Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1280, 720);
  16.  
  17.                                                 supportedRes = gfxDriver->FindSupportedResolutionWidth(1600, 900, firstDepth, 110);
  18.                                             Out::FPrint("ALI: Attempt 1600 x 900. Supported = %d.", supportedRes);
  19.  
  20.                                                 if (supportedRes > 0)
  21.                                                 {
  22.                                                         Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1600, 900);
  23.                                                         failed = init_gfx_mode(1600, 900, firstDepth);
  24.                                                 }
  25.                                                 else
  26.                                                 {
  27.                                                         Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1600, 900);
  28.  
  29.                                                         supportedRes = gfxDriver->FindSupportedResolutionWidth(1920, 1080, firstDepth, 110);
  30.                                                         Out::FPrint("ALI: Attempt 1920 x 1080. Supported = %d.", supportedRes);
  31.  
  32.                                                         if (supportedRes > 0)
  33.                                                         {
  34.                                                                 Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1920, 1080);
  35.                                                                 failed = init_gfx_mode(1920,1080, firstDepth);
  36.                                                         }
  37.                                                         else
  38.                                                         {
  39.                                                                 Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1920, 1080);
  40.                                                         }
  41.  
  42.                                                 }
  43.  
  44.  
  45.                                         }
  46.  
  47.                                 }
  48.  
  49.                                 else if (screenRatio <= 1777) // 1360 x 768, 1280x768, 1440 x 900 (16:9)
  50.                                 {
  51.                                         supportedRes = gfxDriver->FindSupportedResolutionWidth(1360, 768, firstDepth, 110);
  52.                                         Out::FPrint("ALI: Attempt 1360 x 768. Supported = %d.", supportedRes);
  53.  
  54.                                         if (supportedRes > 0)
  55.                                         {
  56.                                                 Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1360, 768);
  57.                                                 failed = init_gfx_mode(1360, 768, firstDepth);
  58.                                         }
  59.                                         else
  60.                                         {
  61.                                                 Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1360, 768);
  62.  
  63.                                                 supportedRes = gfxDriver->FindSupportedResolutionWidth(1280, 768, firstDepth, 110);
  64.                                             Out::FPrint("ALI: Attempt 1280 x 768. Supported = %d.", supportedRes);
  65.  
  66.                                                 if (supportedRes > 0)
  67.                                                 {
  68.                                                         Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1280, 768);
  69.                                                         failed = init_gfx_mode(1280, 768, firstDepth);
  70.                                                 }
  71.                                                 else
  72.                                                 {
  73.                                                         Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1280, 768);
  74.  
  75.                                                         supportedRes = gfxDriver->FindSupportedResolutionWidth(1440, 900, firstDepth, 110);
  76.                                                         Out::FPrint("ALI: Attempt 1440 x 900. Supported = %d.", supportedRes);
  77.  
  78.                                                         if (supportedRes > 0)
  79.                                                         {
  80.                                                                 Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1440, 900);
  81.                                                                 failed = init_gfx_mode(1440, 900, firstDepth);
  82.                                                         }
  83.                                                         else
  84.                                                         {
  85.                                                                 Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1440, 900);
  86.                                                         }
  87.  
  88.                                                 }
  89.  
  90.  
  91.                                         }
  92.  
  93.                                 }
  94.  
  95.                         }


Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Better Widescreen Borders - Testing Needed!
« Reply #14 on: 06 Jun 2013, 10:32 »
1) Can I safely use a customised acwin.exe with a stable build of AGS (like 3.12)?
Yes.

3) How should I give the player control over resolution:
                - for instance, a player might prefer to play 1920x1080 bordered rather than 1280x720 bordered, if they prefer things sharper.
Using config file, for example. You may add new parameter there if you need. Look for "read_config_file" function.

Ali

  • What will become of the baron?
    • Ali worked on a game that was nominated for an AGS Award!
      Ali worked on a game that won an AGS Award!
Re: Better Widescreen Borders - Testing Needed!
« Reply #15 on: 06 Jun 2013, 11:05 »
1) Fantastic!

3) Also great! If I harbour a hope that this might eventually be integrated into AGS, should I avoid messing with the winsetup?

Regarding 2), I think a 'for' loop of some kind would be a better way of trying different resolutions. But I would appreciate any guidance regarding that.