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«First 1 2 Next»
#21
11/10/2009 (7:49 pm)
If you have UseDisplaySizeforBackbuffer set to true then TX uses a backbuffer at the resolution of the players tv screen (XBox settings->tv resolution), which means you are responsible for drawing everything the correct size in your draw methods.

If the players tv is at 1080, and your graphics are 720, then you will be drawing in the upper left quadrant and the right/bottom of the players screen will be blank.

If the players tv is at 480, and your graphics are 720, then you will be over-drawing and the player won't see what you've got in the right/bottom.

The only reason I can think to go this route is if you want to provide optimized graphics for each resolution and display the correct one in code rather than provide 1 set of graphics and rely on the xbox to resize them.

ex:
if (backbuffer == 1080)
--use background1080.png
elseif (backbuffer == 720)
--use background720.png
elseif (backbuffer == 480)
--use background480.png
else
--they have some non standard resolution set so do something else
end if
#22
11/10/2009 (7:54 pm)
What if my game consists completely of 3D objects in a 3D scene? If I don't use any bitmaps (other than textures on the models, of course)?
#23
11/10/2009 (8:17 pm)
That, I don't know.
Glancing through the source code of the FPSDemo, it appears to do just that (setting usebackbuffer to true). For the GUI's and 2d aspect it grabs the GUICanvas.Instance.Size to set them properly, but a quick glance through the player camera doesn't show any special code.

If you try it, let us know the results. If not, then I may try it this weekend to see what happens.
#24
11/10/2009 (8:58 pm)
The Gui can become a nightmare, I also had some problems with particles when setting UseDisplaySizeforBackbuffer. That is what I used for Enemy at the Gate and it made my life a little more difficult than I believe it should have.
#25
11/11/2009 (12:17 am)
Well, the UseDisplaySizeforBackbuffer works great for the 3D part of things. The screen looks right now.

I even just discovered something I didn't realize, but should have known. I took my xBox over to a friend's house the other day. I have the cable that comes with the normal xBox package that is the component and normal AV combined. It has the little switch on it to switch between AV and component.

My friend's TV was AV, so I had the switch in that position. I didn't realize it until tonight when I noticed that the picture looked weird. This has nothing to do with the above problems because I had not tried my game since coming home from my friend's house.

What I am trying to say is that I can actually test normal NON-HD tv functionality on my HD tv by simply switching the cable switch to AV mode. The TV sees the signal as NON-HD. This will help a lot.

So when I am in HD mode now the 3D and GUI stuff looks just like it does on Windows because it matches the 1280x720 size. When I switch the switch (as I just discovered) to TV mode and watch it it comes up in 640x480 mode on my xBox and the 3D stuff looks great.

What doesn't look good, as mentioned above, is that the GUI gets all messed up. I looked at it, however, and it is obvious why. The GUI uses stuff like this:

GUIStyle playStyle = new GUIStyle();
            Name = "GuiPlay";
            Style = playStyle;
            Size = new Vector2(1280, 720);
            Folder = GUICanvas.Instance;

and this:

_playerScore1 = new GUIText();
            _playerScore1.Style = styleMain;
            _playerScore1.Position = new Vector2(25, 25);
            _playerScore1.Size = new Vector2(400, 120);
            _playerScore1.Visible = true;
            _playerScore1.Folder = this;
            _playerScore1.Text = "Player Score:";

which is obviously hard coded to a 1280x720 size image. This along with having images (if I decide to use them) of different sizes should be easy to fix. Math is what computers do well, after all, and coming up with some math to take the current screen size and fit the GUI to it I have done many times before in the windows world.

So things are looking good. Thanks for all the input. It helped me get to this point.
Page«First 1 2 Next»