Using XNA Game Studio 3.0, any programmer can master the art of game development and begin selling games to millions of Xbox 360 users worldwide. Now, there’s a practical, comprehensive guide to game development with Microsoft’s powerful new XNA Game Studio 3.0 and the entire XNA Framework.
In Microsoft® XNA® Game Studio 3.0 Unleashed, XNA expert Chad Carter covers the entire XNA platform, presents extensive sample code, and explains that code line by line. Carter walks you through the entire process of game development, including installing XNA, creating objects, handling input, managing and extending the content pipeline, optimizing game performance, and creating both 3D and 2D games. Carter presents sophisticated coverage of using XNA’s high level shader language; creating physical effects; and endowing characters with realistic artificial intelligence.
A case study section walks through the entire process of planning and coding a game, improving it, and putting on the finishing touches that make it marketable. This edition contains nine new chapters, including all-new sections on creating networked games, programming games for the Zune handheld, and preparing and submitting games to Xbox LIVE, where accepted titles will reach gamers worldwide.
- Plan your games to deliver solid performance on the platforms you’ve targeted
- Understand essential XNA Framework concepts, including object creation, cameras, input handling, libraries, game services, and managing and extending the content pipeline
- Create a 2D game that will run across 3 platforms (Windows, Xbox 360, and Zune) with a single code base
- Create a Visualizer media player for the Microsoft Zune
- Use the High Level Shader Language (HLSL) to communicate directly with graphics hardware
- Bring realistic physics to your game action and realistic artificial intelligence to your characters
- Create sophisticated 3D effects that use advanced texturing and a particle system
- Build networked games, including multiplayer demos, turn-based games, and real-time network games
- Create 4 full games–2D parallax side scroller, 3D shooter, multiplayer turn-based 2D card game, and a multiplayer real-time 3D game
- Discover best practices for creating Xbox LIVE Community Games
- Sell your finished game on Xbox LIVE Marketplace
CD-ROM includes: All C# examples and source code presented in this book.
About the Author
Chad Carter, Chief Technology Officer at Robertson Marketing Group, authored the previous edition of this book, Microsoft® XNA™ Unleashed: Graphics and Game Programming for Xbox 360 and Windows. Chad has been writing games and graphics software for more than 15 years.
Table of Contents
Part I Get Up and Running with XNA Game Studio on Your PC and Xbox 360
1 Introducing the XNA Framework and XNA Game Studio 7
2 XNA Game Studio and the Xbox 360 19
3 Performance Considerations 33
Part II Understanding XNA Framework Basics
4 Creating 3D Objects 55
5 Handling Input to Move Our Camera 83
Part III Content Pipeline
6 Loading and Texturing 3D Objects 113
7 Sound and Music 123
8 Extending the Content Pipeline 151
Part IV 2D in XNA Game Studio
9 2D Basics 171
10 2D Effects 191
11 Creating a 2D Game 217
Part V XNA Game Studio and the Zune
12 Programming for the Zune 255
13 Running the Game on the Zune 273
Part VI High Level Shader Language
14 HLSL Basics 291
15 Advanced HLSL 311
Part VII Physics and Artificial Intelligence
16 Physics Basics 325
17 Finite State Machines and Game State Management 343
18 AI Algorithms 375
Part VIII 3D Effects
19 Advanced Texturing Techniques 391
20 Special Effects 417
21 Particle System 435
Part IX Putting It into Practice
22 Creating a 3D Game 471
23 Improving the Game 501
24 Finishing Touches 525
Part X XNA Framework Networking
25 Networking Basics 549
26 Creating Multiplayer Demos 565
27 Creating a Networking Game Skeleton 583
28 Creating a Turn-based Multiplayer Game 631
29 Creating a Real-time Multiplayer Game 671
Part XI Xbox LIVE Community Games
30 Best Practices for Creating an Xbox LIVE Community Game 719
31 Selling the Game on Xbox LIVE Marketplace 727
Many developers became interested in programming because they saw a video game and thought, “How did they do that?” This book helps demystify what is required to make video games. Being able to write games on a next-generation console such as the Xbox 360 has never been an option for the masses before. Now with the XNA Framework, games can be written for the console.
By the end of this book, you will have created four complete games and many demos along the way. This book takes a serious look at performance-related issues when writing games using XNA for Windows and the Xbox 360. Two chapters are devoted to the High Level Shader Language (HLSL), which is a necessity for writing great games. The book covers physics and artificial intelligence (AI). It also covers special effects, including explosions, transitions, and how to create a 3D particle system. It demonstrates how to create a sound project using the Microsoft Cross-Platform Audio Creation Tool (XACT) and how to directly access sound files in a game. Two chapters are devoted to programming games for the Zune. Saving and loading a high score list and creating a full menu system are also taught in this book. Five chapters are devoted to creating multiplayer games. Writing network games can be challenging, and this book covers networking in detail. The final two chapters are on best practices and provide tips on how to sell games on the Xbox LIVE Marketplace. In general, this book contains a great foundation for many topics that need to be learned to create and sell a full-featured single-player or multiplayer game.
Who Should Read This Book?
This book was written for developers. You should have a good understanding of programming in general. The book uses C#, but if you know any modern language, such as C++, Java, or VB.NET, you will have no problem understanding the code in this book. The book assumes some understanding of the Microsoft .NET Framework, which is what the XNA Framework runs on. Without prior experience writing code using the .NET Framework, you might have to do a little research now and then, but should not have trouble getting through this book.
This book was written with a few different audiences in mind. Business application developers who want to use their programming skill set to write computer games are one audience. Graphics and game developers who have been around the OpenGL and DirectX block should also find useful information in this book—especially in seeing how things are done “the XNA way.” The book also targets readers who have some programming experience but have not done anything formal. The book teaches by example. It is written in such a way that if you are not in front of your computer, you can still get valuable information from the book because the code is presented as it is being discussed.
Hardware and Software Requirements
The code in this book is compiled with XNA Game Studio 3.0. In order to complete the games and demos in this book, the requirements that follow must be met.
Supported Operating Systems
The following operating systems are supported:
- Windows XP Home Edition
- Windows XP Professional Edition
- Windows XP Media Center Edition
- Windows XP Tablet Edition
- Windows Vista Home Basic Edition
- Windows Vista Home Premium Edition
- Windows Vista Business Edition
- Windows Vista Enterprise Edition
- Windows Vista Ultimate Edition
Windows XP requires Service Pack 2 or later.
When you run XNA Framework games on Windows, a graphics card that supports Shader Model 1.1 is required. This book has samples that use Shader Model 2.0 and a couple that use Shader Model 3.0. To get the most from this book, you need a graphics card that supports Shader Model 3.0. The graphics card should have the most up-to-date drivers. Updated drivers can be found on the graphics card’s hardware vendor website.
When you run XNA Framework games on the Xbox 360 console, a hard drive must be connected to the console.
All the software required to utilize the XNA Framework on Windows is free:
- Microsoft Visual C# 2005 Express Edition
- Microsoft XNA Game Studio Express
- DirectX 9.0c
Instructions on installing the software can be found in Chapter 1, “Introducing the XNA Framework and XNA Game Studio.”
The source code for the examples in this book can be found on the accompanying CD. Any updates to the code can be downloaded via http://www.samspublishing.com or http://www.xnaessentials.com.
How This Book Is Organized
This book is organized into 11 main parts, representing the information you need to understand to use XNA Game Studio effectively. Writing a book is an interesting challenge. There are basically two routes an author can go. One route is to create small bite-sized pieces that can be used as a reference. The other route is to take the reader on a journey from start to finish, covering important topics along the way but doing it in such a manner that the reader is gradually learning concepts. Then, once the entire book has been enjoyed, the reader can go back and reread certain sections for mastery.
I have tried to take the second approach in writing this book. The book is best read in order. The Internet has a wealth of information. Learning about a particular topic is not difficult. You can easily find information from many different sources on a particular topic. The problem is there is usually no place to see how a lot of different topics work together. With a book that is designed to be read from front to back, the main drawback is a larger time commitment. However, there is usually deeper understanding by the time the task is complete versus the same amount of time spent looking at particular topics on the subject from online tutorials and blog posts. Both are very important, but because a wealth of reference information is available online already, there was no need to make this a reference book.
There was some criticism concerning the order of the first book. This book is not organized in a manner similar to many other books. However, a lot of thought was put into the order of this book. I do believe this book’s order is important, and I did not change it from the first edition. I start with a very basic chapter explaining the history of XNA and very detailed instructions on how to install XNA Game Studio. Most people will not need this, but it is there for those who do. The next chapter jumps right in to talking about the Xbox 360. Even though there are people who do not have an Xbox 360, it is important to put this chapter up front so you can be aware of certain things when creating games using XNA. It is always important to know what you are up against before you start. It is for this same reason that the very next chapter is on performance. Most books simply give a nod to performance in a later chapter or maybe an appendix, if at all. I personally believe that thinking about performance early on is crucial to making a good game. This does not mean we need to do micro-optimizations early in the process; instead, it is all about measurement. This is why performance is discussed so early in the book.
The first real game code that is presented in this book is written for 3D. Many people are shocked that 2D is not discussed until Chapter 9, “2D Basics.” The reason for putting 3D before 2D in this book is because picking up 3D is not any harder than learning 2D. The early chapters are there to introduce you to the XNA Framework as well as the concepts behind a camera. It is my hope to tear down the mental block many people have that 3D is much harder than 2D. Granted, there are some complex topics surrounding 3D, and those are covered later in the book. However, by getting started by drawing models and responding to input, you’ll see there is not a huge difference in the knowledge needed to write 3D games versus 2D games.
After discussing 3D and the Content Pipeline, the book discusses 2D and then moves into two chapters devoted to programming for the Zune. The next part of the book discusses the High Level Shader Language. Physics and artificial intelligence are discussed next. The code for those chapters uses the basic 3D information you will learn in earlier parts the book.
This is followed up by talking about more advanced 3D topics. A single-player 3D game is then built, thus allowing us to put into practice all you will learn in this book.
The next part of the book provides an intensive look at developing multiplayer games. Then the final part of the book discusses some best practices, most of which are done while creating the demos and games throughout the book. The last chapter explains the review process and getting your game into a condition to be sold on the Xbox LIVE Marketplace.
© Copyright Pearson Education. All rights reserved.
Most Helpful Customer Reviews