Introduction

So You Want to be a Game Developer?

We’ve worked in what you would call the “game industry” for years, and during our time, we’ve met many people and developers. They almost universally share a similar trait in that they either have been or at some time wanted to be a game developer. Games are everywhere—in movies, television, and the Internet. The audience of people playing games has expanded, too, with the popularity of online social media sites such as Facebook.

Much like a book or a movie, games can be a journey. They can tell a story and put the person experiencing it into a whole new world. Unlike a book or a movie, though, games are interactive. The player actually has an effect on the world. People can get immersed in these worlds, and once they are, a natural extension of that is the desire to create other (even better) worlds for others to get immersed in. With this desire to create other worlds, we have a budding game developer.

You may find this surprising, but writing a game is hard work, or, writing a good game is hard work. First, you need to have a good idea, and hopefully, that idea is fun. After you have the idea, though (even if it is the best idea ever), you still have to write the actual core game play and mechanics. After that, there is a ton of work to get something that looks polished. Finishing developing a game is probably one of the most difficult things for someone to do, particularly if he or she isn’t aware of how much work is required.

It isn’t easy to become a professional game developer. For established publishers and studios, it is difficult to come in off the street and get a job writing games. Publishers and studios want people with experience who have shipped games. Times are changing, however, with platforms that allow self-publishing (such as XNA Game Studio on Xbox or for Windows Phone 7). Anyone can publish a game and actually charge for it to make money.

A Brief History of XNA Game Studio

This book covers XNA Game Studio 4.0, and it has been quite a journey to get to this fourth release. XNA Game Studio 4.0 naturally builds on previous versions of XNA Game Studio, which build on a combination of technologies that go way back.

The technologies go all the way back to Windows 95 as a matter of fact! When Windows 95 was released, Microsoft released something called the Windows Game SDK, which would later be renamed to something you might be more familiar with—DirectX. It is somewhat humorous that the X that is everywhere started off as a joke. The original APIs released in DirectX 1.0 were DirectDraw, DirectInput, and DirectSound. The X was used as shorthand to replace each of the actual API component names to talk about the whole group, and that X soon became the official name. It migrated all the way through to the original Xbox to XNA.

Before DirectX, making games was much more difficult than it is today. There wasn’t a standard way of talking to the various pieces of hardware that existed on all the computers, so if you wanted to write a game that worked for everything, you had to write special code for each piece of hardware you wanted to support. With DirectX, there was a standard way of accessing the hardware, and game developers and hardware manufacturers all over rejoiced!

DirectX has gone through quite a few versions, adding new functionality as it developed (such as 3D graphics, networking, and music) and is now on version 11 that shipped with Windows 7. When people talk about DirectX 11, though, they are almost always talking about Direct3D 11, as no other components have changed since DirectX9.

I got ahead of myself, though. Let’s backtrack a little to DirectX 7.0. This was the first version of DirectX that included functionality for a language other than C, as it included DirectX for Visual Basic. This was actually when I joined the DirectX team, specifically to work on that portion of the product. I continued to work on it through DirectX 8.0.

DirectX 8.0 was the first version to include programmable shaders, something you read more about in Chapter 8. It’s actually hard to believe how far we’ve come since then, as there isn’t any way to write graphics code without shaders! DirectX 8.0 is also the time I began looking at this funny thing called .NET.

DirectX 9.0 was the first release of DirectX that included a component specifically designed for the Common Language Runtime (CLR). This component is Managed DirectX. A lot of work went into that project and although it looked only vaguely familiar to people using DirectX, it fit right in for people using C# and the other managed languages.

The response Managed DirectX received was surprising and a bit overwhelming. Although DirectX for Visual Basic had expanded the development audience, Managed DirectX did so even more. The API was cleaner, easier to use, and felt like all of the other managed components that were out there. The biggest worry then (and one you still hear about today) was related to performance. No one could believe that a managed API (particularly one with a garbage collector) could run fast.

After spending a few years working on Managed DirectX, I left the DirectX team in January of 2006 to join a new group that wanted to develop this thing called XNA, which was eventually released late in 2006 as XNA Game Studio Express.

Game Studio changed all the rules. It took the ease of use and power that Managed DirectX had, made it even easier and more powerful, and added the capability to run games on an Xbox 360. Historically, game consoles have always been closed systems, including the Xbox 360. Before Game Studio, the only way to run code on an Xbox 360 was to be a registered native developer, which required a contract with Microsoft and an approved game!

Much like DirectX, Game Studio kept evolving. With 2.0, support for networking via Xbox LIVE was added. Any version of Visual Studio 2005 was allowed to be used (rather than the C# Express that was required in the first version). At the launch of 3.0, new features arrived with the inclusion of support for Zune and the capability to publish and sell games on Xbox LIVE via the Xbox LIVE Community Games (now called Xbox LIVE Indie Games). Version 3.1 included support for the Zune HD, Video, Xbox LIVE Parties, and Avatars.

Game Studio 4.0 is the latest version where the biggest feature is the addition of the Windows Phone 7 development. There are, of course, other updates, too, including a much simpler graphics API and features such as microphone support and dynamic audio. This version is what this book covers. It has been a wild ride getting here, and I can’t wait to see where we go next.

What Is Available in Game Studio 4.0?

Game Studio 4.0 has everything you need to make great and compelling games for Windows Phone 7, Xbox 360, and Windows. The Game Studio 4.0 release is broken into two different profiles: One is called Reach, which encompasses features that exist on all platforms, and the other is called HiDef, which includes extra features that exist only on Xbox 360 and Windows (depending on the graphics card). Each of these areas is discussed in depth later in the book. Table 1 shows the major namespaces and feature areas contained in the framework.

Table 1. Namespaces included in XNA Game Studio 4.0

image

Why This Book?

This book is not only the best reference source for Game Studio 4.0, it also has the added benefit of being authored by two of the people responsible for bringing this product to you. It would be difficult to find two people more knowledgeable on this subject than us, and we want to transfer that knowledge to you.

We cover every aspect of game development using Game Studio 4.0 for every platform that it supports. This includes specifics for APIs that exist on Windows Phone 7 (such as accelerometer and other sensors) that are not part of the Game Studio API, but are important for games.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.125.2