Building Windows 8 blog
Windows Store for developers blog
Visual Studio blog
The Windows blog
Inside SkyDrive blog
Download Windows 8 Release Preview
Windows Dev Center
Follow us @WinDevs
The //build/ conference
Windows 8 has changed the PC landscape with innovative form factors, new chip architectures, exciting commerce models and huge opportunities. PC games have long been a staple of the way computers are enjoyed. Now, more than ever, games exemplify the value of this new landscape of devices. Thanks to the Windows Store, games are easier to acquire, play, share with friends and update safely. It’s no wonder then that games account for such a large number of downloads, generate a lot of revenue, and drive the most user engagement on the new platform. With GDC around the corner, more game developers are eager to learn about the Windows 8 opportunity.
So, how do you create a great Windows Store game? What does Windows offer to make your game more creative, innovative, profitable and easier to develop? What tools, technologies and services can you use? What’s available out there in the ecosystem? What are other discoveries developers shared when developing for Windows 8? This post will answer questions about these topics and clarify how you too, can develop an awesome Windows Store game.
Windows 8 was designed and engineered specifically for the enjoyment of entertainment experiences. The Windows 8 User Experience (UX) guidelines promote full screen imagery, as well as fast and fluid interactions with no borders or extra window decorations. The design guidance recommends that apps focus on experiences that invite users to engage and provide interactions that guide them through an immersive experience. Main game controls should be easily accessible and secondary controls should be tucked away in an app bar or in a settings panel until they are needed. So, that’s great for general apps, but how do these principles affect games? After all, game developers have been providing fast and fluid, full screen, immersive experiences for a long time. Nevertheless, several basic questions arise almost right away:
Game developers have been using a wide range of technologies to deliver entertaining games to the PC community for a long time. The APIs used on Windows have evolved significantly over time. With Windows 8, a new development platform has been added. The Windows Runtime API aggregates the best technologies from APIs of the past and brings significant improvements in performance, security, development consistency and servicing. The Windows Store adds a new way for games to be discovered, distributed and serviced. These new APIs significantly add value for game developers targeting the new development model. You might have some questions when you start to develop a Windows Store game, for example:
Every game starts with an idea. Where that idea comes from can be very different. Sometimes it randomly pops into your head while you’re taking a walk, or while you’re in the shower. Other times, a more collaborative and iterative approach with your team may result in the idea. Once you’ve got your idea, you need to decide what type of game it is. Maybe you want a new unique game. Or perhaps you want to port your existing game. It could be a shooter, or puzzle, or racing game – no matter what type of game it is, there’s a home for it in the Windows Store. The Gaming Case Studies presented at //build/ 2012 might inspire you. If you have a Windows Store developer account you can browse the games’ subcategories to be inspired and see how different game categories are performing in different regions.
Once you’ve decided what game you want to build, making design decisions on the front end can save you a lot of development time later on. The Windows 8 game category design guidance gives you some ideas about how best to attract players and keep them engaged with tiles and notifications. There are also suggestions about what type of overall layout to use and where to place primary and secondary controls.
You can find recommendations about interactions and how to incorporate touch, sensors and contracts into your game. Decisions about game mechanics and controls should be made as early as possible to scope development. That said, the Windows Runtime platform makes it more convenient than ever to support touch, pen (ink) and mouse with the same code so you don’t have to design special mechanics for different form factors. Because every Windows PC has a place to plug in a game controller, don’t miss out on the opportunity and make sure you include that control mechanism in your game as well.
Plan how – and at what pace – you’ll introduce game interactions and mechanics to the player. Too slow and they may lose interest; too fast and they may get frustrated. Perhaps most important of all, decide what monetization model and commerce platform you’d like to use. The Windows Store allows you to choose your business model. It supports Free to Play, Ad-based, In-app Purchases and Downloadable Content. Windows Store games can take advantage of the built-in time-based or feature-based trials. Alternately, you can use a third-party commerce provider or roll your own. Either way, as these issues can significantly impact your game’s success, monetarily or in popularity, they are important to consider.
Like all Windows Store apps, games have to support the different activation, view and suspension states. The design guidance offers some help with considerations for how and when to pause your game, how and when to suspend your game’s state, and how to handle full screen, snapped and filled view states. Decide how your game will support landscape and portrait orientations. Consider the size of hit targets and other on-screen controls when adjusting the resolution of your game’s assets to match different screen sizes (or parts of them). Also don’t forget to take screen aspect ratios, resolutions, and DPI settings into consideration. This will make sure your game’s content renders correctly on any screen size and scale factor.
Finally, remember to consider a few additional things that can help increase your game’s accessibility and socialization capabilities. A high contrast mode and extra audio queues could help increase visibility or playability and therefore encourage adoption among players in less than ideal lighting conditions or with visual impairments. Additionally, leveraging the platform’s built-in capabilities for online identity (authentication), data roaming and sharing to other apps can lead to increased engagement through social activity such as comparing game results and playing games across different PCs.
DirectX is considered to be at the heart of the Windows game development platform. However, many other components were developed and transitioned in to the Windows 8 SDK to provide all the required capabilities the platform needs to support the diverse Windows gaming ecosystem. We provide a consistent and comprehensive development approach. We also incorporated best practices learned from other game development platforms. More than anything, however, we emphasized and observed two key architectural goals. Performance and power consumption were at the core of every architectural decision – as described in the Hardware Accelerating Everything: Windows 8 Graphics blog post. Developing games on Windows 8 rocks because the entire platform was designed to deliver fast and fluid entertainment experiences.
The Windows Runtime provides a rich set of APIs that expose all the new devices and sensors in a convenient, consistent way, and simplifies Windows event handling. There’s a single Windows SDK so every API you need to develop a Windows Store game is available in Microsoft Visual Studio 2012. For the most high-fidelity and immersive experiences, you’ll want to use the Windows 8 DirectX APIs to build 3D games. This is the easiest version of DirectX to develop with, and it supports a wide range of graphics feature levels, from DirectX 9.1 to all the latest hardware features exposed in DirectX 11.1, allowing you to tailor your game to every PC from power-efficient ARM-based portable Windows 8 tablet PCs to overclocked multi-GPU gamer rigs.
If you’re comfortable with a particular development language, you can use a lot of your existing skills and experience in Windows 8. Windows Store games can be developed in a number of technology combinations, depending on the type of game you’re developing and your preference. You’re not going to be forced or constrained to one syntax or model. Managed code developers can build great, smooth 2D games with XAML that leverage the strength and features of the Windows Store platform. If you’re a web developer, you can leverage your existing web and web game development skills to make a game that can be monetized through the Windows Store. For 3D interactive games, we recommend you use C++ with DirectX (and optionally XAML), which will be the main focus of the rest of this article.
Windows 8 offers built-in game technology that ships with every version of the OS and resides on every PC so you don’t have to worry about distributing it or manage multiple versions. There’s no need to find, download and install additional components.
Figure 1: The Windows 8 game development components and libraries
From graphics, audio and input, to file I/O, scheduling, math and networking – each component is accessible in the development language of your choice. Lower level components offer more flexibility, resource management and performance but may require additional code to comprehensively control processing and the flow of data it requires. With C++, you have a direct line to the GPU, CPU and low-level services of the Windows 8 platform, allowing you to write high performance code. With the new C++/CX language extensions, the syntax approaches the simplicity of C#. You get transparent object management via reference counting, and yet there’s no runtime layer, garbage collection or just-in-time compilation behaviors that could compromise the smooth performance of your game.
For 3D and 2D graphics, media, imaging and many of the other gaming components – the Windows 8 DirectX technologies provide a comprehensive set of APIs, components and libraries to build upon. Check out Getting started with DirectX game development for a comprehensive overview. The new Windows 8 graphics stack is better integrated, making Direct2D, Direct3D, DirectVideo and DirectCompute components easier to use together and requiring fewer duplicated resources than before. We’ve also added built-in support for the Xbox controllers with the XInput library. To learn more about it see Working with Input and controls in your DirectX game. The improved APIs for audio and sound mixing with XAudio2 are covered in the Working with audio in your DirectX game section, and simplified math functions and types are covered in the DirectXMath programming guide.
One of the greatest advantages of the DirectX/C++ development approach is that you can reuse significant amounts of your code to create a Windows Store game (and Windows Desktop game), a Windows Phone game, and an Xbox 360 game. The DirectX APIs are relevant to all Microsoft gaming platforms. Everything you’ll need to develop a great Windows game is included in the Runtime, the Windows SDK and Visual Studio 2012. For info about the legacy DirectX SDK, see Where is the DirectX SDK? There are several additional development models available in Windows 8. A hybrid model that supports DirectX and XAML interop provides the best control and performance and the convenience of the WinRT UI toolkit.
We provide a great set of tools to meet the demands of Windows Store game developers. Visual Studio 2012 includes a template for DirectX Windows Store apps that gives you a head start in developing for Direct3D. The template code provides the basic view provider infrastructure and window support, and references to all the necessary headers and components. There are other templates to explore that will make sure you are using best practices no matter which game development model you choose.
Additionally, new features in Visual Studio 2012 have been added to improve game development, debugging and profiling. Investments in Visual Studio 2012 Graphics Tools were made to ensure that graphics application development is seamlessly integrated. Work with 3D models, view textures and images, or create, edit and compile HLSL shaders without ever leaving the familiar IDE interface. Debugging graphics intensive DirectX applications in Visual Studio 2012 is now more intuitive with the integration of graphics API capture and playback features (previously known as Windows PIX).
These samples provide a great range of source code examples to get you started on your game development quickly. Each sample focuses on a particular technology or technique. The tutorials and samples were developed with a progression in mind. They are in logical order beginning with the sparsest amount of code and simplest approach to help you get started. Each additional sample adds to the previous sample with one or two additional concepts until an entire game is created. Writing Code for DirectX and C++ Windows Store apps explains some of the things you need to know about writing DirectX and C++ code for Windows Store apps.
The following are end-to-end samples that combine the individual techniques into full games:
Several development patterns, best practices and techniques that are particularly relevant to game development are worth pointing out:
Developing high quality professional games can be costly. Developing games for multiple platforms can be complex, error prone, and even more costly. Many established game studios build tools and develop production technologies that make up their game development process or “pipeline.” These investments help studios leverage their game assets between different games and platforms. Rendering engines, user interface tool kits, visibility occlusion, physics simulators, audio video authoring, animation interpolation and artificial intelligence are just a few of the technology categories typically involved in game development. Some gaming technologies can take many years to develop and fine-tune.
Proprietary gaming pipelines are incredibly valuable and many studios consider their investments as strategic as the games they make. Not everyone can afford the time or cost of developing a pipeline however. Luckily, third-party vendors offer end-to-end game development pipelines or individual technology libraries that provide these capabilities. Since Windows 8 launched, many gaming middleware vendors have transitioned their offerings to the new Windows Store app model. Using these products will get your game in the Windows Store much faster and with much less risk. As time progresses, we expect more vendors to announce and ship products for Windows Store game development. The following (in alphabetical order) is a compilation of third-party gaming middleware vendors that (at the time of writing) have announced or delivered versions of their product that support Windows 8 game development.
Microsoft’s XNA Game Studio is a game development pipeline that targets the Xbox 360, Windows Phone and Windows. However, it’s not compatible with Windows Store game development, (although XNA games are supported as Windows 8’s desktop apps). DirectX development with Visual C++/CX borrows many patterns and practices from XNA, and shares many conceptual similarities. So many XNA game developers will find it relatively easy to transition to DirectX and C++ development than ever before. Alternatively, we have seen developers successfully use the open source MonoGame library that replicates many of the XNA Game Studio capabilities. Several articles have been written about leveraging assets created with XNA for games targeting the Windows Store. Here’s a link to more info on the subject.
Windows 8 reimagines PCs and with new form factors, innovative technologies and lucrative commerce models that are perfect for gaming. The platform represents a green-field of opportunity for those who take advantage of it. The Windows Store has several thousand games at the time of writing and that number grows daily. The goal of this post was to help you understand what it would take to create a great Windows Store game of your own to leverage the possibilities. The information was meant to clarify how Windows 8 can make game development easier, more creative, innovative and profitable. We’ve reviewed what tools, technologies and services are available on the platform and what third-party technologies are available. As we head out to the annual Game Developer Conference in San Francisco, look to this post for guidance as you develop Windows Store games.
Shai Hinitz, Sr. Program Manager