pt#1
DESCRIPTION
TRANSCRIPT
Developing Great Games for Windows
VistaSkip McIlvaine
Developer Account Manager, Account Management Team
Chuck WalbournSoftware Development Engineer, XNA Developer Connection
Agenda
Windows Vista
Games for Windows best practices
Windows logos and branding
User Account Control
Application compatibility
Minimum System Requirements Home Basic
800 MHz CPU x86 or x64
512 MB RAM
Direct3D 9 video w/ 32 MB VRAM
DVD Drive, Audio, Internet
Other Editions1 GHz CPU x86 or x64
1 GB RAM
Direct3D 9 Aero Capable videoWDDM Driver, Pixel Shader 2.0, 32 bits per pixel128 MB VRAM
DVD Drive, Audio, Internet
Windows Vista Gaming Features
Game Explorer
Parental controls*
WDDM & Direct3D 10
Improved multichannel audio
Improved widescreen support
Improved networking and IPv6 support
* Only available in Home Basic, Home Premium,and Ultimate when not on a domain
Agenda
Windows Vista
Games for Windows best practices
Windows logos and branding
User Account Control
Application compatibility
Top 10 Windows Vista Compatibility Issues for Games1. Technologies not in fresh Windows Vista
installsVC CRT is not part of basic Windows installs
2. Anti-Cheat / Anti-Piracy TechnologiesMany rely on kernel-mode drivers and administrator operations
3. General Application CompatibilityAll the usual problems due to reliance on undocumented version-specific behavior
Top 10 (Continued)
4. Direct3D 9 CompatibilityWDDM exposes some reliance on undocumented driver or Direct3D runtime behaviors
5. Read / Write of Protected Registry KeysMitigated by some general AppCompat fixes, but can be really hard for users to understand and customer service to support / explain
6. Assuming Install and Play Account Are the Same
Even a single administrator account is really two different account tokens in Windows Vista
Top 10 (Continued)
7. Multiple SessionsFast User Switching is now always on, even when on a domain
8. x64 CompatibilityWindows Vista is bit-neutral, so users are free to install either 32-bit or 64-bit versions of the OS
Top 10 (Continued)
9. Assumptions about Audio DriversSurround Sound / Multi-channel fully supported by Windows Vista
Many audio engines assume if hardware audio fails, software stereo is the only remaining option
Audio drivers can no longer ‘fake’ being hardware accelerated to support effects processing
10.Windows FirewallMany games are still not properly configuring the Windows Firewall (XP SP2 or later) at install time
Best Practices
Simplify installationFollowing existing Windows XP best practices
Autorun, long file names, file version info in all DLLs & EXEs, install to “Program Files,” use LUA-friendly data folder and registry locations, avoid forced reboots, use official redists correctly
x64 Compatibility64-bit native is not required except for kernel-mode drivers
Authenticode signing and proper security-level manifests are key to getting the best experience
Best Practices (continued)
Game should run as a Standard User (aka Limited Users under Windows XP)Support the Xbox 360 Common Controller for Windows, if appropriateTest with Application VerifierPass unhandled exceptions along to Windows Error ReportingAuthenticode signing and proper security-level manifests are key to getting the best experience
Best Practices (continued)
Windows Vista Game ExplorerProvide and register a game definition file
Support rich saved games
Parental ControlsProvide rating information in your GDF
Add call to VerifyAccess to startup code
Media CenterSupport launch from the Media Center UI
GameUxInstallHelper sample in the latest DirectX SDK makes all this straight-forward
Going beyond the basics
Compelling use of Direct3D 10
Native 64-bit and large memory utilization
Optimized for multi-core
Games for Windows - LIVE
“Installer-less” deployment
Agenda
Windows Vista
Games for Windows best practices
Windows logos and branding
User Account Control
Application compatibility
Games for Windows
Games for Windows branding is distinct from the other Windows software logo programsCurrently in pilot phase, but will be expanding as the program’s capacity increases
Your Account Manager is your contact point for this program
Technical requirements and test plan in the DirectX SDK documentation
http://msdn2.microsoft.com/en-us/library/bb173456.aspxhttp://msdn2.microsoft.com/en-us/library/bb173457.aspx
Windows Software Logo Programs
Works With Windows VistaBasic compatibility on Windows Vista x86
Certified for Windows VistaCommon requirements with Games for Windows
These programs are administered through WinQual
http://winqual.microsoft.com
Agenda
Windows Vista
Games for Windows best practices
Windows logos and branding
User Account Control
Application compatibility
User Account Control
The most visible aspect of the new security story in Windows Vista
Similar to Windows XP Limited User Accounts
Some new appcompat mitigationsIf you already work well with LUA, you should have very little trouble with UAC
On by default!
Working with UAC
Follow LUA practices about where you write your data files and create registry keysDo all admin-rights tasks upfront at install
Install drivers, configure Firewall, etc.
Mark all EXEs with the right execution levelYour game EXE and auto-runner should not elevate
Likely your installer will require elevation
Alternative to “All users” installsCould do a fully per-user install without elevation
Requires not installing system or driver components
Working with UAC: Data Files
Do not assume you have write access to the program install directory
Use ShGetFolderPath() locations CSIDL_LOCAL_APPDATA, CSIDL_COMMON_APPDATA, or CSIDL_PERSONAL to store read/write data files
Create all your per-user stuff at first-run, not at install time
Working with UAC: Registry
Your application can only write to HKEY_CURRENT_USER
Use ‘first-run’ logic to create the defaults
Installer must set up HKEY_LOCAL_MACHINE and register COM objects
Best to avoid using the registry if you can
Working with UAC: Manifests
To mark an EXE as requiring administrator privileges or not, you use an embedded manifestManifest = binary resource blob of XMLUser Account Control is looking for <requestedExecutionLevel
level=“asInvoker”> means don’t elevatelevel=“requireAdministrator”> means elevateIf this is not found, assumes it’s a ‘legacy’ app
External .manifest files won’t be used by default
simple.rc///////////////////////////////////////////////////////////////////
// RT_MANIFEST
//
1 RT_MANIFEST “simple.manifest"
simple.manifest<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name=“Company.Product.Simple"
type="win32"
/>
<description>Some simple description</description>
<ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
<ms_asmv2:security>
<ms_asmv2:requestedPrivileges>
<ms_asmv2:requestedExecutionLevel level="asInvoker">
</ms_asmv2:requestedExecutionLevel>
</ms_asmv2:requestedPrivileges>
</ms_asmv2:security>
</ms_asmv2:trustInfo>
</assembly>
Working with UAC: Manifests
Visual Studio 2005 has native support of manifests
Added for side-by-side “Fusion” DLL support
UI does not include User Account Control details
Some bugs in the Manifest Tool (MT.EXE) fixed in SP 1Can avoid MT.EXE entirely with an .rc script
VS 2005 CRT DLL details could get out of date
AppCompat and UAC
“Virtualization”Application compatibility fix for existing applications
Silently redirects writes to install directory, registry
AppCompat and UAC (cont)
ProsAllows many existing applications to work
Simple general fix
ConsConfusing to customers (files not really there)
Disabled by various other settings
Adds overhead to file/registry operations
Bottom line: don’t rely on itAdding a UAC manifest to your EXE disables virtualization for that process
Authenticode Signing and UAC
The kind of elevation prompt you get is based on the signing status of the EXE
Sign all your EXEs, DLLs and MSIsCaveat: You can sign cabs, but don’t!
Make code signing a part of your build!
Over-the-Shoulder elevation
Elevation at install is expectedLaunch the game directly after installNeed to be careful due to “OTS” scenarios
Agenda
Windows Vista
Games for Windows best practices
Windows logos and branding
User Account Control
Application compatibility
DirectX Runtime
Windows Vista contains an updated DirectX Runtime unique to the new OS
DirectX 9.0cNo DirectPlay Voice or Direct3D RM
Two new graphics APIsDirect3D9ExDirect3D10
Some new flags for DirectSound8 and DirectDraw7
DirectX Runtime (continued)
Just always use “DXSETUP.EXE /silent”
DirectSetup also installsD3DX9, D3DX10, XACT, XINPUT,
Don’t allow users to opt-out of DirectSetup
If they do, must abort the entire install
Append the DirectX EULA to your own
Other In-box Technologies
.NET Framework 3.0 (includes CLR 2.0)
Improved Windows FirewallIntroduced in Windows XP SP 2The FirewallInstallHelper sample in the DirectX SDK makes this simple
Improved Dual IPv4 / IPv6 stack & Teredo
Introduced in “Advanced Networking Pack”Part of Windows XP SP 2Dual-stack/Teredo is enabled by default in Windows Vista
Components not in Windows Vista*
DirectPlay VoiceDirect3D Retained modeDirectInput8’s ConfigureDevices UIAny version of the Microsoft VC runtime
MSVCRT, MFC, ATL, etc.
Indeo CodecsThird party ActiveX plug-ins (like Flash)Third party OpenGL ICDsWINHELP.EXE (old .hlp files)
* OEMs may preinstall other software
Call to Action
Use Application Verifier
Follow the Games for Windows Technical Requirements
Test on Windows Vista x86 and x64
Don’t rely on legacy “hacks”!
Resources
DirectX Developer Centerhttp://www.msdn.com/directx/
DirectX SDK Technical Articles“Games for Windows Technical Requirements”http://msdn2.microsoft.com/en-us/library/bb173456.aspx
“Games for Windows Test Requirements”http://msdn2.microsoft.com/en-us/library/bb173457.aspx
“User Account Control for Game Developers”http://msdn2.microsoft.com/en-us/library/bb206295.aspx
“Authenticode Signing for Game Developers”http://msdn2.microsoft.com/en-us/library/bb172338.aspx
Questions?
© 2007 © 2007 MicrosoftMicrosoft Corporation. All rights reserved. Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
www.xna.com www.xna.com