Before investing time developing a game based on the UWP framework, please note that UWP is no longer under active development. Further, UWP based games are no longer accepted in the Xbox Store.
This guide provides an end-to-end collection of the resources and information you'll need to develop a Universal Windows Platform (UWP) game. An English (US) version of this guide is available in PDF format.
Introduction to game development for the Universal Windows Platform (UWP)
This guide provides an end-to-end collection of information and resources that will help you as you develop your game. The sections are organized according to the stages of game development, so you'll know where to look for information when you need it.
If you're new to developing games on Windows, the Getting started guide might be where you want to start off. The Game development resources section also provides a high-level survey of documentation, programs, and other resources that are helpful when creating a game. If you want to start by looking at some UWP code instead, see Game samples.
Game development resources
From documentation to developer programs, forums, blogs, and samples, there are many resources available to help you on your game development journey. Here's a roundup of resources to know about as you begin developing your Windows game.
Note
Some features are managed through various programs. This guide covers a broad range of resources, so you might find that some resources are inaccessible depending on the program you're in, or your specific development role. For information about partnering with Microsoft, see Developer programs.
Game development documentation
Throughout this guide, you'll find deep links to relevant documentation—organized by task, technology, and stage of game development. To give you a broad view of what's available, here are the main documentation portals for Windows game development.
Registering as a developer in Partner Center is the first step towards publishing your Windows game. A developer account lets you reserve your game's name, and submit free or paid games to the Microsoft Store for all Windows devices. Use your developer account to manage your game and in-game products, get detailed analytics, and enable services that create great experiences for your players around the world.
Microsoft also offers several developer programs to help you develop and publish Windows games. We recommend seeing whether any are right for you before registering for a Partner Center account. For more info, go to Developer programs
Developer programs
To publish a game in the Microsoft Store, you'll also need to create a developer account in Partner Center .
Game samples
There are many Windows game and app samples available to help you understand Windows gaming features, and get a quick start on game development. Samples are developed and published regularly, so don't forget to occasionally check back on sample portals to see what's new. You can also watch GitHub repos to be notified of changes and additions.
Developer forums are a great place to ask and answer game development questions, and connect with the game development community. Forums can also be fantastic resources for finding existing answers to difficult issues that developers have faced and solved in the past.
Developer blogs are another great resource for the latest information about game development. You'll find posts about new features, implementation details, best practices, architecture background, and more.
In the concept and planning stage, you decide what your game is going to be like and the technologies and tools you'll use to bring it to life.
Overview of game development technologies
When you start developing a game for the UWP you have multiple options available for graphics, input, audio, networking, utilities, and libraries.
If you've already decided on all the technologies you'll be using in your game, then you're set. If not, the Game technologies for UWP apps guide is an excellent overview of many of the technologies available, and is highly recommended reading to help you understand the options and how they fit together.
Choosing your graphics technology and programming language
There are several programming languages and graphics technologies available for use in Windows games. The path you take depends on the type of game you're developing, the experience and preferences of your development studio, and specific feature requirements of your game. Will you use C#, C++, or JavaScript? DirectX, XAML, or HTML5?
DirectX
Microsoft DirectX is the choice to make for the highest-performance 2D and 3D graphics and multimedia.
DirectX 12 is faster and more efficient than any previous version. Direct3D 12 enables richer scenes, more objects, more complex effects, and full utilization of modern GPU hardware on Windows PCs and Xbox One.
If you want to use the familiar graphics pipeline of Direct3D 11, you'll still benefit from the new rendering and optimization features added to Direct3D 11.3. And, if you're a tried-and-true desktop Windows API developer with roots in Win32, then you'll still have that option for your Windows game.
The extensive features and deep platform integration of DirectX provide the power and performance needed by the most demanding games.
XAML is an easy-to-use declarative UI language with convenient features like animations, storyboards, data binding, scalable vector-based graphics, dynamic resizing, and scene graphs. XAML works great for game UI, menus, sprites, and 2D graphics. To make UI layout easy, XAML is compatible with design and development tools like Expression Blend and Microsoft Visual Studio. XAML is commonly used with C#, but C++ is also a good choice if that's your preferred language or if your game has high CPU demands.
HyperText Markup Language (HTML) is a common UI markup language used for web pages, apps, and rich clients. Windows games can use HTML5 as a full-featured presentation layer with the familiar features of HTML, access to the Universal Windows Platform, and support for modern web features like AppCache, Web Workers, canvas, drag-and-drop, asynchronous programming, and SVG. Behind the scenes, HTML rendering takes advantage of the power of DirectX hardware acceleration, so you can still get the performance benefits of DirectX without writing any extra code. HTML5 is a good choice if you're proficient with web development, porting a web game, or you want to use language and graphics layers that can be easier to approach than the other choices. HTML5 is used with JavaScript, but can also call into components created with C# or C++/CX.
The Microsoft DirectX Graphics Infrastructure (DXGI) provides interoperability and compatibility across multiple graphics technologies. For high-performance graphics, you can combine XAML and DirectX; using XAML for menus and other simple UI, and DirectX for rendering complex 2D and 3D scenes. DXGI also provides compatibility between Direct2D, Direct3D, DirectWrite, DirectCompute, and the Microsoft Media Foundation.
DirectX Graphics Infrastructure programming guide and reference
C++/WinRT is a high-performance, low overhead language that provides the powerful combination of speed, compatibility, and platform access. C++/WinRT makes it easy to use all of the great gaming features in Windows, including DirectX and Xbox Live. You can also reuse existing C++ code and libraries. C++/WinRT creates fast, native code that doesn't incur the overhead of garbage collection, so your game can have great performance and low power consumption, which leads to longer battery life. Use C++/WinRT with DirectX or XAML, or create a game that uses a combination of both.
C#
C# (pronounced "C sharp") is a modern, innovative language that is simple, powerful, type-safe, and object-oriented. C# enables rapid development while retaining the familiarity and expressiveness of C-style languages. Though easy to use, C# has numerous advanced language features such as polymorphism, delegates, lambdas, closures, iterator methods, covariance, and Language-Integrated Query (LINQ) expressions. C# is an excellent choice if you are targeting XAML, want to get a quick start developing your game, or have previous C# experience. C# is used primarily with XAML, so if you want to use DirectX, then choose C++ instead, or write part of your game as a C++ component that interacts with DirectX. Or, consider Win2D: an immediate mode Direct2D graphics library for C# and C++.
Use Windows Runtime components to combine languages
With the Universal Windows Platform, it's easy to combine components written in different languages. Create Windows Runtime components in C++, C#, or Visual Basic, and then call into them from JavaScript, C#, C++, or Visual Basic. This is a great way to program portions of your game in the language of your choice. Components also let you consume external libraries that are only available in a particular language, as well as use legacy code you've already written.
If you're choosing DirectX for your game, then you'll need to decide which version to use: Microsoft Direct3D 12 or Microsoft Direct3D 11.
DirectX 12 is faster and more efficient than any previous version. Direct3D 12 enables richer scenes, more objects, more complex effects, and full utilization of modern GPU hardware on Windows PCs and Xbox One. Since Direct3D 12 works at a very low level, it's able to give an expert graphics development team or an experienced DirectX 11 development team all the control they need to maximize graphics optimization.
Direct3D 11.3 is a low level graphics API that uses the familiar Direct3D programming model and handles for you more of the complexity involved in GPU rendering. It is also supported in Windows and Xbox One. If you have an existing engine written in Direct3D 11, and you're not quite ready to make the jump to Direct3D 12, you can use Direct3D 11 on 12 to achieve some performance improvements. Versions 11.3+ contain the new rendering and optimization features enabled also in Direct3D 12.
Depending on the needs of your game, using bridges, game engines, or middleware can save development and testing time and resources. Here are some overview and resources for bridges, game engines, and middleware.
Azure PlayFab
Now part of the Microsoft family, Azure PlayFab is a complete back-end platform for live games and a powerful way for independent studios to get started. Boost revenue, engagement, and retention—while cutting costs—with game services, real-time analytics, and LiveOps.
Unity offers a platform for creating beautiful and engaging 2D, 3D, VR, and AR games and apps. It enables you to realize your creative vision fast, and delivers your content to virtually any media or device.
Beginning with Unity 5.4, Unity supports Direct3D 12 development.
Havok's modular suite of tools and technologies help game creators reach new levels of interactivity and immersion. Havok enables highly realistic physics, interactive simulations, and stunning cinematics. Version 2015.1 or later officially supports UWP in Visual Studio 2015 on x86, 64-bit, and Arm.
Unreal Engine is a complete suite of game development tools for all types of games and developers. For the most demanding console and PC games, Unreal Engine is used by game developers worldwide.
Now that you've decided the type of game you want to create, and the tools and graphics technology you'll use to build it, you're ready to get started with the design and prototype. At its core, your game is a Universal Windows Platform app, so that's where you'll begin.
Introduction to the Universal Windows Platform (UWP)
The Universal Windows Platform (UWP) provides a common API platform across Windows devices. Games that target the UWP can call WinRT APIs that are common to all devices. Because the UWP provides guaranteed API layers, you can choose to create a single app package that will install across Windows devices. And if you want to, your game can still call APIs (including some classic Windows APIs from Win32 and .NET) that are specific to the devices your game runs on.
The following are excellent guides that discuss the Universal Windows Platform apps in detail, and are recommended reading to help you understand the platform.
Getting set up and ready to develop a Universal Windows Platform app is quick and easy. The following guides take you through the process step-by-step.
If you're an absolute beginner to UWP programming, and are considering using XAML in your game (see Choosing your graphics technology and programming language), the Windows 10 development for absolute beginners video series is a good place to start.
Announcing the Windows 10 absolute beginners series using XAML (blog post)
Process lifetime management, or app lifecyle, describes the various activation states that a Universal Windows Platform app can transition through. Your game can be activated, suspended, resumed, or terminated, and can transition through those states in a variety of ways.
Games share some common user interface elements and design principles with apps; but games often have a unique look, feel, and design goal for their user experience. Games succeed when thoughtful design is applied to both aspects—when should your game use tested UX, and when should it diverge and innovate? The presentation technology that you choose for your game—DirectX, XAML, HTML5, or some combination of the three—will influence implementation details, but the design principles you apply are largely independent of that choice.
Separately from UX design, gameplay design such as level design, pacing, world design, and other aspects is an art form of its own—one that's up to you and your team, and not covered in this development guide.
Following a consistent color guideline in your game improves aesthetics, aids navigation, and is a powerful tool to inform the player of menu and HUD functionality. Consistent coloring of game elements like warnings, damage, XP, and achievements can lead to cleaner UI, and reduce the need for explicit labels.
The appropriate use of typography enhances many aspects of your game, including UI layout, navigation, readability, atmosphere, brand, and player immersion.
A UI map is a layout of game navigation and menus expressed as a flowchart. The UI map helps all involved stakeholders understand the game's interface and navigation paths, and can expose potential roadblocks and dead ends early in the development cycle.
Here are guides and references for implementing audio in games using XAudio2, XAPO, and Windows Sonic. XAudio2 is a low-level audio API that provides signal processing and mixing foundation for developing high-performance audio engines. The XAPO API allows the creation of cross-platform audio processing objects (XAPO) for use in XAudio2 on both Windows and Xbox. Windows Sonic audio support allows you to add Dolby Atmos for Home Theater, Dolby Atmos for Headphones, and Windows HRTF support to your game or streaming media application.
Better Power, Better Performance: Your Game on DirectX 12
DirectX Tool Kit and libraries
The DirectX Tool Kit, DirectX texture processing library, DirectXMesh geometry processing library, UVAtlas library, and DirectXMath library provide texture, mesh, sprite, and other utility functionality and helper classes for DirectX development. These libraries can help save you development time and effort.
At this stage, your studio is fully engaged and moving into the production cycle, with work distributed throughout your team. You're polishing, refactoring, and extending the prototype to craft it into a full game.
Notifications and live tiles
A tile is your game's representation on the Start Menu. Tiles and notifications can drive player interest even when they aren't currently playing your game.
An add-on (in-app product) is a supplementary item that players can purchase in-game. Add-ons can be game levels, items, or anything else that your players might enjoy. Used appropriately, add-ons can provide revenue while improving the game experience. You define and publish your game's add-ons through Partner Center, and enable in-app purchases in your game's code.
Debugging, performance optimization, and monitoring
To optimize performance, you can take advantage of Game Mode in Windows to provide your gamers with the best possible gaming experience by fully utilizing the capacity of their current hardware.
The Windows Performance Toolkit (WPT) consists of performance monitoring tools that produce in-depth performance profiles of Windows operating systems and applications. This is especially useful for monitoring memory usage, and improving game performance. The Windows Performance Toolkit is included in the Windows SDK and Windows ADK. This toolkit consists of two independent tools: Windows Performance Recorder (WPR) and Windows Performance Analyzer (WPA). ProcDump, which is part of Windows Sysinternals, is a command-line utility that monitors CPU spikes and generates dump files during game crashes.
Some portions of DirectX development can be nuanced and complex. When you get to the point in production where you need to dig down into the details of your DirectX engine, or debug difficult performance problems, the resources and information in this section can help.
Performance tuning and debugging tool for DirectX 12 on Windows
The store manifest (StoreManifest.xml) is an optional configuration file that you can include in your app package. The store manifest provides additional features that are not part of the AppxManifest.xml file. For example, you can use the store manifest to block installation of your game if a target device doesn't have the specified minimum DirectX feature level or the specified minimum system memory.
After you've finished development and shipped your game, it's not game over. You might be done with development on version 1, but your game's journey in the marketplace has only just begun. You'll want to monitor usage and error reporting, respond to user feedback, and publish updates to your game.
Visual Studio Application Insights provides performance, telemetry, and usage analytics for your published game. Application Insights helps you to detect and solve issues after your game is released, continuously monitor and improve usage, and understand how players are continuing to interact with your game. Application Insights works by adding an SDK into your app, which sends telemetry to the Azure portal.
To update your published game, you submit a new app package with a higher version number. After the package makes its way through submission and certification, it will automatically be available to customers as an update.
Xbox Live is a premier gaming network that connects millions of gamers across the world. Developers gain access to Xbox Live features that can organically grow their game's audience, including Xbox Live presence, Leaderboards, Cloud Saves, Game Hubs, Clubs, Party Chat, Game DVR, and more.
Note
If you would like to develop Xbox Live enabled titles, there are several options are available to you. For info about the various programs, see Choosing an Xbox Live developer program.
At Team Xbox, we believe that when everyone plays, we all win. We're committed to ensuring as many developers as possible have the tools needed to create accessible experiences. This learning path introduces foundational concepts about gaming accessibility for game, platform, and hardware developers looking to expand their knowledge in this space.