<?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>CODETOPIA</title>
	<atom:link href="http://www.codetopia.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codetopia.com/blog</link>
	<description>Software Development Services. Established 2006.</description>
	<lastBuildDate>Sun, 12 Feb 2012 23:58:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Isometric C&amp;C? Youbetcha.</title>
		<link>http://www.codetopia.com/blog/2012/02/12/isometric-cc-youbetcha/</link>
		<comments>http://www.codetopia.com/blog/2012/02/12/isometric-cc-youbetcha/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 23:58:35 +0000</pubDate>
		<dc:creator>groundh0g</dc:creator>
				<category><![CDATA[C&C for Android]]></category>

		<guid isPermaLink="false">http://www.codetopia.com/blog/?p=175</guid>
		<description><![CDATA[In typical Joe fashion, I couldn&#8217;t just do a straight port of Andrew&#8217;s Creatures and Castles game to Android. I thought it might be fun to render his existing level data in an isometric engine. Same game, same rules, new look. Early tests have been promising. Of course the new style means that I can&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>In typical Joe fashion, I couldn&#8217;t just do a straight port of Andrew&#8217;s Creatures and Castles game to Android. I thought it might be fun to render his existing level data in an isometric engine. Same game, same rules, new look. Early tests have been promising.</p>
<div id="attachment_176" class="wp-caption alignnone" style="width: 310px"><a href="http://www.codetopia.com/blog/wp-content/uploads/2012/02/isoScrenshot.png"><img class="size-medium wp-image-176" title="Isometric C&amp;C Test" src="http://www.codetopia.com/blog/wp-content/uploads/2012/02/isoScrenshot-300x278.png" alt="" width="300" height="278" /></a><p class="wp-caption-text">C&amp;C in 2.5d?</p></div>
<p>Of course the new style means that I can&#8217;t reuse any of the existing level / sprite images. The assets you see in the screenshot are all placeholders that I threw together in Illustrator this weekend. My app supports sprite tinting, as well as some other simple effect (like flip and rotate).</p>
<p>Replacing the art will take precious time away from coding, but it&#8217;s not as bad as it sounds. I&#8217;ll be able to put my XNA-inspired Android game lib through some heavier testing, and I&#8217;ll be able to add cutesy extras like avatar customization.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codetopia.com/blog/2012/02/12/isometric-cc-youbetcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C&amp;C Vector-Based Menus</title>
		<link>http://www.codetopia.com/blog/2011/12/19/cc-vector-based-menus/</link>
		<comments>http://www.codetopia.com/blog/2011/12/19/cc-vector-based-menus/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 04:00:38 +0000</pubDate>
		<dc:creator>groundh0g</dc:creator>
				<category><![CDATA[C&C for Android]]></category>

		<guid isPermaLink="false">http://www.codetopia.com/blog/?p=166</guid>
		<description><![CDATA[Andrew says that I should blog about the conversion as it progresses. In truth, I&#8217;m not in conversion mode just yet. I&#8217;m focusing on the differences between the current and new platforms. Ultimately, Andrew and I will work together to merge any new features that I put in the Droid version into the iOS version. [...]]]></description>
			<content:encoded><![CDATA[<p>Andrew says that I should blog about the conversion as it progresses. In truth, I&#8217;m not in conversion mode just yet. I&#8217;m focusing on the differences between the current and new platforms. Ultimately, Andrew and I will work together to merge any new features that I put in the Droid version into the iOS version.</p>
<p>One example is in-app purchases. When Andrew originally wrote Creatures and Castles, there was only one set of levels. Shortly after his port to Chrome, he added a new level pack, which the player can purchase from within the game. The iOS version has no screen to select the level pack, since there&#8217;s only one. The Chrome version has a single screen with only two options (the currently-available level packs: Medieval and Egyptian).</p>
<p>The Android version of C&#038;C has the benefit of hindsight. I know that new level packs will be made available via in-app purchases. While there will only be two level packs when C&#038;C hits the Android Market, I&#8217;m redesigning the menu system to support many more options.</p>
<p>Similarly, there are only two characters that the player can select when they start the game. Both the iOS and Chrome versions present the player with a single screen with those two options. My plan for the Android version is to have the original artist create a few more variations on the characters. As with the level packs, the character select screen will support many more options.</p>
<p>So, I&#8217;ve been spending a good chunk of my time programming a new, generic model for player options, but there&#8217;s another hurdle to leap in the Android port &#8212; the unpredictable variety in devices. I&#8217;ve started down the path of creating vector-based assets for the menu system and fonts.</p>
<p>Menu assets will ultimately be pixel based (after all, OpenGL textures are pixel-based), but those assets will be generated for the host device from vector sources at runtime. That means that tablets and phones, big and small, should have images that appear to be tailor-made for whatever device you happen to be playing the game on.</p>
<p>I took a break from the programming this evening to create some vector-based assets in Adobe Illustrator. Here&#8217;s a PNG of the SVG that I made. Andrew is a little miffed that I drew stars (&#8220;they&#8217;re supposed to be shields, %#$@!&#8221;), but I&#8217;m generally satisfied with the result &#8212; especially considering that this is really just a test to validate my vector-based plans.</p>
<div id="attachment_167" class="wp-caption alignnone" style="width: 310px"><a href="http://www.codetopia.com/blog/wp-content/uploads/2011/12/CnC-Test-Sheet.png"><img src="http://www.codetopia.com/blog/wp-content/uploads/2011/12/CnC-Test-Sheet-300x300.png" alt="C&amp;C Vector Sprites" title="CnC-Test-Sheet" width="300" height="300" class="size-medium wp-image-167" /></a><p class="wp-caption-text">Test of Vector-Based Sprites for C&#038;C</p></div>
<p>Remember, these images are based on vectors. While this looks like a traditional sprite sheet, and it will ultimately be used as a sprite sheet, the pixels aren&#8217;t set in stone until the game starts up. Every device gets its own version.</p>
<p>I hope it works as well in code as it does in my head. <img src='http://www.codetopia.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.codetopia.com/blog/2011/12/19/cc-vector-based-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Cat&#8217;s Out of the Bag &#8230;</title>
		<link>http://www.codetopia.com/blog/2011/12/18/the-cats-out-of-the-bag/</link>
		<comments>http://www.codetopia.com/blog/2011/12/18/the-cats-out-of-the-bag/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 03:00:19 +0000</pubDate>
		<dc:creator>groundh0g</dc:creator>
				<category><![CDATA[C&C for Android]]></category>

		<guid isPermaLink="false">http://www.codetopia.com/blog/?p=161</guid>
		<description><![CDATA[Well, Andrew tweeted about our new project, so I guess it&#8217;s not a secret any longer. I&#8217;m porting his &#8220;Creatures and Castles&#8221; game to Android. He&#8217;s already released the game for iOS in the Apple App Store and for Google&#8217;s Chrome web browser in the Chrome Store. I hope to have the game in the [...]]]></description>
			<content:encoded><![CDATA[<p>Well, Andrew tweeted about our new project, so I guess it&#8217;s not a secret any longer. I&#8217;m porting his &#8220;Creatures and Castles&#8221; game to Android. He&#8217;s already released the game for iOS in the Apple App Store and for Google&#8217;s Chrome web browser in the Chrome Store. I hope to have the game in the Android Marketplace early next year.</p>
<p>So far, everything has gone according to plan. When developing for iOS and Chrome, Andrew was able to easily manage platform variances. For example, all iPhone / iPod Touch devices fall into one of two general categories &#8211; Retina, and non-Retina. When it comes to Android, it&#8217;s not quite that simple. A lot of wiggle room is afforded the hardware manufacturers.</p>
<p>I think of iOS development as a close cousin of developing for game consoles, where hardware consistency is your best friend. Android, on the other hand, is akin to developing for PCs. You&#8217;ll never be able to test every hardware variant, so you try to write code that adapts.</p>
<p>As time (and master Rollings) permits, I&#8217;ll try to blog about the technical details of the project as it progresses, and (more interesting to me) how my assumptions about the Android platform are validated or contradicted.</p>
<p>This week was spent with the family in GA, but I was able to get a lot of the menu code written, and do limited testing on a few hardware devices. Tonight, I added support for SVG images using a 3rd-party lib. Using vector art for the menus and options should make life a lot easier. We&#8217;ll see.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codetopia.com/blog/2011/12/18/the-cats-out-of-the-bag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA 4.x Source Available for Download</title>
		<link>http://www.codetopia.com/blog/2011/07/06/xna-4-x-source-available-for-download/</link>
		<comments>http://www.codetopia.com/blog/2011/07/06/xna-4-x-source-available-for-download/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 22:49:46 +0000</pubDate>
		<dc:creator>groundh0g</dc:creator>
				<category><![CDATA[XNA Book]]></category>

		<guid isPermaLink="false">http://www.codetopia.com/blog/?p=152</guid>
		<description><![CDATA[These ZIP archives contain source code from the book, XNA Game Studio Express: Developing Games for Windows and the Xbox 360, by Joseph Hall. The following paragraphs describe the changes that have been made from the XNA 3.x version of the same code. The Files The update projects are compressed into ZIP files. They&#8217;re separated [...]]]></description>
			<content:encoded><![CDATA[<p>These ZIP archives contain source code from the book, <a href="http://www.amazon.com/dp/1598633686?tag=coll06-20&amp;camp=14573&amp;creative=327641&amp;linkCode=as1&amp;creativeASIN=1598633686&amp;adid=0YJYR31RJKW978MSCNNY&amp;" target="_blank">XNA Game Studio Express: Developing Games for Windows and the Xbox 360</a>, by Joseph Hall. The following paragraphs describe the changes that have been made from the XNA 3.x version of the same code.</p>
<h2>The Files</h2>
<p>The update projects are compressed into ZIP files. They&#8217;re separated based on the section of the book in which the example was developed, with one exception &#8212; chapter 10&#8242;s project is a monster beacuse of the WAV source files. That project has its own ZIP file.</p>
<ul>
<li><a href="http://c645923.r23.cf2.rackcdn.com/Part 1 - Introduction [without Ch 10 Audio].zip">Part 1 &#8211; Introduction [without CH10 - Audio].zip</a> [2.04 MB]</li>
<li><a href="http://c645923.r23.cf2.rackcdn.com/Part 1 - Introduction [with Ch10 Audio].zip">Part 1 &#8211; Introduction [CH10 - Audio].zip</a> [46.80 MB]</li>
<li><a href="http://c645923.r23.cf2.rackcdn.com/Part 2 - Genre Studies.zip">Part 2 &#8211; Genre Studies.zip</a> [1.77 MB]</li>
<li><a href="http://c645923.r23.cf2.rackcdn.com/Part 3 - Components.zip">Part 3 &#8211; Components.zip</a> [0.39 MB]</li>
<li>Part 4 &#8211; Tasty Bits.zip [coming soon]</li>
</ul>
<h2><span class="Apple-style-span" style="color: #444444; font-size: 22px; line-height: 33px; font-family: verdana, arial;">Intuitive File Names</span></h2>
<p>I used longer, more descriptive filenames for the solution files, project files, and directory names. The new names make it much easier to locate the source code for a specific chapter. This may cause issues if you do your development in a deeply-nested subdirectory, like the default Visual Studio project folder of &#8220;C:\Documents and Settings\{username}\My Documents\Visual Studio 2005\Projects\&#8221;.</p>
<p>I suggest creating a folder off the root of the drive from which you wish to develop your XNA games. I use &#8220;C:\projects\&#8221; on my laptop, and &#8220;E:\projects\&#8221; on my desktop.</p>
<h2>Reach versus HiDef</h2>
<p>There are two &#8220;Game Profile&#8221; options for your projects &#8212; Reach and HiDef. If you get an error along the lines of &#8220;No suitable graphics card was found&#8221;, you probably need to change your projects Game Profile to Reach. You&#8217;ll find this setting in the project properties, under the XNA Game Studio tab.</p>
<p>When converting the book&#8217;s examples to XNA 4.0, I&#8217;ve been setting the projects to the Reach profile. I&#8217;m working on a virtual machine, and it doesn&#8217;t support HiDef. Read about the differences for yourself, and see which is right for your game. In my case, I&#8217;d prefer that my examples work on as many hardware types as possible (Reach).</p>
<h2>SpriteBatch.Begin</h2>
<p>There were some changes to the parameters of the SpriteBatch.Begin method. Nothing Earth-shattering, but the changes did break many of the examples. I edited the calls to correct the errors where needed.</p>
<h2>Chapter 5</h2>
<p>The ResolveBackBuffer API has been deprecated. I rewrote the CaptureGameScreen method to use RenderTarget2D instead. This required changes to the Draw method as well. The general flow is (within Draw):</p>
<ul>
<li>Create RenderTarget2D object.</li>
<li>Set GraphicsDevice to new render target.</li>
<li>Draw stuff. (results are drawn to a texture)</li>
<li>Set GraphicsDevice render target to null.</li>
<li>Draw stuff again. (results are drawn to the screen)</li>
</ul>
<h2>Chapter 6</h2>
<p>(Ugh.) The FillMode.Point enum has been removed, along with the FILLMODE = Point statement in HLSL. Point rendering is no longer supported as of XNA 4.0, <a href="http://forums.create.msdn.com/forums/p/55022/420927.aspx" target="_blank">per Shawn Hargreaves</a>.</p>
<p>The simple fix (and the one that I chose) is to remove the point.fx shader from the example. If you REALLY want to render points, Shawn recommends converting each point to a tiny (single-pixel) triangle.</p>
<p>The &#8220;GraphicsDevice.RenderState.FillMode = FillMode.Solid&#8221; statement that was used in the example has been deprecated. You now need to use a RasterizerState object, which has a FillMode property.</p>
<h2>Chapter 10</h2>
<p>The previous version of XACT is no longer supported by XNA 4&#8242;s content pipeline. To fix this, I just loaded the XACT project (example.xap) into the new version of XACT and saved it (without making any changes). This automatically converted the project file to the new version.</p>
<h2>Chapter 11</h2>
<p>There were some significant changes to the storage APIs. I added a static helper to emulate the old APIs, based on the code found at <a href="http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/" target="_blank">this website</a>. The two biggest changes are: all storage APIs are now asynchronous, and the container.Path property is no longer supported.</p>
<h2>Chapter 14</h2>
<p>The way that you load files from the game&#8217;s directory has changed. References to StorageContainer.TitleLocation have been replaced with TitleContainer.OpenStream.</p>
<p>Significant changes have been made to the GameFont class. See the notes for Chapter 21. In short, I recommend that you replace any references to the GameFont class with XNA&#8217;s built-in SpriteFont. The GameFont class is obsolete.</p>
<h2>Chapter 19</h2>
<p>As with Chapter 14, references to StorageContainer.TitleLocation were changed to TitleContainer.OpenStream.</p>
<h2>Chapter 21</h2>
<p>The byte ordering on internal storage for the Color struct has changed in XNA 4. BGRA is now RGBA. I tweaked the logic in GameFont, but the result is less than ideal. I do not plan to spend any more time on this code since XNA has provided support for in-game fonts since version 2. Changes include:</p>
<ul>
<li>Set the Properties / Content Processor / Premultiply Alpha of the image in the content project to false. This preserves the row markers, column markers, and encoded character data in the source image &#8212; but it makes the letters more &#8220;jaggy&#8221;.</li>
<li>Set the Properties / Texture Format of the image in the content project to NoChange.</li>
<li>In the GameFont class, replace Texture2D.GetData&lt;uint&gt; calls with Texture2D.GetData&lt;Color&gt;, and correct logic that depends on specific byte ordering with new Color-based checks. For example, &#8220;data[0] &amp; ROW_COLUMN_MASK == ROW_COLUMN_MASK&#8221; becomes &#8220;data[0].A == 0xFF&#8221;.</li>
</ul>
<p>While the changes that I made allow the GameFont library to work as before, I recommend that you no longer use it. Replace references to the GameFont library with XNA&#8217;s built-in SpriteFont. Consider this library an interesting look into how sprite fonts could be implemented, rather than as an example of how to draw text within your games.</p>
<h2>Where&#8217;s Part 4?</h2>
<p>I&#8217;ll try to get the source for Part 4 converted soon, but I can&#8217;t commit to a specific deadline. As with previous source updates for the book, I don&#8217;t expect the Content Pipeline example (from chapter 26) to be included in the conversion. There are plenty of other resources out there that provide guidance on this topic (see Google).</p>
<h2>Thanks!</h2>
<p>Thanks for your patience, guys! Enjoy the code, and let me know if you find any issues or need any help.</p>
<p>Oh, and if you&#8217;re reading this blog post and you&#8217;re asking yourself, &#8220;Book? What book?&#8221; &#8212; <a href="http://www.codetopia.com/blog/xna-game-studio-express/">click here</a> to see what the fuss is all about. You can read <a href="http://c645923.r23.cf2.rackcdn.com/Game_Dev_1598633686_ch07.pdf" target="_blank">Chapter 07</a> here, and <a href="http://c645923.r23.cf2.rackcdn.com/Game_Dev_1598633686_ch18.pdf" target="_blank">Chapter 18</a> here. If you like what you see, please feel free to <a href="http://www.amazon.com/dp/1598633686?tag=coll06-20&amp;camp=14573&amp;creative=327641&amp;linkCode=as1&amp;creativeASIN=1598633686&amp;adid=0YJYR31RJKW978MSCNNY&amp;" target="_blank">buy a copy of the book here</a>.</p>
<p>&#8211; joe</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codetopia.com/blog/2011/07/06/xna-4-x-source-available-for-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s Coming&#8230;</title>
		<link>http://www.codetopia.com/blog/2011/05/24/its-coming/</link>
		<comments>http://www.codetopia.com/blog/2011/05/24/its-coming/#comments</comments>
		<pubDate>Wed, 25 May 2011 04:41:14 +0000</pubDate>
		<dc:creator>groundh0g</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.codetopia.com/blog/2011/05/24/its-coming/</guid>
		<description><![CDATA[I&#8217;m in the process of moving my site from easycgi to rackspace. Please excuse the clutter for a few more weeks. &#8212; Joe]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of moving my site from easycgi to rackspace. Please excuse the clutter for a few more weeks. &#8212; Joe</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codetopia.com/blog/2011/05/24/its-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

