<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Paul Solt &#187; XNA</title>
	<atom:link href="http://paulsolt.com/category/xna/feed/" rel="self" type="application/rss+xml" />
	<link>http://paulsolt.com</link>
	<description>Putting the Inc back in Solt since 2005.</description>
	<lastBuildDate>Wed, 12 May 2010 19:34:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>XNA 3.0 Content Pipeline</title>
		<link>http://paulsolt.com/2009/01/xna-30-content-pipeline/</link>
		<comments>http://paulsolt.com/2009/01/xna-30-content-pipeline/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 17:50:00 +0000</pubDate>
		<dc:creator>Paul Solt</dc:creator>
				<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://paulsolt.com/?p=61</guid>
		<description><![CDATA[I spent all day researching the XNA Content Pipeline in XNA 3.0. The MSDN documentation is a little sparse/dense on how things work together; so I pulled together some resources that I found helpful when trying to understand it. There&#8217;s 4 main components in the Content Pipeline: Importers, Processors, Writers, and Readers. Read the 2nd [...]]]></description>
			<content:encoded><![CDATA[<p>I spent all day researching the XNA Content Pipeline in XNA 3.0. The <a title="MSDN Content Pipeline" href="http://msdn.microsoft.com/en-us/library/bb203887.aspx/">MSDN documentation</a> is a little sparse/dense on how things work together; so I pulled together some resources that I found helpful when trying to understand it.</p>
<p>There&#8217;s 4 main components in the Content Pipeline: Importers, Processors, Writers, and Readers. Read the 2nd point to understand how they work together or go through the tutorial in my 1st point to get your hands dirty. The 3rd point is another tutorial to help you understand creating a new game asset from start to finish.</p>
<p><span id="more-61"></span></p>
<p>1. <a href="http://nick.gravelyn.com/code">Nick Gravelyn</a> wrote a brief tutorial on using XML to describe content <a title="XNA and XML content" href="http://www.ziggyware.com/readarticle.php?article_id=150">here</a>. It uses the default Content Processor and Importer from XNA for XML and then it creates custom Readers and Writers.</p>
<p>I followed along and got stuck on the project Reference part. There are two sets of references, one for the code and the other for the Content sub-folder in an XNA project. I didn&#8217;t realize it until I looked very closely at my project. Since I overlooked the Content references I got the following error while trying to build the CrateSprite XML asset.</p>
<p style="padding-left: 30px;"><code>Building CrateSprite.xml -&gt; C:\Documents and Settings\Paul Solt\My Documents\Visual Studio 2008\Projects\XMLProject\XMLProject\bin\x86\Release\Content\CrateSprite.xnb<br />
Content\CrateSprite.xml(3,10): error : There was an error while deserializing intermediate XML. Cannot find type "XmlContentSampleShared.Sprite".</code></p>
<p>The problem is that the reference to the SpriteContentWriter.cs and the Sprite.cs classes are missing (They are in separate projects). To fix it all you need to do is to include the project containing the Writer, which has a reference to the shared project containing the Sprite class. My Content build process just didn&#8217;t know how to process the CrateSprite.xml file. Here&#8217;s a picture of the projects and the highlighted references (Right click and add Reference -&gt; Projects).</p>
<p style="text-align: center;">
<div id="attachment_67" class="wp-caption aligncenter" style="width: 504px"><a href="http://paulsolt.com/wp-content/uploads/2009/01/xmlproject.png"><img class="size-full wp-image-67" title="xmlproject" src="http://paulsolt.com/wp-content/uploads/2009/01/xmlproject.png" alt="Visual Studio 2008" width="494" height="456" /></a><p class="wp-caption-text">Visual Studio 2008</p></div>
<p>2. <a href="http://blogs.msdn.com/shawnhar/">Shawn <span class="headermaintitle">Hargreaves</span></a> also recently posted about the basics of the Content Pipeline <a href="http://blogs.msdn.com/shawnhar/archive/2008/11/24/content-pipeline-assemblies.aspx">here</a>. He pulls apart the different steps involved so that you can understand the entire content pipeline using colors. (Shawn Hargreaves is the expert on XNA)</p>
<p>He describes why the Content Readers and Writers are separated. Writers help create the .xnb (XNA Binary) format, while readers read in the compiled .xnb format that is packaged with an XNA game. A distributed game doesn&#8217;t need the Content Writers, so you can separate that functionality into a separate project, while keeping the Content Readers associated with the Game project that gets distributed.</p>
<p>3. Another tutorial I looked into is from <a href="http://www.ziggyware.com/readarticle.php?article_id=69">Ziggy</a>. He creates a custom game asset (bounding box) and the associated Content Processor, Importer, Reader, and Writer. This tutorial helps drill in the fact that you&#8217;re creating new content and having XNA interpret it and build it into an asset that your game can load. Very powerful stuff.</p>
<p>I incountered a few differences in the tutorial, since it was written using XNA 1.0, but overall you shouldn&#8217;t have too many issues following it. (There is a converted XNA 2.0 project for the tutorial if you get stuck)</p>
<p><strong>Update:</strong> Here&#8217;s another useful <a href="http://blogs.msdn.com/etayrien/archive/2008/02/15/useful-content-pipeline-links.aspx">blog post</a> from <a href="http://blogs.msdn.com/etayrien/default.aspx">Eli Tayrien</a> with a collection of links for the XNA Content Pipeline.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulsolt.com/2009/01/xna-30-content-pipeline/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->