Adventure Game Studio | Forums

AGS Development => Engine Development => Topic started by: Ali on Tue 04/06/2013 19:38:41

Title: Better Widescreen Borders - Testing Needed!
Post by: Ali on Tue 04/06/2013 19:38:41
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 (http://www.adventuregamestudio.co.uk/forums/index.php?topic=40848.msg540190#msg540190).

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:
(http://i.imgur.com/4MvnEI0.jpg)

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!
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Ghost on Tue 04/06/2013 19:47:30
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?
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Crimson Wizard on Tue 04/06/2013 20:02:08
This is the reason I keep running AGS games in window :(.

BTW, this is Engine issue, not Editor one.
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Eric on Tue 04/06/2013 20:05:39
Have you tried updating your graphics card drivers? That worked for me when I had this issue.
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Ali on Tue 04/06/2013 20:23:44
Quote from: Crimson Wizard on Tue 04/06/2013 20:02:08
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.


Quote from: Eric on Tue 04/06/2013 20:05:39
Have you tried updating your graphics card drivers? That worked for me when I had this issue.

Downloading now...
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Crimson Wizard on Tue 04/06/2013 20:27:48
Quote from: Ali on Tue 04/06/2013 20:23:44
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 :).
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Ali on Tue 04/06/2013 21:58:37
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?
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Crimson Wizard on Tue 04/06/2013 22:06:56
Quote from: Ali on Tue 04/06/2013 21:58:37
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?
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Ali on Tue 04/06/2013 22:19:35
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?
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Crimson Wizard on Tue 04/06/2013 23:26:19
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.
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Ali on Tue 04/06/2013 23:58:37
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?
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Crimson Wizard on Wed 05/06/2013 08:12:11
Quote from: Ali on Tue 04/06/2013 23:58:37
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?

Quote from: Ali on Tue 04/06/2013 23:58:37
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.
Title: Re: [REQUEST] More Flexible Widescreen Borders?
Post by: Ali on Wed 05/06/2013 09:32:36
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.
Title: Re: Better Widescreen Borders - Testing Needed!
Post by: Ali on Thu 06/06/2013 10:21:32
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) Select
if (gameHeight == 600) // ALI
{
if (screenRatio >= 1777) // 1280x720, 1600 x 900, 1920x1080 (16:9)
{
supportedRes = gfxDriver->FindSupportedResolutionWidth(1280, 720, firstDepth, 110);
Out::FPrint("ALI: Attempt 1280 x 720. Supported = %d.", supportedRes);

if (supportedRes > 0)
{
Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1280, 720);
failed = init_gfx_mode(1280, 720, firstDepth);
}
else
{
Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1280, 720);

supportedRes = gfxDriver->FindSupportedResolutionWidth(1600, 900, firstDepth, 110);
    Out::FPrint("ALI: Attempt 1600 x 900. Supported = %d.", supportedRes);

if (supportedRes > 0)
{
Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1600, 900);
failed = init_gfx_mode(1600, 900, firstDepth);
}
else
{
Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1600, 900);

supportedRes = gfxDriver->FindSupportedResolutionWidth(1920, 1080, firstDepth, 110);
Out::FPrint("ALI: Attempt 1920 x 1080. Supported = %d.", supportedRes);

if (supportedRes > 0)
{
Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1920, 1080);
failed = init_gfx_mode(1920,1080, firstDepth);
}
else
{
Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1920, 1080);
}

}


}

}

else if (screenRatio <= 1777) // 1360 x 768, 1280x768, 1440 x 900 (16:9)
{
supportedRes = gfxDriver->FindSupportedResolutionWidth(1360, 768, firstDepth, 110);
Out::FPrint("ALI: Attempt 1360 x 768. Supported = %d.", supportedRes);

if (supportedRes > 0)
{
Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1360, 768);
failed = init_gfx_mode(1360, 768, firstDepth);
}
else
{
Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1360, 768);

supportedRes = gfxDriver->FindSupportedResolutionWidth(1280, 768, firstDepth, 110);
    Out::FPrint("ALI: Attempt 1280 x 768. Supported = %d.", supportedRes);

if (supportedRes > 0)
{
Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1280, 768);
failed = init_gfx_mode(1280, 768, firstDepth);
}
else
{
Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1280, 768);

supportedRes = gfxDriver->FindSupportedResolutionWidth(1440, 900, firstDepth, 110);
Out::FPrint("ALI: Attempt 1440 x 900. Supported = %d.", supportedRes);

if (supportedRes > 0)
{
Out::FPrint("Widescreen side borders: enabled, attempting resolution %d x %d", 1440, 900);
failed = init_gfx_mode(1440, 900, firstDepth);
}
else
{
Out::FPrint("Widescreen side borders: gfx card does not support suitable resolution: %d x %d", 1440, 900);
}

}


}

}

}


Title: Re: Better Widescreen Borders - Testing Needed!
Post by: Crimson Wizard on Thu 06/06/2013 10:32:29
Quote from: Ali on Thu 06/06/2013 10:21:32
1) Can I safely use a customised acwin.exe with a stable build of AGS (like 3.12)?
Yes.

Quote from: Ali on Thu 06/06/2013 10:21:32
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.
Title: Re: Better Widescreen Borders - Testing Needed!
Post by: Ali on Thu 06/06/2013 11:05:24
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.