Help - Bug - Game created in 800x600 however different computers/monitors have different outputs for FullScreen Mode causing Image Distortion
by Vikram Jhaveri · in Torque Game Builder · 09/22/2009 (9:14 am) · 6 replies
I was creating my game in 800x600 View. Everything was fine until i decided to run fullscreen.
I tested my game (EXE Version) on 6 different computers (work, laptop and home) here is the problem.
2 Computers - Intel Graphics - Widescreen Monitors - Full Screen is fine with Black Bars on the side
4 Computers - 1 AMD Card - 3 Intel Graphics - Widescreen Monitors - Full Screen does not show bars. It covers the full screen. Causing the images to stretch and look bad.
I have gone through forums. Tried rebuilding the code using Vista Fix Post. Did not help me.
Any help appreciated. Here is what i want:
Image should not distort. I do not mind the black bars.
This is a major bug IMHO. Torque should have tested this. I have a game almost ready for launch and now i find this bug.
Kindly give me steps to fix this.
Thanks a ton for any help.
I tested my game (EXE Version) on 6 different computers (work, laptop and home) here is the problem.
2 Computers - Intel Graphics - Widescreen Monitors - Full Screen is fine with Black Bars on the side
4 Computers - 1 AMD Card - 3 Intel Graphics - Widescreen Monitors - Full Screen does not show bars. It covers the full screen. Causing the images to stretch and look bad.
I have gone through forums. Tried rebuilding the code using Vista Fix Post. Did not help me.
Any help appreciated. Here is what i want:
Image should not distort. I do not mind the black bars.
This is a major bug IMHO. Torque should have tested this. I have a game almost ready for launch and now i find this bug.
Kindly give me steps to fix this.
Thanks a ton for any help.
#2
Quick question here. What is better:
1. Create the Game in Widescreen or Fullscreen?
2. Create at 800x600 or 1600x1200 or 1920x1200
Thanks...
09/22/2009 (12:41 pm)
I came to the same conclusion. Use a high screen resolution and let the user select; to dumb it down. Quick question here. What is better:
1. Create the Game in Widescreen or Fullscreen?
2. Create at 800x600 or 1600x1200 or 1920x1200
Thanks...
#3
09/22/2009 (3:11 pm)
Anyone out there that has published their games that can help me answer this question. Would be much appreciated.
#4
Since you designed at 800x600, change the "1024.0/768.0" to "800/600".
09/22/2009 (3:32 pm)
I have something like this in my game:$qInExtentChange = false;
function sceneWindow2D::onExtentChange( %this, %data )
{
if( $qInExtentChange ) return;
$qInExtentChange = true;
setAcceptableScreenRatio();
// If the current scene has an extent change method, call it
$lastLoadedScene.onExtentChange();
$qInExtentChange = false;
}
function setAcceptableScreenRatio()
{
%screenWidth = getWord( Canvas.extent, 0 );
%screenHeight = getWord( Canvas.extent, 1 );
%screenRatio = %screenWidth / %screenHeight;
%optimalRatio = 1024.0 / 768.0;
%newWidth = %screenWidth;
%newHeight = %screenHeight;
if( %screenRatio < %optimalRatio )
%newHeight = %screenWidth / %optimalRatio;
else if( %screenRatio > %optimalRatio )
%newWidth = %screenHeight * %optimalRatio;
%newX = (%screenWidth - %newWidth) / 2.0;
%newY = (%screenHeight - %newHeight) / 2.0;
sceneWindow2D.setPosition( %newX, %newY );
sceneWindow2D.setExtent( %newWidth, %newHeight );
}Since you designed at 800x600, change the "1024.0/768.0" to "800/600".
#5
If you can't do both, 4:3 and 5:4 aspects are fine. Popcap get away with it. Computers with a decent driver have aspect-ratio corrected scaling (Mac, some nVidia Windows drivers on LCDs).
09/22/2009 (3:41 pm)
Both. It's not easy, unfortunately.If you can't do both, 4:3 and 5:4 aspects are fine. Popcap get away with it. Computers with a decent driver have aspect-ratio corrected scaling (Mac, some nVidia Windows drivers on LCDs).
#6
There are also a few things you have to consider. Basically, you have your design aspect ratio and your monitor aspect ratio. The monitor aspect ratio is NOT simply the pixel width divided by the pixel height. For example, I don't have a widescreen monitor, but I can run at 1600x900 resolution (which gives me non-square pixels). If a game assumes that 1600x900 = widescreen, I will get a squashed picture when I could have run it at the proper aspect ratio.
Under Windows, at least, there are some OS functions to get the real monitor size (GetDeviceCaps() with HORZSIZE and VERTSIZE) but they can be wrong if the user doesn't have a monitor driver installed. (How many of you have drivers for something other than "Default Monitor"?) So that value should only be treated as a guess. In truth, it's probably best to ask users what their monitor aspect ratio is (with a few common settings, like 4:3, 5:4, 16:9, 16:10), or at the very least provide a widescreen setting.
In any case, if you have GUI elements other than just a sceneWindow2D, you will probably need to add in an extra dummy GuiControl parent to all of your GUI configurations that can be resized -- by default, anything sent to Canvas.setContent() is forced to the size of the Canvas itself. If you use the mouse cursor at all, you may also run into other issues if your code is not set up to handle mouse cursor coordinates outside the bounds of the screen. Same goes if you have any code that assumes that screen size and sceneWindow2D size are equal.
I suppose I could make a resource out of mine, although it's not a scripted solution. I tried to make it so that it could just be dropped in and most scripts would think that the letterboxed size was in fact the screen size. For scripted stuff, there is what William has already posted above, and there's also this resource, but please do keep in mind what I said about non-square pixels.
09/28/2009 (10:43 pm)
I just did something like this myself in my own code. I modified the Canvas class to simulate being a different screen size so that any GUI elements would be properly resized as well (not just sceneWindow2D).There are also a few things you have to consider. Basically, you have your design aspect ratio and your monitor aspect ratio. The monitor aspect ratio is NOT simply the pixel width divided by the pixel height. For example, I don't have a widescreen monitor, but I can run at 1600x900 resolution (which gives me non-square pixels). If a game assumes that 1600x900 = widescreen, I will get a squashed picture when I could have run it at the proper aspect ratio.
Under Windows, at least, there are some OS functions to get the real monitor size (GetDeviceCaps() with HORZSIZE and VERTSIZE) but they can be wrong if the user doesn't have a monitor driver installed. (How many of you have drivers for something other than "Default Monitor"?) So that value should only be treated as a guess. In truth, it's probably best to ask users what their monitor aspect ratio is (with a few common settings, like 4:3, 5:4, 16:9, 16:10), or at the very least provide a widescreen setting.
In any case, if you have GUI elements other than just a sceneWindow2D, you will probably need to add in an extra dummy GuiControl parent to all of your GUI configurations that can be resized -- by default, anything sent to Canvas.setContent() is forced to the size of the Canvas itself. If you use the mouse cursor at all, you may also run into other issues if your code is not set up to handle mouse cursor coordinates outside the bounds of the screen. Same goes if you have any code that assumes that screen size and sceneWindow2D size are equal.
I suppose I could make a resource out of mine, although it's not a scripted solution. I tried to make it so that it could just be dropped in and most scripts would think that the letterboxed size was in fact the screen size. For scripted stuff, there is what William has already posted above, and there's also this resource, but please do keep in mind what I said about non-square pixels.
Torque Owner Joe Rossi
Indri Games
If it looks bad, maybe allow the users to adjust the screen size? Torque supports more than 800x600.