Tutorial 02 - Turning Your XNA App into a Starter Kit

Saturday, December 23 2006 - ,

One of features of the Visual Studio 2005 range is the ability to use Starter kits. With Starter kits you are able to load up a complete project or application and use it as a base for another application. It is also a good way to publish base projects that are shipped with SDKs or complete SDK Systems. At the moment several systems are using this method, for example the Dot Net Nuke portal system ships the base site as a Starter kit which you can customize and publish to your own site. In relation to game programming the XNA System Ships with one Starter kit “Space war”, and the Torque X Game Engine from Garage Games ships with several base applications in Starter kit form, we have also been told that more Starter kits will start to roll from Microsoft.

One of my hopes is that over the next few months we will start to see community based starter kits being published on various sites. But one of the problems I do see is that the documentation to create these Starter kits is a little hard to find. You can find all that you need for the task inside the MSDN Documentation but you have to dig a little deep to do this. So what I am going to do is use the previous Tutorial that I have put together and convert the Base Application into a simple Starter kit.

At present there is no real GUI way to do this, you will need to create some XML documents as well as perform some simple file operations to complete the task, note that none of the tasks are hard to do and anyone should be able to complete the tasks with the base tools shipped with Windows XP/Vista and the Game Studio Express.

The first Step is to get you base application complete, for those who are new at this you could have a look at my First Tutorial. Once you have the application complete and compiling without any problems you will now need to export the project as a template.

To export the project as a template select the Export Template option under the file menu. When going through this menu you will be presented with some options, first make sure that you select a project template and not an object. When you select a project it will export the complete project including all of the content. If you select the object you will be given the option to export single classes of forms from inside your project.

During the export process you are presented with several configuration options for the project, these include the Template name and description, as well as what to do with the template. It is up to you weather you import the template when finished (I don’t import it). But it will ask you about opening an explorer window to the template, do this…

When the template has been exported make sure that you take note of the Template name. Also I normally move the file to a temp directory so that I can work on the Starter kit files and not interfere with the Template systems. For the purpose of this example I have used the following settings for the names, this will allow you to see where they fall into place when the Starter Kit is finished.

Template Name: BaseXNAApplication
Template Description: Base Windows XNA Application

After you have finished the export you will have a file called BaseXNAApplication.zip, copy this file to a temp location so that we can work on it.

The next step is to create and edit an XML File so that we can use it as a configuration file for the Starter kit. What I have done is create a base configuration file which I customize each time I use it. Here is the Base File…

<VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005">
<Content>
<FileName>LibraryApp Starter Kit.zip</FileName>
<DisplayName>Library Application Starter Kit</DisplayName>
<Description>VSTemplate for VB project</Description>
<FileContentType>VSTemplate</FileContentType>
<ContentVersion>1.0</ContentVersion>
<Attributes>
<Attribute name="TemplateType" value="Project"></Attribute>
<Attribute name="ProjectType" value="Visual Basic"></Attribute>
<Attribute name="ProjectSubType" value=""></Attribute>
</Attributes>
</Content>
</VSContent>

We need to save this file as a *.vscontent file, so for this project we would save it as BaseXNAApplication.vscontent.

Now that we have the base vscontent file we will need to change it to reflect our project, change the vscontent file that we just created so that it matches the one below.

<VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005">
<Content>
<FileName>BaseXNAApplication.zip</FileName>
<DisplayName>Base Windows XNA Application</DisplayName>
<Description>Base Windows XNA Application that can be used to create new Projects</Description>
<FileContentType>VSTemplate</FileContentType>
<ContentVersion>1.0</ContentVersion>
<Attributes>
<Attribute name="TemplateType" value="Project"></Attribute>
<Attribute name="ProjectType" value="Visual C#"></Attribute>
<Attribute name="ProjectSubType" value=""></Attribute>
</Attributes>
</Content>
</VSContent>

With the files that we now have (BaseXNAApplication.zip and BaseXNAApplication.vscontent) we can now put together the Kit. The first step is to create an empty archive/Zip file. In windows XP just right click in the working folder and select new->compressed folder and call it “temp.zip”. Next add the two files that we have created to this compressed file. We need to make sure that the files we add are at the root folder inside the compressed file; if not the starter kit will fail and not work like we want it to. With the files inside the compressed file we now need to rename the compressed file so it is the same as the template file stored inside, rename it to “BaseXNAApplication.zip”.

Almost Done, The last step is to rename the zip file that we have just created and call it “BaseXNAApplication.vsi”…. If all has been done right we should now be able to double click on the vsi file and the Visual Studio Installer will take over and install the Starter Kit.

kick it on DotNetKicks.com kick it on gamedevkicks.com

Similar Posts

  1. Getting Started with Blender 3D and XNA
  2. Blender 3D - Texturing a Box
  3. Getting Started with Blender 3D and XNA

2 comment(s)

Clicky Web Analytics