<?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>Fri, 03 May 2013 18:00:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Why Am I Making Games?</title>
		<link>http://gamesfromwithin.com/why-am-i-making-games</link>
		<comments>http://gamesfromwithin.com/why-am-i-making-games#comments</comments>
		<pubDate>Fri, 03 May 2013 17:59:26 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1653</guid>
		<description><![CDATA[A couple of weeks ago I posted my GDC micro-talk titled Why are you making games?. From the feedback I got, it seems that it resonated with a lot of people, and it also made some people stop and ask &#8230; <a href="http://gamesfromwithin.com/why-am-i-making-games">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago I posted <a href="http://gamesfromwithin.com/why-are-you-making-games">my GDC micro-talk titled <em>Why are you making games?</em></a>. From the feedback I got, it seems that it resonated with a lot of people, and it also made some people stop and ask themselves that question (along with a few sleepless nights).</p>
<p>However, the question I was asked over and over was why am <strong>I</strong> making games? What are my answers to that question? As I said before, there are no right or wrong answers. Everybody needs to find their own answers, so in that respect, my answers don&#8217;t really matter.</p>
<p>On the other hand, since what I write here is purely personal, and a lot of people are curious about it, I figured I would give it a shot and answers those questions publicly.</p>
<p><span id="more-1653"></span>Another thing I also want to stress is that these are not even permanent answers for me. These are my answers for the projects I&#8217;m working on right now. Whenever it&#8217;s time to start a new project, I will ask myself this question again and probably come up with different answers. That, I think, it&#8217;s key to be able to focus on some aspects at the expense of others, instead of always compromising and trying to achieve a bit of everything.</p>
<h2>Why I Am Not Making Games</h2>
<p>You thought I was going to get right away to the reasons why I was making games? No, it&#8217;s not that easy. I need to start with the reasons I thought I was making games, but turns out I discarded (for this time around).</p>
<h3>Innovation/awards</h3>
<p>I&#8217;ve always felt an urge to innovate and create something original. Something that would be worthy of getting some awards and recognition. Even back in the <a href="http://gamesfromwithin.com/tag/power-of-two/page/2">Power of Two Games days</a>, <a href="https://twitter.com/c_nich">Charles</a> and I (half) joked that if we won an IGF award, we would eat a whole cheesecake from <a href="http://www.estreetcafe.com">E Street</a>. Unfortunately (or fortunately, depending from your point of view), that never happened, and the cheesecake remained safe behind the glass. Flower Garden was pretty innovative (even to this day, there aren&#8217;t many similar games&#8211;if you can even call it a game). Casey&#8217;s Contraptions had some original aspects, but its main strength was in polish of execution.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2013/05/cheesecake.jpg" alt="Cheesecake" border="0" width="307" height="204" /></div>
<p>For this time around, I decided that this was not going to be one of the main reasons behind me making games though. I&#8217;m sure I&#8217;ll come back to this one very soon though.</p>
<h3>Money</h3>
<p>It&#8217;s hard not to think about money when one of your main target platforms is iOS. I know they&#8217;re mostly the exception, but looking at the huge financial success of some indie developers, or the revenue of some of the games on the Top Grossing chart, it&#8217;s only natural to want a slice of that pie.</p>
<p>Since free-to-play is one of the most profitable approaches on the App Store, I originally started out some of my designs by trying to do &#8220;free-to-play done right&#8221;. I was going to show the world how you can make a free-to-play game, treat players as human beings, not play any psychological tricks, not make the game suck on purpose, and still make a boatload of money.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2013/05/wq-money-woman.jpg" alt="Wq money woman" border="0" width="400" height="384" /></div>
<p>Along the way, two things happened:</p>
<ol>
<li>It&#8217;s a lot harder to design a game that does all those things than to write it out in a neat, little sentence like I just did.</li>
<li><a href="https://twitter.com/checker">Chris</a> called me on it. He asked the really pointed question of &#8220;if you don&#8217;t need the money, why focus your design around that idea when there are so many interesting design aspects out there to explore?&#8221; He was totally right! At this moment, I don&#8217;t have the financial pressure to ship a game, so why limit my game artificially like this?</li>
</ol>
<p>Those two things, combined with the fact that I hate most games in the Top Grossing chart of the App Store, means that I should not even try making a game aimed at that audience.</p>
<p>Since money eventually runs out, I will have to consider money more seriously in future projects. Even so, I will probably go the route of making more personal, niche games that appeal to a small percentage of people, rather than try to go after a pure mass-market approach.</p>
<h3>Expressing something</h3>
<p>I fall in the camp of people who believe that games are (or can be) art. That&#8217;s especially true of indie games, which carry the strong creative touch of an individual or a small team. Starting from something you want to express. For this one time, I was going to put that aside and focus on other aspects.</p>
<h2>Why I Am Making Games</h2>
<p>After removing all those reasons (and lots more that I didn&#8217;t talk about), why am I making games? Or rather, why am I making the games I&#8217;m currently making? It turns out, the reasons for these game are mostly selfish.</p>
<h3>Enjoy the development</h3>
<p>I wanted to make a game where I would enjoy the actual development as much as possible. This is a lot more constrictive than it may seem at first glance, and it means many things:</p>
<ul>
<li>I wanted to avoid games with large components that are uninteresting to design and implement (in-game stores, credits, managing users, etc).</li>
<li>I need to be exploring new concepts (to me) and trying new things to really enjoy the development process, so  the game needs to be substantially different from other games that I made in the past: no growing virtual plants, or creating physics puzzles to share with friends. </li>
<li>The focus of the game should be on the design itself, not some technology. Even though most of my past experience comes from programming, I&#8217;m only interested in design these days. Programming is just a means to quickly convert my ideas into something the computer can do, but I&#8217;m not interested in programming for the sake of programming (as anyone who looks at my code can attest to).</li>
</ul>
<h3>Create something I&#8217;ll be proud of afterwards</h3>
<p>This is an easy one. It doesn&#8217;t matter how much money the game makes, but I wanted it to be something I can be proud of afterwards. Interestingly, the &#8220;innovation/awards&#8221; point is a subset of this reason, but this point is more general, and I can be proud of the games I make for many reasons.</p>
<p>You would think that this point should go without saying, and nobody should be making games they&#8217;re not proud of. Unfortunately, just a glance at the App Store will quickly convince anyone that&#8217;s not the case.</p>
<h3>One more thing…</h3>
<p>Indie game development can be a pretty solitaire affair, but that&#8217;s not something that bothered me too much (maybe growing up an only child had something to do with that). I never needed someone else to keep me motivated in or committed to a project. </p>
<p>I am currently working on not one, but two different projects at once. Soon I&#8217;ll be able to start talking about them in detail. Both of those projects are collaborations with other people. After working on them for a few months, I have come to realize that working with the right people can be really invigorating: Bouncing ideas back and forth and see them grow into something bigger than they started, or just pushing and motivating each other has become completely invaluable for me. I&#8217;m hoping to be able to continue working and collaborating with amazing people in my future projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/why-am-i-making-games/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why Are You Making Games?</title>
		<link>http://gamesfromwithin.com/why-are-you-making-games</link>
		<comments>http://gamesfromwithin.com/why-are-you-making-games#comments</comments>
		<pubDate>Mon, 01 Apr 2013 18:28:49 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Conferences and events]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1646</guid>
		<description><![CDATA[This is a written version of my 5-minute talk from the Indie Soapbox session at this year&#8217;s GDC. Why are you making games? No, I don&#8217;t mean &#8220;why are you making games?&#8221;. Also, I don&#8217;t mean &#8220;why are you making &#8230; <a href="http://gamesfromwithin.com/why-are-you-making-games">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><i>This is a written version of my 5-minute talk from the Indie Soapbox session at this year&#8217;s GDC.</i></p>
<p><br/></p>
<p>Why are you making games? No, I don&#8217;t mean &#8220;why are <i>you</i> making games?&#8221;. Also, I don&#8217;t mean &#8220;why are you making <i>games</i>?&#8221;. And I certainly don&#8217;t mean &#8220;<i>why (on earth)</i> are you making games?&#8221;. I mean the question in the purest, most abstract sense. Just &#8220;why are you making games?&#8221;.</p>
<p>This was a key question for me last year, I spent a lot of time thinking about it, and I thought other people might benefit from asking themselves the same question. To see where I&#8217;m coming from, let&#8217;s do a quick flash back.</p>
<p>It&#8217;s late 2011. Miguel and I finished working on Casey&#8217;s Contraptions and my daughter was born. I took a couple months completely off from work (new dads will understand why), and then, right at the turn of the new year, I decided to start working again. The plan was to prototype a few of the juiciest ideas, pick one that really stood out, and make a new game in a few months. How hard could it be, right?</p>
<p>Right?</p>
<p><span id="more-1646"></span>It turns out it was a lot harder than I ever imagined. I was confident in my list of hundreds of game ideas that I had been adding to over the years. I picked one idea, made a quick prototype in a day or two, and decided that I wasn&#8217;t as excited about that idea as I thought. So I picked another one, and another prototype that didn&#8217;t go anywhere. Then another, then another, and then another. This went on for months.</p>
<p>By the time I realized that my prototype icons weren&#8217;t fitting in a single page on my development iPad, I started worrying that something was wrong. Prototyping is great, it allows you to find the truly great ideas and all of that, but I wasn&#8217;t any closer to a game idea I wanted to make than when I started.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2013/04/prototypes.jpg" alt="Prototypes" border="0" width="600" height="465" /></div>
<p>At this point, I even started prototyping game ideas I knew I was <i>not</i> going to make, just to remove any pressure on me, as well as to get it out of my system how much I hated those game genres. It was an interesting effort, but, as you can imagine, it didn&#8217;t lead to any shipped games.</p>
<p>I did, however, help me start figuring out what was going on. I realized that the prototypes I was creating were dissatisfying because my intentions were unclear. I wanted too many conflicting things out of this next game, and that was pulling the game in all kinds of opposite directions.</p>
<p>I wanted to make a unique a different game, yet at the same time I wanted it to reach a huge audience. I wanted to ride the wave of financially successful iOS games, but I didn&#8217;t want to sell my soul with freemium-based games, and instead, I was going to make a &#8220;good&#8221; freemium game. I wanted to make something innovative, but I wanted to do it in just 6-9 months. I wanted it all, and I wanted it yesterday. Bad combination.</p>
<p>That&#8217;s when I sat down and asked myself point blank &#8220;why am I making games?&#8221;. Or at least the more concrete version &#8220;why am I making my next game?&#8221;. That&#8217;s a surprisingly hard question to answer really honestly. I had to peel away a bunch of layers until I found the answers to my question.</p>
<p>My specific answers don&#8217;t matter because there isn&#8217;t a right and wrong answer. Any answer is good as long as it&#8217;s honest, from the bottom of your heart. There are as many valid answers as game developers out there. Some people make games because they want to be famous, others because they want to make money, others because it&#8217;s the only thing they know how to do, others because they want to win awards, others because they want to reach as many people as possible, others because they want to tell stories, etc, etc. </p>
<p>It&#8217;s actually amazing it took me this long to ask and confront this question. When you&#8217;re working on a game company things are different, and you don&#8217;t need to do that level of introspection. But once you go indie, it becomes really important. Even though I&#8217;ve now been indie for 6 years, I&#8217;ve been going in automatic pilot all this time, kind of skirting around this issue and winging it. I see a lot of indie developers out there doing the same thing, with greater or lesser success, but still conflicted internally about what they&#8217;re doing.</p>
<p>Once you have the answer to your question, you can use it to guide you in any big decisions related to game development, and even in life in general. Which projects to tackle, or even what features to add to your game, will often be easy to decide if you keep your goals in mind.</p>
<p>For me, within two weeks of answering the question, I had settled on not just one, but two different projects that I was super-excited about. Both projects are still moving along and I hope to start sharing information about them soon.</p>
<p>So I encourage anybody reading this to make some quiet time in the next few days, and pose yourself the question &#8220;why am I making games&#8221;. Once you find your answer, not only will it help you with future decisions, but it will make you more satisfied with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/why-are-you-making-games/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Porting My Game Code To Mac OS</title>
		<link>http://gamesfromwithin.com/porting-my-game-code-to-mac-os</link>
		<comments>http://gamesfromwithin.com/porting-my-game-code-to-mac-os#comments</comments>
		<pubDate>Thu, 05 Jul 2012 18:50:46 +0000</pubDate>
		<dc:creator>Noel</dc:creator>
				<category><![CDATA[Game tech]]></category>

		<guid isPermaLink="false">http://gamesfromwithin.com/?p=1641</guid>
		<description><![CDATA[I&#8217;m still working on prototypes. I&#8217;ve spent the last six months going through different game ideas and working on prototype after prototype. Along the way I&#8217;ve made over 20 different prototypes on iPad or iPhone. I&#8217;m sure a lot of &#8230; <a href="http://gamesfromwithin.com/porting-my-game-code-to-mac-os">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still working on prototypes. I&#8217;ve spent the last six months going through different game ideas and working on prototype after prototype. Along the way I&#8217;ve made over 20 different prototypes on iPad or iPhone. I&#8217;m sure a lot of those prototypes would have made decent iOS games, but I wasn&#8217;t particularly excited to develop them all the way and take them to completion. I&#8217;m looking for something that&#8217;s both very interesting to develop and something I can proudly point to after it ships.</p>
<p>Right now I have a couple of game ideas in hand that I&#8217;m pretty excited about. I prototyped one of those, but I quickly realized it might be a game better suited for desktops rather than iOS, so I decided to write my next prototype for that game on the Mac. Maybe another day I&#8217;ll write a post about prototypes, but what I want to write about today is my experience moving over my prototyping code to the Mac.<span id="more-1641"></span>I&#8217;ve been working on MacOS since 2007, when I switched because of iPhone development. <a href="http://gamesfromwithin.com/quick-notes-on-lion">For the most part</a>, I&#8217;ve been loving it as an OS, but I never actually targeted it as a platform in my development. I figured it wouldn&#8217;t be very hard at all to compile my simple C/C++ + OpenGL code that I use as the basis for all my iOS games on MacOS. After all, that code started on Windows and DirectX, and porting it to iOS was pretty quick and easy. On top of that, I can use Xcode 4 for Mac, just like iOS (<a href="http://gamesfromwithin.com/xcode-4-trials-and-tribulations">I&#8217;m not sure that counts as a plus</a> though). How card can it possibly be?</p>
<p>The answer is, not hard at all, as long as you&#8217;re aware of a couple gotchas along the way.</p>
<h2>Xcode project</h2>
<p>I figured I would start from scratch, so I created a new Xcode project targeting MacOS. First surprise was that, unlike iOS, there wasn&#8217;t a template to create an OpenGL application. Instead, I need to create an empty Cocoa application and set things up by myself. No big deal.</p>
<p>I used the <a href="https://developer.apple.com/devcenter/mac/resources/opengl/">samples from Apple</a> to get me started. I could have grabbed those and started adding stuff, but for some reason they have all the logic built into the OpenGL views, and I like to keep my views as simple as possible: they hold the surface to render, and they collect input and other window events. Done. So I had to do some moving around of code and responsibilities, which at the same time allowed me to make it more like the structure I used on iOS.</p>
<p>The AppDelegate does most of the initialization and creation on applicationDidFinishLaunching, and the OpenGL view gets created through the minimal nib file (with just a menu, window, and a view). AppDelegate is also responsible for setting up the display link callback, and then all the rest of the execution happens in my own code, away from those classes.</p>
<p>That was all pretty smooth. The only weird gotcha I ran into is that, unlike with previous Xcode 4 projects on iOS, I was no able to add any files to it that were not under the project root. They would turn red and not be available in the project. I tried adding them in every possible way and always got the same result. So, in the end, I gave in and just moved my External dir under the same directory as the Xcode project. Some people on Twitter had the same experience, while others didn&#8217;t, so there&#8217;s something fishy going on in there.</p>
<p>I have all my game static libraries (I refuse to call it an &#8220;engine&#8221;) as a separate Xcode project. I was able to add the project to the workspace and just change the target to be MacOS, and everything worked without a hitch.</p>
<h2>OpenGL</h2>
<p>I knew I was going to have to make some changes to the graphics code because all my iOS code uses OpenGL ES 2.0, and the Mac supports OpenGL &#8220;non ES&#8221; version. But I never did any graphics programming on the Mac, so I had no idea what to expect.</p>
<p>I decided to start with <a href="http://developer.apple.com/library/mac/#samplecode/GLEssentials/Introduction/Intro.html">this sample code</a> from Apple. After all, it seemed to be exactly what I was looking for: A simple project that sets up OpenGL both on iOS and MacOS. Score!</p>
<p>Once I started digging into it, I realized that it wasn&#8217;t going to be as straightforward as I realized. It turns out there were lots and lots of differences between OpenGL ES 2.0 and the OpenGL version on the Mac. Some were easy to catch, like different syntax for the shaders (&#8220;varying&#8221; became &#8220;in&#8221;, &#8220;uniform&#8221; was &#8220;out&#8221;, etc). Some were a pain to track down (needed to bind some Vertex Array Objects, and I was forced to use Vertex Buffers).</p>
<p>The documentation wasn&#8217;t clear on this point at all, but fortunately I got some good tips from Twitter. It turns out that the sample I used as a starting point created an OpenGL 3.2 context, and OpenGL 3.2 is very different from OpenGL ES 2.0. </p>
<pre>
	NSOpenGLPixelFormatAttribute attrs[] =
	{
		NSOpenGLPFADoubleBuffer,
		NSOpenGLPFADepthSize, 24,
		NSOpenGLPFAOpenGLProfile,
		NSOpenGLProfileVersion3_2Core,
		0
	};

	NSOpenGLPixelFormat* pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
	NSOpenGLContext* context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil];
	int swapInt = 1;
	[context setValues:&#038;swapInt forParameter:NSOpenGLCPSwapInterval];
</pre>
<p>It turns out that leaving out the last attribute (NSOpenGLPFAOpenGLProfile) creates an OpenGL 2.1 profile, which is very similar to OpenGL ES 2.0 (GLSL 1.2 is the shader version that OpenGL 2.1 uses and that&#8217;s also very similar to GLSL ES). With that change, all the OpenGL code worked perfectly, with the only exception of the precision modifiers in shaders. Fortunately, I we can wrap those up in a simple #ifdef like this</p>
<pre>
#ifdef GL_ES
precision lowp float;
#endif
</pre>
<h2>Unit tests</h2>
<p>Apart from input, which will require a total re-work, the last major thing I had left was running unit tests after each build. I&#8217;ve seen references to Xcode&#8217;s unit testing functionality, but I was hoping to reuse <a href="http://code.google.com/p/unittestpp/">UnitTest++</a> and run it like I do on iOS projects. It turns out it was even easier because you can run them natively without the extra step of the simulator like on iOS projects.</p>
<p>All I had to do was create a new phase in the Debug scheme to run a script. The &#8220;script&#8221; is just the name of the executable that was just build with the -unittest parameter added to it. I suspect that there&#8217;s probably a &#8220;better&#8221; way than hardcoding the .app/Contents/MacOS/ string in the middle to find the binary itself, so if someone knows the correct variable that includes that, let me know.</p>
<div style="text-align:center;"><img  src="http://gamesfromwithin.com/wp-content/uploads/2012/07/UnitTests.png" alt="UnitTests" border="0" width="600" height="297" /></div>
<p>The only other thing that came up is that apparently Xcode adds the parameter -NSDocumentRevisionsDebugMode when you debug it from the IDE. No big deal, unless you have your program exit with an error if you pass an unrecognized parameter. I just made it accept and ignore that parameter, and everything worked like a charm.</p>
<h2>Conclusion</h2>
<p>It took a bit longer than I expected, but I finally have my code base running on MacOS. Iteration time is faster because it doesn&#8217;t even launch the simulator, and I suspect graphics performance will also be a lot faster (the iOS simulator does all the graphics processing in software), so I might end up doing more prototyping on the Mac unless the touch input is an integral part of the game.</p>
]]></content:encoded>
			<wfw:commentRss>http://gamesfromwithin.com/porting-my-game-code-to-mac-os/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>39</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>21</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>13</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>14</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>16</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>14</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>18</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>
	</channel>
</rss>

<!-- Dynamic page generated in 1.218 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-05 12:38:29 -->
