Game Development Community

XBox verion stretched

by Tony Pitman · in Torque X 3D · 11/09/2009 (1:23 pm) · 25 replies

I am sure this has been discussed before, but I couldn't find an answer. I have a TX3D game that I am making. The windows 3D screen looks like this:

www.shatalmic.com/Problems/StretchProblem1.png

I created an xBox version of it and when I run it on the xBox it looks like this:

www.shatalmic.com/Problems/StretchProblem2.png

You can see that it is horizontally stretched thus cutting off the health value and making everything look fat.

What is strange about this to me is that the windows project is set to a "wide screen" resolution (the default of 1280x768) and I am viewing the xBox version on my HD TV which is also wide screen.

What is the proper thing to do about this so that the xBox version doesn't get stretched?

Page «Previous 1 2
#1
11/09/2009 (8:05 pm)
Most HD TV's are set to 1280x720 (or 1920x1080 for full HD). I think only computer displays use the 1024 or 1280 x 768.

I set all of my projects to use 1280x720 resolution. Works on nearly all pc's and it's the format that the XBox can properly resize to match most tv's.
#2
11/09/2009 (8:10 pm)
Thank you for the reply.

Did you happen to take a look at the images that I posted? I may not have made my question clear or maybe the pictures didn't express what I am asking.

I really don't care about the PC version at all. It is just the default build that gets created and I use it for basic testing and such.

My question is why does it get stretched on the xBox version and what do I have to do in order to fix that?
#3
11/10/2009 (11:11 am)
Quote:My question is why does it get stretched on the xBox version
Because your tv can't properly handle that resolution. That resolution is used by computer monitors only.

Quote: and what do I have to do in order to fix that?
Set your project resolution to 1280x720. It is a resolution tv's (and pc's) can handle, and the XBox can properly resize up/down to match the end users tv.
#4
11/10/2009 (11:19 am)
Quote:Because your tv can't properly handle that resolution...

Well, my TV is an HDTV and has a native resolution of 1366 x 768. I would think it could handle 1280x720.

Quote:Set your project resolution to 1280x720
Where do I set this value? The only resolution value I can find is in the torqueSettings.xml file. It is these lines:

<WindowsGraphicsManagerSettings>
		<PreferMultiSampling>false</PreferMultiSampling>
		<PreferredBackBufferHeight>720</PreferredBackBufferHeight>
		<PreferredBackBufferWidth>1280</PreferredBackBufferWidth>
	</WindowsGraphicsManagerSettings>

Notice that they are in a Windows section. Do I just make similar entries in the xbox section.

Is this something I need to do in code in the BeginRun or something like that?
#5
11/10/2009 (2:48 pm)
I tried this and there is a bit of a problem with the GuiPlay class. However there was no stretching etc of the actual game for me. The Gui stretched in TX2D as well.

#6
11/10/2009 (3:15 pm)
Thanks for the reply, Henry.

I know the GUI is stretched and I can deal with that. What I can't fix is the stretching of the 3D objects.

If you look close at the 2 images that I posted you will see it is not just the GUI. Look at the side of the balcony that the user is facing. Notice how the xBox image the balcony is wider than in the windows image even though they are about the same height? You can also notice it on the tall blue building in the background. It is fatter on the xbox than windows.

That is the real problem that I need to solve.
#7
11/10/2009 (3:48 pm)
Had to edit my reply, on a third look there is some distortion between the Xbox version and the PC version. This is a bit troubling. I made a 16x9 3D box and there is less space on the left and right than on the top/bottom. so it is stretched horisontally. I really do not know why.


#8
11/10/2009 (3:51 pm)
I am using 3.1.4. I will have to try what you suggest and see if that does make a difference. Thanks for the suggestion.
#9
11/10/2009 (3:52 pm)
Sorry had to edit my reply there is a distortion.
#10
11/10/2009 (3:54 pm)
Thank you for confirming that then. I would guess there has to be a setting of some kind somewhere. I just don't know where to look.
#11
11/10/2009 (4:18 pm)
OK I found it, now just to find out how to fix it. The updateRect the rectangle it uses to set the aspect ration is 1024x768, always. Like in the OnRender(Vector2 offset, GarageGames.Torque.MathUtil.RectangleF updateRect) in the GuiPlay. weird so apparently the game thinks it is in 4x3 no matter what.
#12
11/10/2009 (4:20 pm)
Heh, that sounds kind of like a problem.
#13
11/10/2009 (4:36 pm)
OK this is quick and dirty and probably wrong however it does work. in GuiPlay.cs

public override void OnRender(Vector2 offset, GarageGames.Torque.MathUtil.RectangleF updateRect)
        {
            _playerScore1.Text = "Player Score: " + Game.Instance.PlayerScore;
            _healthLevel.Text = "Health Level: " + Game.Instance.HealthLevel;
            updateRect.Height = 720;
            updateRect.Width = 1280;
            base.OnRender(offset, updateRect);
        }
#14
11/10/2009 (4:40 pm)
Thanks. I will have to give that a try when I am at home with my xBox later.
#15
11/10/2009 (4:58 pm)
in torquesettings.xml I have
<XboxGraphicsManagerSettings>
    <UseDisplaySizeForBackbuffer>false</UseDisplaySizeForBackbuffer>
    <PreferredBackBufferHeight>720</PreferredBackBufferHeight>
    <PreferredBackBufferWidth>1280</PreferredBackBufferWidth>
</XboxGraphicsManagerSettings>

and in my gui file I have
...
   <GUISceneview name="PlayScreen">
      <Size>
         <X>1280</X>
         <Y>720</Y>
      </Size>
      ...
   </GUISceneView>
...
I wasn't experiencing issue's with the GUI stretching before, but I haven't tested my current project on the XBox since moving to 3.1.4.
#16
11/10/2009 (5:02 pm)
When you say "gui file". Where is this file located exactly? I am guessing the changes you show are exactly what I am looking for.
#17
11/10/2009 (5:10 pm)
Mine happens to be located at '\Content\UI\PlayScreen.gui', your's would be whatever .gui file you are using to draw your UI elements on the screen. Unless you are doing it all in code, even then it should probably be exposed where you can set it.
#18
11/10/2009 (5:24 pm)
Awesome, thanks. I just created a new GUI project using the 3.1.4 project wizard. There is not a content folder at all. This wizard creates a data folder instead. It also creates a bunch of gui cs files. I will look around in there and see if it is set somewhere.
#19
11/10/2009 (6:34 pm)
OMG this is so simple scratch everything else, I just traced the entire source and found it, it's also a problem with 2D

in the torqueSettings.xml you need to set the graphics mode for the xbox separately from the PC.

<WindowsGraphicsManagerSettings>
		<PreferMultiSampling>false</PreferMultiSampling>
		<PreferredBackBufferHeight>720</PreferredBackBufferHeight>
		<PreferredBackBufferWidth>1280</PreferredBackBufferWidth>
	</WindowsGraphicsManagerSettings>
	<XboxGraphicsManagerSettings>
		<PreferMultiSampling>false</PreferMultiSampling>
		<UseDisplaySizeForBackbuffer>false</UseDisplaySizeForBackbuffer>
    <PreferredBackBufferHeight>720</PreferredBackBufferHeight>
    <PreferredBackBufferWidth>1280</PreferredBackBufferWidth>
	</XboxGraphicsManagerSettings>
In the file TorqueEngineComponent the LoadSettings method. If the settings are not explicitly done in the xml file they default. The default for backbuffer on xbox is 1024x768. Easy enough this clears up tons of problems I was having...
#20
11/10/2009 (6:48 pm)
I was wondering if that would work, but since I am not where my xBox is I couldn't try it out.

Has anyone played with the <UseDisplaySizeForBackbuffer>true

to see if that will automatically adjust things?
Page «Previous 1 2