Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I'm making a game with XNA, what I'm wondering is; what should the dimensions in pixels be of the window? It needs to be a size that will work on the majority of computers. I'm not sure if there's some size that most games use.

share|improve this question
    
Why do you want to restrict the window size? –  dnbrv Apr 5 '12 at 4:31
add comment

3 Answers

up vote 3 down vote accepted

On a PC or the Xbox 360, there's no single size that is "best", or that all games tend to use. (The Windows 7 Phone has far fewer choices.)

There's no reason to not use the native window resolution by default.

In XNA, you can do this with code like this in the Initialize method:

int width = GraphicsDevice.DisplayMode.Width;
int height = GraphicsDevice.DisplayMode.Height;
this.graphics.PreferredBackBufferWidth = width;
this.graphics.PreferredBackBufferHeight = height;
this.graphics.IsFullScreen = true;
this.graphics.ApplyChanges();

Of course, it would be meaningful to provide the user with options to change the size they are using, as ChrisF points out. Many people may not ever use it if you've chosen a good default. Still, though, it's one of those things that makes a big difference for the people who want it, and it doesn't take a whole lot of work.

You can also find a good list of common screen resolutions on Wikipedia.

Your biggest challenge in this area will be writing your game in a way that it can handle a wide variety of resolutions and aspect ratios. This is especially true if you want to run the same game/codebase on the PC, the Xbox 360, and the Windows 7 Phone, all of which, XNA supports. From a technical standpoint, here's a few things you can do to help address this problem:

  1. Build content for the largest window size that you'll support. Drawing a 1920x1080 background on an 800x480 screen has its problems, but not as bad as drawing an 800x480 background on a 1920x1080 screen.
  2. Along with #1, if you have time, you might want to consider supplying different sets of content to different devices. Or simply loading different sets of content at runtime. This might be especially important for your sprite fonts, which may not scale nearly as well as other things.
  3. Find an intelligent way to support the two prominent aspect ratios (4:3 and 16:9). For a 3D game, that will almost certainly mean choosing a different field-of-view angle for a perspective projection. A 2D game might require something like letterboxing, but do it in a more creative way than just black bars on the sides.
  4. Detach your game's internal coordinate system from screen coordinates. Your game will have a behind-the-scenes coordinate system. Do not use the window's coordinates as that behind-the-scenes coordinate system. For example, let's say you're making Asteroids. You will be keeping track of the player's ship's position. It is possible to just say "my ship is at pixel (56, 213) on the screen." But don't do that. Come up with your own internal coordinate system, and when it comes time to draw it, apply some sort of transform to figure out where (and how big) it should be on the screen. Because you're keeping track of things in your behind-the-scenes coordinate system, you can apply different transforms for different resolutions and aspect ratios. And it makes it easy to make a 3D version of your game using the same logic, if you ever choose that route.
share|improve this answer
    
Thanks for the information! Ill use it. Also I love your site! –  Cyral Apr 5 '12 at 23:30
add comment

Use scalable assets when possible, and use the full resolution of the screen. There is no reason to require a user with a large monitor to be stuck with a 1/4 screen window due a limit of 800x600 screen size. I have specifically dropped games, despite promise in their gameplay, if I cannot play them fullscreen and at my native monitor resolution.

A better question might be aspect ratio. This is a harder one, because the majority of screens are now 16:9 or 16:10, but there are still a lot of 4:3 monitors out there. Adjusting the aspect ratio of a game is more difficult than simply scaling the UI, as it requires dealing with anchoring and whitespace. If you cannot make your user interface adjust to multiple aspect ratios, then you should allow the screen to letterbox as needed when the screen ratio does not match your game UI ratio.

share|improve this answer
    
Hmm, What I mean is, what size should it be on launch? Ive enabled the maximize button so they can scale it to there screen size and display more tiles and info on screen. –  Cyral Apr 5 '12 at 0:42
1  
Full screen/maximized at launch. 9 times out of 10, users will play that game exclusively... other than very casual games like Mine Sweeper or Solitaire, games are almost always not multitasked. Players play the game and do nothing else until they are done. If you are aiming for a casual 'off to the side' game such as Solitaire your needs might be different. –  Myrddin Emrys Apr 5 '12 at 1:28
add comment

Make it configurable or user selectable, and allow the user to maximise the window.

There's no need in a modern game to restrict the size of the window the user can play the game in.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.