<?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>Games from Within</title>
	<atom:link href="http://gamesfromwithin.com/feed" rel="self" type="application/rss+xml" />
	<link>http://gamesfromwithin.com</link>
	<description>Living the indie life</description>
	<lastBuildDate>Mon, 14 May 2012 16:06:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What The Rovio Deal With Casey&#8217;s Contraptions Means To Me</title>
		<link>http://gamesfromwithin.com/what-the-rovio-deal-with-caseys-contraptions-means-to-me</link>
		<comments>http://gamesfromwithin.com/what-the-rovio-deal-with-caseys-contraptions-means-to-me#comments</comments>
		<pubDate>Fri, 11 May 2012 17:21:37 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[casey's contraptions]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1628</guid>
		<description><![CDATA[I imagine everybody reading this already knows that we sold the Casey&#8217;s Contraptions game and IP to Rovio. They&#8217;ll be relaunching the game as Amazing Alex for iOS and other platforms soon, and putting all the Rovio marketing might behind &#8230; <a href="http://gamesfromwithin.com/what-the-rovio-deal-with-caseys-contraptions-means-to-me">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-673" src="http://gamesfromwithin.com/wp-content/uploads/2012/05/CaseysContraptionsIcon.png" alt="CaseysContraptionsIcon" border="0" width="128" height="128" />I imagine everybody reading this already knows that <a href="http://www.gamasutra.com/view/news/170084/Rovio_confirms_acquisition_of_Caseys_Contraptions_IP.php">we sold the Casey&#8217;s Contraptions game and IP to Rovio</a>. They&#8217;ll be relaunching the game as <a href="http://amazingalex.com/">Amazing Alex</a> for iOS and other platforms soon, and putting all the Rovio marketing might behind it. Exciting times ahead for Casey!</p>
<p>I&#8217;ve been receiving a lot of questions about how it happened, how&#8217;s affecting me, and what my plans for the future are. So here&#8217;s my attempt to answer some of those questions.<span id="more-1628"></span><br />
<h3>The Game</h3>
<p>It might come as a surprise to a lot of people, but selling Casey&#8217;s Contraptions was never in our minds. <a href="https://twitter.com/#!/mysterycoconut">Miguel</a> and I put all our energy into making a great game and infusing it with lots of personality. Half way through development we realized we had something special in hand, and when Apple selected it as the iPad game of the week and the reviews and comments came pouring in, we knew the game had connected with a lot of people. We were thrilled.</p>
<p>We were in for a big surprise when sometime after the iPad release, Rovio approached us and offered to buy Casey&#8217;s Contraptions. We were understandably very attached to the game we had just released, but Rovio eventually made us an offer we couldn&#8217;t refuse. </p>
<p>Rovio is one of the biggest players in the mobile market, and sometimes people get tired of seeing the top 10 charts full of Angry Birds. I&#8217;ve always had a lot of respect for them: Angry Birds wasn&#8217;t just a fluke, it&#8217;s a super approachable game, perfectly suited for mobile phones, and crafted to perfection. They deserve all the success they got. I don&#8217;t think I would have agreed to sell Casey&#8217;s Contraptions to most of the other big game companies.</p>
<p>As the co-creator of Casey&#8217;s Contraptions, I&#8217;m super excited to see it reach a much wider audience we could have ever dreamed of reaching ourselves. Every developer&#8217;s dream is to see people playing your games, and Rovio can make that happen with their huge marketing power and influence. Just look at all the media sites covering the news for the Amazing Alex announcement (most of those sites never talked about Casey&#8217;s Contraptions at launch <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<p>Miguel and I chose not to be involved in future development of Casey&#8217;s Contraptions/Amazing Alex. As an indie developer, your time is the most limited and precious resource. Every game you release takes some of that time away even after it launches: new content, higher-resolution graphics, fixing problems with the latest OS version, porting to other platforms, etc. This was a great opportunity to pass the baton to Rovio and be able to focus 100% on new creative projects.</p>
<p>Yes, it&#8217;s hard to let go. Not like I have experienced that yet, but it probably feels like sending your kid to college, knowing that he&#8217;s starting a new life without you. At least we can rest easier knowing Casey is in good hands. Whenever Amazing Alex becomes a worldwide hit, we can proudly point to that and say we started that game.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2012/05/cc.jpg" alt="Cc" border="0" width="400" height="224" /></div>
<h3>Personal life</h3>
<p>On a personal level, my life hasn&#8217;t changed at all. <a href="http://www.snappytouch.com/flowergarden">Flower Garden</a> has been doing a good job at keeping my family fed for the last few years, so getting more money doesn&#8217;t have a huge impact. This unexpected deal bumped up those numbers in the bank, but hasn&#8217;t otherwise changed much for me. No Ferraris in the garage, or even, for those who know me, no fancy new road bikes (still riding my trusty 12-year old Trek 5200). The only splurge was <a href="http://gamesfromwithin.com/big-displays-the-good-the-shiny-and-the-ugly">buying a 30&#8243; Apple Cinema Display</a>.</p>
<p>The deal has, however, definitely affected my future projects. At one level, it means I don&#8217;t have to worry about funding for my next few games, which is great. Both Flower Garden and Casey&#8217;s Contraptions were done on a minimal budget. Now I can afford to spend more money in areas where it can make a difference, and be able to offer people money up front instead of just some percent of royalties. </p>
<p>One thing I never want to do is have full time employees though. Full time employees bring constant burn rate, and start adding a sense of pressure I do not want. One of the best things about being indie is the flexibility that it brings. Collaborations with other indies have worked really well so far, and I&#8217;ll continue to do that as much as possible for future projects.</p>
<p>The other way the deal has affected my future projects is that there will be more pressure to follow up Casey&#8217;s Contraptions with a great game. Even though Casey&#8217;s Contraptions is the same it was a few months ago, the fact that it was bought by Rovio will make a lot of people take notice and compare it to any of my future games.</p>
<p>I&#8217;ve already been struggling with those effects for several months. I&#8217;ve been making and discarding prototype after prototype. More than half of those would have made for fine games, but I have no desire to release a &#8220;just OK&#8221; game for the sake of releasing something. I&#8217;ve also decided that I&#8217;m not even going to consider potential for financial success for my next game. It&#8217;s not going to be aimed at the mass market, it&#8217;s not going to be full of zombies, and it&#8217;s certainly not going to be a typical freemium game. </p>
<p>Whatever my next game is, it&#8217;s going to be a more personal, more niche game. Something that I can be really excited about working for however many months it takes, and something I can be really proud of after launch.</p>
<p><br/></p>
<p>Bye, bye Casey! We&#8217;ll miss you, but we can&#8217;t wait to see what you do out there!</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/what-the-rovio-deal-with-caseys-contraptions-means-to-me/feed</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Office Space</title>
		<link>http://gamesfromwithin.com/office-space</link>
		<comments>http://gamesfromwithin.com/office-space#comments</comments>
		<pubDate>Mon, 16 Jan 2012 20:28:48 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1620</guid>
		<description><![CDATA[Those who put up with my incessant chatter (or rants, depending how long I&#8217;ve gone without a run) on Twitter, know that I recently moved out of my home office and leased an office in town. This change was mostly &#8230; <a href="http://gamesfromwithin.com/office-space">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Those who put up with my incessant chatter (or rants, depending how long I&#8217;ve gone without a run) <a href="https://twitter.com/#!/noel_llopis">on Twitter</a>, know that I recently moved out of my home office and leased an office <a href="http://maps.google.com/maps?q=carlsbad,+ca&#038;hl=en&#038;sll=33.158093,-117.350594&#038;sspn=0.481134,0.737457&#038;vpsrc=0&#038;hnear=Carlsbad,+San+Diego,+California&#038;t=m&#038;z=12">in town</a>. This change was mostly due to my wife and I having a baby daughter a few months ago. I&#8217;ve taken most of this time as an extended paternity leave, but when it was time to do some work again, it was clear that working from home wasn&#8217;t the ideal environment anymore.<span id="more-1620"></span>Having a separate office not only gives me the distraction- and interruption-free environment I need, but also gives me some much-needed separation between home and work. My office is about a mile away from home, so that makes for a very nice 15-minute walking commute (with the Macbook Pro in my backpack). It&#8217;s also located right in the Carlsbad village, so it&#8217;s a block or two away from tons of cool places to have lunch, grab a coffee, or even go to the beach for a quick break!</p>
<p>Here are a few pictures from the new office. Things aren&#8217;t completely set up yet (that bare wall is waiting for some Flower Garden and Casey&#8217;s Contraptions posters that should be arriving today).</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2012/01/CRW_5052.jpg" alt="CRW 5052" border="0" width="600" height="400" /></div>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2012/01/CRW_5056.jpg" alt="CRW 5056" border="0" width="600" height="400" /></div>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2012/01/CRW_5059.jpg" alt="CRW 5059" border="0" width="600" height="400" /></div>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2012/01/CRW_5055.jpg" alt="CRW 5055" border="0" width="600" height="400" /></div>
<p>The thing I like the most about this office is the light. It&#8217;s a corner office and it&#8217;s aiming north, so that means great, indirect light all day long. Oh, and the windows can be opened to let some fresh air in. That might seem like an odd detail to mention to some of you, but you&#8217;d be surprised how many office buildings in the US have windows that can&#8217;t be opened. Really.</p>
<p>Both desks are adjustable, standing desks. The main desk in the pictures is the <a href="http://www.geekdesk.com/">large frame GeekDesk</a> one. I used to have the small frame because I didn&#8217;t have the room at home, but I love the extra space, especially with the <a href="http://gamesfromwithin.com/big-displays-the-good-the-shiny-and-the-ugly">30&#8243; display</a>! I&#8217;ve kept the small desk to the side, that way I can invite other people to come work from here for the day (indie work day!) or even (gasp) hire someone if the right time comes.</p>
<p>The rest is pretty standard: whiteboard (I prefer use one much larger, but that&#8217;s what I had around), bouncy ball (gotta have a bouncy ball!), and couch (pretty important to unwind, or just to take a break from standing all day).</p>
<p>So far, I&#8217;m very happy with this setup. Working from here is definitely invigorating, and the separation between work and home helps a lot in both locations. Maybe once our daughter is older and going to school I&#8217;ll consider working from home again, but this is perfect for now.</p>
<p>What does your work setup look like? Post some pictures and let me know. I love seeing other devs work setups.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/office-space/feed</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Quick Tip: Working With Shaders On iOS</title>
		<link>http://gamesfromwithin.com/quick-tip-working-with-shaders-on-ios</link>
		<comments>http://gamesfromwithin.com/quick-tip-working-with-shaders-on-ios#comments</comments>
		<pubDate>Fri, 06 Jan 2012 19:13:09 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1607</guid>
		<description><![CDATA[I&#8217;m taking a couple of days to upgrade some of my libraries for doing prototyping both in 2D and 3D. One of the many overdue things I wanted to do, was to finally ditch OpenGL ES 1.1 and move to &#8230; <a href="http://gamesfromwithin.com/quick-tip-working-with-shaders-on-ios">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m taking a couple of days to upgrade some of my libraries for doing prototyping both in 2D and 3D. One of the many overdue things I wanted to do, was to finally ditch OpenGL ES 1.1 and move to 2.0 exclusively. Yes, even if you&#8217;re only doing a 2D game, OpenGL ES 2.0 is way worth it. </p>
<p>There were even a couple of cases during Casey&#8217;s Contraptions that we wanted a particular effect, and couldn&#8217;t get it quite right, but it would have been trivial to whip up a shader if we had been using OpenGL ES 2.0. In the end, we had to resort to <a href="http://gamesfromwithin.com/customizable-color-sections-with-opengl-es-1-1">texture combiners</a> (yuck), and it wasn&#8217;t exactly what we had in mind.<span id="more-1607"></span>OpenGL ES 2.0 requires that you write shaders for any different kind of &#8220;thing&#8221; you render, whether it&#8217;s a simple 2D quad, or a fancy skinned character. I wanted to provide at least a basic 2D rendering shader in my graphics library, but the workflow was a bit awkward.</p>
<p>First of all, shaders on iOS are compiled at runtime <a href="#1">[1]</a>, so we need to access the shader source and compile it. Initially I was thinking of having the shader source files as text in the graphics library, but for the game to access those files, it would have to explicitly add them to its resources so they can be copied during the build phase. That&#8217;s error prone (I would always forget to do that with every new project) and just plain ugly.</p>
<p>Another possibility would be to include the source text as a string in the library. That would simplify things, but it would mean that:</p>
<ol>
<li>You would lose shader syntax highlighting.</li>
<li>You would need to have the annoying \ at the end of every line.</li>
</ol>
<p>After <a href="https://twitter.com/#!/noel_llopis/status/155072436113649665">asking on Twitter and getting some good suggestions</a>, I decided the easiest way would be to use <a href="http://linuxcommand.org/man_pages/xxd1.html">xxd</a>. It&#8217;s a shell tool that comes preinstalled in all Macs (and Linux) that takes a file and converts it into a C array that can be included in a program directly.</p>
<p>I liked xxd even better than the old standby of <a href="http://wiki.wxwidgets.org/Embedding_PNG_Images-Bin2c_In_Python">bin2c</a> because it already comes installed, and it generates the whole file, not just an array that then needs to be included from another file. Yes, it would be easy enough to modify, but why bother when you have a perfect tool for the job already?</p>
<p>Now, I can set up a custom rule in Xcode 4 like this:</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2012/01/custom_rule1.png" alt="Custom rule" border="0" width="600" height="288" /></div>
<p><b>Update:</b> The array generated by xxd isn&#8217;t null-terminated, so we need to add a zero to the array. The easiest way is to use sed. Thanks to <a href="http://twitter.com/#!/SixEchoStudios">SixEcho Studios</a> for the heads up. Also, I updated it to use the varaibles INPUT_FILE_DIR and INPUT_FILE_NAME thanks to <a href="http://twitter.com/#!/mysterycoconut">Miguel&#8217;s</a> comments.</p>
<p>Now, whenever the shader source changes, it generates a header file like this:</p>
<pre>
unsigned char PassThrough_fsh[] = {
  0x0a, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x6f,
  0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x44, 0x65, 0x73, 0x74,
  0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
  0x3b, 0x0a, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e,
  0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x67, 0x6c, 0x5f,
  0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20,
  0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43,
  0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d
,0x00};
unsigned int PassThrough_fsh_len = 91;
</pre>
<p>To compile that shader in the game, all I have to add is two lines:</p>
<pre>
#include <Graphics/Shaders/PassThrough.fsh.h>
//...
const int fs = ShaderUtils::CompileShader(PassThrough_fsh, GL_FRAGMENT_SHADER);
</pre>
<p>Done! Clean, simple, and minimal cruft. </p>
<p><b>Update:</b> I haven&#8217;t tried it yet because I haven&#8217;t had the need for any expensive shaders, but I hear really good things about Aras Pranckevičius GLSL optimizer. In that case, I would add it before the xxd step. You would still use the shader the same way, but it would be optimized and perform faster.</p>
<p><br/></p>
<p><a name="1"></a>[1] That&#8217;s a huge mistake and I hope Apple fixes that ASAP. <a href="https://github.com/aras-p/glsl-load-speed">Loading times for any amount of non-trivial shaders adds up really quickly</a>. That&#8217;s the last thing you want on a mobile device! The OpenGL ES 2.0 standard provides an optional way to load binary shaders, and all that Apple has to do is provide a tool that will compile shaders for the iOS hardware. To be completely future-proof, you they can even mandate that if the binary load fails, you still need to compile from source.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/quick-tip-working-with-shaders-on-ios/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Big Displays: The Good, The Shiny, and The Ugly</title>
		<link>http://gamesfromwithin.com/big-displays-the-good-the-shiny-and-the-ugly</link>
		<comments>http://gamesfromwithin.com/big-displays-the-good-the-shiny-and-the-ugly#comments</comments>
		<pubDate>Fri, 23 Dec 2011 19:37:22 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1602</guid>
		<description><![CDATA[I remember back in the mid-90s, I went through 5 or 6 19&#8243; CRT monitors before I found one that I thought was acceptable running at 1600&#215;1200. I believe it was a Samsung and it even needed BNC cables to &#8230; <a href="http://gamesfromwithin.com/big-displays-the-good-the-shiny-and-the-ugly">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I remember back in the mid-90s, I went through 5 or 6 19&#8243; CRT monitors before I found one that I thought was acceptable running at 1600&#215;1200. I believe it was a Samsung and it even needed BNC cables to get the signal without interference and degradation to get the quality I wanted.</p>
<p>Fortunately, display technology caught up over the years and I&#8217;ve been happy with the LCD monitors I have since then. </p>
<p>Until now.</p>
<p>I&#8217;ve been looking into large LCD monitors to set up in my new office with my Macbook Pro, and I find myself pushing into the limit of technology once again. The results: I went through 3 monitors of about $1K each. Two fell completely short, and one was perfect.<span id="more-1602"></span><br />
<h2>The Shiny: 27&#8243; Apple Thunderbolt Display</h2>
<p>The top contenders starting out were the <a href="http://www.apple.com/displays/">27&#8243; Apple Thunderbolt Display</a>, and the <a href="http://accessories.us.dell.com/sna/productdetail.aspx?c=us&#038;cs=04&#038;l=en&#038;s=bsd&#038;sku=224-8284&#038;redirect=1">27&#8243; Dell U2711</a>. I read reports that they both use the same display technology, and the differences between the two were relatively minor. After some conflicting reviews (that should have been the first warning), I decided to go with the Apple Display.</p>
<p>This display seemed perfect for me. It looks gorgeous, like an oversized iPad. The image quality is fantastic, with text being sharp and clear and having a great resolution. Since I&#8217;m only connecting a Macbook Pro to it, the connections are perfect: The Thunderbolt cable is great because it deals with display, USB, ethernet, and even audio in one fell swoop. The display also has a power cable for the Macbook Pro, so it&#8217;s like a perfect docking station.</p>
<p>It really was almost perfect. Almost.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/12/465078317.jpg" alt="465078317" border="0" width="400" height="533" /></div>
<p>The glare was simply horrible and I could see myself reflected on the screen, even with a white background. The shiny display was almost a perfect mirror. It might be the ideal display if you like to work in a dungeon, but I like light, the more the better. Even though my office has no direct sunlight, just the indirect light coming in was enough to see everything brightly reflected on it. </p>
<p>
<div style="text-align:center;"><a href="https://twitter.com/#!/noel_llopis/status/144143019862528000"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/12/347027484_f4552c672b.jpg" alt="347027484 f4552c672b" border="0" width="500" height="375" /><br/>One possible way to work with the Apple Display</a></div>
</p>
<p>What&#8217;s worse, if one day I had to rearrange things or move to a different office and I had a window behind me, it would go from distracting to impossible to see anything. </p>
<p>Another annoying aspect of that monitor is that the stand height wasn&#8217;t adjustable. I like to look at a monitor straight while my arms are about a 90-100 degree angle, so the monitor ended up being several inches too low. I can do the old phone book trick, but it seemed ridiculous having to do that on such a beautiful display.</p>
<p>As much as I liked that display, it just wasn&#8217;t for me.</p>
<h2>The Ugly: Dell U2711</h2>
<p>In spite of some comments complaining about &#8220;over aggressive&#8221; anti-glare coating, I decided to give the <a href="http://accessories.us.dell.com/sna/productdetail.aspx?c=us&#038;cs=04&#038;l=en&#038;s=bsd&#038;sku=224-8284&#038;redirect=1">Dell U2711</a> a try. I had used Dell monitors before and I was never bothered by the screen. And after all, the antiglare coating could fix the problem the Apple display had. Apart from the antiglare, it had some attractive options: Multi-card reader, several video inputs, and better color options. It could be the perfect screen.</p>
<p>It turns out it was far from that. It was the opposite of the Apple display in many ways. Connecting it to the Macbook Pro was a hassle since it shipped with a Displayport cable, but not a Mini Displayport one. I tried using my Mini Displayport to DVI adaptor, but it turns out it was single-link and you need a dual link to drive the full 2560 x 1440 resolution.</p>
<p>Once I finally got it up and running (with a Mini Displayport to Displayport cable), the resulting image was plain ugly. The colors were off, but more seriously, the antiglare coating really was horrible. It made the screen look like there was a fine coating of dust on it, or like it was film with a very obvious grain to it. I had to strain my eyes to focus on the text because the graininess kept throwing me off. </p>
<p>I suppose I could have gotten used to it, but since I use the Macbook Pro display next to it, going back and forth was torture. One moment I would see this clean, sharp, beautiful display, the next moment I would see this horrible grainy mess. </p>
<p>To make sure I wasn&#8217;t hallucinating, I took a picture of both displays with my iPhone displaying the same content. The differences are obvious (click on them to see them full size).</p>
<p><center><a href="http://twitpic.com/7wsaos/full"><img src="http://gamesfromwithin.com/wp-content/uploads/2011/12/MBP_antiglare_small.jpg" alt="MBP antiglare small" border="0" width="290" height="250" /><br/>Macbook Pro with antiglare</a></center></p>
<p><center><a href="http://twitpic.com/7wsc0h/full"><img src="http://gamesfromwithin.com/wp-content/uploads/2011/12/dell_u2711_small.jpg" alt="Dell u2711 small" border="0" width="290" height="232" /><br/>Dell U2711</a></center></p>
<p>In case that wasn&#8217;t enough, the colors were severely off. I played around for an hour with the custom settings and some advice from the internet, but I just managed to make them a bit better. I still liked the colors on the Apple Display (or the Macbook Pro) way better.</p>
<h2>The Good: 30&#8243; Apple Cinema Display</h2>
<p>At this point I thought I was out of luck, and that I was going to have to settle for either one of those two monitors (I would take the 27&#8243; Apple one), or something smaller but without those problems.</p>
<p>Fortunately, <a href="https://twitter.com/#!/ruttencutter">several</a> <a href="https://twitter.com/#!/lilwhitebear">people</a> on Twitter encouraged me to try out the <a href="http://www.everymac.com/monitors/apple/studio_cinema/specs/apple_cinema_display_30.html">30&#8243; Apple Cinema Display</a>. I never saw paid attention to one, but apparently they had fantastic image quality and a good antiglare coating. That sounded promising!</p>
<p>One of the pleasures of being a small company is that once I decide to do something, I can do it right away. There&#8217;s no paperwork, approval, ordering through certain channels, or any of that overhead. Since Apple doesn&#8217;t make that display anymore, I hopped on Craigslist, called a guy up, and picked it up a few hours later. Done!</p>
<p>And boy was I glad I did! That monitor is everything that was cracked up to be and more! Since it&#8217;s an older display, it doesn&#8217;t have Mini Displayport cables, so I had to use a Mini Displayport to Dual DVI adaptor. The image quality is indeed, outstanding, and the colors are quite good (although maybe a touch redder than the laptop).</p>
<p>I actually love that it&#8217;s a 16:10 ratio instead of the more common 16:9 in most monitors today. That gives results in a resolution of 2560 x 1600, which gives me some much-needed vertical space when writing code (which is 80-90% of my day).</p>
<p>As a totally minor, but nice side effect, the brightness controls on the keyboard control the screen brightness (which is kind of surprising considering it&#8217;s connected over the dual DVI adaptor, but there&#8217;s also a USB cable going into the display, so maybe it&#8217;s communicating through that channel). </p>
<p>The only drawback is that the back only has two USB ports (I wish it had 4 or more). It does have two Firewire ports as well, although I don&#8217;t have any devices that use those. </p>
<p>For completeness sake, I took a picture of the new monitor with the same image I used as a test earlier. It shows how much cleaner the image is than the Dell.</p>
<div style="text-align:center;"><a href="http://twitpic.com/7ww43p/full"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/12/cinema_30_small.jpg" alt="Cinema 30 small" border="0" width="290" height="252" /><br/>30&#8243; Apple Cinema Display</a></div>
<h2>Conclusion</h2>
<p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/12/lineup.jpg" alt="Lineup" border="0" width="597" height="292" /><br/>From left to right: The shiny, the ugly, and the good.</div>
</p>
<p>If you&#8217;re picky like me about the quality of your displays, and you&#8217;re looking for a large monitor, I can&#8217;t recommend the 30&#8243; Apple Cinema Display enough. It&#8217;s a shame that Apple stopped manufacturing it, so check Cragislist or Ebay for it. If you work in a dark place, maybe the 27&#8243; Thunderbolt one will work as well. Whatever you do, stay far, far away from the Dell one. </p>
<p>We can only hope that Apple will make a revision of the 27&#8243; Thunderbolt Display soon with a high-quality antiglare coating like the laptops. In the meanwhile, I&#8217;m thankful both Apple and Dell have good return policies.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/big-displays-the-good-the-shiny-and-the-ugly/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>iCloud Demystified</title>
		<link>http://gamesfromwithin.com/icloud-demystified</link>
		<comments>http://gamesfromwithin.com/icloud-demystified#comments</comments>
		<pubDate>Thu, 22 Dec 2011 23:34:12 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Game tech]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[icloud]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1592</guid>
		<description><![CDATA[Play a game on a device, put it down, pick up another device, and continue playing exactly where you left off. This is the future of games. That future is a reality today for some games and apps (Netflix, Kindle), &#8230; <a href="http://gamesfromwithin.com/icloud-demystified">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Play a game on a device, put it down, pick up another device, and continue playing exactly where you left off. This is the future of games.</p>
<p>That future is a reality today for some games and apps (Netflix, Kindle), and I&#8217;m convinced that players will expect that in most games in the next year or so. So obviously, the next bit of new iOS tech I decided to try was iCloud. I would love to turn Flower Garden into that kind of seamless experience, independently of the device you use to access it. </p>
<p>As a quick spoiler, it turns out I won&#8217;t be able to make Flower Garden quite so seamless without a lot of extra work. But I learned a lot along the way and I should be able to take a small step in that direction.<span id="more-1592"></span><br />
<h2>Design considerations</h2>
<p>iCloud promises to be the &#8220;available from everywhere&#8221; storage solution that will be a key component towards the scenario of playing on any device at any time. Unfortunately, it&#8217;s just a component of that whole scenario and still requires quite a bit of work on the part of the developer.</p>
<p>Since I&#8217;m just retrofitting Flower Garden to work with iCloud, I wanted a simple way to simply replicate the game state on iCloud. Then, whenever you play it from any device, you get the latest state and everything works as expected.</p>
<p>The big problem with that approach is that you can&#8217;t always count on having an active (or fast enough) internet connection. iPod Touches, iPads, or even iPhone in a plane or a cell tower black spot will make it so your device has no way to communicate with iCloud. So what happens if the player plays without an internet connection, then comes home, grabs another device, plays for a bit with internet connection, and finally launches the original device, this time with internet connection. You&#8217;ll end up with two conflicting game states. Not fun!</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/12/whatis_icloud.jpg" alt="Whatis icloud" border="0" width="382" height="295" /></div>
<p>I can think of two different strategies to deal with this situation:</p>
<ul>
<li>Require internet connection to play. Some games do this today. It can be quite frustrating not being able to play your favorite game in the plane, but it does solve the game state conflict problem because they can always communicate with iCloud, so they usually provide seamless multi-device play.</li>
<li>Detect changes on both game states and intelligently solve them. Sounds good in theory, but it&#8217;s a pain in practice. Unless you have a very simple game state (a percentage completion for example), it means not only do you have to record the state, but you have to record the events that led to that state, and be ready to examine them, compare them, and marge them in the case of a conflict. And the worst part is that even if you put lots of care into it, there will be cases where the merge is not ideal and the player will feel like he lost something in the merge.</li>
</ul>
<p>For Flower Garden, neither solution is particularly attractive. It&#8217;s the proverbial rock and a hard place. So for the moment I&#8217;ve decided to implement just a small step in that direction: Sync things that only progress in one direction, without any danger of conflict. That includes purchased IAPs and unlocked seeds. Later on, once that&#8217;s working solidly without any problems, I can consider adding counts like Fertilizer, Color Dust, or Green Thumb points. That will be a bit trickier because there&#8217;s still chance for conflict since the count can go up and down, but it&#8217;s possible to change each amount into two different values that always go up: Earned amount, and spent amount. That way I can always grab the maximum value that I find either local or on iCloud and things should work smoothly. (Update: What I wrote there about separating them in two different values is totally wrong, and any DB programmer worth his salt would be laughing at that. Separating them in two different values won&#8217;t help at all. That&#8217;s what I get for doing brain-dump posts on the fly <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Apple provides <a href="https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iCloud/iCloud.html#//apple_ref/doc/uid/TP40007072-CH5-SW1">two APIs to store data in iCloud</a>: key-value storage and file storage.</p>
<h2>Key Value storage</h2>
<p>Initially, this seems like a great way to go. It&#8217;s a <a href="https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSUbiquitousKeyValueStore_class/Reference/Reference.html#//apple_ref/occ/cl/NSUbiquitousKeyValueStore">very simple API</a>, and it&#8217;s very familiar to most iOS programmers because it&#8217;s just like <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html">NSUserDefaults</a>.</p>
<p>Don&#8217;t be fooled into thinking you need to store data in strings or one field at the time. You can stuff whatever binary chunk of data you want with NSData, so it&#8217;s quite versatile.</p>
<p>It does have three pretty big drawbacks thought:</p>
<ul>
<li><b>Size</b>. You can only store up to 64KB of data. That&#8217;s definitely a big deal if you&#8217;re planning on storing large data files. Even for Flower Garden, each pot is about 30KB, so I wouldn&#8217;t be able to save the full garden state this way.</li>
<li><b>Syncing</b>. The Apple docs say that &#8220;Keys and values are transferred to and from iCloud at periodic intervals.&#8221; Ouch! What does that mean? Clearly this is intended for non-crucial data (like settings), so the potential delay isn&#8217;t a big deal. In my tests, I found that data was often not available when starting the app, but would become available a few seconds later.</li>
<li><b>No way to check state.</b> When starting the app, there&#8217;s no way to find out if the values you&#8217;re reading are up to date. Combined with the slow syncing, it makes it less than idea for important data. On the flip side, <a href="https://developer.apple.com/library/ios/#documentation/Foundation/Reference/NSUbiquitousKeyValueStore_class/Reference/Reference.html#//apple_ref/occ/cl/NSUbiquitousKeyValueStore">you can be notified when the data changes</a>, but that means having to deal with changes while the game is running (which I was hoping not to do).</li>
</ul>
<h2>File storage</h2>
<p>File storage might be a better option then since it doesn&#8217;t have any of those drawbacks: there&#8217;s no size limit, data is synced much more aggressively, and you can check if the data is up-to-date, and wait until it is otherwise.</p>
<p>What&#8217;s not to like about file storage then? The cumbersome and intrusive API that Apple created around it. If you read the docs, they make it sound like you need to inherit from UIDocument and load all your data through that class. I like to keep things simple and portable, so I&#8217;d really rather not introduce UIDocument into the file-loading process if I don&#8217;t have to.</p>
<p>It turns out that <a href="https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/iCloud/iCloud.html#//apple_ref/doc/uid/TP40007072-CH5-SW1">Apple&#8217;s docs on the iCloud SDK</a> are quite sparse and lacking details. I was able to put together a demo from those docs and some experimentation, so hopefully this will be useful to other devs as well.</p>
<p>The device has an iCloud storage daemon running, monitoring specific directories for changes. You get the directory assigned to your app by calling <a href="https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/URLForUbiquityContainerIdentifier:">URLForUbiquityContainerIdentifier</a>. </p>
<p>To add a new file, the docs recommend first creating the file somewhere else, and then calling  <a href="https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/setUbiquitous:itemAtURL:destinationURL:error:">NSFileManager:setUbiquitous:itemAtURL:destinationURL:error:</a> to move it to iCloud. Interestingly, I accidentally skipped this step and just wrote to the iCloud directory directly, and the files were stored correctly anyway. Might as well leave it just in case that behavior changes later on, or there&#8217;s some side effect I didn&#8217;t notice.</p>
<p>After that, every time you write to the file, the iCloud daemon will detect the changes and push them out to iCloud. This is an important point because a) You don&#8217;t have explicit control to say &#8220;start send it now&#8221; or even &#8220;This file is ready to be sent to iCloud&#8221; (that would be my choice), and b) I don&#8217;t know what it does with partial updates, so I would be very careful about writing to those files and make sure it&#8217;s an atomic operation (save somewhere else, and them move the file in one operation).</p>
<p>To get the latest version of the files on iCloud, you can check whether they&#8217;re fully downloaded or not by calling <a href="https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html#//apple_ref/occ/instm/NSURL/getResourceValue:forKey:error:">NSURL:getResourceValue:&#038;isDownloaded forKey:NSURLUbiquitousItemIsDownloadedKey error:</a>. If they are up to date, you can move on, otherwise, you can initiate a download of the files by calling <a href="https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/startDownloadingUbiquitousItemAtURL:error:">NSFileManager:startDownloadingUbiquitousItemAtURL:error:</a>.</p>
<p>One weird thing is that the startDownloading function doesn&#8217;t have a callback (that I can see). So I had to set up a timer to check periodically if the files are synced.</p>
<p>Since all the syncing happens at startup, there&#8217;s no complexity involved with data changing while the app is running. If that&#8217;s a case you need to handle, you might be better off using UIDocument since it at least detects conflicts. If you do it this way, the latest one will overwrite any past changes.</p>
<p>Also, working this way, it seemed easier to keep the files in Application Support (or Documents), and only move them to/from iCloud when I wanted to. That has the advantage of iCloud not changing things from under you while the game is running, and the fact that, if for some reason the files in iCloud are corrupt, you always have good local files to fall back to.</p>
<h2>Demo</h2>
<p><a href="http://gamesfromwithin.com/wp-content/uploads/2011/12/iCloudTest.zip" title="iCloudTest.zip" alt="ICloudTest">iCloudTest.zip</a></p>
<p>The demo iCloudTest saves data both with the key value pair, and the file storage system directly like I described above. If you run it from different devices, you&#8217;ll see that it&#8217;s amazing how quickly file data gets propagated, but key-value data takes a few more seconds. </p>
<p>The demo project also works in the simulator (there&#8217;s no iCloud support, so it just uses local files), and it even works with iOS4 (also using local files, and it avoids using any iOS5 symbols while detecting iCloud support).</p>
<h2>Sharing Data Between Multiple Apps</h2>
<p>Once you&#8217;re at this point, sharing data between multiple apps is really straightforward. </p>
<p>First you need to make sure the app IDs of both apps start with the seam Team ID. For some unknown reason lost in the midsts of time, Flower Garden and Flower Garden Free use different prefixes, so that option is out for me. Hopefully most people having been using the Team ID only.</p>
<p>Then you need to decide which type of data you want to share. If you want to share files, you need to add the app ID of the other app to your iCloud entitlement, and then as for the correct app ID (including prefix!) when you call <a href="https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/URLForUbiquityContainerIdentifier:">URLForUbiquityContainerIdentifier</a>. If you just want the app&#8217;s own iCloud data, you can pass NULL as the parameter.</p>
<p>As far as I can tell, each application can only have one set of key-value data. So sharing it between two apps means changing one app to use the app ID of the other app in the com.snappytouch.icloudtest field of the iCloud entitlements file. As long as both apps use the same Team ID prefix, it should work fine without having to do anything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/icloud-demystified/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Trying Out Multisampling On iOS</title>
		<link>http://gamesfromwithin.com/trying-out-multisampling-on-ios</link>
		<comments>http://gamesfromwithin.com/trying-out-multisampling-on-ios#comments</comments>
		<pubDate>Fri, 16 Dec 2011 21:03:33 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[iDevBlogADay]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[flower garden]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1578</guid>
		<description><![CDATA[I only recently broke free of iOS3.x for Flower Garden, so I&#8217;m finally adding all the features I had been itching to add that required higher OS support. I had already added some iOS4+ features, but I was keeping them &#8230; <a href="http://gamesfromwithin.com/trying-out-multisampling-on-ios">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I only recently broke free of iOS3.x for Flower Garden, so I&#8217;m finally adding all the features I had been itching to add that required higher OS support. I had already added some iOS4+ features, but I was keeping them to a minimum because it&#8217;s always a huge cause of bugs to target multiple versions of the OS at once.</p>
<p>One of the first features I looked into adding was <a href="http://en.wikipedia.org/wiki/Multisample_anti-aliasing">multisample antialiasing (MSAA)</a> support for OpenGL, which was originally introduced in iOS 4.0. The geometry generated for the petals in Flower Garden is fairly high contrast, and since it&#8217;s not like the textures were carefully created and laid out by an artist, the result is pretty bad aliasing around the edges. Perfect candidate for multisampling!<span id="more-1578"></span>I based everything on the <a href="http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/WorkingwithEAGLContexts/WorkingwithEAGLContexts.html#//apple_ref/doc/uid/TP40008793-CH103-SW12">Apple documentation on multisampling</a>. It was very straightforward and it works for both off-screen and view-based render targets. It was also extremely helpful to keep both the ability to use regular and multisampled render targets. That way I can easily run performance and visual comparisons, and, if necessary, I can disable multisampling on a particular device. </p>
<p>The main gotcha was making sure I used the GL_RGBA8_OES color format on the multisampling color buffer (otherwise it won&#8217;t work, and all you&#8217;ll get are 1282 &#8220;invalid operation&#8221; OpenGL errors). Also, if you&#8217;re in the same boat as Flower Garden, which uses OpenGL ES 1.1 and the fixed function pipeline, you&#8217;ll have to add _OES to just about every constant in the documentation.</p>
<h2>Visual results</h2>
<p>I will let the screenshots speak for themselves.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/12/multisample.png" alt="Multisample" border="0" width="600" height="451" /></div>
<p>In this screenshot you can see the rendering of the pots using off-screen render targets.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/12/multisample2.png" alt="Multisample2" border="0" width="600" height="450" /></div>
<p>Pretty impressive improvement, even if I say so myself! The improvement is even more striking in-game because the animation of the flowers moving in the wind doesn&#8217;t have jaggies popping in and out.</p>
<p>The improvements are more noticeable on the iPad because the pixels are bigger, and, not surprisingly, less so on retina-display iPhones. But even on the retina displays, jaggies are less noticeable during the flower wind-swaying animations.</p>
<h2>Performance</h2>
<p>So, no doubt: They look pretty. But how about performance? Under the hood, the rasterizer is generating four samples for every pixel, and then combining them at the end in a separate step. <strike>So you&#8217;ll get more of a performance hit with complex pixel shaders</strike>. <b>Edit:</b> My bad. I spaced out and I forgot that MSAA only evaluates the pixel shader once, so performance doesn&#8217;t depend on pixel shader complexity. Instead, the performance hit probably comes from the extra writes (four per pixel) to the render target, and should be fairly similar between games.</p>
<p>It turns out that Flower Garden is still using OpenGL ES 1.1, which is implemented using shaders at the driver level. Fortunately, even though I&#8217;m using some texture combiner operations and several input textures, those pixel shaders aren&#8217;t all that complex.</p>
<p>These are the frames per second I recorded with one particular flower pot on the different devices I have for testing. Notice that the lowest device I have listed is the iPhone 3GS. That&#8217;s because I have also stopped supporting arm6 CPUs to keep things simpler (and the market share is minimal).</p>
<p><b>Update:</b> I was only running the game loop at 30 fps, so the initial performance numbers I had listed are pretty meaningless. Here are the correct numbers running at a max of 60 fps.</p>
<table>
<tr>
<th>Device</th>
<th>Without MSAA</th>
<th>With MSAA</th>
</tr>
<tr>
<td>iPhone 3GS</td>
<td align="center">39 fps (25.6 ms)</td>
<td align="center">37 fps (27.0 ms)</td>
</tr>
<tr>
<td>iPhone 4</td>
<td align="center">48 fps (20.8 ms)</td>
<td align="center">23 fps (43.5 ms)</td>
</tr>
<tr>
<td>iPhone 4S</td>
<td align="center">60 fps (16.7 ms)</td>
<td align="center">60 fps (16.7 ms)</td>
</tr>
<tr>
<td>iPad 1</td>
<td align="center">60 fps (16.7 ms)</td>
<td align="center">18 fps (55.6 ms)</td>
</tr>
<tr>
<td>iPad 2</td>
<td align="center">60 fps (16.7 ms)</td>
<td align="center">60 fps (16.7 ms)</td>
</tr>
</table>
<p>Of the devices I tested, MSAA didn&#8217;t slow down things much on the iPhone 3GS, and the iPhone 4S was maxed out at 60 fps both ways. The iPad 1 was a different story, and performance crashed from 60 fps to 18 fps. Like Rory pointed in the comments, looking at the actual time instead of the fps gives a better insight. Using MSAA adds 38.9 ms to each frame! The iPhone 4 also suffered from a big performance hit due to all the extra pixels in the retina display. I don&#8217;t care how pretty the flowers are, that&#8217;s just not acceptable (and no, I&#8217;m not adding user-tweakable graphics settings like PC games).</p>
<p>I should also add that Flower Garden is hugely CPU bound. It generates all that geometry every frame on the CPU, and that&#8217;s a lot of vector transforms. So if your game is GPU bound, you&#8217;re likely to see higher performance hits.</p>
<p>I was initially very surprised to see that the performance on the simulator tanked big time (as in, going from 30 fps to 5 fps). This was news to me, but apparently the iOS simulator runs completely in software, so the quadrupling of pixels brings it to its knees. I&#8217;m really, really, impressed at how smoothly it usually runs for being in software though. It had me fooled thinking it was using OpenGL under the hood!</p>
<p>As far as memory goes, after an <a href="https://twitter.com/#!/Frogblast/status/144811240177405952">animated discussion on Twitter</a>, it seems that the iPhone does create full buffers for the multisample frame buffers, so there is a significant increase in memory usage. It&#8217;s not something easy to track because it all happens at the driver level, but it&#8217;s something to be aware of. Because of this, I might consider turning multisampling off on retina displays, since the improvement is not mind-blowing (and the extra memory is very significant because of the amount of pixels). I&#8217;ll also probably turn it off in the simulator so I can achieve a decent frame rate during development.</p>
<h2>Conclusions</h2>
<p>Multisampling only required adding a few lines of code and resulted in an impressive visual improvement and minimal performance impact in some devices. It&#8217;s a no-brainer on the 3GS and iPad 2. I&#8217;m wishing I had implemented it earlier!</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/trying-out-multisampling-on-ios/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>View Controller Notification Changes on iOS5</title>
		<link>http://gamesfromwithin.com/view-controller-notification-changes-on-ios5</link>
		<comments>http://gamesfromwithin.com/view-controller-notification-changes-on-ios5#comments</comments>
		<pubDate>Fri, 09 Dec 2011 20:58:16 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1574</guid>
		<description><![CDATA[If you use view controllers in your iOS apps, here&#8217;s a doozie: The behavior of viewWillAppear/viewDidApear/viewWillDisappear/viewDidDisappear silently changed on iOS5. Depending how your app is organized, this might range from not mattering to being a total disaster.Pre-iOS5, if you added &#8230; <a href="http://gamesfromwithin.com/view-controller-notification-changes-on-ios5">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you use view controllers in your iOS apps, here&#8217;s a doozie: The behavior of viewWillAppear/viewDidApear/viewWillDisappear/viewDidDisappear silently changed on iOS5. Depending how your app is organized, this might range from not mattering to being a total disaster.<span id="more-1574"></span>Pre-iOS5, if you added a view with [self.view addSubview:myView], myView didn&#8217;t get any notifications. That was weird, but we learned to live with it. Tens (hundreds?) of thousands of developers worked around that and wrote gobs and gobs of code that worked with and counted on that behavior.</p>
<p>Then along comes the iOS5 SDK and someone decided that it would be good to &#8220;fix&#8221; that behavior, but doing it silently. By silently I mean no compile-time errors or warnings, but apparently it wasn&#8217;t deemed worthy of including in the <a href="https://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-5_0/_index.html">iOS5 release notes either</a>. I&#8217;m sure they thought they were doing us a favor. After all, if someone had a problem with it, it&#8217;s because they hadn&#8217;t structured their code correctly.</p>
<p>So now every view you add/remove will get those notifications. Which is fine, except if you had decided to call those by hand yourself. In that case, now they get executed twice, so you may be allocating things twice, making multiple network calls, and just causing general mayhem.</p>
<p>I also noticed that if you call presentModalViewController with a view controller, all the views underneath the modal view controller will get the viewWillDisappear/viewDidDisappear event. In my case this causes total chaos because those events trigger the freeing of some views that the modal view controller will need.</p>
<p>But wait, it gets even better! From what I&#8217;ve been able to tell, if your app compiled with the iOS5 SDK runs on iOS4, then you don&#8217;t get those events! That means that now you need to be ready to both deal with receiving them and not receiving them at the same time. Is that useful to anyone (other than devs making iOS5+ apps)?</p>
<p>Fortunately, existing apps compiled with the iOS4 SDK are consistent running both on iOS4 and iOS5 (no view events automatically generated). Phew! Dodged that bullet.</p>
<p>It seems I <a href="http://gamesfromwithin.com/xcode-4-trials-and-tribulations">complain</a> <a href="http://gamesfromwithin.com/quick-notes-on-lion">a lot</a> lately, but this seems like another very justified complaint. Wasn&#8217;t there a way for Apple to add that behavior to new functions without changing the old ones? For example, they could have introduced UIView:addSubview:withNotifications: and eventually deprecated the old ones. Yes, that means that they would have had to duplicate 10-20 functions related to adding/removing views, but they wouldn&#8217;t have broken half the iOS code out there.</p>
<p>This is probably my fault for relying on viewDidAppear events and calling them myself. I started working around this problem by being super-careful about how and when I call viewDidAppear, but as soon as I realized that iOS4 does it differently, I threw in the towel and went for a different approach. Now, I just implement my own function in the different view controllers and call that instead of viewDidAppear. That way Apple can change those events all they want and it won&#8217;t affect me anymore.</p>
<p>Of course, all of this only matters if you&#8217;re making heavy use of view controllers (which unfortunately I am  doing in Flower Garden). I&#8217;ve already said that my future game projects are going to be UIKit-free, so I won&#8217;t have to deal with this kind of problems again.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/view-controller-notification-changes-on-ios5/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>My Next Game</title>
		<link>http://gamesfromwithin.com/my-next-game</link>
		<comments>http://gamesfromwithin.com/my-next-game#comments</comments>
		<pubDate>Sat, 19 Nov 2011 00:31:50 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[iDevBlogADay]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1535</guid>
		<description><![CDATA[No, this is not an announcement of my next game (I wish). Rather, it&#8217;s a brain dump of my struggle with the process. It seems that in the game development community we often share the process of making a game &#8230; <a href="http://gamesfromwithin.com/my-next-game">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-673" src="http://gamesfromwithin.com/wp-content/uploads/2011/11/stick_2.png" alt="Stick 2" border="0" width="128" height="170" />No, this is not an announcement of my next game (I wish). Rather, it&#8217;s a brain dump of my struggle with the process. It seems that in the game development community we often share the process of making a game and how it did afterwards. But it&#8217;s rare having some insight into what goes on before the project gets started. Where do ideas come from? Why do we pick one and not another? These are semi-coherent notes about the things I&#8217;m struggling with right now.<span id="more-1535"></span><br />
<h2>Brewing</h2>
<p>A new game for me starts as an idea somewhere, sometime, that got jotted down into my &#8220;game ideas&#8221; personal wiki page. I have that page accessible 24 hours a day on my computer, iPhone, or iPad. Only while I&#8217;m running/cycling or in the shower am I away from that page (and unfortunately, that&#8217;s the time when most ideas seem to spark). I make a point of not censoring any ideas: If I thought that something would be neat (not just gameplay, but a setting, a visual, a mechanic, or anything), I jot it down.</p>
<p>Over time, I accumulate quite a few ideas. Every so often I review them and I might expand on some and flesh out sub-ideas. Or they might spark different ideas of their own and I jot them down too. I never delete any of them, because I&#8217;m consciously trying to not censor anything yet. This is purely brainstorming mode. I&#8217;ve even sent emails to friends about possible game ideas straight out of this list, crappy ideas and all.</p>
<p>During this time I&#8217;ll rearrange the list. I&#8217;ll move more likely ideas up, or ones that I&#8217;m more excited about. That has the effect of a kind of <a href="http://en.wikipedia.org/wiki/Bubble_sort">bubble sort</a>, so the better ideas somehow rise to the top (except for the brilliant ones hidden in the depths somewhere).</p>
<p>This list is particularly useful when I&#8217;m in the middle of a project and I have what seem brilliant game ideas. Do I put the project aside to do this great idea instead? No. Instead, I add it to the list with all the others. If I&#8217;m really excited about it, I&#8217;ll flesh it out as much as I can, but it needs to wait its turn. As you can imagine, after a few days, the idea doesn&#8217;t seem so shiny anymore, so it was a good thing it didn&#8217;t derail the current project.</p>
<h2>Struggling</h2>
<p>Eventually the time comes when I need to pick a new project, and this is where the fun and the pain start.</p>
<p>You would think a good approach might be to read the list and start evaluating ideas. In a way, that&#8217;s what I do, but before I evaluate ideas, I need to some frame of reference to decide what&#8217;s a worthwhile idea and what isn&#8217;t. </p>
<p>In the past my criteria for considering a project involved the intersection of three requirements:</p>
<ul>
<li>The game must be interesting for me to work on. I want to learn something new and be excited about what I do. Not interested in cloning something or making a derivative game.</li>
<li>A game I can realistically implement with the resources at my disposal. I&#8217;m not an artist, so that usually means not having a content-heavy game, and relying on code as much as possible (like the procedural geometry in Flower Garden&#8211;no artist modeled those flowers by hand).</li>
<li>A game that has potential to sell well on the target platforms.</li>
</ul>
<p>Unfortunately, meeting all those three requirements at the same time isn&#8217;t easy, especially given the astounding number of games already on iOS.</p>
<p>Before I go any further, I need to step back and ask myself a very important question: Why do I want to make this next game? This is a question we indies have the luxury of asking (and answering). I think most big (and small) studios are too busy staying afloat to be able to ask anything like that (besides, the answer is almost always &#8220;make more money&#8221; for them).</p>
<p>It turns out the indie life is treating me very well, so making lots money isn&#8217;t one of the main reasons to make this next game. That means I can safely remove that requirement from my previous list, which grants me a lot more freedom.</p>
<p>I&#8217;m probably going to spend the next 6 to 10 months working on this project, so it needs to be worthwhile. Does it need to be innovative and break new ground in a way no one has seen before? Does it need to make hard-core FPS players cry to be worth considering? Does it need to be radical, pixelated, mash up 5 different genres, an win the IGF and respect of my peers? </p>
<p>It turns out none of those are the reasons that drive me to make games. In the end, when I look deep down, the reason I want to make games is for the pleasure of taking a vision from the initial idea to something people can play. It&#8217;s the creativity involved that drives me. I imagine it&#8217;s the same reason people are driven to write or paint. If along the way, some of those games manage to be innovative, make money, or win an IGF award, that&#8217;d be fantastic, but in any case, the development process is its own reward.</p>
<p>Given all those factors, I can go down the list of games and evaluate each one. Does it have potential to meet those requirements and be a satisfying project? This might not come as a surprise for those of you involved in creative activities, but this is hands-down, the most difficult time of development for me. As long as I don&#8217;t have a project picked, my mind is constantly going over this. Anything I read, see, or hear is filtered and analyzed thinking of how it would fit in a game. During this time I&#8217;m often moody, volatile, and prone to depression if this goes on for too long.</p>
<p>Even though it seems I&#8217;ll never going to be able to come up with an idea worth doing, eventually something comes along, and the next phase starts.</p>
<h2>Prototyping</h2>
<p>I&#8217;ve already <a href="http://gamesfromwithin.com/prototyping-youre-probably-doing-it-wrong">talked about prototyping</a> <a href="http://gamesfromwithin.com/prototyping-for-fun-and-profit">at length</a> before. I take the idea I&#8217;m considering and I try to answer the key questions in the shortest possible time. This is the time to shoot down any bad ideas, or prove why they&#8217;re not feasible or just boring.</p>
<p>The prototyping phase is a big high for me. It often involves manic activity and I can get a prototype done in a day or two from the initial excitement on the idea. The bad part is that most prototypes prove not to be that great, and they go back to the drawer of game ideas, and I&#8217;m left scrambling for another idea.</p>
<p>Struggle. Prototype. Discard. Repeat. </p>
<p>I usually repeat this cycle multiple times. Each time around I get more anxious, and the lows and highs are a bit more extreme. </p>
<p>Fortunately, at least so far, eventually I find a prototype that seems worth doing. Something I can see spending the next X months of my life doing. I usually run it by a few friends whose opinion I value highly, and if they&#8217;re excited about it too, then it becomes an internal green light and I move on to the implementation phase.</p>
<h2>Tips</h2>
<p>Apart from asking yourself why your making a game, here are a couple of things worth keeping in mind when picking a new project. They&#8217;re not new things and I&#8217;ve heard them before in one form or another, but they&#8217;re worth reiterating:</p>
<ul>
<li>Don&#8217;t compete with big companies. They can throw a lot more resources, and, most importantly, lots of marketing behind their titles. Don&#8217;t try to take Zynga head on. Do your own thing.</li>
<li>Don&#8217;t chase trends. Take risks. Be different. You&#8217;re indie and have low overheard. Take advantage of that and do things the big boys would never dare risk $50 million on.</li>
<li>Keep the scope of the project small and focused. It will be bigger than you envision anyway. By being small, you can come up with new ideas faster than big companies.</li>
</ul>
<p><br/></p>
<p>How about you? What&#8217;s your process for deciding to work on something? Do you struggle until you pick the project? Do you stick with an idea, or do you change and restart?</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/my-next-game/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Designing Good Free-To-Play Games</title>
		<link>http://gamesfromwithin.com/designing-good-free-to-play-games</link>
		<comments>http://gamesfromwithin.com/designing-good-free-to-play-games#comments</comments>
		<pubDate>Tue, 15 Nov 2011 20:17:31 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Game Design]]></category>
		<category><![CDATA[free-to-play]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1532</guid>
		<description><![CDATA[It&#8217;s pretty clear that free-to-play games are the way to go if you care about making money from your games. And don&#8217;t give me that line about being indie and not caring about the money. On the contrary, being able &#8230; <a href="http://gamesfromwithin.com/designing-good-free-to-play-games">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s pretty clear that <a href="http://blog.flurry.com/bid/65656/Free-to-play-Revenue-Overtakes-Premium-Revenue-in-the-App-Store">free-to-play games are the way to go</a> if you care about making money from your games. And don&#8217;t give me that line about being indie and not caring about the money. On the contrary, being able to make money from the games we love to make, allows us to keep doing what we&#8217;re passionate about.</p>
<p>I was having a discussion today about free games with other developers and I thought I would post here some random thoughts and open it up for discussion.<span id="more-1532"></span>Free-to-play (or freemium&#8211;even if they aren&#8217;t exactly the same, I&#8217;m bundling them all under the same category for this discussion), have have a fairly bad reputation, and they&#8217;ve been under fire recently from developers. It&#8217;s true that a lot of those games have been rather poor from a game design point of view, while raking in loads of money from players who are apparently happy to play them.</p>
<p>It&#8217;s important to separate the financial model (free with other ways for players to spend money in-game), and the quality of those early games or the intentions behind them. I am convinced that free games is the future of mass-market games (it&#8217;s already pretty much the present, so that&#8217;s not much of a stretch). </p>
<p>There&#8217;s no doubt that the financial model of game affects its design. Compare arcade games, retail console games, and subscription-based games just as an example. Free-to-play has a huge impact on the design as well. </p>
<p>Free-to-play games are in their infancy. Not only are they a relatively recent happening, but they were also wildly successful, which encouraged a lot of copying and not much innovation. So they&#8217;re stuck in a type of design that results in a local maximum of profit, while providing a not very satisfying experience for a lot of players.  As game developers, we need to find out how to make great games while using the free-to-play model.</p>
<p>I&#8217;ve been going around this quite a bit recently, because I&#8217;m in the stages of deciding what my next game is going to be. The reality of the App Store are pushing me towards free-to-play, but I&#8217;m not interested in making a Farm/Store/Pet game.</p>
<p>These are my random thoughts on what we can charge for in a free game and how it affects game design:</p>
<ul>
<li><b>Reduce delays</b>. This is very effective, but feels cheap and somewhat manipulative (yes, this is coming from the guy who did <a href="http://www.snappytouch.com/flowergarden">Flower Garden</a>&#8230; but that was before IAPs and the whole point of the game was the nurturing/waiting part). It also falls in the category of the question I often ask myself: If I remove this from the game, will it be better or worse? The answer is (almost) always &#8220;better&#8221; by removing those delays.</li>
<li><b>In-game currency</b>. This is seems like a better approach as long as there&#8217;s no competitive multiplayer. However, it does wreck havoc with the game balance. Either it becomes too easy and not fun for those who paid, or boring and grindy for those who didn&#8217;t. Still, especially on mobile, it&#8217;s not a totally bad way to go. You&#8217;re letting people make a choice how they want their experience.</li>
<li><b>Extra content</b>. That seems to be the traditional, developer-approved way to go. PC and console games have been doing that with DLCs for a long time. The main problem is that not many players want that content, the amount of content you can sell is limited, and it often requires a lot of extra effort to generate.</li>
<li><b>Extra choices</b>. This includes different characters, clothes, weapons, etc. I see this as the sweet spot between the last two options. What you buy doesn&#8217;t completely throw off the game curve, but it&#8217;s also not just new levels or missions. Combine that with letting players earn credits to get those choices (by grinding if they want to, but it&#8217;s all optional) and it seems like a good way to go. You can also go the way of <a href="http://na.leagueoflegends.com/">League of Legends</a> (which I have yet to play!) and you can rotate in that extra content for limited amounts of time, so players get a taste and they have the option of buying them permanently.</li>
<li><b>Cheats</b>. By cheats I mean more lives, rewind/replay, invulnerability, etc. It feels like a throwback to the arcade days. Some players will be put off by it (either by the fact it exists, or by the fact that they finished the game too quickly with the help of those cheats), but it can work in the right game. You&#8217;d probably want to do something about high scores, like putting players who used those cheats in a different leaderboard.</li>
</ul>
<p>What are your thoughts on this? What are some other ways that players can pay for in free games and still allows us to make a great game?</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/designing-good-free-to-play-games/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Duplicating Launchboard Wobble</title>
		<link>http://gamesfromwithin.com/duplicating-launchboard-wobble</link>
		<comments>http://gamesfromwithin.com/duplicating-launchboard-wobble#comments</comments>
		<pubDate>Fri, 30 Sep 2011 19:04:45 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[flower garden]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1524</guid>
		<description><![CDATA[One of the most requested features for Flower Garden is to be able to move pots around. Not only do players want to group similar flowers or colors together, but they also want to be able to take advantage of &#8230; <a href="http://gamesfromwithin.com/duplicating-launchboard-wobble">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the most requested features for Flower Garden is to be able to move pots around. Not only do players want to group similar flowers or colors together, but they also want to be able to take advantage of the properties of the different gardens. I figured the best thing to do this is by mimicking the wobble on the iPhone launchboard icons when you enter edit mode.<span id="more-1524"></span>I have to say, I&#8217;m not a huge fan of the wobble movement, but it does indicate that icons are &#8220;loose&#8221; and movable. And since most players are already familiar with that metaphor, and the overhead view of Flower Garden resembles the launchboard quite a bit (not coincidence), I might as well go with it.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/09/garden02.jpg" alt="Garden02" border="0" width="250" height="375" /></div>
<p>Each pot is a UIButton with a custom image (<a href="http://gamesfromwithin.com/opengl-and-uikit-demo">rendered from OpenGL into an off-screen target</a>). So when I enter edit mode, I need to wobble them like the launchboard. Easier said than done.</p>
<p>I searched online and <a href="http://twitter.com/#!/noel_llopis/status/119795265069785088">asked on Twitter</a>, but surprisingly, nobody had done a perfect, reverse-engineering of the wobble movement. Most mentions just do a z rotation on a sine wave, which is not that close of the launchboard animation.</p>
<p>I found that to get closer to the real thing, you need to do that rotation around a random point offset from the center. That&#8217;s better, but it&#8217;s still not perfect. There&#8217;s an additional extra twitch in the original Apple animation. I&#8217;d love it if someone already reverse-engineered it and has a better model for that animation.</p>
<p>In the meanwhile, I figured I would share the core I&#8217;m using. It&#8217;s all very straightforward, except for the part about rotating a UIView around a different point other than the center. I initially thought I could just concatenate transforms, but no matter how you do it, UIKit always interprets the transform around the center. </p>
<p>To be more precise, it interprets the rotation around the anchor point, and that&#8217;s what you need to modify. The anchor point is defined in units that are a percentage of the layer&#8217;s size, so by default it&#8217;s 0.5, 0.5. When you move the anchor point, the layer itself will move, so you need to fix it up by moving the layer&#8217;s position by the same amount in the opposite direction.</p>
<p>This is what the final code looks like:</p>
<pre>
void StartPotWobble(UIButton* button, Random&#038; random)
{
	const Range posOffset(0.10f, 0.2f);
	const float amplitude = random.GetFloat(1,1.5f);
	const Vec2 startCenter(Sign(random.GetFloat(-1,1))*random.GetFloat(posOffset), Sign(random.GetFloat(-1,1))*random.GetFloat(posOffset));
	const Vec2 endCenter(Sign(random.GetFloat(-1,1))*random.GetFloat(posOffset), Sign(random.GetFloat(-1,1))*random.GetFloat(posOffset));

	CGPoint center = button.center;
	button.layer.anchorPoint = CGPointMake(0.5f + startCenter.x, 0.5f + startCenter.y);
	CGRect bounds = button.bounds;
	button.layer.position = CGPointMake(button.layer.position.x + bounds.size.width*startCenter.x,
									button.layer.position.y + bounds.size.height*startCenter.y);
	button.transform = CGAffineTransformMakeRotation(-amplitude*DegToRad);

	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationRepeatAutoreverses:YES];
	[UIView setAnimationRepeatCount:FLT_MAX];
	[UIView setAnimationDuration:0.12];
	[UIView setAnimationDelay:random.GetFloat(0,0.09f)];
		button.transform = CGAffineTransformMakeRotation(+amplitude*DegToRad);
	[UIView commitAnimations];
}

void StopPotWobble(UIButton* button)
{
	[button cancelAllAnimationsRecursively];
	button.transform = CGAffineTransformIdentity;
	CGPoint anchor = button.layer.anchorPoint;
	CGPoint offset = CGPointMake((0.5f - anchor.x)*button.width, (0.5f - anchor.y)*button.height);
	button.layer.anchorPoint = CGPointMake(0.5f, 0.5f);
	button.layer.position = CGPointMake(button.layer.position.x + offset.x, button.layer.position.y + offset.y);
}
</pre>
<p>Ah yes, and I couldn&#8217;t find a way to loop the animation infinitely (without using the new UIView animation syntax), so FLT_MAX will have to do <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Any cleaner way?</p>
<p>If someone has an animation that more closely resembles the iPhone launchboard, I&#8217;d love to hear about it. Let me know and I&#8217;ll update this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/duplicating-launchboard-wobble/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Xcode 4 Trials and Tribulations</title>
		<link>http://gamesfromwithin.com/xcode-4-trials-and-tribulations</link>
		<comments>http://gamesfromwithin.com/xcode-4-trials-and-tribulations#comments</comments>
		<pubDate>Thu, 22 Sep 2011 21:55:41 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[iDevBlogADay]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1518</guid>
		<description><![CDATA[Wether you want it or not, Xcode 4 is around to stay when it comes to iOS development. I&#8217;ve been happily comfortable with Xcode 3 for quite a while, and my first impressions of Xcode 4 left me completely cold. &#8230; <a href="http://gamesfromwithin.com/xcode-4-trials-and-tribulations">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wether you want it or not, Xcode 4 is around to stay when it comes to iOS development. I&#8217;ve been happily comfortable with Xcode 3 for quite a while, and my first impressions of Xcode 4 left me completely cold. However, support for Xcode 3 will soon go away, so I need to get ready for the inevitable transition. Maybe I was just having a bad day when I looked at Xcode 4 for the first day. Or maybe my nightmares finally came true and I&#8217;ll be forced to look for an alternative IDE. Which one is it? Read on to find out.<span id="more-1518"></span>To put all the whining and complaining that&#8217;s about to come in perspective, I want to build some character references first. I&#8217;ve been programming for 27 years, 13 of those professionally in the games industry, although the non-professional years I probably did just as much coding. I have used everything from emacs + make files to the gamut in IDEs: Turbo C++, Visual Studio, KDevelop, and Xcode 3 among others.</p>
<p>Contrary to popular belief, I&#8217;m not that picky when it comes to a development environment. Or at least, it doesn&#8217;t feel that way to me. I want the basics, that&#8217;s all. Doesn&#8217;t everybody want this?</p>
<ul>
<li>Have 2-3 source code windows opened side by side.</li>
<li>Build and see the output.</li>
<li>Do everything with keyboard shortcuts.</li>
</ul>
<p>There are lots of other things I want (project configuration, debugging, run tests), but those are the ones I&#8217;m doing 99% of the time. I never had a problem doing any of those things with past development environments.</p>
<h2>The hit list</h2>
<p>Having more tools and options is great. I love having the option to do advanced operations on my code, but I want to decide when to use those tools, not being bombarded by them. That, in a single sentence, is why Xcode 4, out of the box, is completely unusable for me.</p>
<p>Attempting to do something as simple as type code and build it is extremely frustrating. Xcode will react to me doing that by flashing all sorts of stuff on screen, bring up sidebars with messages, change which source files are displayed, draw squiggles all over my code, and flash alerts overlays. All of that, while not showing me the build output.</p>
<p>Working on Xcode is an extremely noisy (visually) and distracting experience. I understand it&#8217;s trying help me, but it&#8217;s failing miserably at it. I&#8217;m trying to concentrate on what the code does, and I feel I have a parrot yelling stuff from my shoulder and flapping in front of the screen in some misguided attempt to help me code better. </p>
<p>That might work for some people, but not for me. I&#8217;m the guy who turns off &#8220;spell check as I type&#8221; everywhere because I don&#8217;t want to be taken out of flow while I&#8217;m typing (I&#8217;ll do a spell checking pass later on, thank you). I don&#8217;t have notifications on my mail or Twitter; I check them explicitly when I want to. Now take that kind of annoyances and multiply it times 10 and you start getting an idea of what working on Xcode 4 is like. Xcode 4 feels like it&#8217;s squarely designed for the texting/ADD generation.</p>
<p>Fortunately, most of it can be remedied and turned into a half-way sane environment.</p>
<p>Here&#8217;s how to tame the noise in Xcode 4:</p>
<ul>
<li>Autocomplete is one of the worst offenders. Turn it off! Good autocomplete is awesome, but I&#8217;d rather ask for it (with a keystroke) than have it bombard me constantly. Not just that, but it&#8217;s so badly implemented that it will a) put shadows on top of the text I&#8217;m typing b) replace the text I&#8217;m typing on the fly so I can&#8217;t even see what I typed (see screenshot below). Off with it!</li>
<p><img style="display:block; margin-left:auto; margin-right:auto;" src="http://gamesfromwithin.com/wp-content/uploads/2011/09/autocomplete.png" alt="Autocomplete" title="autocomplete.png" border="0" width="600" height="204" /></p>
<li>
<p>Having the whole screen flash with squiggles on and off while I&#8217;m typing isn&#8217;t helping in any way. Xcode is trying to &#8220;highlight instances of selected symbol&#8221;, which is a really useful tool, but not while I&#8217;m typing/thinking! Not just that, but half the time it will add extra squiggles to the screen to make sure I can&#8217;t even read the symbols themselves. So off with that one too.</p>
<p><img style="display:block; margin-left:auto; margin-right:auto;" src="http://gamesfromwithin.com/wp-content/uploads/2011/09/squiggles.png" alt="Squiggles" title="squiggles.png" border="0" width="430" height="38" /></p>
<p>Here&#8217;s one very frustrating thing: When I turn off the option to automatically highlight instances of the selected symbol from the settings, I lose the ability to do that at all. Yes, you heard that right: I can&#8217;t (as far as I can tell) press a key and have the IDE highlight all the instances on demand. No sir, that&#8217;s not the way it was intended.</p>
<li>Continuing with the theme of noise and distractions, having a sidebar popup and start showing me errors with my code as I&#8217;m typing is also definitely NOT helping. Fortunately we can turn off &#8220;Show live issues&#8221; in the general settings.</li>
<li>One thing that Xcode 4 appeared to have gotten right is the idea of showing multiple source files at the same time. Now many IDEs do that by default these days, so that was a plus. Unfortunately, it&#8217;s part of the &#8220;smart&#8221; assistant. As a general rule, I end up turning off anything with the word &#8220;smart&#8221; in it, and this is no exception. The assistant tries to present &#8220;relevant&#8221; files to the one I&#8217;m working on. No, no, no, no! *I* want to decide what to display and what to work on. Just get out of the way and let me do that easily. You can turn off the view to &#8220;Manual&#8221;, which helps a huge amount.
</ul>
<p>Just those changes make Xcode 4 into something that at least I can type into and not get sick at my stomach. We&#8217;re making progress.</p>
<p>Now I can finally build and&#8230; everything goes wrong. Xcode doesn&#8217;t show me the build output and it decides to flash a &#8220;build completed&#8221; screen overlay in case I looked away in the two seconds it took to build. Seriously? Maybe my attention was drawn into some of the flashing squiggles and I forgot it was building.</p>
<p><img style="display:block; margin-left:auto; margin-right:auto;" src="http://gamesfromwithin.com/wp-content/uploads/2011/09/alert.png" alt="Alert" title="alert.png" border="0" width="363" height="213" /></p>
<p>Fortunately for my sanity, it&#8217;s possible to fix both those things. The alert is easy: Go to behaviors, &#8220;Build succeeds&#8221; and turn off &#8220;Show bezel alert&#8221; (make sure it&#8217;s off for all the others while you&#8217;re there).</p>
<p>The other one is a bit trickier, but it&#8217;s certainly possible. Set up the &#8220;Build starts&#8221; behavior to open a named tab and go to the current log. Like this:<br />
<img style="display:block; margin-left:auto; margin-right:auto;" src="http://gamesfromwithin.com/wp-content/uploads/2011/09/behaviors.png" alt="Behaviors" title="behaviors.png" border="0" width="600" height="554" /></p>
<p>Now when you build your project, you&#8217;ll get to see something sane like this. It might initially be as a tab, but you can drag that out and make it into a separate window of its own so it doesn&#8217;t obscure the source code window:<br />
<img style="display:block; margin-left:auto; margin-right:auto;" src="http://gamesfromwithin.com/wp-content/uploads/2011/09/build.png" alt="Build" title="build.png" border="0" width="600" height="344" /></p>
<p>You should be able to navigate through any issues found during the build with Cmd + &#8216;, or, if you like the fancy issue display, press Cmd + 4. Things are so much better when you initiate them on demand rather than when they&#8217;re forced on you!</p>
<p>Finally, a couple minor UI annoyances that are easily fixed:</p>
<ul>
<li>The toolbar is positively huge. I feel crammed in the high-res 15&#8243; MBP (1680 x 1050), so I can&#8217;t imagine how anyone works with something smaller. In any case, hiding the toolbar helps tremendously. As a bonus, the setting is per window, so your source code windows get the extra real estate, but the build output window keeps the toolbar so you have easy access to changing the target platform.</li>
<li>Line wrap is on by default. Seriously? Off.</li>
</ul>
<h2>The suck list</h2>
<p>If that was everything, I&#8217;d be happy. It means that even though Xcode 4 ships with retarded defaults, it can be whipped into shape into something usable. Unfortunately, there are a two major things I haven&#8217;t found a workaround for:</p>
<ul>
<li>
<p>Can&#8217;t build a single file. Someone at Apple, in their infinite wisdom, decided that building a single file was obsolete with the awesome new feature of &#8220;show live features&#8221;. Except that &#8220;show live features&#8221; sucks and has to be turned off. Apparently you either take it their way, or the highway, because there isn&#8217;t an alternative. As with the case of highlighting symbol instances, there isn&#8217;t a command I can use to &#8220;show live features&#8221; on demand.</p>
<p>The alternative is doing a full build. Most of the time that&#8217;s fine, but whenever you&#8217;re doing one of those refactorings that breaks half the codebase, then you&#8217;re really screwed. The only way I can stay focused in a case like that is by cleaning up one file at the time, but this makes it impossible as you keep getting errors from all over the codebase. And as you fix one, the first error in the next build might be in a different file. Very annoying to say the least, especially because this was working and they removed it on purpose. I never file radar bugs (long story), but I made an exception just for this.</p>
</li>
<li>
<p>Build configurations and schemes. Did you notice that when you built the project earlier there was no option to choose debug vs. release or some other configuration? That&#8217;s another one of those decisions that make you wonder if Apple uses Xcode to manage their own projects (and if they do, what kind of developers or projects they have).</p>
<p>They turned something simple like project configurations that nobody ever complained about, into something byzantine worthy of some of the best efforts from Redmond. This gets the award for &#8220;most complicated feature nobody needed or wanted&#8221;. It seems now we have an extra layer of indirection. So you act on a scheme, which then decides which configuration to build and what to do. That&#8217;s why there are &#8220;Build for analysis&#8221; (debug), &#8220;Build for running&#8221; (release), &#8220;Build for testing&#8221; (WTF?), &#8220;Build for archiving&#8221; (distribution?).</p>
<p>After spending some time with it, I&#8217;m still confused how I would go about running the release configuration, or how to mass-edit all the schemes at once (every target seems to get a different scheme).</p>
<p>The whole schemes thing leaves me completely speechless, and that vein on the side of my forehead is pulsating just from thinking about it, so let&#8217;s just move on.</p>
</li>
</ul>
<h2>The good</h2>
<p>After you take the time to fix Xcode 4 into something usable, and (somehow) put up with the new broken features, is there something to like?</p>
<p>I had to dig deep, but I found a couple of things that I like better than Xcode 3:</p>
<ul>
<li>Much better project settings UI: Multiple panes, showing multiple values for different configurations, etc. Way better than Xcode 3.</li>
<li>Better semantic analysis. During the build process, Xcode 4 was able to correctly flag some problems in my code that Xcode 3 never warned me about. Mostly to do with constness of parent-scope variable when using blocks.</li>
<li>Better keyboard shortcut support for opening files in different windows (assistant pressing the Option key). I never found a way to open a file in a specific window in Xcode 3 without having to use the mouse.</li>
</ul>
<p>And that&#8217;s pretty much the whole good list that I was able to find <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' /> </p>
<h2>Conclusion</h2>
<p>Xcode has been progressively evolving from version 1 until version 3.2. I have no doubt that&#8217;s the reason for some of the quirks in the later versions. Xcode 4 seems to be a total re-design and re-implementation, and suffers from the classic <a href="http://en.wikipedia.org/wiki/Second-system_effect">second system effect</a>. It&#8217;s change for the sake of change, most of the time scrapping useful features and not offering useful alternatives. </p>
<p><img style="display:block; margin-left:auto; margin-right:auto;" src="http://gamesfromwithin.com/wp-content/uploads/2011/09/lawn.jpg" alt="Lawn" title="lawn.jpg" border="0" width="400" height="299" /></p>
<p>I&#8217;m sure I only scrapped the surface of the horrors of Xcode 4 in the day I spent with it. I didn&#8217;t look very closely at the debugger or the Interface Builder (saving those for another day). I keep hearing about developers with stability problems with Xcode, although I didn&#8217;t run into any crashes (but I hardly did any real work with it).</p>
<p>Overall, my recommendation is that, if you&#8217;re comfortably working on Xcode 3, stay as far as possible from Xcode 4. We&#8217;ll all be forced to move there sooner or later, but in the meanwhile you can continue being productive. Maybe by the time they discontinue Xcode 3, Xcode 4 will have improved a bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/xcode-4-trials-and-tribulations/feed</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Quick Notes On Lion</title>
		<link>http://gamesfromwithin.com/quick-notes-on-lion</link>
		<comments>http://gamesfromwithin.com/quick-notes-on-lion#comments</comments>
		<pubDate>Wed, 21 Sep 2011 23:01:18 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1501</guid>
		<description><![CDATA[A couple of days ago I had the misfortune of getting back home to find my 6 month-old MacBook Pro completely dead (my second Apple laptop casualty in three years&#8211;not a great track record). Long story short, the Apple Store &#8230; <a href="http://gamesfromwithin.com/quick-notes-on-lion">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://gamesfromwithin.com/wp-content/uploads/2011/09/Mac-OS-X-Lion.png" alt="Mac OS X Lion" title="Mac-OS-X-Lion.png" border="0" width="210" height="210" style="float:right;" />A couple of days ago I had the misfortune of getting back home to find my 6 month-old MacBook Pro completely dead (my second Apple laptop casualty in three years&#8211;not a great track record). Long story short, the Apple Store wasn&#8217;t able to help me in any way other than ship out the laptop for repairs. Since without it I&#8217;m dead on the water, I bought a 17&#8243; MacBook Pro on the spot. They didn&#8217;t have one with SSD hard drive, so this is most likely going back to the store when I get back my repaired laptop. In the meanwhile, I can continue working and it lets me check out first hand Lion and Xcode 4.</p>
<p>These are mostly quick notes to myself so I remember what to change when I upgrade my main machine, but I thought other developers hesitant to upgrade to Lion might find it useful as well.<span id="more-1501"></span><br />
<h2>Things that had to go</h2>
<p>I found Snow Leopard (and Leopard before it) to be very palatable out of the box. I don&#8217;t remember any things I absolutely had to do. Lion, however, had some questionable defaults. Or at least, ones that I just can&#8217;t take.</p>
<p>After making these changes, Lion was quite usable:</p>
<ul>
<li>Turn off &#8220;natural&#8221; scroll direction. The fact that before you can run Lion for the first time it forces you to scroll that way should be a tip off that people aren&#8217;t ready for this one yet. Maybe in a few years it will make sense to have it as the default, but now it&#8217;s just against every single computer out there (including most Macs).</li>
<li>
<p>Autocorrect. This is not an iPhone. It *has* a perfectly fine keyboard. Thank you.</p>
</li>
<li>
<p>Setting up Spaces. Oh, excuse me, Mission Control (sigh). This is the one I was really afraid of. I absolutely rely on having about 8 spaces (2 monitors in each) open at all times and swapping with a keystroke. That&#8217;s something that I&#8217;ve been using for many years (first in Linux, then hacked onto Windows XP, and finally in Leopard/Snow Leopard). I just absolutely have to have that.</p>
<p><b>Update:</b> There are still a couple annoying things with the new setup. You can&#8217;t see the number of the desktop you&#8217;re currently on, like you did with earlier versions of OS X. <a href="https://twitter.com/#!/daniel_collin/status/116889821707902976">Daniel Collin</a> pointed me to an <a href="http://stackoverflow.com/questions/6768684/osx-lion-applescript-how-to-get-current-space-from-mission-control">interesting thread on StackOverflow</a> where people are discussing how to get access to desktop numbers. Give it a few more weeks. Also, when you restart the computer, Lion is smart enough to restore all the apps to their last state&#8230; except that they&#8217;re all opened in the first desktop, not in the one they were when the system restarted. How difficult would that have been? Here&#8217;s hoping it&#8217;s fixed in a <strike>patch</strike>update soon.</p>
<p>The good news is that it&#8217;s possible to set up Lion that way. The bad news is that by default, it&#8217;s quite far from that. Bring up Mission Control and create by hand as many desktops as you want. Then go to System Settings | Keyboard | Keyboard Shortcuts and turn on one for each desktop. And for the love of god, please go to Mission Control settings and turn off &#8220;Automatically rearrange spaces based on most recent use&#8221;. Clearly Apple doesn&#8217;t think people want to go to a space directly, and instead prefer to browse them one at the time.</p>
</li>
</ul>
<p>The next few changes just made my experience better, but they&#8217;re not absolutely musts:</p>
<ul>
<li>This might sound dumb, but Finder didn&#8217;t have a good way to easily browse my files. Instead, it has this weird &#8220;All My Files&#8221; view that jumbles together all your junk there. I have no idea who thought that was a good idea. Maybe Apple is trying to wean users from browsing around the file system. In any case, you can drag your home directory to the sidebar in Finder and that makes it much easier to browse. While you&#8217;re at it, turn off the &#8220;Hide extensions in files&#8221; dumb setting.</li>
<li>
<p>Having used a Mac for several years, I&#8217;m much more sensitive to ugly UI elements. That&#8217;s why it&#8217;s so weird that, by default, Lion has the sidebar font in all programs just very slightly larger than the regular system font. Fortunately I wasn&#8217;t the <a href="http://navinpeiris.com/2011/07/23/os-x-lion-change-finder-sidebar-font-size/">only one bothered by that and it&#8217;s an easy fix</a>.
</ul>
<p>That&#8217;s about it. Lion is not very nice and usable (i.e. looks like Snow Leopard). You have that weird &#8220;full screen&#8221; button on the top right of all windows, but that&#8217;s much better ignored (which funny that, was the feature Apple really pushed in their PR for Lion). I have no idea why anyone would want to use that other than the usual word processor that blocks out everything else. If I want to have crippled multitasking, I&#8217;ll just use the iPad.</p>
<h2>Good things about Lion</h2>
<p>So far, if all I&#8217;m going to do is disable new features so it looks like Snow Leopard, is there there any reason to upgrade to Lion? I surprised myself, but the answer is yes (although they&#8217;re all very, very minor).</p>
<ul>
<li>Resize a window in any corner and cursor feedback (finally, only 20 years late to the party).</li>
<li>Perfect contact and calendar syncing with Google. I can&#8217;t tell you how much I appreciate that. I use Google as the backend for all my mail, calendar, and contacts. With Snow Leopard you could sync them, but you had to do some digging and mess around with the sync program. With Lion it works out of the box. Totally awesome. That alone makes it worth the upgrade.</li>
<li>Much improved Mail UI: Better layout, better shortcuts, better conversation view, and, my favorite by far, finally an Archive command for Gmail. Archive doesn&#8217;t exactly do the same as archiving in Gmail, but it&#8217;s close enough. Finally I can have two different keyboard shortcuts: One for trashing an email and another one for archiving it.</li>
<li>The jury is still out on how Lion restores the application state when you launch an app. I&#8217;ve been pleasantly surprised a couple of times, and annoyed a couple other times that I had to close a bunch of useless tabs. Maybe there&#8217;s a shortcut like Shift + Cmd + Q that quits and app without saving state? That&#8217;d be handy (OK, that one is not it <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Oh wow, it&#8217;s Option + Cmd + Q! I love it when something makes sense like that and you can guess it. OK, so that makes this feature very cool.</li>
<li>Slightly improved Safari (better download management). I really don&#8217;t see a reason to use Firefox or Chrome when you can use the preinstalled Safari. But then again, I can&#8217;t stand web UIs and I use native clients for lots of things.</li>
</ul>
<h2>Must-have apps</h2>
<p>It&#8217;s actually quite refreshing to use the bare minimum number of extra apps beyond what comes with the OS. But there are some apps I just have to have in order to do anything. The main two are <a href="https://agilebits.com/products/1Password">1Password</a> and <a href="http://www.alfredapp.com/">Alfred</a>. I can&#8217;t recommend them highly enough. They completely change how I work and make me ten times as productive (you&#8217;ve probably noticed by now that I&#8217;m not a mouse person).</p>
<p>After those two awesome super-apps, is the second tear of very useful ones: <a href="http://selfcoded.com/app/justnotes/">JustNotes</a>, <a href="http://culturedcode.com/things/">Things</a>, and <a href="http://www.barebones.com/products/textwrangler/">TextWrangler</a>.</p>
<p>Probably <a href="http://www.dropbox.com/">Dropbox</a> should be there somewhere, but for some reason, I still haven&#8217;t felt the need to use it heavily. I know some people put almost everything on Dropbox and can use across computers. Maybe it&#8217;s because I only have one that I haven&#8217;t felt the need for it too much. 1Password and Things both sync from the iPhone so it was really handy restoring all my data. I probably could have done the same thing with Dropbox.</p>
<p><br/></p>
<p>Tomorrow I&#8217;ll post similar quick notes about Xcode 4. Those might not be quite as positive though.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/quick-notes-on-lion/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>URL Shorteners In Under Two Minutes</title>
		<link>http://gamesfromwithin.com/url-shorteners-in-under-two-minutes</link>
		<comments>http://gamesfromwithin.com/url-shorteners-in-under-two-minutes#comments</comments>
		<pubDate>Fri, 26 Aug 2011 17:26:09 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Game tech]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[flower garden]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1488</guid>
		<description><![CDATA[This morning I added the goo.gl URL shortener to Flower Garden, so I thought a quick post with sample code might be helpful for other developers looking to do something similar. I use the URL shortener in Flower Garden to &#8230; <a href="http://gamesfromwithin.com/url-shorteners-in-under-two-minutes">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This morning I added the goo.gl URL shortener to Flower Garden, so I thought a quick post with sample code might be helpful for other developers looking to do something similar.</p>
<p>I use the URL shortener in Flower Garden to send bouquets through SMS. Space is limited in a text message, so the message just contains some text explaining what is it and the URL pointing to the bouquet image. (Yes, I would much rather send them through MMS, but Apple isn&#8217;t exposing that yet to developers).</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/08/sms.png" alt="Sms" border="0" width="280" height="231" /></div>
<p>In this case, the full URL is <a href="http://flowers.snappytouch.com/sms.php?id=949618b4b3c6f3d76e32b45446e238a0">http://flowers.snappytouch.com/sms.php?id=949618b4b3c6f3d76e32b45446e238a0</a> which gets thankfully shortened to <a href="http://goo.gl/IV5cq">http://goo.gl/IV5cq</a>.<span id="more-1488"></span>
<p>Sending bouquets through SMS has been in Flower Garden for several months, but it was using bit.ly before, which is probably the most popular URL shortener out there. I like their web interface and their super-easy to use API, but unfortunately it seems that I hit some mysterious API limit during the Mother&#8217;s Day Flower Garden promotion. That limit isn&#8217;t public anywhere, and as far as I can tell, I can&#8217;t even see it myself through the web interface or through an API query.</p>
<p>Finding out that I reached the API limit was quite shocking, because sending bouquets through SMS isn&#8217;t a particularly popular feature. Unfortunately I don&#8217;t have <a href="http://gamesfromwithin.com/analytics-for-ios-games">good analytics hooked up to that step</a>, but I can&#8217;t imagine there were more than a few thousand per day.</p>
<p>They were very nice and contacted me instead of shutting down my account since it was just a spike. They also tried to sell me their &#8220;Enterprise&#8221; account, but $995/month is a tad too expensive for me. By about $990 probably, so I had to look for other options.</p>
<p>After a very quick research, <a href="http://googlesystem.blogspot.com/2011/01/api-for-google-url-shortener.html">goo.gl</a> was the perfect alternative. Not only is it very fast (and backed up by the giant Google no less), but they have an API limit of 1,000,000 queries/day. If I ever blow that budget, I&#8217;ll be able to afford the $995/month without a problem <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>All URL shorteners are very easy to use. You need an API key, and figure out the exact format of the HTTP message you send and the response you get.</p>
<h3>goo.gl</h3>
<p><a href="http://goo.gl">Goo.gl</a> has a great <a href="http://code.google.com/apis/urlshortener/v1/getting_started.html">Getting Started Guide</a> that tells you everything you need to know. Get your private API key from <a href="https://code.google.com/apis/console">here</a>, and you&#8217;re ready to rock.</p>
<p>Drop this in your app and start shortening away. You&#8217;ll notice I used a synchronous HTTP request, which is usually a big no-no. Here I felt it was justified since the user is blocked waiting for the SMS to be prepared and sent. Besides, goo.gl is very, very fast, so it&#8217;s never even noticeable.</p>
<pre>
const NSString* GooGlAPIURL = @"https://www.googleapis.com/urlshortener/v1/url?key=YOUR_API_KEY_HERE";

NSString* ShortenURLWithGooGl(NSString* longURL)
{
	NSURL* apiUrl = [NSURL URLWithString:GooGlAPIURL];

	NSMutableURLRequest* req = [[NSMutableURLRequest alloc] initWithURL:apiUrl];
	[req setHTTPMethod:@"POST"];
	[req setTimeoutInterval:Timeout];
	[req setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

	NSString* body = [[NSString alloc] initWithFormat:@"{\"longUrl\": \"%@\"}", longURL];
	[req setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
	[body release];

	NSError* error = [[NSError alloc] init];
	NSHTTPURLResponse* urlResponse = nil;
	NSData* data = [NSURLConnection sendSynchronousRequest:req returningResponse:&#038;urlResponse error:&#038;error];
	[error release];
	if (data == NULL || ([urlResponse statusCode] < 200 &#038;&#038; [urlResponse statusCode] >= 300))
		return NULL;

	NSString* response = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
	NSDictionary* responseDict = [response JSONValue];
	NSString* shortURL = [[responseDict objectForKey:@"id"] retain];
	[response release];
	return shortURL;
}
</pre>
<p>I&#8217;m using a <a href="https://github.com/stig/json-framework/">JSON framework</a> to parse the answer, but it&#8217;s so simple I probably wouldn&#8217;t even have to. I only used it because it&#8217;s already part of the project because of <a href="https://developers.facebook.com/docs/guides/web/">Facebook Connect</a>.</p>
<h3>bit.ly</h3>
<p>Even though it&#8217;s not my favorite shortener, I&#8217;m adding it here for completeness (and because I had the code already written).</p>
<p>The one thing that bit.ly has going for it is that it&#8217;s even easier to use than goo.gl. No JSON involved, and you don&#8217;t even need to send a body with your request. As usual, get your API key by <a href="http://bitly.com/a/sign_up">signing up with bit.ly</a>.</p>
<pre>
const NSString* BITLYAPIURL = @"http://api.bit.ly/v3/shorten?login=%@&#038;apiKey=%@&#038;format=txt&#038;";

NSString* ShortenURLWithBitLy(NSString* longURL)
{
	NSString* urlWithoutParams = [NSString stringWithFormat:BITLYAPIURL, LoginName, APIKey];
	CFStringRef encodedParamCF = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
															 (CFStringRef) longURL,
															 nil, (CFStringRef) @"&#038;+", kCFStringEncodingUTF8);
	NSString* encodedURL = (NSString*)encodedParamCF;
	NSString* parameters = [NSString stringWithFormat:@"longUrl=%@", [encodedURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
	NSString* finalURL = [urlWithoutParams stringByAppendingString:parameters];

	NSURL* url = [NSURL URLWithString:finalURL];

	NSMutableURLRequest* req = [[NSMutableURLRequest alloc] initWithURL:url];
	[req setTimeoutInterval:Timeout];

	NSHTTPURLResponse* urlResponse = nil;
	NSData* data = [NSURLConnection sendSynchronousRequest:req returningResponse:&#038;urlResponse error:NULL];
	if (data == NULL || ([urlResponse statusCode] < 200 &#038;&#038; [urlResponse statusCode] >= 300))
		return NULL;

	NSString* response = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
	return response;
}
</pre>
<p><br/></p>
<p>That&#8217;s it. You should be able to drop in either one of those snippets in your project and spend your time working on the things that really matter in your games.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/url-shorteners-in-under-two-minutes/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Analytics For iOS Games</title>
		<link>http://gamesfromwithin.com/analytics-for-ios-games</link>
		<comments>http://gamesfromwithin.com/analytics-for-ios-games#comments</comments>
		<pubDate>Thu, 25 Aug 2011 19:08:56 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Game tech]]></category>
		<category><![CDATA[iDevBlogADay]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1481</guid>
		<description><![CDATA[Unlike a lot of console and PC games, most mobile and web games keep evolving over time [1]. It&#8217;s up to a game&#8217;s designers to ultimately decide how to change and improve the game, but the more data about players&#8217; &#8230; <a href="http://gamesfromwithin.com/analytics-for-ios-games">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Unlike a lot of console and PC games, most mobile and web games keep evolving over time <a href="#1">[1]</a>. It&#8217;s up to a game&#8217;s designers to ultimately decide how to change and improve the game, but the more data about players&#8217; habits they have, the more informed a decision they&#8217;ll be able to make. Having good analytics on iOS games is simply essential these days.<span id="more-1481"></span>Recording particular events as part of the analytics is only part of it. The most important part is how that data is presented to the developer. Having tables with millions of entries does me no good, and as a busy indie developer, I can&#8217;t afford to spend hours writing scripts to analyze it. I want something that allows me to easily visualize the data and makes sense out of it at a glance.</p>
<p>One possible snagging point about analytics is that Apple was cracking down on some applications with analytics enabled a while back. Specifically, the <a href="https://developer.apple.com/programs/terms/ios/standard/ios_standard_agreement_20110215.pdf">iOS developer agreement</a> states:</p>
<blockquote><p>
3.3.9	You and Your Applications may not collect user or device data without prior user consent, and then only to provide a service or function that is directly relevant to the use of the Application, or to serve advertising. You may not use analytics software in Your Application to collect and send device data to a third party.
</p></blockquote>
<p>Where does that leave us? Reading it carefully, it seems that the restrictions are limited to &#8220;user or device data&#8221;. I&#8217;m interpreting that to mean things like UDIDs and emails, not anonymous player usage data (how long did it take to reach level 5, how long are play sessions, etc), so I think we&#8217;re clear there. </p>
<p>The puzzling thing is that a lot (all?) of the third party analytics libraries do report device information, like what kind of hardware or iOS version is running. That is extremely important information that developers really benefit from knowing, but it seems to go against point 3.3.9. Maybe &#8220;device data&#8221; only applies to information about that specific device? (as in, <a href="http://venturebeat.com/2011/08/23/ios-5-udid-privacy/">the UDID that is now going away</a>). I hope so.</p>
<p>Not having analytics isn&#8217;t really an option. Unless you make a game that you plan to throw on the App Store, never touch again, and hope for the best, you&#8217;re flying blind without analytics. </p>
<p>What are some of the options we have then?</p>
<h3>Home brewed</h3>
<p>If you read this blog regularly, you probably know that I&#8217;m a <a href="http://gamesfromwithin.com/360idev-cranking-up-floating-point-performance-to-11">low-level</a>, do-it-myself kind of guy, with <a href="http://gamesfromwithin.com/my-fear-of-middleware">a deep mistrust and suspicion of middleware</a>. So you would think that I would want to write my own analytics package. After all, how hard can it be? Collect the data you want and ping your server with it. If you get fancy, you can even use a scalable server back end like <a href="http://aws.amazon.com/">AWS</a> or <a href="http://code.google.com/appengine/">GAE</a>. Done.</p>
<p>Not so fast. To do that well, it&#8217;s a lot more involved than that. You want to batch when you send out the information, and you might want to distinguish between WiFi and 3G connection (to avoid causing extra data usage for players on a limited data plan).</p>
<p>That in itself is not even that bad. The real pain comes in visualizing that data, and that&#8217;s where you can easily sink in days or weeks, and you would still not have something as good as some of the other alternatives. </p>
<p>The other drawback is that if you have some successful applications, you may be generating Terabytes of data per day. Think about the storage and bandwidth costs for that. Yes, I know that sounds insane, but Playfish reported generating that much analytics data at a <a href="http://www.gdcvault.com/play/1014544/Scaling-Social-Games-What-Game">GDC 2011 talk</a> (<a href="http://www.gdcvault.com/play/1014543/Scaling-Social-Games-What-Game">video for paid GDC Vault members</a>).</p>
<h3>Flurry</h3>
<p><a href="http://www.flurry.com/product/analytics/index.html">Flurry Analytics</a> appears to be the most common analytics package out there among my indie iOS dev friends. It&#8217;s free and it&#8217;s easy to integrate. The visualization page is pretty good, and it even offers some fancy features beyond session length and events, such as flow through the application.</p>
<p>So what&#8217;s not to like? I was never able to make heads or tails of the application flow. When you get at that level, you start needing to spend some serious time making sense of data, which is what I don&#8217;t have as an indie. <s>The web page to visualize the data is written in Flash, so for those of you using an iPad to check it, it&#8217;s not a good option.</s> <b>Update:</b> Flurry apparently added a Flash-free web page since I last looked at it a few months back. Thanks Charilaos Kalogirou for the tip.</p>
<p>The killer deal for me was bloat. Adding the Flurry analytics library to an app increased the executable size by 500KB. I&#8217;m sorry, but that&#8217;s completely unacceptable for me. Memory is tight, and half a MB is very significant. I would rather add another large texture or another music track. And if you think about it, why does it need 500KB to buffer and send some events? That&#8217;s simply ridiculous.</p>
<h3>Google Analytics</h3>
<p>I never actually tried out <a href="http://code.google.com/mobile/analytics/docs/iphone/">Google Analytics</a>. They have an iOS SDK and it integrates quite well into the web page Google Analytics environment. The main drawback I heard from other developers is that it&#8217;s designed more for web pages rather than for apps and games, so it wasn&#8217;t a perfect fit.</p>
<p>Anyone who used it want to expand on this in the comments?</p>
<h3>Localytics</h3>
<p><a href="http://www.localytics.com/app-analytics/">Localytics</a> is a relative newcomer to the iOS analytics field, but it was love at first sight for me.</p>
<p>It has the same ease of integration of Flurry, and it provides very similar functionality. Localytics, however, is completely open source, so instead of a black box library, you get the source code and you can add it directly to your game. How much does it increase executable size? 4KB! You have to wonder what the other 496KB were for in the Flurry library.</p>
<p>As a bonus, their visualization web page works great on an iPad, although it can be a bit slow for very large data sets sometimes.</p>
<p>One of their biggest selling points is that they report the analytics in real time, but I really don&#8217;t care one way or another. Waiting 12 or 24 hours to see the analytics doesn&#8217;t bother me one bit.</p>
<p>Unlike Flurry, you can only add strings as parameters to events. That works fine if I have a set of discrete options. For example, when someone sends a bouquet in Flower Garden, I can send a &#8220;bouquet sent&#8221; event with a parameters that is &#8220;email&#8221;, &#8220;facebook&#8221;, or &#8220;sms&#8221;. As a result, I can see a nice pie chart with the breakdown of how people are sending bouquets. Very useful stuff!</p>
<p>But how about things that don&#8217;t have discrete options? For example, in Casey&#8217;s Contraptions, we wanted to see how long players take to solve each level. It turns out you can&#8217;t have a number as a parameter, but you can easily get around that by discretizing it yourself, which in the end, is easier to visualize. So when we send the LevelXXFinished event, we look at how long the player took to finish it, and we break it down into ranges: under 30s, 30s-1min, 1min-2min, etc.</p>
<p>This is what the report looks like for one of Casey&#8217;s Contraptions levels:</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/08/piechart.png" alt="Piechart" border="0" width="380" height="317" /></div>
<p>It looks like a fairly balanced level with the majority of the people spending under 3 minutes to solve it.</p>
<p><br/></p>
<h3>Random tips</h3>
<p>A couple random things we learned along the way about analytics:</p>
<ul>
<li>Less is more. Start with just a few events and go from there. If you have tons of data, you might never have the time to look at it.</li>
<li>Use analytics during playtesting. One thing is what people tell you, and another thing is what they really do. Since most of our playtesting is done remotely and we can&#8217;t observe as people play (which is invaluable), we can at least gather some hard data about it.</li>
<li>Turn off analytics reporting in debug mode. Trust me on that one.</li>
</ul>
<p><br/></p>
<p>How about you? What&#8217;s your favorite analytics package and why?</p>
<p><br/></p>
<p><a name="1"></a>[1] For example, Flower Garden has been on the App Store for almost two and a half years, and it has changed radically in that time!</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/analytics-for-ios-games/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Casey’s Contraptions Postmortem</title>
		<link>http://gamesfromwithin.com/casey%e2%80%99s-contraptions-postmortem</link>
		<comments>http://gamesfromwithin.com/casey%e2%80%99s-contraptions-postmortem#comments</comments>
		<pubDate>Tue, 26 Jul 2011 10:42:19 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Development log]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[casey's contraptions]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1453</guid>
		<description><![CDATA[Casey’s Contraptions is an iOS game created by the two of us, Noel Llopis and Miguel Ángel Friginal. Noel, an industry veteran for over a decade, turned indie over four years ago and found success with microtransaction-based Flower Garden on &#8230; <a href="http://gamesfromwithin.com/casey%e2%80%99s-contraptions-postmortem">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/07/banner.png" alt="Banner" border="0" width="580" height="188" /></div>
<p>Casey’s Contraptions is an iOS game created by the two of us, <a href="http://twitter.com/#!/noel_llopis">Noel Llopis</a> and <a href="http://twitter.com/#!/mysterycoconut">Miguel Ángel Friginal</a>. Noel, an industry veteran for over a decade, turned indie over four years ago and found success with microtransaction-based <a href="http://www.snappytouch.com/flowergarden">Flower Garden</a> on iOS. Miguel worked as a graphic designer in the advertising industry for years before becoming a web developer. Casey’s Contraptions is his first published video game, although his first paper role-playing game came out almost 20 years ago. We met through Twitter several years ago, and then finally in person at a 360iDev conference. Even thought we didn’t plan it that way, we ended up working together during a game jam, and that set us in the path to collaborate in a future project.</p>
<p>We knew we wanted to target iOS for our next project because we love the platform from a user and a developer point of view, and because it’s a platform where it’s possible for indies to succeed financially. Beyond that, starting a new game is never easy. Even though we have page after page of possible ideas, settling on a specific game idea is always very hard. We wanted something that met three requirements: The game had to be creative in nature as opposed to using destruction as the main gameplay element, it had to be something we were excited about, and it had to be something with the potential to sell reasonably well on the Apple App Store. Easier said than done!<span id="more-1453"></span>We prototyped game idea after game idea, and even though a lot of them were not bad, none were a complete standout. Eventually, after seven or eight different prototypes, we settled on the concept of creating physics-based, Rube Goldberg-like contraptions to solve different puzzles. At its core, the game has similar mechanics to some classic games like The Incredible Machine, but with an emphasis on exploration of creative solutions rather than finding the one right answer to each puzzle, designed around sharing, and built from the ground up for a touch interface on iOS.</p>
<p>We structured this project as a pure 50-50 partnership, and without any external funding or publishers. Miguel quit his full time job (as a web programmer no less!) to do the art for Casey’s Contraptions, and Noel took care of the programming. Design was a fully collaborative activity, where we both contributed equal amounts to everything from the rules, the feel of the game, or level creation. Everything else we split up based on our strengths and expertise: web site, server back end, PR, etc.</p>
<p>This is not a true postmortem, but more of a post-launch analysis. Games today, and especially iOS and Facebook games, are becoming more of a service rather than a product. Development and launch are only the beginning of the story. If all goes well, we’ll have a lot more to say about Casey’s Contraptions in a few months.</p>
<h2>What went right</h2>
<h3>Strong theme and style</h3>
<p>Casey’s Contraptions started life without Casey! The initial prototype focused only on the creation of contraptions and the physics simulation behind it. It showed a lot of potential, but it was missing something to make it stand out. It needed more personality.</p>
<p>After some brainstorming, we quickly zeroed-in the idea of a smart 8 year old building the contraptions. Not only did that add the much-needed personality to the game, but it also focused the rest of the development. Instead of doing a physics game with generic pulleys and levers and other industrial-looking items, we naturally went with toys and household items Casey could have access to: His sister’s doll, paper planes, or his RC truck. </p>
<p>The choice of toys as game items not only influenced the level design, but also the goal of the levels. At the beginning we were thinking of doing levels to accomplish tasks Casey would have to deal with in real life, such as putting toys away or popping a balloon. After a while, the idea of “playtime” levels came up, where the setting and the goal were completely imaginary (rescue explorers from a jungle in their hot air balloon) just as Casey would have imagined during his playtime sessions.</p>
<p>The character of Casey also helped anchor the art direction. We were aiming for something that would appeal to a very wide range of people, from the very young to adult casual gamers. Although Miguel looked into everything from a most modern Cartoon Network style to manga, to crazier Warner Bros., we ended up settling with a mix of Calvin &#038; Hobbes and something out of a 50s Hanna-Barbera show, with strong outlines and solid colors, to make people of all ages feel comfortable with the visuals. We were able to carry this distinct style to all the items, locations, and user interface in the game, which gave it a very consistent and unique look.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/07/CaseyEvolution.jpg" alt="CaseyEvolution" border="0" width="500" height="500" /></div>
<h3>Social features</h3>
<p>Creating something is fun, but creating something and being able to share it with people is twice as much fun. We wanted to make Casey’s Contraptions a very social experience from the start. Not something that you played through and put away, but something you could share with friends along the way.</p>
<p>Since Casey’s Contraptions uses a full physics simulation at its core, it’s possible to come up with very unique, chaotic, and often unexpected solutions to most puzzles. Weeks after launch, we’re still amazed at how some people are solving some levels, coming up with item combinations we never thought about during development. Since these solutions are very unique and fun to watch, they were a perfect candidate to share with friends.</p>
<p>With that in mind, we designed the game with sharing from the start. After you complete each level, you can share your solution with all your friends just with the tap of a button (and, in the latest update, the default is to autosubmit a solution if you improved your score). Your friends’ solutions are equally accessible, as cropped thumbnails in the level completion screen, and tapping on any of them will bring up a full-screen view that you can even replay and watch the full solution.</p>
<p>In addition to sharing solutions, we also included a level editor to allow players to create their own contraptions from scratch. This was the same level editor we used to create all the levels in the game. Nothing like eating your own dog food to make something solid and usable. Initially, players were able to share these levels through email, and, in the first update, we also added the ability to share them publicly through a web site (http://shared.caseyscontraptions.com), effectively giving players access to hundreds of new levels.</p>
<p>As it’s the case with most games that include level editors, we were aware that only a small minority of players would take the time to create their own contraptions. But it’s also those players that are really devoted to the game, and take it upon themselves to spread the word about your game and champion it to all their friends.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/07/2.png" alt="2" border="0" width="500" height="375" /></div>
<h3>Iterative development</h3>
<p>For Casey’s Contraptions we used a very stripped down and relaxed form of iterative development. We had short iterations and in each iteration we aimed to fully implement what we considered the most important features at the time. We didn’t do any real estimating of tasks (other than, “yeah, we think we can do that in about two weeks”), and we didn’t set a hard-limit on the iteration (they varied naturally between one and a half and three weeks). The most important concept is that at the beginning of each iteration we would make decisions about what to work on next, and those decisions were made with all the knowledge leading up to that point. </p>
<p>For example, we didn’t start the project by coming up with the full list of items we were going to have in the game. Instead, we had a list on the wiki of possible items (to which we would add more whenever we thought of a new one during development), and we only decided which new items to add to the game at the beginning of each iteration. That allowed us to make good decisions based on what we had learned so far: “Most objects we have so far fall down. We need more items that add forces upwards”, or “The magnet is fun, but we need more metal items to make it more useful”.</p>
<p>This mentality applied to everything: From level creation, to menus, features, etc. Looking back, we can say there’s no way we would have made the same decisions early in the project than we did as we went along.</p>
<h3> Strong launch</h3>
<p>In less than 24 hours after launch, Casey’s Contraptions worked its way up to the top 10 paid apps in the US and in over 20 different countries. A day later, it reached the #2 overall spot in the US and had great initial weekend sales.</p>
<p>This strong launch wasn’t just pure luck. It was something we planned months in advance and worked hard to achieve (although we did need a dash of good luck). We wanted to build awareness and buzz around the game, but given the short development cycle for iOS games, we would have to do it in a shortened scale.</p>
<p>We started out by announcing the game more than six months before release (25% of the way into development). During the following months, we continued talking about the game on Twitter and our blogs, often showing work in progress or outtakes. The next big milestone was showing the game around at GDC. Not only did we get a lot of other developers to play it and give us invaluable feedback on it, but we also met with some of the game press, and that resulted in some very nice previews afterwards.</p>
<p>The final push came as soon as we submitted the game to Apple for review. We decided to set a fixed release date three weeks after the submission, which would give us enough time to do all the PR work: creating a video, putting together a media packet, contacting media outlets, etc. In the weeks leading up to the launch, we also stepped up our blogging of different interesting aspects of the game.</p>
<p>As a result of everything we had done up to that point, we were very lucky that Casey’s Contraptions attracted Apple’s attention, and they featured it prominently on launch day as iPad Game of the Week worldwide. We had given the press enough time with the game, so a lot of very positive game reviews came in right around launch day, helping get the word out for the game. </p>
<p>Even though we had been originally thinking of pricing the game at $4.99, we decided to shoot for volume instead and priced it at $2.99. That turned out to be the right decision and immediately put us on the top 10. Sales on iOS charts follow a sharp, exponential drop off, so being in the top 5 represents a huge increase in sales over just a few positions down the chart.</p>
<p>Looking at the App Store today, it’s apparent that it’s becoming harder for small, quick games to be really successful and top the charts. With over half a million different apps on the App Store, and hundreds of games released every day, you really need to stand out from the rest to be noticed. Most of the games that manage to do that are ones that required significant time and effort investment and have good production values. The App Store gold rush is over.</p>
<h3>Enough development time</h3>
<p>From start until launch, Casey’s Contraptions was in development for 8 months. That seems like a long time by iOS standards, although more and more successful iOS games are starting to take that long.</p>
<p>Our initial plan was to ship the game by Christmas. It wasn’t based on any rigorous estimating, just an off-the-cuff estimate. It just “felt” like we could be done by then. Obviously we were wrong. </p>
<p>Taking the amount of time that we did was a very positive thing. We didn’t really waste much time, it’s just that the game needed that amount of time to mature and get to where it is today. If we had chosen to ship it earlier, the final product would have suffered significantly.</p>
<p>One of the hardest things in a game like Casey’s Contraptions is making interesting levels. Having this amount of development time, with a working game editor since the very beginning, allowed us to make a lot of levels along the way. Looking back at a lot of the early levels we made, they were laughably hard and not that interesting. After several months, were able to develop a sense about what made good levels and what the appropriate difficulty was.</p>
<p>Having enough time allowed us to make fairly fundamental changes to the game design when something wasn’t working. For instance, initially each level had three different goals you could achieve. Depending on the number of goals you accomplished, you earned a bronze, silver, or gold medal. It quickly became apparent that players were  extremely confused by the three goals and weren’t able to keep them straight. </p>
<p>We changed levels to have a single goal, but since we still wanted to have some replayability beyond “solving” a level, we added optional stars you could collect by touching them with any item in the game. The first star would be very easy to get, the second one a bit harder, and the third one would require some serious thinking. That was a huge improvement, but then we discovered that most players expected to get all three stars in their first playthrough, and would stubbornly keep playing the same level until they got them all or quit in frustration. That prompted us to change the stars yet again. This time the difficulty of getting them was tied to the overall level difficulty, so players could easily get all three stars in the early levels. We’re very happy with the final design, and we would not have gotten there if the project had been rushed.</p>
<p>We also gave ourselves sufficient time at the end for polish and style. Polish isn’t going to make the game design any better, but it’s going to contribute a huge amount to first impressions. Every animation, sound, and particle effect becomes really important in those crucial first few seconds with the game. On a mobile platform, polish becomes even more crucial. If your game doesn’t immediately engage the player, there are lots of other things they can shift their attention to.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/07/CaseysContraptions08.jpg" alt="CaseysContraptions08" border="0" width="580" height="435" /></div>
<h2>What went wrong</h2>
<h3>No simultaneous iPhone launch.</h3>
<p>The initial prototype of Casey’s Contraptions was running on an iPhone. While it showed a lot of promise and it was fun to assemble contraptions even that early on, it was clearly begging for more screen space.</p>
<p>The iPad was the obvious platform of choice. Its large screen can display very nicely detailed graphics, and allows for very natural, direct manipulation of items. It was a perfect fit for Casey’s Contraptions. </p>
<p>Even so, while there are a lot of iPads out there (14 million), the iPhone and iPod Touch are the undisputed kings of the App Store (about 185 million devices). Especially for a game that relies on the social component, getting a critical mass of users playing at the same time, sharing solutions, and sending levels is very important. We definitely stormed up the iPad charts, but that still left the majority of iOS users not being able to purchase our game.</p>
<p>Why didn’t we wait until we had the iPhone version to launch? No particularly good reason other than we were itching to get the game out. We also had no idea what kind of impact a strong launch would have on our servers, so the idea of an iPad-first launch seemed like the way to go. In hindsight, we would have been better off waiting to launch both versions at the same time (or almost the same time, maybe a week or two apart at most).</p>
<p>To make up for this, we’re planning on making the iPhone release a second launch of sorts: We’ll make the iPhone version coincide with a new game update that includes a lot of new content (for free for people who already bought it), and we’ll try to repeat the same strong launch we had on the iPad. The idea is to get everybody who’s already bought the game playing again, along with all the new iPhone players and create that critical mass.</p>
<h3>Butting heads too much</h3>
<p>We make the perfect two person team: We have complementary specialties, but we also have a lot of overlapping skills. We also seem to always approach things from opposite ends: Aesthetics vs. usability, performance vs. gameplay, simplicity vs. interest, uniqueness vs. familiarity, or tea vs. coffee. That is actually a really good thing and the success of Casey’s Contraptions was in no small part due to our combination of personalities and skills.</p>
<p>There is, however, such a thing as too much of a good thing. We are both very stubborn and it will take a lot to convince us to see things in a different way. There were some times during development that we spent more time debating one point than actually implementing it.</p>
<p>The fact that we’re working remotely didn’t really affect most of our day to day development, but it definitely made hashing out these situations significantly harder, dragging them out for far longer than they should have. This was also the first time we were working together on a significant project, so it made resolving those situations more difficult. Now that we’ve gone through this first project, we’ll hopefully be better equipped to handle similar situations in the future.</p>
<h3>Unnecessary rework</h3>
<p>Rework is a necessary part of a creative process. You’re unlikely to get everything right in the first draft of a text or a music composition. That’s even more so the case for game development because there are so many parts interacting with each other. Not only is it hard to predict the exact final outcome, but even if you could, you often don’t know exactly what you want until you’ve seen one version of it.</p>
<p>Just about every screen and every item in the game went through several revisions of art, behavior, sounds, or layout. There’s no doubt that every revision made them better. However, we had a few parts of the game that we had to revise a few too many times. This was mostly in some of the UI screens, like the now infamous “level completed” screen, or the look and positioning of the in-game menu, which we must have gone through at least 6 or 7 complete redesigns. </p>
<p>We believe that design doesn’t just flow one way. If you want the best final product, you can’t just decide on the functionality of some user interface (or any part of the game for that matter), implement it, and then give it a pretty face with some graphics. Both the implementation and the graphic design will actually feed back into the functionality of the UI. Once you go around this cycle a few times, you can zero in on a very strong design, both from a functional and a design point of view.</p>
<p>The problem comes when you go around that loop too many times, or when the loop doesn’t converge into a particular design, but keeps shifting around. That was often caused because we were fuzzy on some of the details, or when we were forgetting about some particular feature that had to be reworked into the design. Some other times feedback from our testers made us realize that a screen wasn’t clear enough as we had designed it and caused us to rework it. As tempting as it was to push through and call it good enough since it was already completely done, it was always the right decision to go back and re-work things as needed.</p>
<p>For example, at the beginning of each level Casey explains what goal you need to achieve. This screen seemed straightforward enough, except that the version we had early on was blocking the view of the level while it was up. Our testers complained it was hard to remember what you had to do without seeing the items it was referring to at the same time, so the final design shows Casey’s dialog along the bottom of the screen, and the goal items are even circled with a marker.</p>
<p>We can alleviate this problem by iterating on particular pieces of UI or the game in smaller cycles, without taking each one to completion. Instead of starting by completely implementing a screen, or completely creating a perfect mock up with all the graphic elements, we need to start by laying out a screen with simple boxes and buttons and implement the basic functionality. Then we can make a first pass at a real layout and some graphical element, implement some of the new functionality and animations suggested by that, and continue iterating until it’s done. We got much better about this in the last third of development, and it’s something we want to carry forward to future projects. </p>
<p><img src="http://gamesfromwithin.com/wp-content/uploads/2011/07/LevelGoals1.jpg" alt="LevelGoals1" border="0" width="200" height="150" /><img src="http://gamesfromwithin.com/wp-content/uploads/2011/07/LevelGoals2.jpg" alt="LevelGoals2" border="0" width="200" height="150" /><img src="http://gamesfromwithin.com/wp-content/uploads/2011/07/LevelGoals3.jpg" alt="LevelGoals3" border="0" width="200" height="150" /></p>
<h3>Not enough unit-testing</h3>
<p>Noel is a big fan of unit testing and test-driven development (TDD). Those are some techniques we used in past projects to very good effect and something we definitely wanted to carry into Casey’s Contraptions as well. </p>
<p>The goal was never to have 100% unit-test coverage or write every single line of code through TDD, but to write only the tests that would benefit the project. That usually meant some code that a lot of other code relied on (the game item management), or something complicated (toolbox interaction), or something prone to breaking (rope manipulation).</p>
<p>In the end, we slipped to the side of not having as many unit tests as we would have liked. Some things like object attachments kept repeatedly giving me headaches during development because of the complicated, untested code. By the time we noticed those problems and wanted to start adding tests, it was too late because some of that code relied on non-unit test friendly APIs like UIKit or Box2d. </p>
<p>We should have taken the time when those problems started appearing to start writing some tests and slowly refactor the code as we fixed the bugs and added new features. Instead, since we seemed to be constantly “just a few months away from shipping”, we decided to skip that and definitely paid the price later on. We even shipped with a few off edge cases that we knew were buggy but we didn’t dare fix weeks before submission.</p>
<p>We’re already working on updates and and an iPhone version of Casey’s Contraptions, so we’ll continue dealing with that code for quite a while to come. We’ll slowly introduce unit tests in areas of the code that we need to revisit during this time.</p>
<h3>Fixed price model</h3>
<p>The pricing model is something we went back and forth about several times during development. In spite the long-term success of Flower Garden and other free games with microtransactions on the App Store, we chose to go with a fixed-price model for Casey’s Contraptions.</p>
<p>We thought our audience would appreciate a traditional fixed-price model better than a microtransaction-based one. We also figured it was a model that was working well for other similar iPad games such as Angry Birds or Cut The Rope, so it made sense to follow their lead on that.</p>
<p>Unfortunately it seems that might have been the wrong decision from a financial point of view. After a really strong initial launch, Casey’s Contraptions dropped down the charts very rapidly after just a few weeks. Since revenue follows a very sharp exponential drop off, even being in the top 100 iPad games means very little revenue per day, and points to a very thin “tail” to the sales curve.</p>
<p>In spite of the bad reputation microtransaction games have in traditional game development circles, they’re a lot harder to develop than single-purchase, fixed-price games. Not only do you need to implement very robust server features, but you need to finely balance the in-game economy, the pace of rewards, and the cost of new purchases. Our optimistic estimate was that it would add at least a full month to the development time (and given how our estimates were, it probably meant two months for real).</p>
<p>A possible alternative would be to have a traditionally-priced game, but offer new levels or locations as extra purchases. This would have been a lot simpler to implement, but it probably wouldn’t have made much difference in revenue. Usually, only about between 2% and 5% of the players buy any extra content, so for microtransactions to really pay off, they need to be unlimited (in-game currency, fertilizer, etc), or have a very large user base. With a small, fixed amount of possible things to buy, we would need to rely on having lots of players to make much of a difference.</p>
<p>We’re hoping releasing the iPhone version will generate lots of renewed interest in Casey’s Contraptions, spur lots of sales on both platforms, and hopefully increase the long-term chart staying power. If that’s not the case, we can always consider the possibility of experimenting by changing the pricing model in the future.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2011/07/CaseysContraptions10.png" alt="CaseysContraptions10" border="0" width="580" height="435" /></div>
<h2>Conclusion</h2>
<p>We’re extremely happy with the development of Casey’s Contraptions and with the initial launch. We managed to create a unique game around creativity that was very well received critically and from a sales point of view. </p>
<p>The first free update should be available by the time you read this. It adds the ability to share contraptions with everybody through the web site, as well as browing public contraptions, which should increase the popularity of that feature quite a bit. It also adds some of the most-requested features, such as multiple player profiles for all the parents playing Casey’s Contraptions with their children out there.</p>
<p>Unlike a traditional retail game though, the story is far from over. What we do in the next few months will have a very significant impact on the long-term success of the game.</p>
<h3>Facts</h3>
<ul>
<li>Web site: http://www.caseyscontraptions.com</li>
<li>Release date: May 19, 2011 (iPad). Summer 2011 (iPhone)</li>
<li>Development time: 8 months</li>
<li>Team size: 2 (full time)</li>
<li>Development cost: Cost of living for 8 months + a tad over $1000</li>
<li>Open source code: Box2d, UnitTest++</li>
<li>Primary tools: Xcode, svn, Versions, Trac, TexturePacker, Adobe Illustrator, Audacity</li>
<li>Lines of code: 46,518</li>
<li>Raw asset size: 510 MB</li>
<li>Total app size: 12.2 MB</li>
<li>Subversion commits: 2442</li>
<li>Trac tickets closed: 683</li>
<li>Gallons of tea brewed: 77</li>
<li>Shots of espresso consumed: around 1500</li>
</ul>
<p><br/></p>
<p><i>This article was initially published on <a href="http://www.gamasutra.com/view/feature/6412/postmortem_llopis_and_friginals_.php">Gamasutra in June 22, 2011</a>. I reprinted it here for completeness, to keep it with all the other Casey&#8217;s Contraptions articles.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/casey%e2%80%99s-contraptions-postmortem/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.880 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-16 18:26:30 -->

