Advanced XNA Tutorials

This category of tutorials covers some of the more advanced things that you can do in XNA that don't specifically fall under another category. (For instance, HLSL and shaders are an advanced component of XNA, but they are covered in their own category.) The tutorials here assume that you have done quite a bit with the 2D and 3D tutorials, but each tutorial states what it expects you to know in advance, and links to the tutorials that you should go through in case you haven't done them yet.

advanced100.png

1 - Viewports and Split Screen Games

Many multiplayer games will take the screen and split it up into different areas for each player. This tutorial covers how you can do this using viewports in XNA.
Viewports and Split Screen Games


advanced100.png

2 - Rendering to a Texture

In XNA it is easy to take your entire game and render it to a texture, which you can then do all sorts of things with. You'll have a Texture2D object, and by now, you can probably think of a thousand ways they are used. Really, the possibilities are endless, especially once you get into HLSL and effects. This tutorial will show you how to render to a texture using RenderTarget2D objects, and give you a bunch of ideas about how it could be used.
Rendering to a Texture


advanced100.png

3 - Video Playback

As of version 3.1, XNA easily allows you to play videos in your XNA game! Playing videos is extremely simple to do, and is used quite commonly in games. This tutorial will walk you through the basics of playing video.
Video Playback


advanced100.png

4 - The Game Loop

The first tutorial on general game architecture, this tutorial discusses the game loop design pattern and describes how XNA implements it. Nearly every game will use a game loop as a part of the underlying architecture for the game. XNA gives this to you for free, but in upcoming tutorials, we're going to learn how to fine-tune this. Because of that, it will be worth taking the time to understand how the game loop works.
The Game Loop


advanced100.png

5 - GameTime: A Game's Heart Beat

This tutorial covers some details about the GameTime class and TimeSpan struct, which are used to provide you with important information about the timing of the game loop. This will be helpful to understand, before we get into how to customize and control the game loop in our game.
GameTime: A Game's Heart Beat


advanced100.png

6 - Time Steps

This tutorial covers how to control the timing of the game loop, including choosing between fixed and variable time steps (frame rates), selecting the time for a fixed time step, and how to manage the code changes needed to take advantage of a variable time step.
Time Steps


advanced100.png

7 - Cracking the Game Time Problem

As you make XNA games, you're likely to eventually discover a "problem", where timing information isn't what you'd expect. This comes up when you have a fixed time step that is running slowly. Ultimately, it comes down to getting an understanding of what's actually going on. In the case of this problem, the "bug" is usually a misunderstanding of how the game loop is functioning, rather than an actual problem with the XNA code. This tutorial will demystify this situation, so that you have a clear understanding of this tricky game time problem.
Cracking the Game Time Problem


advanced100.png

8 - Extracting Raw Color Data from a Texture2D

It's fairly common to want to pull out raw color data from a Texture2D object. This tutorial covers how to retrieve color data from a Texture2D, as well as for only a subsection of the image. This also covers how to convert the 1D array that is normally returned into a 2D grid that matches the image size.
Extracting Raw Color Data from a Texture2D