<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Caffeine Monster Software blog</title>
	
	<link>http://www.caffeinemonstersoftware.com/blog</link>
	<description>Devblog for indie game developer Caffeine Monster Software!</description>
	<lastBuildDate>Mon, 24 Aug 2009 16:05:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/CaffeineMonsterSoftwareBlog" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>32×32 is getting an update</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/1El2XXDZMYM/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/08/32x32-is-getting-an-update/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 16:05:44 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=231</guid>
		<description><![CDATA[When I started developing 32&#215;32, I was worried that I&#8217;d be its only user! Thankfully this hasn&#8217;t been the case. In fact, I&#8217;m really pleased with the feedback I&#8217;m getting on 32&#215;32, from positive reviews to emails saying, &#8220;this is exactly what I was looking for.&#8221; And here I thought I was the only one [...]]]></description>
			<content:encoded><![CDATA[<p>When I started developing 32&#215;32, I was worried that I&#8217;d be its only user! Thankfully this hasn&#8217;t been the case. In fact, I&#8217;m really pleased with the feedback I&#8217;m getting on 32&#215;32, from <a href="http://www.iphoneappreviews.net/2009/07/20/32x32/">positive</a> <a href="http://www.148apps.com/reviews/32-32/">reviews</a> to emails saying, &#8220;this is exactly what I was looking for.&#8221; And here I thought I was the only one who wanted to draw monochrome pixel art on my iPhone. <em>Silly me.</em></p>
<p>I&#8217;ve been working on version 1.1 for around a month now. Updating an app who&#8217;s primary goal is simplicity is challenging to say the least. The update needs to add substantial value to the app without destroying the very simplicity that defines it. I think I&#8217;ve managed to pull this off.</p>
<p>Version 1.1 introduces three new features:</p>
<p><strong>1. Editor tweaks and settings</strong></p>
<p>Something I overlooked for 32&#215;32 was a coordinate readout. Counting pixels just became second nature at some point, and I kinda didn&#8217;t realize how useful it would be. All sorted out now. The text fades quickly fades away when there are no fingers on the screen so it doesn&#8217;t get in the way.</p>
<div style="text-align:center"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_coordinates.png" class="thumb"/></div>
<p></p>
<p>If you want to leave things the way they were there&#8217;s a setting to turn off the coordinate readout. There&#8217;s also a setting for turning off the auto-erase functionality. I use auto-erase very frequently, but I understand that it feels unintuitive to some. This way everyone&#8217;s happy.</p>
<p><strong>2. Image tools</strong></p>
<p>These tools manipulate the entire image. Again, the idea is to keep this simple, so I put some careful thought into adding just two image tools.</p>
<p>It&#8217;s always frustrating when you start drawing something only to realize you didn&#8217;t leave enough space on one side. <strong>Move Canvas</strong> lets you shift the entire image around. It wraps the pixels around the canvas so it&#8217;s non-destructive.</p>
<div style="text-align:center"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_move.png" class="thumb"/></div>
<p></p>
<p><strong>Clear Canvas</strong>, you know, clears the canvas. It&#8217;s not totally necessary, but I find that when starting to draw something I often go through several &#8220;false-starts&#8221; where I erase everything before settling on the right look. It also gave me an excuse to use a superfluous curl animation:</p>
<div style="text-align:center"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_clear.png" class="thumb"/></div>
<p></p>
<p>The Image Tools menu is accessed by shaking the device. I&#8217;m not a fan of &#8220;shake&#8221; in general, but it feels right in this case. Shaking the device accidently doesn&#8217;t cause any harm (it just brings up the menu), and the image tools aren&#8217;t accessed often enough for shaking to be an inconvenience. By using the shake gesture I can extend the functionality of 32&#215;32  without cluttering the editor screen with infrequent (but useful) options.</p>
<p><strong>3. Share on Twitter</strong></p>
<p>This is the one I spent most of my time working on. I&#8217;ve had <a href="http://twitpic.com/bvp7m">one</a> or <a href="http://emberapp.com/rayben/images/32x32-icons">two</a> people forward me their pixel art on Twitter, so I figured, &#8220;why not built the functionality right in?&#8221; 32&#215;32 will upload your images to <a href="http://twitpic.com">TwitPic</a>, append them to your message, and post the tweet onto Twitter. It also adds a #32&#215;32 <a href="http://twitter.pbworks.com/Hashtags">hashtag</a> to the tweet, which will allow you to browse all the images people have uploaded using 32&#215;32. I&#8217;ve been very impressed with the stuff people have produced with 32&#215;32, so I&#8217;m hoping you guys will continue to share your fantastic work on Twitter.</p>
<p>Finally, the ETA: 32&#215;32 v1.1 is code complete. I just need to do some further testing before submitting it to Apple. So, maybe two or three weeks from now?</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/1El2XXDZMYM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/08/32x32-is-getting-an-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/08/32x32-is-getting-an-update/</feedburner:origLink></item>
		<item>
		<title>32×32 is on the App Store!</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/r0xgwqpiiHU/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/07/32x32-is-on-the-app-store/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 03:21:23 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=227</guid>
		<description><![CDATA[Finally! After a little over two weeks in certification, 32&#215;32 is up on the App Store ready for all to create fancy pixel art with.
Check out the official page, or go straight to the App Store.
Happy pixel plotting!  
]]></description>
			<content:encoded><![CDATA[<p>Finally! After a little over two weeks in certification, 32&#215;32 is up on the App Store ready for all to create fancy pixel art with.</p>
<p>Check out the <a href="http://www.caffeinemonstersoftware.com/32x32/">official page</a>, or go straight to the <a target="_blank" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=322436592&#038;mt=8">App Store</a>.</p>
<p>Happy pixel plotting! <img src='http://www.caffeinemonstersoftware.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/r0xgwqpiiHU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/07/32x32-is-on-the-app-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/07/32x32-is-on-the-app-store/</feedburner:origLink></item>
		<item>
		<title>Delicious dogfood</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/uWiRemo1-ZE/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/07/delicious-dogfood/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 04:26:45 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=211</guid>
		<description><![CDATA[The week before I submitted 32&#215;32 for App Store approval (that was a while back) was spent eating my own dogfood.
To eat one&#8217;s own dogfood means to test an app by using it like a customer would. I had been doing this through the development of 32&#215;32, but this last week was going to be [...]]]></description>
			<content:encoded><![CDATA[<p>The week before I submitted 32&#215;32 for App Store approval (that was <a href="http://twitter.com/caffeinemonster/status/2440971461" target="_blank">a while back</a>) was spent eating my own dogfood.</p>
<p>To <a href="http://en.wikipedia.org/wiki/Eating_one%27s_own_dog_food" target="_blank">eat one&#8217;s own dogfood</a> means to test an app by using it like a customer would. I had been doing this through the development of 32&#215;32, but this last week was going to be a more concentrated approach.</p>
<p>I&#8217;m pretty pleased with the results:</p>
<div style="text-align:center"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_dogfood.png" class="thumb"/></div>
<p></p>
<p>While I realize I&#8217;m not the greatest artist, I think my work shows that you can put complex pieces of art together rather quickly with 32&#215;32. I spent around 15 minutes on each piece, mostly done on my commute to university and back. Oh, and maybe a couple were done when I should have been paying attention during lectures too. <img src='http://www.caffeinemonstersoftware.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Really looking forward to seeing what proper artists are going to make with 32&#215;32.</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/uWiRemo1-ZE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/07/delicious-dogfood/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/07/delicious-dogfood/</feedburner:origLink></item>
		<item>
		<title>RTFM!</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/9V7s_U1eZzk/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/06/rtfm/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 15:29:43 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=200</guid>
		<description><![CDATA[I spent a couple of days agonizing over the help screens for 32&#215;32. No, really:


It looks like a lot, but each page has just a couple of lines of text at most. Users are more willing to digest several short snippets of information over fewer pages filled with &#8220;walls of text&#8221;. But trying to communicate [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a couple of days <em>agonizing</em> over the help screens for 32&#215;32. No, really:</p>
<div style="text-align:center"><a class="thumb_link" href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/DSC02033.jpg"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/DSC02033_thumb.jpg" class="thumb"/></a></div>
<p></p>
<p>It looks like a lot, but each page has just a couple of lines of text at most. Users are more willing to digest several short snippets of information over fewer pages filled with &#8220;walls of text&#8221;. But trying to communicate even simple interactions with such little text is tricky. Originally (as you might be able to make out) each page was suppose to have an animated, screencast-esque image to go along with it, but that ended up being too much work for me to handle. Images and animations definitely help though. To keep the work manageable, I used fewer images and instead of animations I used static images which convey motion (a skill in itself).</p>
<p>Once I decided what to say, and how to say it, the next question was: do I really need to say it? Help screens should not discuss each and every feature of an app. It ends up being a very tedious user experience. A good rule of thumb is to teach users the basics, and to give them enough knowledge to discover the advanced features.</p>
<p>The final help screens for 32&#215;32 was trimmed from the 7 pages I have up on the wall. I ended up using 4 help pages (covering 6 topics) with 3 images in all.</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/9V7s_U1eZzk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/06/rtfm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/06/rtfm/</feedburner:origLink></item>
		<item>
		<title>From humble origins</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/R_Hk3fzZK3w/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/06/from-humble-origins/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 19:41:05 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=192</guid>
		<description><![CDATA[32&#215;32 wasn&#8217;t suppose to be &#8220;the next project&#8221;. It began as a tool for me to use while commuting. I often whip out the sketchpad and doodle stuff while commuting, but I felt the need to draw some good ol&#8217; fashioned pixel art.
It was never going to work though. I decided that the minimum size [...]]]></description>
			<content:encoded><![CDATA[<p>32&#215;32 wasn&#8217;t suppose to be &#8220;the next project&#8221;. It began as a tool for me to use while commuting. I often whip out the sketchpad and doodle stuff while commuting, but I felt the need to draw some good ol&#8217; fashioned pixel art.</p>
<p>It was never going to work though. I decided that the minimum size of the canvas would have to be 32&#215;32 pixels which, in order to fit on the iPhone screen, would mean a 10&#215;10 px on-screen representation for each pixel. There&#8217;s no way you could accurately tap on a 10&#215;10 px space on the iPhone screen. I gave the idea of a zooming/scrolling canvas a brief thought, but dismissed it due to being too fiddly. (A later prototype found this assumption to be true) But then the crosshair occurred to me. I&#8217;ll talk about exactly how the crosshair works in a later post. But the idea is what made me think, &#8220;maybe, just maybe, this&#8217;ll actually work.&#8221;</p>
<p>So one night, lying on the couch watching a re-run of <em>America&#8217;s Next Top Model</em> with my sister, I started working on the prototype. After an hour of hacking away at it I had something usable. And it worked. The rest, as they say, is history.</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/R_Hk3fzZK3w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/06/from-humble-origins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/06/from-humble-origins/</feedburner:origLink></item>
		<item>
		<title>Announcing 32×32</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/TCme09IWpeA/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/06/announcing-32x32/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 03:21:16 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=168</guid>
		<description><![CDATA[Alternately titled: &#8220;And now for something completely different.&#8221;
32&#215;32 is my next project, and it isn&#8217;t a game at all. It&#8217;s a pixel art editor for the iPhone/iPod touch.
The mantra behind 32&#215;32 (read as: &#8220;32 by 32&#8243;) is simplicity and usability. Basically, I took the idea of drawing pixel art and stripped it down to its [...]]]></description>
			<content:encoded><![CDATA[<p>Alternately titled: &#8220;And now for something completely different.&#8221;</p>
<p>32&#215;32 is my next project, and it isn&#8217;t a game at all. It&#8217;s a pixel art editor for the iPhone/iPod touch.</p>
<p>The mantra behind 32&#215;32 (read as: &#8220;32 by 32&#8243;) is simplicity and usability. Basically, I took the idea of drawing pixel art and stripped it down to its core actions. After that I stripped it down even further. The resulting app is joyfully simple to use, but still pretty powerful.</p>
<div style="text-align:center">
<a class="thumb_link" href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_01.png"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_01_thumb.png" class="thumb"/></a>  <a class="thumb_link" href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_02.png"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/32x32_02_thumb.png" class="thumb"/></a><br />
<span class="date">(click to enlarge)</span>
</div>
<p></p>
<p>The canvas has a fixed size of 32 pixels across by 32 pixels down, thus the name. The drawing tools are simply pen, erase, fill and undo/redo. Full RGB support got the axe pretty early on. It would be clunky and pointless, and not about drawing at all. Instead, 32&#215;32 provides 5 shades of grey, a neutral set of colours.</p>
<p>Clearly, 32&#215;32 isn&#8217;t interested in being the ultimate pixel art editor. It would end up being bulky, complicated and slow to use. Instead, it is a quick and painless way to get all that pixel art goodness onto a digital canvas, wherever you are. The idea is that you&#8217;ll create pixel art on your iPhone, but more advanced work (such as animation) can be done on your computer.</p>
<p>Check out the <a href="http://www.caffeinemonstersoftware.com/32x32/">32&#215;32 page</a> for more details. I&#8217;ll be posting more about 32&#215;32 on here, so stay tuned. The tentative release is July 2009 for only $0.99.</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/TCme09IWpeA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/06/announcing-32x32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/06/announcing-32x32/</feedburner:origLink></item>
		<item>
		<title>Over-optimized</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/7yB-yk7VoY8/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/05/over-optimized/#comments</comments>
		<pubDate>Mon, 18 May 2009 02:27:19 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=146</guid>
		<description><![CDATA[A blog post I wrote a while ago on developing Geomex 1.1 which I kinda forgot about.
When I first implemented the drop shadows I talked about earlier, it wasn&#8217;t very promising. It looked good, but it caused a very noticeable drop in performance. Like, I lost 10 frames per second. Geomex didn&#8217;t feel as snappy [...]]]></description>
			<content:encoded><![CDATA[<p><em>A blog post I wrote a while ago on developing Geomex 1.1 which I kinda forgot about.</em></p>
<p>When I first implemented the drop shadows I talked about <a href="http://www.caffeinemonstersoftware.com/blog/2009/03/geomex-sexier/">earlier</a>, it wasn&#8217;t very promising. It looked good, but it caused a very noticeable drop in performance. Like, I lost 10 frames per second. Geomex didn&#8217;t feel as snappy as it used to. For a while I just decided to (err) drop the drop shadows, but then I decided, &#8220;what the heck, let&#8217;s get optimizing!&#8221;</p>
<p>I did a lot of good stuff. In this article I want to talk about how I optimized one function in particular: drawSubtile. A sub-tile is a quarter of each tile that the shapes are made out of. In this section of the function, we&#8217;re figuring out the coordinates for a sub-tile. The simple answer is that they start at (x, y) and end at (x+TILE_SIZE/2, y+TILE_SIZE/2). The twist is that we&#8217;ve got two variables, xflip and yflip, which swap these coordinates around on their respective axes. So, for example, if xflip=YES, then the coordinates are (x+TILE_SIZE/2, y) and (x, y+TILE_SIZE/2).</p>
<p><span id="more-146"></span></p>
<p>Here&#8217;s what we started off with:</p>
<pre><code>    short int x0, y0, x1, y1;

    if (!xflip)
    {
        x0 = x;
        x1 = x + TILE_SIZE/2;
    }
    else
    {
        x0 = x + TILE_SIZE/2;
        x1 = x;
    }

    if (!yflip)
    {
        y0 = y;
        y1 = y + TILE_SIZE/2;
    }
    else
    {
        y0 = y + TILE_SIZE/2;
        y1 = y;
    }

    short int verts[] = { x0, y0,  x1, y0,  x1, y1,  x0, y1 };
</code></pre>
<p>It&#8217;s pretty much what you&#8217;d expect the code to look like. If the axis isn&#8217;t flipped, store the smaller value in index 0 and the larger value in index 1, otherwise store them the other way around. It&#8217;s simple to read, but actually quite slow. If-statements tend to do that. Of course, you never <em>really</em> put effort into eliminating if-statements because it&#8217;s just not worth losing the readability for an insignificantly minor speed boost. However, this is a special case. When a function is called more than 10,000 times a second and it&#8217;s running on a handheld device, every little speed boost counts!</p>
<p>So I set off to eliminate the if-statements still in disbelief that I was actually bothering to do this. Result:</p>
<pre><code>    short int xx[] = { x, x+TILE_SIZE/2 };
    short int yy[] = { y, y+TILE_SIZE/2 };

    short int x0 = xx[ xflip];
    short int x1 = xx[!xflip];

    short int y0 = yy[ yflip];
    short int y1 = yy[!yflip];

    short int verts[] = { x0, y0,  x1, y0,  x1, y1,  x0, y1 };
</code></pre>
<p>I looked at my implementation and laughed. It&#8217;s completely correct, but it&#8217;s just so silly! The way this works is by exploiting the fact that a boolean (true/false) value can be used as an array index (where true=1, false=0). So if xflip is set, x0 = xx[1], which is the flipped value. Similarly for x1, we use the index !xflip (read as: not xflip, or the opposite of xflip) which, in this example, gets us xx[0].</p>
<p>It&#8217;s simple, it&#8217;s silly, but it worked really well. I actually felt a noticeable speed boost! My frame-rate counter proved this as well. I was pretty pleased.</p>
<p>I should have left it at that. But no, I just had to have another go at it. I knew I could do it just a little bit better. I knew further optimization wouldn&#8217;t give me a significant performance boost (see: <a href="http://en.wikipedia.org/wiki/Diminishing_returns">Law of diminishing returns</a>), but I had to do better. I had to over-optimize the solution. And so, an over-optimized solution was produced:</p>
<pre><code>    short int xx[] = {x, x};
    short int yy[] = {y, y};

    xx[!xflip] += TILE_SIZE/2;
    yy[!yflip] += TILE_SIZE/2;

    short int verts[] = { xx[0], yy[0],  xx[1], yy[0],
                          xx[1], yy[1],  xx[0], yy[1] };
</code></pre>
<p>The previous solution eliminated if-statements. This one minimizes the number of assignments. I&#8217;ll leave it as an exercise to the reader to figure out how this one works. If you &#8220;got&#8221; the last solution, this one shouldn&#8217;t be difficult to figure out.</p>
<p>I stared at my code, stroked my chin, sipped my tea. I&#8217;d optimized, I&#8217;d over-optimized, and I finally concluded this couldn&#8217;t be optimized any more.</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/7yB-yk7VoY8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/05/over-optimized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/05/over-optimized/</feedburner:origLink></item>
		<item>
		<title>w00t, one year!</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/azyXHKmAN70/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/04/w00t-one-year/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 02:18:40 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=141</guid>
		<description><![CDATA[Man, time goes by fast! Exactly one year ago I got my Dad to push the return key on my laptop triggering the launch of Caffeine Monster Software. Over the year I&#8217;ve released three games on four different platforms. In other words, I&#8217;ve been incredibly productive!   There have been many highs and some [...]]]></description>
			<content:encoded><![CDATA[<p>Man, time goes by fast! Exactly <a href="http://www.caffeinemonstersoftware.com/blog/2008/04/now-open-for-business/">one year ago</a> I got my Dad to push the return key on my laptop triggering the launch of Caffeine Monster Software. Over the year I&#8217;ve released three games on four different platforms. In other words, I&#8217;ve been incredibly productive! <img src='http://www.caffeinemonstersoftware.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  There have been <a href="http://www.caffeinemonstersoftware.com/blog/2008/09/geomex-released/">many</a> <a href="http://www.caffeinemonstersoftware.com/blog/2008/11/duotrix-released/">highs</a> and some <a href="http://www.caffeinemonstersoftware.com/blog/2009/03/duotrix-sales-numbers/">disappointments</a>, but mostly it&#8217;s been a totally fun, crazy ride! <img src='http://www.caffeinemonstersoftware.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s to another year of exciting releases!</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/azyXHKmAN70" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/04/w00t-one-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/04/w00t-one-year/</feedburner:origLink></item>
		<item>
		<title>Bloopers</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/guW_l1dnmho/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/04/bloopers/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 03:44:10 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=122</guid>
		<description><![CDATA[I spent a lot of time attempting to optimize the graphics code for Geomex. I say &#8220;attempting&#8221; because I got horribly, horribly wrong many times before I finally got it right. Here is a gallery of all my glorious graphics glitches.
(click to make them bigger)





]]></description>
			<content:encoded><![CDATA[<p>I spent a lot of time attempting to optimize the graphics code for Geomex. I say &#8220;attempting&#8221; because I got horribly, horribly wrong many times before I finally got it right. Here is a gallery of all my glorious graphics glitches.</p>
<p>(click to make them bigger)</p>
<div style="text-align:center">
<a href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper0.png" class="thumb_link"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper0_thumb.png" class="thumb"/></a><a href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper1.png" class="thumb_link"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper1_thumb.png" class="thumb"/></a><a href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper2.png" class="thumb_link"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper2_thumb.png" class="thumb"/></a><br />
<a href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper3.png" class="thumb_link"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper3_thumb.png" class="thumb"/></a><a href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper4.png" class="thumb_link"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper4_thumb.png" class="thumb"/></a><a href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper5.png" class="thumb_link"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper5_thumb.png" class="thumb"/></a><br />
<a href="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper6.png" class="thumb_link"><img src="http://www.caffeinemonstersoftware.com/wordpress/wp-content/uploads/blooper6_thumb.png" class="thumb"/></a>
</div>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/guW_l1dnmho" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/04/bloopers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/04/bloopers/</feedburner:origLink></item>
		<item>
		<title>Geomex 1.1 is live, now just $1.99!</title>
		<link>http://feedproxy.google.com/~r/CaffeineMonsterSoftwareBlog/~3/nD6DpnpSnbs/</link>
		<comments>http://www.caffeinemonstersoftware.com/blog/2009/04/geomex-11-is-live-now-just-199/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 01:48:35 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.caffeinemonstersoftware.com/blog/?p=118</guid>
		<description><![CDATA[It&#8217;s been a bit of a wait but Geomex 1.1 is live and on the AppStore. It introduces online hiscores, achievements and improved graphics. Updates should be zapping their way to your phones as we speak.
I&#8217;ve also cut the price on Geomex once again to the super-cheap price of $1.99. Tell your friends, etc.
The Hiscores [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a bit of a wait but Geomex 1.1 is live and on the AppStore. It introduces online hiscores, achievements and improved graphics. Updates should be zapping their way to your phones as we speak.</p>
<p>I&#8217;ve also cut the price on Geomex once again to the super-cheap price of $1.99. Tell your friends, etc.</p>
<p>The <a href="http://www.caffeinemonstersoftware.com/hiscores/geomex/">Hiscores</a> page for Geomex is also up. Of course, you can also check the scores from within Geomex. Some incredible scores have started trickling in! Hope to see more of this soon.</p>
<p>As usual, please <a href="http://www.caffeinemonstersoftware.com/about.php">let me know</a> if you&#8217;ve got issues with the update or have suggestions.</p>
<img src="http://feeds.feedburner.com/~r/CaffeineMonsterSoftwareBlog/~4/nD6DpnpSnbs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.caffeinemonstersoftware.com/blog/2009/04/geomex-11-is-live-now-just-199/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.caffeinemonstersoftware.com/blog/2009/04/geomex-11-is-live-now-just-199/</feedburner:origLink></item>
	</channel>
</rss>
