XNA, Managed DirectX and Game Programming

March 2008 - Posts

Blender 3D - Adding a Normal Map to a Plane

Here is a Quick Video Tutorial that goes through the simple process of adding a Normal Map to a plane in Blender 3D.

Cross Post from www.virtualrealm.com.au
Blender 3D - Game Scene Modelling

I came across this Video this morning that goes through the process of creating a Game Set or Scene using Blender 3D. Looking at the Scene created, this could be a good example and method to creating the base scenes for you XNA Games. The author of the video has said that he plans on going through the complete process and will update each week.

"this is part one in a series of short Demos/Tutorials with commentary that I have started on. they will be released each tuesday till I have finished."

Have a look, and don't forget to comment.

Cross Post from www.virtualrealm.com.au
XNA Game - Tile Map and Battle Scenes

For those who have not noticed yet Nick has been working on a Remake of the xnaresources.com Tile Map Engine, you can view the articles, videos and samples on his Blog.

But this morning I came across the following video that uses some of the information in Nicks Video Series.

"This is the 3rd progress report on Project ShackRPG. This project is being done by one person, with roughly 3 months experience in programming.

Included in this demo is a test of the new TileEngine with a BIG scrollable map and collision detection with 'rock' tiles and screen borders. This is a modified version of the tile engine I wrote when I first started learning how to program mixed with some techniques from Nick Gravelyn's tilemap tutorial series located at his blog at:
http://nick.gravelyn.com/

I also changed the battle system layout a bit based on feedback, and touched up some of the polish.

Next step for me is to work on the animations for enemy units, add some graphics (especially for the F(ight) D(efend) and R(run) icons in battle) and sound effects.

Further down the list I would like to do a basic scripting engine so I could put together small cutscenes.. but this is starting to look like an actual game! "

If you havn't yet, please drop over and try Nicks Code...

Cross Post from www.virtualrealm.com.au
Posted: Mon, Mar 24 2008 16:40 by Glenn Wilson | with no comments
Filed under:
XNA Game - 3d Frogger

Here is a good example of a simple game converted to 3d...

"Video of my 3d version of Frogger made in Microsoft XNA"

Cross Post from www.virtualrealm.com.au
Posted: Mon, Mar 24 2008 16:37 by Glenn Wilson | with no comments
Filed under:
Blender 3D - Presenting your Models

On Blender Newbies today I came across a really good video tutorial on Presenting your [Blender] Models.

Here is the Direct Link to the Post, the site also offers a Download of the Video Tutorial.

If you have a need to showoff or present your models this example will give you a good environment to do so.

Also remember to check out my Blender Tutorials Page.

Cross Post from www.virtualrealm.com.au
Blender 3D Video Tutorial - Creating a Low Poly Character

In this simple Video Tutorial the author goes through the simple process of creating a low poly Characters body using the [Blender] Tools. This is a really good example of what you can get done quickly inside the Blender 3D Environment.

For those using XNA you should be able to export this model using the FBX Exporter and import it into your games, first though you would need to put a Head onto it.

Cross Post from www.virtualrealm.com.au
XNA Game - CaveIn 3D

I can across this really cool looking game "CaveIn 3D".

In CaveIn, players assumes the role of a member of the Miner Rescue Team. They have been called in on a mission to rescue trapped miners in a dangerous and puzzle-filled 3D environment. The player starts the game choosing one of two heroes Johnny Red or Parker Blue. Once in the game, the player views the level from a 3rd person ¾ view camera and also has the assistance of a mini-map to help get an idea of the overall state of the game.

At the moment I do not know if the game is ready for download, or even if the author is going to release the source code. But from the looks of it the game has some real potential. Drop on over to the site, have a look and leave some feedback for the Author.

Cross Post from www.virtualrealm.com.au
XNA Racer Starter Kit Mod - Flying Car

I came across an interesting Mod done to the XNA Racer Starter Kit, the author has moderfied the system to include a Car that reminds be of the "Back to the Future" Movies.

"My XNA Racing Game Starter kit modification to Back To the Future style flying car race.

Changes done in source code:
Added PC joystick support
Added speed dependent altitude change
Added wheels turned down when airborn
(I will release source code on my webpage) "

Cross Post from www.virtualrealm.com.au
Posted: Sun, Mar 16 2008 16:54 by Glenn Wilson | with no comments
Filed under:
Blender 3D - Video Tutorial on UV Unwrapping

Here is a simple video that will guide you through one of the ways to UV Unwrap your model.

Cross Post from www.virtualrealm.com.au
Using Blender 3D to Create a Star Field

One of the simple systems that you need for almost all of the XNA Applications is the ability to display a nice clean background; I know that not everyone likes the cornflower blue background for the default application.

With one of my projects I needed to draw a simple star field for the background. To do this I could have used one of the 2D drawing applications like Photoshop or the free Paint.Net, but I chose to use the 3D rendering system of Blender to draw my scene and render out the Background.

Here is a Direct Link to the Article, Also check out this page for a list of my Blender Tutorials as well as Several from the Community.

Cross Post from www.virtualrealm.com.au
Using Visual Studio Code Snippets for XNA Development

On the XNA IRC Channel this morning someone asked a question on how to use the Visual Studio Code snippets. I have been using these snippets for a long time, not normally for XNA but for other applications. But when the question popped up I thought I would put something together for the XNA Development world, in some cases the snippets functions could assist us with code that we seem to type all of the time.

For this example I have put to different snippets together, note that the principles here can be used in other different types off applications as well. Also the examples here can be used in all SKU's of the Visual Studio 2005 system; I will update this article once XNA is supported under the Visual Studio 2008 system.

In Visual Studio you have the ability to use two main types of snippets, the first is a surround snippet and the second is a normal code section.

The first snippet that I plan to show you will give you the ability to highlight a section of code and surround it with a #if !XBOX360 call. Now I know that this doesn't seem like much, but when you are developing a complete section of say Mouse Input code and then decide to turn on the Xbox 360 project. With this snippet you should now be able to just highlight the code, right click and select surround with and you are done.

The second snippet will allow you to use a shortcut to enter a block of code into your application. For this example I have decided to design a small section of code that will setup your Graphic Device to use a 720p format (1280x720). Once complete you will be able to add the code by just typing gd720p and pressing tab twice on the keyboard.

Ok let's get started...

The first thing that you will need to do is to create a folder to store the snippets. This folder can be located anywhere as long as Visual Studio and your User can get access to it. In the case of a Team you might be able to create a folder on a shared location and allow all of the team members to connect to it. Once the folder has been created (I Called mine ‘XNA 2.0 Code Snippets', this way as I work on both versions I will not get confused) go back and Fire Up Visual Studio. As you will also be testing these application snippets also start up a basic Windows Game Application so that we have something to work with.

Once inside Visual Studio press ‘CTRL + K + B' to bring up the Code Snippet Manager. Inside the Code Snippets manager press the add button and navigate to the location where you created the folder to store the snippets.

Next step is to add the code snippets, below is the code for both of the snippets that I am planning to use in this example. The code is easy to understand and in some future articles I will go through expanding on them.

[code language="C#"]

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
   <CodeSnippet Format="1.0.0">
      <Header>
         <Title>#if not Xbox 360</Title>
         <Shortcut>#ifxbox</Shortcut>
         <Description>Code snippet for #if !XBOX360</Description>
         <Author>Virtual Realm Consulting</Author>
         <SnippetTypes>
            <SnippetType>Expansion</SnippetType>
            <SnippetType>SurroundsWith</SnippetType>
         </SnippetTypes>
      </Header>
         <Snippet>
            <Code Language="csharp"><![CDATA[#if !XBOX360
                      $selected$
                      $end$ 
                      #endif]]>
            </Code>
         </Snippet>
   </CodeSnippet>
</CodeSnippets>

[/code]

[code language="C#"]

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
   <CodeSnippet Format="1.0.0">
      <Header>
         <Title>Graphic Device - 720p</Title>
         <Shortcut>gd720p</Shortcut>
         <Description>Code Snippet to Set up the Graphic Device for 720p</Description>
         <Author>Virtual Realm Consulting</Author>
         <SnippetTypes>
            <SnippetType>Expansion</SnippetType>
         </SnippetTypes>
      </Header>
      <Snippet>
         <Code Language="csharp"><![CDATA[graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;
            graphics.ApplyChanges();
            $end$]]>
         </Code>
      </Snippet>
   </CodeSnippet>
</CodeSnippets>

[/code]

The next step is to open up your favourite XML Editor; my preference is Primal Script. Create a new file and call it "pp_ifxbox.snippet" making sure the extension is .snippet, once done copy the first section of code into the file. Do the same for the second, but call the file "gd720p.snippet". When complete save both of these files in you new snippet directory.

Now back to your visual Studio Application.

Inside your Windows game application what I would like you to do now is scroll down to where the Content Root Directory is set, underneath that start a new line and type gd720p and press ‘TAB' Twice. And there you have it a simple code block inserted.

Now highlight the code that we just added to the application, once highlighted click on it with the right mouse button. You will see a menu item appear that says "Surround with", select that. Once selected you should be presented with a folder list that has your new XNA Snippet Folder listed, select that and then select the If !XBOX360 tag. This will now surround the highlighted code with the #if !XBOX360....

Hope you have understood the process, I do plan on expanding on this and creating some snippets that will in turn ask you for variables once you enter them. At least now with the main setup done, if you do develop or download others snippets, all you have to do is drop them into the Directory and you are right to go.

Cross Post from www.virtualrealm.com.au
Architecture Modeling with Blender 3D

For most of us the main use of Blender 3D is to get some sort of a Model into our games, from what I have seen most of the modeling I have seen sofar with XNA has been around the main Character or Objects. Today I was going through my normal Blog posts and such and came across a very simple tutorial on "Architecture Modeling with Blender 3D".

With the Skills that are demonstrated in this article we should now be able to show off our modelling skills in the background of our games.

Thanks to Blender Nation for the article.

Cross Post from www.virtualrealm.com.au
Modeling for XNA with Blender

For a while now I have been using a mix of Blende and 3D Studio Max to do my modeling for XNA and before that Managed DirectX (MDX). Over this time I have posted several blog posts on how to use Blender with the different Application, what I have started to do is to collate these onto a new Article page on the site. Here is a link to the Cover page, note that as time goes on I plan to keep adding to the list.

Cross Post from www.virtualrealm.com.au
Posted: Tue, Mar 11 2008 16:41 by Glenn Wilson | with no comments
Filed under: ,
Blender 3D - Video Tutorial Hoovers Pipe

I came across this great simple video tutorial that uses Blender 3D to create a simple pipe.

The tutorial goes through several moderfiers that will help you to twist and turn the pipe as needed, I can see this technique being used to create addons to space ship hulls, or even additional scene objects in you games.

Cross Post from www.virtualrealm.com.au
Exporting your Google Sketchup Models for XNA

I am not a big one for Google Sketchup but I have seen a lot of people asking how they would export their work so that they can use it in their XNA Games. Here is a link to a site that talks about a x file exporter that can be used with Sketchup to export your models, they even go through some code that will display your model for you.

Direct Link to the Post.

Cross Post from www.virtualrealm.com.au
XNA Game - Cow Tipping

One of the guys from the #xna channel on the IRC pointed me to this different type of game that has been developed using the XNA Framework, thanks 'boki'.

It would be good to get some more information on this, also if there is going to be any type of release to the public.

Cross Post from www.virtualrealm.com.au
Blender 3d - Video Tutorial on Creating a Sword

Here is a small video that shows you a simple method of creating a sword using the Blender 3d System.

Cross Post from www.virtualrealm.com.au
Using Gamer Services in your XNA Game

I started to play around with the Gamer Services this morning and have started to collect a small amount of code that may help others get started. The first is just a simple way to start a session and allow the Gamer to sign in.

To start just fire up a new Windows XNA Game from the Game Studio system, once done add the following line to the Games Constructor.

[code language="C#"]

Components.Add(new GamerServicesComponent(this));

[/code]

The above statement is all you need to intergrate the gamer Services into your application. Now to work on the sign in part.

You will find that when you first put this code in and run the application nothing will happen. To activate the in game guide you can either press the ‘Home' key on the keyboard, or if you have a controller connected you can press the ‘Guide Button'. Doing this should bring up the Live sign in Guide. When you do sign in for the first time you may need to go through an update process, but this is relativly simple and does not take to long.

This is all well and good, but now we want to handle the sign in ans sign out of a player. For this simple task we are going to have to add two events to the code base right underneath the code we just added.

[code language="C#"]

SignedInGamer.SignedIn += new EventHandler<SignedInEventArgs>(SignedInGamer_SignedIn);
SignedInGamer.SignedOut += new EventHandler<SignedOutEventArgs>(SignedInGamer_SignedOut);

[/code]

When you are typing these in you will find that one of the great built in functions that ship with Visual Studio will assist you in creating not only the events but also the procedures caled by these event calls.

You should have the following two procedures created in your code base.

[code language="C#"]       

void SignedInGamer_SignedIn(object sender, SignedInEventArgs e)
        {
            throw new Exception("The method or operation is not implemented.");
        }

void SignedInGamer_SignedOut(object sender, SignedOutEventArgs e)
        {
            throw new Exception("The method or operation is not implemented.");
        }

[/code]

 

What I would like to do when a Gamer Signs in or out is to change the Windows Forms Title. I know this will not afect the Xbox 360 code, but at least you will be able to see what we are doing with this example. To change the Windows title change the two procedures to look like the following.

[code language="C#"]

void SignedInGamer_SignedOut(object sender, SignedOutEventArgs e)
        {
            this.Window.Title = "No Gamers Signed In";
        }

void SignedInGamer_SignedIn(object sender, SignedInEventArgs e)
        {
            this.Window.Title = "Gamer Signed In - " + e.Gamer.Gamertag.ToString();
        }

[/code]

If you run the application now you should find that when you activate the Guide ("Home" or "Guide Buttons") you should be presented with an option to sign in to the Gamer Services. When you do the Windows Title will change to show your Gamer Tag as Signed in, and when you sign out (Pressing the Guide Buttons again and signing out) you should see the Title change to show that no gamers are signed in.

I do hope that this helps someone get started using the Gamer Services, over the next few weeks I am planning on doing a bit of work with them and will post what I find.

Cross Post from www.virtualrealm.com.au