By Jon Steed, Software Design Engineer
Microsoft Corporation
April 2005
A growing number of people are using their personal computers in a completely new way. When you think of a typical PC interaction you probably envision sitting at a desk with a monitor, and using a mouse and keyboard (or perhaps a joystick device); this is referred to as the "2-foot experience," and it's still the most common scenario for Windows gaming, but there's another trend which you'll probably start hearing more about: the 10-foot experience, which describes using your computer as an entertainment device outputting to a TV. This article introduces the 10-foot experience and explores the list of things you should consider first about this new interaction pattern, even if you aren't expecting your game to be played this way. Some portion of your customers will run your Windows game on a Media Center PC - it's better that you know what that experience will be like before your customers try it.
Contents:
Windows XP Media Center Edition 2005 (now in its third iteration) is a special version of Windows XP; in addition to the normal Windows XP functionality (minus a few features like Domain Controller support), it features the integrated Media Center application which can act as the interface to the multimedia capabilities of the host machine. The Media Center Edition website offers a much more thorough introduction and shows off all the good stuff available in the new version.
Traditionally the only way to get Media Center Edition was to buy a Media Center PC (which comes preloaded with Windows XP Media Center Edition) from a tier-1 system manufacturer. Under the new Microsoft OEM System Builder License, Media Center Edition is now available to mid-tier distributors who may resell it to the public provided it's bundled with non-peripheral hardware, so the potential marketplace is suddenly much larger. It's expected that the number of PC's running Media Center Edition will grow from about 2 million at the start of 2005 to 20 million by 2008.
Computer systems sold as Media Center PC's are typically higher-end machines with very capable video cards and multimedia peripherals like video capture/edit boards, but they are nonetheless still PC's capable of running Windows XP applications. If you're currently shipping a Windows game title, it's more likely that some of your customers are running your game on a Media Center PC; whether your game is accessed through the regular Windows shell or through the Media Center interface is largely dependent on which experience turns out to be more pleasant for the user. Directions on how to ensure Media Center properly handles the presentation and launch of your title are found later in this article.
The Media Center PC was designed around the idea that people could use a Windows PC for a rich living room entertainment experience, and it follows that most users prefer to interact with a Media Center PC differently than a normal desktop workstation. For one, it's likely that a Media Center PC will output video to a display other than a conventional computer monitor: Analog TV's, high-definition digital TV's, and any number of LCD displays are all likely candidates. These types of displays are usually viewed from a distance of roughly 10 feet, hence the label "10-foot experience."
The 10-foot experience isn't confined to Media Center Edition users either; it's become common in recent years for users to connect their workstation or notebook computer to their TV and audio system. It's increasingly common for consumer display devices to expose RGB or DVI connections, the standard video output ports on computers. In addition, S-Video ports are a typical feature of high-end video cards, and offer an easy way to output to an alternate display device.
There are some important design guidelines which should be considered for a pleasant 10-foot experience:
Avoid any physical interaction between the user and the Media Center PC or peripherals. Required input controller changes during gameplay are undesirable since it's likely the user is positioned near the primary input device only.
Microsoft has announced plans to release a common gamepad controller for use with Windows and the future version of Microsoft Xbox. Making sure that your title plays well on the common controller will ease some of the headache associated with testing your game against potential input devices.
You should also avoid single-pixel thick horizontal lines or static UI elements with single-pixel detail. Older televisions may simply not display fine detail, and even on the latest displays your content will flicker when running on an interlaced display mode since a single row of pixels will be visible only half the time. As a replacement for small detail, realize that a 2-pixel gray line will appear 'thinner' than a 2-pixel white line (this is essentially the same as blurring a 1-pixel white line).
Aspect ratio describes the width and height proportion of the display. Standard TV and computer monitor displays have an aspect ratio of 4:3 (meaning for every 4 pixels running along the width of the frame buffer there are 3 pixels along the height, sometimes also represented simply as 1.33).
With the advent of HDTV, an aspect ratio of 16:9 (a.k.a. widescreen) has become the standard for the future of TV. There are three EDTV/HDTV modes you're likely to encounter which will output to widescreen:
If your game is hard-coded to work on a 4:3 display, then a user who outputs your game to a 16:9 display will likely have three options to choose from, none of which are particularly satisfying:
A better approach is to add support for widescreen to your game. The most important change is to set the game camera's projection transform to use a 16:9 aspect ratio, which avoids the stretching distortion. Even if you leave the backbuffer at a 4:3 resolution, switching the projection transform to use 16:9 will greatly improve the perceived accuracy of the rendered image; of course the final image will undergo some filtering to upscale the 4:3 backbuffer resolution to meet the 16:9 native display resolution, but this is a less noticeable artifact than the stretch distortion caused by a mismatch of aspect ratios.
The cost of rendering the scene through 16:9 camera may be higher than a 4:3 camera (even at identical resolutions) because more scene objects will be visible in the wider view frustum. You should also be aware of how the enlarged viewable area may influence gameplay, as a game camera with a 16:9 ratio will reveal more of your game world than a 4:3 camera.
For the best results on a 16:9 display you should render to a 16:9 backbuffer, but this will obviously require filling more pixels. The difference between 640x480 and 720x480 is almost 38,400 pixels, a gain of 12.5%. If you can afford the extra fill cost this is strongly suggested.
The entire image frame buffer may not be visible to the end user; often a certain amount of border pixels are covered by the display's front bezel. To ensure that critical UI elements are visible across the spectrum of potential consumer display hardware you should observe the "title-safe region" requirements for your target display mode: For non-HDTV modes, the title-safe region is the inner 85 percent of the frame buffer; for HDTV modes, the title-safe area is the inner 90 percent. For the greatest compatibility across current and future display hardware you should therefore keep all your game's critical UI elements and heads-up display indicators within the inner 85 percent of the frame buffer.
Since NTSC is the most common video standard in the United States for consumer display hardware, it's important to know about some of the guidelines you should follow for your output image:
To make your application easily accessible using the Media Center interface, there are two available options:
Using the extensibility model of Media Center offers the tightest integration with Media Center, but requires that the game be hosted on a webpage. By using the extensibility model, your game title will appear as a first-class citizen within the Media Center UI, and will also be able to interface with the Now Playing experience. If this approach is suitable for your title, the Microsoft Windows XP Media Center Edition Software Development Kit (SDK) documents the extensibility model and demonstrates this approach with a sample application.
You can also install your game so that it runs in a separate process in full-screen mode, by adding a couple extra files to your installation. This will expose your game application through the Media Center UI which is probably the most practical option for any game which is also intended to be played on a non-Media Center version of Windows. In this approach the game itself will need to relaunch the Media Center UI when it finishes.
Typical fullscreen Windows games that use stand-alone exes will use option 2. A working example of the process for full screen games is explained below and can be found in the DirectX SDK with the MediaCenterGame sample. The steps to properly install and register your game in the Media Center UI are:
To make your game show up in the Media Center UI, you must first create an MCL file which is an XML file with any name and the .mcl filename extension. Here is the MCL file that is included with the MediaCenterGame sample:
<application Title = "MediaCenterGame" ID = "" Run = ".\MCELauncher.lnk" BGColor = "RGB(0,0,0)" Name = "MediaCenterGame" CompanyName = "Microsoft" StartImage = ".\icon_128.jpg" ThumbnailImage = ".\icon_128.jpg" SharedViewport = "" NowPlayingDirective = "" > <capabilitiesRequired directX="True" audio="False" <!-- Set false even if your game uses audio --> video="False" <!-- Set false even if your game uses video --> intensiveRendering="True" console="False" /> </application>
The most important parameters are described as follows:
The values shown in the capabilitiesRequired section should work well for all Windows games. All other values in the application section can be safely ignored.
To register this MCL file with the Media Center UI, you need to place the MCL file or a shortcut to the MCL file in a known folder location:
CSIDL_COMMON_STARTMENU + "\Programs\Accessories\Media Center\Media Center Programs"
CSIDL_COMMON_APPDATA + "\Media Center Programs"
Note The location specified by these paths is relative to the location returned by SHGetFolderPath.
Do not use a hard-coded path when installing. Instead query the operating system for the proper folder location using the SHGetFolderPath API, For example, if you install for all users (the generally preferred manner), then a call with the CSIDL_COMMON_STARTMENU appended with the Unicode string L" Programs\Accessories\Media Center\Media Center Programs" should be used. Use CSIDL_STARTMENU instead if you want to install for the current user only.
In the MCL file's Run tag, you specify what you want to launch when the button is clicked from within the Media Center UI. If you need command line arguments passed to your game .exe, you must make the MCL file run a shortcut that has the command line arguments in it. In other words, use the Run tag to specify a shortcut such as MyGame.lnk, and include the command line arguments in the .lnk file.
There is one important issue you might see when you try doing this depending on your game initialization code. You may get an error when trying to create the Direct3D device because the Media Center UI and the game may compete for the same Direct3D device.
The performance and stability of the Media Center UI is due to the fact that it renders everything via Direct3D, typically in full-screen exclusive mode. This means that when the Media Center UI atempts to launch a full-screen game (from inside its Direct3D-based UI), the game may also try to immediately create a full-screen exclusive-mode device which can fail if the Media Center UI has not yet released it's Direct3D device.
There are two solutions for a device creation problem:
While it may be easier to use an external launcher (since one is supplied in the DirectX SDK), a game which handles this initial start condition gracefully provides a better end-user experience and is therefore preferred. DXUT has been updated to handle this scenario, so any application using DXUT will get the "keep trying to create an exclusive device" behavior automatically.
If you choose to use the external launcher, MCELauncher.exe (which is in the DirectX SDK) simply tries to create a full screen device for a certain amount of time and when it succeeds it will launch the game that is specified on the command line. Using this approach, make sure MCELauncher.exe is installed with your game.
After exiting the game, the user should be returned to the Media Center UI. The game itself must re-launch MCE by doing this:
bool ReLaunchMediaCenter() { // Skip if not running on a Media Center if( GetSystemMetrics( SM_MEDIACENTER ) == 0 ) return false; // Get the path to Media Center WCHAR szExpandedPath[MAX_PATH]; if( !ExpandEnvironmentStrings( L"%SystemRoot%\\ehome\\ehshell.exe", szExpandedPath, MAX_PATH) ) return false; // Skip if ehshell.exe doesn't exist if( GetFileAttributes( szExpandedPath ) == 0xFFFFFFFF ) return false; // Launch ehshell.exe INT_PTR result = (INT_PTR)ShellExecute( NULL, TEXT("open"), szExpandedPath, NULL, NULL, SW_SHOWNORMAL); return (result > 32); }
If you are using DXUT, you can add the command line parameter -relaunchmce which will do this for you, or you can use the helper function called DXUTReLaunchMediaCenter().
This article was an attempt to offer a first look at the 10-foot experience from the perspective of a Windows game developer, but it is by no means comprehensive; you should research these topics further if you're developing a Windows game title (even if it's not intended for Media Center PC's). The true test is to try your game on a variety of video displays to ensure your game offers a pleasant experience on each. Based on the typical life-span of a Windows game and the predicted growth of Media Center enabled PC's, it's almost guaranteed that a game you release today is going to take part in a 10-foot experience (at least people will try it). Whether they can play your game from a couch or they're forced to sit at a desk is largely up to you.