Sgt. Conker We are "Absolutely Fine"

8Sep/105

Article: Rolling World Tutorial

by Christian Schlager

When you look around the XBox Indie Games Channel, there aren't a lot of 3D games around. Most XNA games only feature 2D graphics. I hope to contribute with this tutorial to making 3D graphics a bit less intimidating. And maybe the little prototype we will create throughout the next pages will be the starting point of a great 3D indie game by one of you :)

We will make a prototype that features the kind of rolling world effect that you can see in games such as Animal Crossing or DeathSpank. We will also create the textures and 3D models that go along with the rolling effect and recreate the combination of 2D art with a 3D world you can see in the game DeathSpank.

6Sep/100

Article: Character Movement

by David Kendall

When development started on The Casino, a lot of things were implemented quickly to get the game to a playable state as soon as possible with the intention of coming back to these parts at a later point. In order to achieve character movement quickly, character movement that can be found in most XNA tutorials were added. This involved the character strafing and moving based upon the left thumbstick and rotation of the character based upon the right thumbstick.

This control scheme may seem familiar to some of you, and it should as it is reminiscent of the controls for a First Person Shooter (FPS). However, The Casino is in no way a FPS. In fact I don't know what you would classify it as. I also had an aim when designing the controls...to keep it simple. This was so players of all ages and skills could pick up and play the game as quickly as possible. This meant that the FPS control scheme had to go.

5Sep/1019

Article: Simple 3D Camera in XNA

by Pete Street

How do I make a 3D camera?

This is the most common question I hear from people starting out with 3D game development.
There are many different types of possible cameras and various ways to achieve each of them. The amount of unique camera samples available online, while some are more complicated than others, can be daunting to those just beginning with 3D games.

Additionally, it’s frustrating and nearly impossible to combine two different samples without doing some serious hacking.
My goal for this tutorial is to remove that frustration from 3D-beginners by providing a back-to-basics approach to three of the most common types of cameras used in games:

  • a free camera
  • a chase camera
  • a orbit camera
3Sep/100

Article: Multiple columns with game state management

by Jeff Brown

This tutorial is based on the Game State Management (singleplayer games) from the xna website but the Network Game State Management (multiplayer games) can also be used based on your needs. There's no better place to start and I believe every game should incorporate one of the two. For this tutorial I'll be using the game state management but both should be nearly identical except for some multiplayer menus but those don't apply here.

This tutorial focuses on adding left and right movement to your menus so you can have multiple columns of menus.
NOTE: I have debug code in to modify the number of columns and number of menu entries in-game just to show how you can scale it very easily. You can download the project here to play with it. Left/right triggers add/remove menu entries and left/right shoulder buttons increase/decrease the number of columns.

3Sep/100

Article: WCF on the Windows Phone 7–The How to Guide

by Simon Jackson

Well at the behest of Michael B McLaughlin (@MikeBMCL on Twitter), here's a run down of what you need to know to get WCF working on the Windows Phone 7, both for Silverlight and XNA.  This is just going to be a brief overview and the full detail will be included in the LeaderBoard sample for Silverlight and XNA coming soon.

Many thanks to @MikeBMCL pointing me to this post by Michael Cummings who details one approach to getting WCF working for XNA.  It does work, but it’s a long way round.  It did however point me in the right direction to solve the problem and now I’ve got WCF working the way I Like it.  As in Working.

3Sep/107

Article: Scripting on the Xbox 360, Windows Phone, and Beyond!

by UberGeekGames

Scripting

Scripting. It’s a recurring theme on the XNA forums: “Can I use Lua?” “Can I script on the Xbox 360?” “Scripting FTW! No, scripting FTL!”. Do a quick search for “scripting” on the XNA forums and you’ll find many threads with the preceding themes. There’s a lot of information about scripting, and it usually ends with “no, you can’t do scripting on the Xbox, and it’s probably not a good idea anyway”.
In this tutorial, I’m going to show you what scripting is, a very useful type of scripting that I’ve been using more and more, and how you can make your own scripting system and use it effectively.

1Sep/106

Article: Node-Based Scripting

by Blecki

Node Based Scripting

Node-based scripting is not a traditional scripting language. And it's not a new idea, though it seems like people have forgotten about it. New systems appear - see Unreal Engine's Kismet - which people think are amazing new technologies. They aren't new; just amazing. I first encountered this scripting system in the quake engine. It was very crude, and limited, but it had all the basic properties of the system I am about to describe.

A brief note : Throughout this article, I use my own engine, Jemgine, and it's level editor for my examples. Jemgine is available at http://jemgine.codeplex.com You'll need to have XNA Gamestudio 3.1 installed to compile it, and to run the editor.

The target user of a node-based scripting system isn't the programmer, it's the level designer. The level designer might not know how to program. They might be constantly bothering a programmer to write scripts for them. Node-based scripting is an attempt to give the non-programmer level designer tools they understand and can use to create interesting behavior in a level without involving the programmer, and without having to learn a complex scripting language.

24Aug/1018

Article: Programming your first XNA 4.0 game for PC, Xbox 360 & Windows Phone 7: Pong

by Thomas "Mister Helmut" Altenburger

Programming your first XNA 4.0 game

I’d like to introduce the XNA framework to you with this very simple and straightforward tutorial. We will see what XNA is and how its basic features works to continue with the programming of your first game, a simple Pong clone for Windows. At last, we’ll try to convert it to the Xbox 360 and Windows Phone 7. This tutorial assumes that the readers have a basic C#/.Net understanding. I hope that it will help you to understand the basics of the framework and that it will motivate you to go further in. The article should be suitable to complete beginners in game programming.

About this tutorial: I wrote this tutorial back in the days of XNA 2.0 beta and used it as an introductory course I taught to master degree students. Since then, it evolved to support XNA 4.0 beta with added Window Phone 7 development.

English not being my native language, please forgive and/or report any English oddities.

This tutorial targets XNA 4.0 beta. It will be updated when the final version will be released. It uses some new features of XNA 4.0 so it will not run out-of-the-box on previous XNA version (mainly due to the usage of Viewport.Bounds and changed SpriteBatch.Draw arguments order).

17Aug/104

Article: Texture Modification using Render Targets, with some Stencil Buffer Action

by Dave Carlile

Planet Craters

Sometimes you need to modify a texture while your game is running, and there are a number of ways to do this. One of the first things newer game programmers often try to do is use Texture2D.GetData to copy the texture data from the GPU to an array on the CPU, modify the bytes, and then send it back to the GPU with Texture2D.SetData.

This is a bad idea on many, levels. Beyond issues with pipeline stalls, GetData and SetData can be slow, especially when working with a large texture. Any time you’re tempted grab data from the GPU for use on the CPU you should very carefully consider all of your options. There are often other solutions that let you keep the data entirely on the GPU and accomplish the same thing.

This tutorial will use an example that could be solved with GetData and SetData, and show you another alternative using render targets and the stencil buffer that will let you perform the same function entirely on the GPU.

14Aug/105

Article: Derived Effect Classes in XNA 4

by Dave Carlile

One of the nice API changes in XNA 4.0 is the simplified syntax used when drawing with an Effect. In previous versions you would draw things like this:

[csharp]
effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Begin();
// draw your stuff
pass.End();
}
effect.End();
[/csharp]

Now you can draw things like this, with EffectPass.Apply handling all the magic:

[csharp]
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
// draw your stuff
}
[/csharp]

Related to this is the new Effect.OnApply virtual method which gets called by EffectPass.Apply. By overriding this method in a derived class you can do things like perform pre-shader calculations and set shader parameters from properties. This is how BasicEffect and the other new standard shaders work, and it would be nice to be able to duplicate that functionality in our own derived effects.
Ideally we would like to be able to do something like this:

[csharp]
MyEffect effect = Content.Load<MyEffect>(“myeffect”);
effect.World = Matrix.Identity;
effect.Color = Color.Blue;
...
effect.Apply();
...
[/csharp]

The first line is where we begin running into issues. In order to load a derived class using the content pipeline you have to write your own content processor, reader, and writer, for every single class. You might think that you could load an Effect instance using the content manager, then create an instance of your derived Effect class and pass in the code. Unfortunately, there is no way to get at the code in the Effect instance (okay, that is not entirely true, but this solution requires the full Game Studio install).
If you want to store the class properties (e.g. MyEffect.World, MyEffect.Color) as content then extending the content pipeline for each class is your best option. But what if you don't need to store the properties? What if you just want a cleaner interface to your shaders? Extending the pipeline each time for these cases seems like a lot of unnecessary work.

A Solution

This remainder of this tutorial will show you how to load any derived Effect class from the content pipeline without having to extend the pipeline for each class. To accomplish this we're going to create a content pipeline extension library that will compile the effect into an intermediate object that will let us get at the compiled code. We will also create a game library that will define the intermediate class so we can get to it at run time. And finally we’ll add an extension method that will do the work of loading our derived Effect class.