<?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>Mystery Coconut. Resident Alien</title>
	<atom:link href="http://mysterycoconut.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mysterycoconut.com</link>
	<description>Where Game Development Hits the Fruit Stand</description>
	<lastBuildDate>Thu, 29 Jul 2010 18:37:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Conditionally Linked</title>
		<link>http://mysterycoconut.com/blog/2010/07/conditionally-linked/</link>
		<comments>http://mysterycoconut.com/blog/2010/07/conditionally-linked/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 04:03:02 +0000</pubDate>
		<dc:creator>Miguel A. Friginal</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://mysterycoconut.com/?p=554</guid>
		<description><![CDATA[Conditionally linking static libraries and frameworks depending on build configuration. Now say it fast.]]></description>
			<content:encoded><![CDATA[<p>You have been rejected. Last Friday you thought you had hit bottom when you got rejected by the barista of the day in account of you flirting with the barista of a different day that showed up out of turn to, surprise, have a coffee. What can you say, you got confused.</p>
<p>But things just went down hill from there. On Sunday your main competitor, Mystery Bunny Games, publicly criticized you on their blog! They pointed out that all that <a href="/blog/2010/07/tweak-away/">Telnet business you were babbling about</a> made your applications waste memory, increased the size of your binary, and misspent time initializing frameworks that were never used in the final release of your app. They called it a <q>disservice to the users, that have to suffer slow, bloated apps cause some lazy developer decided to add thousands of lines of code just for his own convenience.</q> Ouch.</p>
<p style="text-align: center; background: white;"><img title="Pissed off bunny" src="http://mysterycoconut.com/wp-content/uploads/2010/07/bunny_rabbit_cr.jpg" border="0" alt="" width="300" height="300" /></p>
<p>If that was not enough, this morning you got rejected again… by Apple! They discovered they could use your binary to upload Lua scripts and run all kinds of hacks on the device. Somehow they didn&#8217;t thought that was cool.</p>
<p>But you have learned the lesson: never follow any advice you get on the intertubes. Now, let me explain you how you can fix two of those three problems.</p>
<p><span id="more-554"></span><br />
<h3>Debug/Release</h3>
<p>Whenever you build your applications you always start with an Xcode project template that has the basis all setup for you. Between other things it comes with one <strong>Target </strong>representing the product you are building, and two <strong>Configurations</strong> with the settings appropriate for both a <em>Debug</em> build, and a <em>Release</em> one.</p>
<p>The<em> Target</em> contains between other things what files, libraries, and frameworks are linked and compiled. And that is your problem. Your Telnet debug server class,<em> AsyncSocket</em> and the<em> CFNetwork</em> framework it requires, plus all those files of the Lua runtime, should really not be in your<em> Release</em> build; they are<em> Debug</em> tools. How can you have the two different builds include different files? You only see two ways of doing this, and you don&#8217;t like either.</p>
<ol>
<li>To create different<em> Targets</em> for Debug and Build, and forget about the<em> Configurations</em> all together. But then for files that should be shared you will have to keep the targets in sync yourself, adding files to one then to the other.</li>
<li>The old <code>#ifdef/#endif</code> trick: edit all those files so they end up empty if you are building a Release. But modifying 3rd party code? You will need to do it every time they update it! And what about that framework you are linking to? Even linking empty files takes time, especially since your development powerhouse is the cheapest Mac Mini you could find on eBay.</li>
</ol>
<h3>Chunking with static libs</h3>
<p>The first thing you really need to do is separate all this code into chunks. On one side all the code that is required for both<em> Debug</em> and<em> Release.</em> On the other, all the code for your debug server. So you start by putting it all into its own project, and building one of those<em> static libraries</em> you have heard about. It is so easy these days… Apple even provides you with a project template out of the box to do this.</p>
<p>What? Don&#8217;t want to do it yourself? Gosh, you are so damn lazy. OK, I will give you the code! Just grab it, build it and you will end up with a<em> libLuaDebugServer.a</em> that contains all the stuff from the last time. Well… almost all.</p>
<p>Remember that<em> CFNetwork</em> framework we needed? Static libraries don&#8217;t… well, they don&#8217;t include frameworks so… I guess we still need to link to that in the main proj… Why are you looking at me like that? Man, I am getting there! Don&#8217;t worry! When have I failed you? Yeah, don&#8217;t answer that.</p>
<h3>Otherworldly flags</h3>
<p>So now that you have that library, you can delete all that code from the main project and add the library instead. If you want to get serious you could even do some of that <a href="http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/130-Files_in_Projects/project_files.html#//apple_ref/doc/uid/TP40002666-CJBJHJCJ">cross-project referencing</a> and <a href="http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/100-Targets/bs_targets.html#//apple_ref/doc/uid/TP40002689-CJBIGJHD">target dependencies</a> crap. But you know what? You will still have the same problem! Adding your static lib to the project will add it to the<em> Target,</em> and that will link and compile it in both<em> Configurations!</em></p>
<p>So is time to rethink this. Linking is the problem, and you need to do it differently depending on your Configuration. Hey, what&#8217;s this?</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="flags.png" src="http://mysterycoconut.com/wp-content/uploads/2010/07/flags.png" border="0" alt="flags.png" width="405" height="226" /></p>
<p><strong>Other Linker Flags?</strong> I know you never look at any of these arcane build settings unless it is to check the -O <a href="http://www.codinghorror.com/blog/2008/12/pressing-the-software-turbo-button.html">Turbo button</a>. But you can pass to this one here parameters for things you want linked <strong>only in the configuration selected!</strong> How? Easy.</p>
<blockquote><p><code>-framework NameOfFramework<br />-l NameOfLibrary</code></p></blockquote>
<p>So in our case, this should be…</p>
<blockquote><p><code>-framework CFNetwork<br />-l LuaDebugServer</code></p></blockquote>
<p>By the way, notice is not <code>CFNetwork.framework</code> or <code>libLuaDebugServer.a</code>; it figures out the filenames on its own. Now that you have that you don&#8217;t need to add the files to the<em> Target</em>, so they will not be linked and compiled with the<em> Release</em> build. Except that if you try to build the project right now, you are just going to receive a bunch of gibberish errors.</p>
<h3>Paths</h3>
<p>Although Xcode has no problem finding that<em> CFNetwork</em> framework, it has no clue where the hell your static library is. Not only that, but it doesn&#8217;t know where the headers of your static library are either, so when you call any of the methods of your LuaServer class, is more bitter than your quadruple shot of the mornings.</p>
<p>I am sure that you saw this coming, but you will have to mess with build setting again. The two we need are <strong>Header Search Paths</strong> and <strong>Library Search Paths.</strong> Let&#8217;s imagine that you have your static library project in the same folder than your main project. Then the paths should be like this:</p>
<dl>
<dt>Header Search Path:</dt>
<dd><code>﻿"$(SRCROOT)/../LuaDebugServer/"</code></dd>
<dt>Library Search Path:</dt>
<dd><code>"$(SRCROOT)/../LuaDebugServer/build/<br /> $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/"</code></dd>
</dl>
<p>The important parts of those paths are the quotes (useful in case you have your projects in folders with names containing spaces), the <code>$(SRCROOT)</code> (that points to the folder containing the main project), and the <code>$(EFFECTIVE_PLATFORM_NAME)</code> (that makes sure to grab the correct version of your library whether you are building for the simulator or for the device).</p>
<h3>Check?</h3>
<p>There you have it. The same project than before, featuring Pancho the Begging Cat, built so it only uses the Telnet Debug Server and all the Lua code in Debug configuration, but not in Release. You don&#8217;t believe me? Is easy to check!</p>
<p><img style="display: block; margin-left: -125px; margin-right: auto;" src="http://mysterycoconut.com/wp-content/uploads/2010/07/Debug1.gif" border="0" alt="Debug, 938 KB" width="605" height="330" /></p>
<p style="background-color: #333; margin-left: -125px; text-align: center;">Debug</p>
<p><img style="display: block; margin-left: -125px; margin-right: auto;" src="http://mysterycoconut.com/wp-content/uploads/2010/07/Release.gif" border="0" alt="Release, 541 KB" width="605" height="330" /></p>
<p style="background-color: #333; margin-left: -125px; text-align: center;">Et Release</p>
<p>Also, did you noticed how after building for the simulator, the firewall in your Mac didn&#8217;t bug you about accepting connections when running the<em> Release</em> build? I say you are ready for a nasty response to the Mystery Bunny Games people. If you only knew who they are…</p>
<div style="background: #333; margin-left: -125px; margin-bottom: 1em; padding: 1em 1em 0.5em 1em;">
<h3><img class="size-medium wp-image-431" style="float: right; padding: 3px; background: white; margin: 0 0 0.5em 0.5em;" title="LuaSockets, featuring… Pancho!" src="http://mysterycoconut.com/wp-content/uploads/2010/07/LuaSockets-208x300.png" alt="" width="208" height="300" />LuaSockets Source Code! Again!</h3>
<p>This time not one, but two Xcode projects! One containing all the Telnet server and Lua code that builds a static library, and one with the example project.</p>
<p>The static library only contains headers for the LuaSocketServer class. If you want to make any of the other AsyncSocket or Lua methods available to the main project, you will need to add those headers to the Target&#8217;s Copy Headers build phase.</p>
<p>If you check the main project you will see the debug server code and the CFNetwork framework are gone; the Target Settings of the Debug configuration contain the necessary linking flags.</p>
<p style="float: right;"><strong><a href="/examplecode/LuaSocketsLib.zip">Download LuaSockets Lib project</a></strong></p>
<p>Have fun!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mysterycoconut.com/blog/2010/07/conditionally-linked/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Shelve it</title>
		<link>http://mysterycoconut.com/blog/2010/07/shelve-it/</link>
		<comments>http://mysterycoconut.com/blog/2010/07/shelve-it/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 01:45:18 +0000</pubDate>
		<dc:creator>Miguel A. Friginal</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://mysterycoconut.com/?p=483</guid>
		<description><![CDATA[Deciding when a project needs to be cancelled is hard, but the sooner you realize something is wrong, the sooner you can start on one that does work. ]]></description>
			<content:encoded><![CDATA[<p>You have been staring at that email for a few days now. Is only 4 lines long, but boy, you are at a loss on how to reply. This has never happened to you before, and no quantity of coffee ingested today, visits to the barista of the day, or cookies stolen from the grasp of old ladies in the grocery store&#8217;s free samples isle has helped at all. Is like one of those <a href="http://samizdat.cc/cyoa/">Choose Your Own Adventure books</a>. You can see your 3 options at the bottom of this page: send (another) polite response, ignore it, or make fun of it on Twitter. But <a href="http://www.sydlexia.com/jeebus/cyoa.htm">years of practice looking pages ahead</a> tell you all these are going to resolve in a really short paragraph followed by a centered, 14 point, Souvenir Bold &#8221;The End&#8221;. And you hate Souvenir Bold. The email reads:</p>
<blockquote><p>NO!<br />
I am in love with <em>#nameOfCancelledProjectHere#</em>!<br />
Can you send me a .app or .ipa so I can play it?<br />
I am seriously so mad right now!!!!</p></blockquote>
<p>There you have it. A true fan of your work. Somebody that got really excited about a 1–day prototype by just reading about it somewhere online and looking at some awful screenshots of programmer art. If you compare it with the crap your friends are giving you lately about your projects this person is <a href="http://www.youtube.com/watch?v=8FT5QF4JZUA">the best thing that ever happened to you</a>! And he is seriously so mad right now. Not with one, or two, but with four, four exclamation marks! He was your best fan, but now he is so pissed he will forever be your worse detractor.</p>
<p><span id="more-483"></span></p>
<p><img class="aligncenter size-full wp-image-505" title="Angered client!" src="http://mysterycoconut.com/wp-content/uploads/2010/07/youwillruethe128554493213891386.jpg" alt="" width="480" height="344" /></p>
<p>You can see it now. Anytime you post in a forum, join a new social network to avoid the friends that followed you to the last one, or do your taxes online, there he will be right behind you, yelling what an untrustworthy dirty rat you are. And you know what you did wrong, you knew it was wrong even before sending him that fateful email. You told him you have cancelled the project.</p>
<p>Why did you shelved this one? Why did you cancelled his favorite thing ever? To tell the truth you have quite a few rules you follow in the hopes of <strong>actually finishing something.</strong> Let&#8217;s just look at three. Your projects need to be…</p>
<h3>Small</h3>
<p>You are just one guy. You do it all: programming, art, sound, QA, customer support, testing, accounting, marketing, or any other ungrateful job required to make your game happen. Would it be easier if you worked with other people, contract some of these things out, have a team? Yes, but the crude reality is you don&#8217;t have money. You know how difficult all these jobs are, and jeez, what kind of person would ask anybody, even friends, to do all that work for free? No, you are on your own for now, and that means you have to be careful about the scope of your projects, cause you cannot spend years working without income… even ramen costs money these days!</p>
<p><img class="alignleft size-medium wp-image-509" style="margin-right: 1em; margin-top: 10px;" title="Hamster WINS!" src="http://mysterycoconut.com/wp-content/uploads/2010/07/hamster-video-game-maze1-300x243.jpg" alt="" width="300" height="243" />But you know what? Keeping projects small is difficult. It always starts with a simple idea like, I don&#8217;t know, a hamster running around the screen. But soon you need to add some variation and interest, so you build levels, and different enemies, and weapon upgrades, and to make it more appealing you write a story line and start planning animated cutscenes, then figure out you may as well add vehicles, and… at the end it seems like your Hamster on a Hover Board idea has grown out of control. It was probably <a href="http://www.youtube.com/watch?v=6j4ADzIlUDk">ahead of its time</a> anyway.</p>
<p>You <strong>need</strong> to shelve anything that even smells like scope creep… were you having dreams of building a new MMORPGs? Forget it! Not on this shop!</p>
<h3>Fun</h3>
<p>You are making games, and the elusive fun factor is always your main goal. But you have noticed how &#8220;fun&#8221; means different things to different people; the barista of the day can be hours arranging formations of flying quesadillas into bunny heads; but your best friend laughs every time a quesadilla he shot down spits out cheese all over the screen. Now I could tell you about target markets and what not, but I think there is a more fundamental thing you need to do to make a fun game, and that is <strong>having fun making it</strong>.</p>
<p>When you are having a blast, when you are so delighted by your creation that it keeps making you smile, when you are loving to tweak it, and even the boring tasks are made bearable by just thinking how damn cool your game is, then you are on the right track. Your users will enjoy it cause its sheer awesomeness will exude all the enthusiasm you put into it into their little fingers. It&#8217;s so difficult to <a href="http://positech.co.uk/cliffsblog/?p=753">stay motivated</a> and pull a project through to the end… if you are not having fun, is not going to work. So the moment it becomes too tedious, it gets shelved!</p>
<h3><img class="alignleft size-medium wp-image-514" style="margin-right: 1em; margin-top: 5px;" title="iPad needs a Joystick? No problem" src="http://mysterycoconut.com/wp-content/uploads/2010/07/icade-ipad-arcade-cabinet_1-300x255.jpg" alt="" width="300" height="255" />Seamless</h3>
<p>You are creating games for iPhone. Not for Windows, not for the XBox, not for the Nintendo DS, and obviously <a href="http://www.youtube.com/watch?v=Yo7nTxFxCaE">not for free for a website</a>. Each platform has it pros and its cons, and the quickest way to fail is not embracing what the platform offers, or not accepting what the platform is. Who uses it? How? When? What can it do, and what it is not designed to do? For you working on the iPhone this means your game needs to be:</p>
<ul style='clear: both; padding-top: 1em'>
<li><strong>Playable in short bursts:</strong> pick up and play for five minutes while waiting in line to buy your lotto tickets.</li>
<li><strong>Made for a small screen:</strong> a reduced version of the experience in your computer screen doesn&#8217;t work.</li>
<li><strong>Controlled appropriately: </strong>trying to simulate buttons and d-pads? Better if you touch the objects on the screen directly, move the thing around, shoot photos, connect to the internet… in summary, do the things iPhone handles best.</li>
</ul>
<p>Seamless is the best word you can think of. You know some of your game ideas are too rooted in your previous experiences in other platforms. They just don&#8217;t work that well on the iPhone. Does it feel forced? Are you going in circles trying to find an interface that fits your idea? It just may not be the right idea to begin with. So shelve it.</p>
<h3>Is difficult, but is all for the better</h3>
<p>At the end putting a project to sleep is a difficult decision. You have the best intentions for all your projects at the beginning. And after you have spent months working on something it is even harder! All that time weights like an iron ball attached to your foot. You think, &#8220;is not working that well, but… I cannot just trash all this work and start over!&#8221;. Don&#8217;t get married to your projects that fast. Keep re-evaluating them. If you have to cancel them, at least you have learnt what didn&#8217;t work! So if it&#8217;s growing out of control, if it doesn&#8217;t feel right, if is not fun to work on it anymore, make yourself a favor. Brighter ideas, exciting things that you can actually finish, are right around the corner, waiting for you to pay them some attention. So shelve that puppy and get cracking with the next one!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysterycoconut.com/blog/2010/07/shelve-it/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Learning from board games</title>
		<link>http://mysterycoconut.com/blog/2010/07/boardgames/</link>
		<comments>http://mysterycoconut.com/blog/2010/07/boardgames/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 20:53:13 +0000</pubDate>
		<dc:creator>Miguel A. Friginal</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://mysterycoconut.com/?p=441</guid>
		<description><![CDATA[Lots can be learned from board games that can be applied to video game design. Here you have some ideas that will get you thinking.]]></description>
			<content:encoded><![CDATA[<p>You are not feeling the love. You keep looking at your creation in the iPhone&#8217;s screen, and is not clicking. Your best friend has been checking it out over your shoulder, and be keeps chugging his beer without a word. Finally he mutters something about it not being that bad, then goes to check out what&#8217;s all the excitement coming from the table in the back of the bar.</p>
<p>Not that bad! You cover your eyes. &#8220;Not that bad&#8221; is the kiss of death in the freaking App Store! You can already see your game  disappearing into the tide of forgotten apps, maybe get a few downloads when you finally make it free and it gets featured on <a href="http://krapps.com">Krapps.com</a>. And the thing is… you don&#8217;t know why! Why is it so bad when it has all this cool stuff in it?</p>
<p>You remember when you started it. You were dating that daycare teacher, and inspired with how her sweet voice was always punctuated by the sudden <a href="http://www.google.com/images?q=screech">screech</a> when catching her rugrats doing something behind her back, you added to your game dinosaurs farting rainbows while juggling baby&#8217;s heads. That didn&#8217;t work out; actually, she got a restraining order. But the next date was such a great cook… you added the fire meatball shooter. Then it was the gothic girl (you added the fatty lipid-vampire), then the one in the military (the terrorist-skewer flag poles), then the veterinary (bi-headed chickens), then the farm girl (beheaded chickens)… Is all there on the screen in all its full-color animated glory.</p>
<p><img class="alignleft size-full wp-image-467" style='margin-right: 1em' title="War on Terror, the board game, in action" src="http://mysterycoconut.com/wp-content/uploads/2010/07/oil-greedy-empires.jpg" alt="" width="350" height="245" />You turn the iPhone off (for some reason is always running out of battery lately), and go after your friend see what&#8217;s up with all the laughing. What the…! Is that a gal wearing a mask that says &#8220;Evil&#8221;? Oh gosh, they are <a href="http://www.boardgamegeek.com/image/161221/war-on-terror">playing a board game</a> in your bar! Disgusting! You knee your friend and point to the door, but is already too late; he is in perpetual snorting/chuckle mode now. You hurry out before it gets to you.</p>
<p>Wait a moment there buddy! Are you saying you don&#8217;t like board games? Aren&#8217;t you creating a video game? Not the same, eh? You sir are missing out! There are so many games out there with many interesting mechanics: board games, card games, dice games, role-playing games… They have been around for a while too, so I think they can probably teach you a thing or two about how to make your iPhone video game better, you know. Ah, now you are listening! OK, let me just explain you a few things about board games that can be applied to your designs.</p>
<p><span id="more-441"></span></p>
<h3>The components tell a story</h3>
<p>On a good board game you can look at the board, the individual pieces, the cards, the dice, and the box it all comes in, and before reading a word of the rules you should know what the game is about. You have pieces of an island, people screaming and boats, marine monsters, and a big whirlpool in the middle of the board! You must be playing <a href="http://www.boardgamegeek.com/image/720359/escape-from-atlantis">Escape from Atlantis</a>! Or you have a long icy track with a start and a finish line, wooden pieces of trees, cards with illustrations of dogs… this must be a sledge race! <a href="http://www.boardgamegeek.com/image/453517/snow-tails?size=large">Snow Tails</a>! Even if some pieces are abstract cubes, everything works together to support the theme and create a powerful image, and a promise for a experience that will be remembered.</p>
<p><img src="http://mysterycoconut.com/wp-content/uploads/2010/07/pic582061_md.jpg" alt="" title="Treasure hunting in Tobago" width="480" height="319" class="aligncenter size-full wp-image-469" /></p>
<h3>The players know what their options are</h3>
<p>At any moment, a player can look at the board and see the whole state of the game. He can see what tunnel his Space Marines are in, the blip in the next hallway that may reveal <a href="http://www.boardgamegeek.com/image/541119/space-hulk?size=original">some violent Genestealers</a> or be fake, just a trap to misdirect his resources. He knows he will have to open the door to find out, advance, and fire, with his limited action point supply; with all that info, he can more or less calculate the odds of the flamethrower guy frying whatever is there before one to six 4-arm aliens with razor claws get to him.</p>
<p><img src="http://mysterycoconut.com/wp-content/uploads/2010/07/pic566570_md.jpg" alt="" title="Help needed in the Space Hulk!" width="480" height="320" class="aligncenter size-full wp-image-472" /></p>
<h3>Players learn as they go</h3>
<p>Some players like to get into the game and learn the rules as they progress. Even simple rules can combine in unexpected ways, and even experience players learn a lesson at every game. After all, nothing teaches you faster to close all those portals to another world than to have your <a href="http://www.boardgamegeek.com/image/534047/arkham-horror">city overrun by tentacled monsters</a>.</p>
<p><img src="http://mysterycoconut.com/wp-content/uploads/2010/07/pic742385.jpg" alt="" title="The Race for the Galaxy is not going that well…" width="480" height="360" class="aligncenter size-full wp-image-471" /></p>
<h3 style='clear:both; padding-top: 1em'>There is a clear goal</h3>
<p>Maybe the players are not on top of all the rules, but there is at least one thing all of them will want to know from the very beginning: how can I win? Does the player that kills the dragon win? Or is it the one that stole the most gold and got out while the rest were fighting the dragon? Different goals make for totally different strategies, and making clear what those goals are is of the utmost importance. Making it easy to guess who is getting ahead at any moment also enhances the game with ever-changing conflicts.</p>
<h3>Quality components make a big difference…</h3>
<p>Games with good components, even if they have terrible rules, are a pleasure to play. The click of the stones in a wooden Go set, the thick lavishly illustrated cards of Magic the Gathering in your hand, or a battlefield full of painted metal miniatures and props in a Warhammer 40K battle. Yes, you could play Go with bottle caps on a note pad, or Warhammer with some cheap plastic cowboys and indians and a few cardboard boxes. The rules, the gameplay, would be the same. But would the experience be the same?</p>
<p><img src="http://mysterycoconut.com/wp-content/uploads/2010/07/pic292440_md.jpg" alt="" title="Battle Lore in Technicolor!" width="480" height="352" class="aligncenter size-full wp-image-473" /></p>
<h3>…cause physical items are cool</h3>
<p>Players like to roll the dice even when is not their turn, listen to them bouncing playfully on the table. They like to play with the pile of plastic coins by their character sheet. They like to organize the little wooden fences around their farms and set the animals in random patterns inside. They like to move their figurine with rhythmic little thumps over the board, one square at a time. The tangible nature of the pieces, being able to move them around, listen to the many different sounds they make, adds to the enjoyment.</p>
<h3>Nobody wants it to take forever</h3>
<p>Let&#8217;s be realistic, the number of players that enjoy going through the <a href="http://www.desperationmorale.com/museum/aslmuseumrulesex9.png">ASL binders</a> is really small compared to the ones that like to pull Ticket to Ride out the shelf and start playing. This is clear too when you invite non-gamers to play. First question usually is, how long does this one take? As more and more euro-style games get published the trend is clear: simple rules and short play-time sells more, because people enjoy a 30 minute one-shot every now and then, but they think twice before getting into a 3 hour deal.</p>
<p>Even for gamers setup time is also an issue. I look at my collection, and even for games I love I have to stop and think… do I want to spend the next half hour setting all the little pieces? Setup time and complicated rules are both barriers to entry.</p>
<h3>The experience is bigger than the game</h3>
<p>Look at those people in the bar. They really seem to be having fun. But wait, the people watching them play, your friend included, seem to be having fun too. The question is then, is the game itself fun? Or is all the goofiness going on around the table? You know what, is both. After all, a boring game would not propitiate that kind of behavior! At the end of the day everything those people will remember is having a great time with their friends. And next time they see that board game sitting on a shelf somewhere the memory of this evening will bring a smile to their face. Just remember you want to be associated to those happy moments and not to the frustrating ones!</p>
<p><img src="http://mysterycoconut.com/wp-content/uploads/2010/07/pic663850_md.jpg" alt="" title="Successful Nanuk hunters cheer!" width="480" height="346" class="aligncenter size-full wp-image-474" /></p>
<p>And that&#8217;s all for today buddy! Not get out of your video game shell and go play something else!</p>
<p><small><em>Most images were taken from the excellent <a href='http://boardgamegeek.com'/>BoardGameGeek.com</a>. Go visit the the site to learn about board games you are planning to buy, or find excellent gaming aids for the ones you already have.</em></small></p>
]]></content:encoded>
			<wfw:commentRss>http://mysterycoconut.com/blog/2010/07/boardgames/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tweak away</title>
		<link>http://mysterycoconut.com/blog/2010/07/tweak-away/</link>
		<comments>http://mysterycoconut.com/blog/2010/07/tweak-away/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 03:36:11 +0000</pubDate>
		<dc:creator>Miguel A. Friginal</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://mysterycoconut.com/?p=327</guid>
		<description><![CDATA[Good morning monsieur, welcome back! Today we have a very special three-course coding menu. The entree is a well cooked debug socket server, preceded by a fast app switching appetizer for your iOS 4 apps; and the dessert… oooo… wait for the dessert.]]></description>
			<content:encoded><![CDATA[<p>Another week, another iOS release, another multi-gigabyte SDK download. You have been sitting all day in front of nondescript backdrops under the rain, coffee mug attached to your paw. Your doctor left a message saying your liver looks like last year&#8217;s filter from the hospital&#8217;s coffee vending machine. You lost your Barista of the Day 2010 Tracker Calendar and now every time you show up there is a dude with an apron behind the counter. iPod keeps shuffling once and again over the sad parts of the Start Wars soundtrack. You have to accept it. You are stuck again.</p>
<p>It all started with the interface. You were there positioning buttons, entering coordinates by hand: the score label, the Menu-pause™ widget, the alertness/drunkenness meter… it really started bugging you after having to re-compile for the tenth time just to find your designer (that is, you on Fridays) had decided to change the size of all the graphics. Then there was the turtle. I mean, how difficult do you think it is to calculate the mass of a freaking turtle? But somehow anytime you tried to change it the physics engine either made it go through the floor or <a href="http://www.youtube.com/watch?v=l2r8S4uke34">bounce like crazy</a>. Gosh man, <a href="/blog/2010/06/levels/">didn&#8217;t we go through this already</a>? Except your fancy level editor was of no help with any of this. You see, I may run the risk of repeating myself, but maybe is time to revisit the advice I gave you. <strong>First you need better tools.</strong></p>
<p><span id="more-327"></span></p>
<h3>Implementing a Socket Server for your iPhone Game</h3>
<p>If there is anything to learn from all this frustration is that waiting to recompile sucks. Seeing changes live, that&#8217;s what you need. Being able to move your interface around until you get it perfectly lick-able, or change the hit points of your Pretzel Dragon till you find the perfect balance between Masochist level and N00b. At runtime. That&#8217;s what we are talking about! Sure you can already do all that with the debugger, but really… do you enjoy pausing and restarting, fishing for the right breakpoint and variable? That&#8217;s like having a swimming pool when what you need is an umbrella. Not fun.</p>
<p>So you come up with a plan: you are going to run a server on your game, connect to it from your computers command line, and send commands for the things you want to modify. You look on the interwebs for information on how to do this and then start wondering if maybe Networking 101 in school had nothing to do with hanging in the bar with the girl of the <a href="http://farm4.static.flickr.com/3447/3998367841_5712ba61ae_o.jpg">anchor tattoo</a>. I could explain you how Berkeley sockets work, and the difference between transfer protocols, and we could talk about streams and datagrams, and the beautiful C API… or we could just use <a href=" http://code.google.com/p/cocoaasyncsocket/">AsyncSocket</a>. You will like AsyncSocket cause:</p>
<ul>
<li>you only need to add one class to your project! There are two available, one for TCP connections and another one for UDP. We will stay with TCP cause we are going to use Telnet to connect to your server.</li>
<li>you don&#8217;t need to worry about low level details. Whenever the server accepts connections, clients disconnect or timeout, or a number of other things happen, AsyncSocket will just call your delegate methods. And for starters, you only need to really worry about implementing 4 methods.</li>
<li>it plays nice with the current application NSRunLoop by default, and is non-blocking.</li>
</ul>
<p><img class="alignleft size-full wp-image-335" style="margin-right: 1em;" title="Initial Setup" src="http://mysterycoconut.com/wp-content/uploads/2010/07/debugserver-01.gif" alt="" width="233" height="298" />So you open Xcode, and decide to create a new barebones Window-based Application to test all this. Let&#8217;s just call it the <strong>Mystery Coconut HQ Simulator.</strong> You include <code>AsyncSocket</code>, then the <code>CFNetwork.framework</code>, then finally create a normal <code>NSObject</code> descendant for the Debug Server itself.</p>
<p><code>DebugServer.h</code> ends up just with a few instance variables: the AsyncSocket object that works as server, an array of connected clients, and a flag to tell if is already running or not. One method for starting the server on a specific port, another for stopping, and we are done.</p>
<div style="clear:both; padding-bottom: 1em"></div>
<div class="scgeshi-container"><div class="objc scgeshi"><span class="kw1">@class</span> AsyncSocket;<br />
<br />
<span class="kw1">@interface</span> DebugServer <span class="sy0">:</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/"><span class="kw5">NSObject</span></a> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; AsyncSocket <span class="sy0">*</span>debugServer;<br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/"><span class="kw5">NSMutableArray</span></a> <span class="sy0">*</span>connectedClients;<br />
&nbsp; &nbsp; bool running;<br />
<span class="br0">&#125;</span><br />
<br />
<span class="kw1">@property</span> <span class="br0">&#40;</span>readonly,getter<span class="sy0">=</span>isRunning<span class="br0">&#41;</span> bool running;<br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> startOnPort<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span>port;<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> stop;<br />
<br />
<span class="kw1">@end</span></div></div>
<p>Then you implement a few delegate methods. I see your server can send messages to connected clients with <code>writeData:withTimeout:tag:</code>, and that it requires <code>NSData</code> versions of your strings. And since you want to listen to connected clients until they disconnect, you call <code>readDataWithTimeout:tag:</code> when they first connect, and then every time you get some input, cause if you didn&#8217;t the server would only ever receive the first message!<br />
<div class="scgeshi-container"><div class="objc scgeshi"><span class="kw1">@implementation</span> DebugServer<br />
<br />
<span class="kw1">@synthesize</span> running;<br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">id</span><span class="br0">&#41;</span> init;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; self <span class="sy0">=</span> <span class="br0">&#91;</span>super init<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>self <span class="sy0">!=</span> <span class="kw2">nil</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; debugServer <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>AsyncSocket alloc<span class="br0">&#93;</span> initWithDelegate<span class="sy0">:</span>self<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; connectedClients <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/"><span class="kw5">NSMutableArray</span></a> alloc<span class="br0">&#93;</span> initWithCapacity<span class="sy0">:</span><span class="nu0">1</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; running <span class="sy0">=</span> <span class="kw2">false</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> self;<br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> dealloc;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#91;</span>self stop<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#91;</span>connectedClients release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#91;</span>debugServer release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#91;</span>super dealloc<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> startOnPort<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span>port;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>running<span class="br0">&#41;</span> <span class="kw1">return</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>port &lt; <span class="nu0">0</span> || port &gt; <span class="nu0">65535</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; port <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSError_Class/"><span class="kw5">NSError</span></a> <span class="sy0">*</span>error <span class="sy0">=</span> <span class="kw2">nil</span>;<br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="br0">&#91;</span>debugServer acceptOnPort<span class="sy0">:</span>port error<span class="sy0">:&amp;</span>error<span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; NSLog<span class="br0">&#40;</span><span class="co3">@</span><span class="st0">&quot;My Awesome Debug Server has started on port %hu&quot;</span>, <span class="br0">&#91;</span>debugServer localPort<span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; running <span class="sy0">=</span> <span class="kw2">true</span>;<br />
<span class="br0">&#125;</span><br />
<br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> stop;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span>running<span class="br0">&#41;</span> <span class="kw1">return</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="br0">&#91;</span>debugServer disconnect<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>AsyncSocket<span class="sy0">*</span> socket <span class="kw1">in</span> connectedClients<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>socket disconnect<span class="br0">&#93;</span>; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; running <span class="sy0">=</span> <span class="kw2">false</span>;<br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>onSocket<span class="sy0">:</span><span class="br0">&#40;</span>AsyncSocket <span class="sy0">*</span><span class="br0">&#41;</span>socket didAcceptNewSocket<span class="sy0">:</span><span class="br0">&#40;</span>AsyncSocket <span class="sy0">*</span><span class="br0">&#41;</span>newSocket;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#91;</span>connectedClients addObject<span class="sy0">:</span>newSocket<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span><br />
<br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>onSocketDidDisconnect<span class="sy0">:</span><span class="br0">&#40;</span>AsyncSocket <span class="sy0">*</span><span class="br0">&#41;</span>socket;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#91;</span>connectedClients removeObject<span class="sy0">:</span>socket<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>onSocket<span class="sy0">:</span><span class="br0">&#40;</span>AsyncSocket <span class="sy0">*</span><span class="br0">&#41;</span>socket didConnectToHost<span class="sy0">:</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>host port<span class="sy0">:</span><span class="br0">&#40;</span>UInt16<span class="br0">&#41;</span>port;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; NSLog<span class="br0">&#40;</span><span class="co3">@</span><span class="st0">&quot;Accepted client %@:%hu&quot;</span>, host, port<span class="br0">&#41;</span>;<br />
<br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/"><span class="kw5">NSData</span></a> <span class="sy0">*</span>welcomeData <span class="sy0">=</span> <span class="br0">&#91;</span><span class="co3">@</span><span class="st0">&quot;Welcome to my Awesome Debug Server<span class="es0">\r</span><span class="es0">\n</span>&quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; dataUsingEncoding<span class="sy0">:</span>NSUTF8StringEncoding<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#91;</span>socket writeData<span class="sy0">:</span>welcomeData withTimeout<span class="sy0">:-</span><span class="nu0">1</span> tag<span class="sy0">:</span>WelcomeMsgTag<span class="br0">&#93;</span>;<br />
<br />
&nbsp; &nbsp; <span class="br0">&#91;</span>socket readDataWithTimeout<span class="sy0">:-</span><span class="nu0">1</span> tag<span class="sy0">:</span>GenericMsgTag<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span><br />
<br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>onSocket<span class="sy0">:</span><span class="br0">&#40;</span>AsyncSocket <span class="sy0">*</span><span class="br0">&#41;</span>socket didReadData<span class="sy0">:</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/"><span class="kw5">NSData</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>data withTag<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">long</span><span class="br0">&#41;</span>tag;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>tmp <span class="sy0">=</span> <span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> stringWithUTF8String<span class="sy0">:</span><span class="br0">&#91;</span>data bytes<span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>input <span class="sy0">=</span> <span class="br0">&#91;</span>tmp stringByTrimmingCharactersInSet<span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSCharacterSet_Class/"><span class="kw5">NSCharacterSet</span></a> whitespaceAndNewlineCharacterSet<span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#91;</span>input isEqualToString<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;exit&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/"><span class="kw5">NSData</span></a> <span class="sy0">*</span>byeData <span class="sy0">=</span> <span class="br0">&#91;</span><span class="co3">@</span><span class="st0">&quot;Bye!<span class="es0">\r</span><span class="es0">\n</span>&quot;</span> dataUsingEncoding<span class="sy0">:</span>NSUTF8StringEncoding<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>socket writeData<span class="sy0">:</span>byeData withTimeout<span class="sy0">:-</span><span class="nu0">1</span> tag<span class="sy0">:</span>GenericMsgTag<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>socket disconnectAfterWriting<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="br0">&#91;</span>socket readDataWithTimeout<span class="sy0">:-</span><span class="nu0">1</span> tag<span class="sy0">:</span>GenericMsgTag<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span><br />
<br />
<span class="kw1">@end</span></div></div></p>
<p>Nice! That was fast. You have a socket server.</p>
<h3>Fast app switching in iOS 4</h3>
<p>What? You don&#8217;t think is going to work? You think the whole AsyncSocket thing is a prank, like that time the girl of the anchor tattoo convinced you the NSCoders meeting was at the <a href="http://www.youtube.com/watch?v=tdbt-sx5MDc">Blue Oyster</a>? Well, let&#8217;s see; just add a <code>DebugServer</code> to the <code>AppDelegate</code> and… Holy crap! Who the hell put all this garbage in your <code>AppDelegate</code>?! Oh, wait… does this have anything to do with you using iOS 4? You skim through <a href="http://mysterycoconut.com/supportDocs/appledocsparody.html">the docs</a> as your eyes glaze over. OK, don&#8217;t get stressed. The important part is: <strong>where do you put the code to start and stop the server?</strong></p>
<p>You could put the <code>startOnPort:</code> call on <code>applicationWillEnterForeground:</code>, but then iOS 3 devices will never run that code… no thanks. You end up putting it in <strong><code>applicationDidBecomeActive:</code></strong>.</p>
<p>As per the <code>stop</code> call… <strong><code>applicationWillTerminate:</code></strong> for sure, but also in <strong><code>applicationWillResignActive:</code></strong>, so that when the app goes to sleep you don&#8217;t keep the server running and draining battery and stuff. You know the system will kill it if you did that!</p>
<p>You wonder, how would you do all this if it was a game that needs to save state, and handle a run loop? If it was me, I think I would do something like this:<br />
<div class="scgeshi-container"><div class="objc scgeshi"><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>applicationDidFinishLaunching<span class="sy0">:</span><span class="br0">&#40;</span>UIApplication <span class="sy0">*</span><span class="br0">&#41;</span>application <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co2">// Load your game state here</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>applicationDidBecomeActive<span class="sy0">:</span><span class="br0">&#40;</span>UIApplication <span class="sy0">*</span><span class="br0">&#41;</span>application <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co2">// We are back! Start the run loop!</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>applicationWillTerminate<span class="sy0">:</span><span class="br0">&#40;</span>UIApplication <span class="sy0">*</span><span class="br0">&#41;</span>application <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co2">// Save the game state (probably stop the run loop first)</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>applicationWillResignActive<span class="sy0">:</span><span class="br0">&#40;</span>UIApplication <span class="sy0">*</span><span class="br0">&#41;</span>application <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co2">// Stop the run loop or we will be killed! </span><br />
&nbsp; &nbsp; <span class="co2">// Don't save yet, maybe he doesn't answer that phone call from his mom...</span><br />
<span class="br0">&#125;</span><br />
<br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>applicationDidEnterBackground<span class="sy0">:</span><span class="br0">&#40;</span>UIApplication <span class="sy0">*</span><span class="br0">&#41;</span>application <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="co2">// Save and release any memory you can load fast, </span><br />
&nbsp; &nbsp; <span class="co2">// maybe that way we are last when they line us up against the wall</span><br />
<span class="br0">&#125;</span></div></div></p>
<p>So let&#8217;s see what you got. You added a <code>DebugServer</code> instance variable to your <code>AppDelegate</code>. Then started it in say port 9990 in the <code>applicationDidBecomeActive:</code> method. Stopping happens in <code>applicationWillTerminate:</code> and <code>applicationWillResignActive:</code>. With a self-congratulatory smile you check the IP of your iPhone in the LAN before compiling and running.</p>
<p>There it is. A boring gray background. But unaffected by the laughs of imaginary peers looking over your shoulder, you fire up the Terminal and type <strong><code>telnet 0.0.0.0 9990</code></strong> (or whatever your device&#8217;s IP was, I cannot remember now). And… you see nothing. Gosh! Open the port in your Firewall man! Do I have to explain you everything?</p>
<p>Finally. There it is. Those two days you spent messing with color settings in the Terminal were so worthy of this screenshot…</p>
<p><img class="size-full wp-image-335" title="Telnet into your iPhone!" src="http://mysterycoconut.com/wp-content/uploads/2010/07/debugserver-02.png" alt="" width="477" height="320" /></p>
<p>Now… what happens if you run this in the simulator? It works too?! Good job!</p>
<h3>Commands?!</h3>
<p>There you are, glancing at the screen full of pride. You can hear the <em>Force Theme </em>finally coming up on iTunes. Sun shines outside. Is that the calendar you were looking for under that pile of printed PDFs? </p>
<p>But wait… what can you do now with this? Are you telling me that you can type &#8220;exit&#8221;??? Really?! How the heck are you going to use this to modify your game at runtime?! Come on, look at those clouds outside!</p>
<p>Well, you obviously have to put more work on this! You grab a notebook and start scribbling a list of commands you need to have, like &#8220;get&#8221; and &#8220;set&#8221; and &#8220;list&#8221; and &#8220;make coffee with sock and fish tank&#8221;, and… I think you are going to need a parser for all that. But after that what? Well you will need to hook your variables to this system, so when you write &#8220;set turtle-mass 1.1&#8243; it converts &#8220;turtle-mass&#8221; into a reference to a specific instance of your StupidTurtle.mass… You start thinking about registers, and command patterns, and lexers… and start crying while the Imperial March booms in the stereo.</p>
<p>OK, OK. Look, I will help you again. Let me present you my friend…</p>
<h3>Lua</h3>
<p>Would not it be nice if you could just type code in that Terminal? That it magically knew how to do operations, and loops, and assignments… that it knew about your variables… that it was as easy as writing in Xcode? Well, you cannot do that. At least not in Objective-C cause, you know, your friend the compiler waits at the end of that track. So what you need is a scripting language. You have read before about games using Python and similar languages to help with their fancy data-orientation. So you look around and find <a href="http://www.lua.org/">Lua&#8217;s ugly website</a>. A scripting language that was made especially to be integrated with C? And <a href="http://lua-users.org/wiki/BindingCodeToLua">with other languages too</a>?? Wait, is that Objective-C in that list?</p>
<p>You check around diverse Objective-C/Lua projects and end up grabbing the <a href="http://luaforge.net/projects/luaobjc/">Lua Objective-C Bridge</a>. Seems kind of old and unmaintained, but you think is worth a try. You download the latest <a href="http://www.lua.org/ftp/">Lua 5.1.4</a> too, and add all the files to your project except for the lua.c, luac.c, and print.c, that you read somewhere are not needed. You go back to your <code>DebugServer</code> header and add a <code>lua_State</code> instance variable, then you change your init method implementation…</p>
<div class="scgeshi-container"><div class="objc scgeshi"><span class="co2">// Prepare Lua interpreter</span><br />
luaState <span class="sy0">=</span> lua_objc_init<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
lua_settable<span class="br0">&#40;</span>luaState, LUA_GLOBALSINDEX<span class="br0">&#41;</span>;</div></div>
<p>Then you add this to your <code>onSocket:didReadData:</code>, right after checking the client didn&#8217;t type &#8220;exit&#8221;.</p>
<div class="scgeshi-container"><div class="objc scgeshi"><span class="co2">// Run Lua</span><br />
luaL_loadbuffer<span class="br0">&#40;</span>luaState, <span class="br0">&#91;</span>input UTF8String<span class="br0">&#93;</span>, <span class="br0">&#91;</span>input length<span class="br0">&#93;</span>, <span class="kw2">nil</span><span class="br0">&#41;</span>;<br />
lua_pcall<span class="br0">&#40;</span>luaState, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;</div></div>
<p>Then you run the app again, connect through the Terminal, and start typing.<br />
<img class="size-full wp-image-335" title="Lua, are you there?" src="http://mysterycoconut.com/wp-content/uploads/2010/07/debugserver-03.png" alt="" width="411" height="362" /><br />
But you get nothing. Then you remember you have not fed the client the results… but what is that in Xcode&#8217;s console?</p>
<p><img class="alignleft size-full wp-image-335" title="Lua running in you Xcode project!" src="http://mysterycoconut.com/wp-content/uploads/2010/07/debugserver-04.png" alt="" width="605" height="115" /></p>
<p>Yes! You start coding like crazy. In a few minutes you have a game loop, some sprites, and a GameState object with some properties and methods. You add the following to your Lua setup:</p>
<div class="scgeshi-container"><div class="objc scgeshi"><span class="co2">// Prepare Lua interpreter</span><br />
luaState <span class="sy0">=</span> lua_objc_init<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<br />
AppDelegate<span class="sy0">*</span> app <span class="sy0">=</span> <span class="br0">&#40;</span>AppDelegate<span class="sy0">*</span><span class="br0">&#41;</span><span class="br0">&#91;</span><span class="br0">&#91;</span>UIApplication sharedApplication<span class="br0">&#93;</span> delegate<span class="br0">&#93;</span>;<br />
GameState<span class="sy0">*</span> game <span class="sy0">=</span> app.gameState;<br />
<br />
lua_pushstring<span class="br0">&#40;</span>luaState, <span class="st0">&quot;game&quot;</span><span class="br0">&#41;</span>;<br />
lua_objc_pushid<span class="br0">&#40;</span>luaState, game<span class="br0">&#41;</span>;<br />
lua_settable<span class="br0">&#40;</span>luaState, LUA_GLOBALSINDEX<span class="br0">&#41;</span>;</div></div>
<p>Just grabbing the GameState object and adding it as a Lua variable &#8220;game&#8221;? How do you call the methods of this object then? Seems <strong>&#8220;game:test()&#8221;</strong> calls <code>[gameState test]</code>, and <strong>&#8220;game:setX_Y_(0, 2)&#8221;</strong> calls GameState&#8217;s <code>setX:Y:</code> selector! And since properties create accessors, you can also call those??? Can it really be that easy?!</p>
<p>The sun is bright, birds sing… as the <em>Rebel Fanfare</em> quicks in, you look at your phone and see somebody is calling… from your favorite coffee place.</p>
<div style='background: #FBE77E; color: black; padding: 0.5em 1em 0.5em 1em; margin-bottom: 1em'>
<p style='padding: 0; margin: 0'>Liked this article? Check out the follow–up and learn <a style='border-color: #0c2b08; color: #0c2b08'  href='/blog/2010/07/conditionally-linked/'>how to include your Lua Telnet Server only in the Debug build of your app</a>.</p>
</div>
<div style='background: #333; margin-left:-125px; margin-bottom: 1em; padding: 1em 1em 0.5em 1em'>
<h3><img src="http://mysterycoconut.com/wp-content/uploads/2010/07/LuaSockets-208x300.png" alt="" title="LuaSockets, featuring… Pancho!" width="208" height="300" class="size-medium wp-image-431" style='float: right; padding: 3px; background: white; margin: 0 0 0.5em 0.5em' />LuaSockets Source Code!</h3>
<p><small>Updated 7/11/2010</small></p>
<p>This Xcode project features one of the inhabitants of Mystery Coconut HQ, Pancho in his usual begging mode. Take a look at the GameState class and its methods and properties. You can access all of these from a telnet session (on port 9990) by typing, for example…</p>
<p><code>game:setRequestsPerSecond(10) <span style='color: #c70'>// that's closer to the real Pancho</span><br />
game:setCloud_toSpeed(0, 3.5) <span style='color: #c70'>// notice how multiple arguments are handled here</span><br />
print(game:numBalloons()) <span style='color: #c70'>// to get properties, just print them through Lua. Remember you don't have access to member variables, just to methods</span></code></p>
<p style='float: right'><strong><a href='/examplecode/LuaSockets.zip'>Download LuaSockets project</a></strong></p>
<p>Have fun experimenting!</p>
<p></code>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mysterycoconut.com/blog/2010/07/tweak-away/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>The True Story of #iDevBlogADay As Told by Things Seen During my Vacation</title>
		<link>http://mysterycoconut.com/blog/2010/06/idevblogaday/</link>
		<comments>http://mysterycoconut.com/blog/2010/06/idevblogaday/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 15:07:12 +0000</pubDate>
		<dc:creator>Miguel A. Friginal</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://mysterycoconut.com/?p=283</guid>
		<description><![CDATA[
@mouseStuckOnACoffeeShopDoor
Eeeeeeeeeeeekkkkk! Oh, God, I thought you were going to step on mee! Well, don&#8217;t look at mee like that! You have never seen a mouse, or what? I am just… resting here, OK? I will bee on my waee when my back legs climb this damn bump. Who had the ideea of putting this stupid [...]]]></description>
			<content:encoded><![CDATA[<div>
<h3>@mouseStuckOnACoffeeShopDoor</h3>
<p>Eeeeeeeeeeeekkkkk! Oh, God, I thought you were going to step on mee! Well, don&#8217;t look at mee like that! You have never seen a mouse, or what? I am just… resting here, OK? I will bee on my waee when my back legs climb this damn bump. Who had the ideea of putting this stupid plastic trim in the middle of the entrywaee anywaee?</p>
<p>Ah yes, you want to know about the #iDevBlogADay thingy. Oh, I can tell you! I saw it all from the very beginning. I was sitting on the blueberry muffins… have you tried them? Oh, yes, they are good. Just don&#8217;t… don&#8217;t eat the ones with… eh… chocolate chips, OK? Just saying. Anyway, this guy was hanging around with one of those new iPhones in hand. Tweeting like crazy, not paying any attention to his wife that had just order a blueberry muffin with chocolate chips for him. He he. He he he hehee. He he was talking with somebody about how great his new blog post was. Full of himself if you ask mee. The other guy is like…</p>
<div class="quotedtweet" id="tw16869020648" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/chrismwaite" title="Christopher Waite" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/chrismwaite_n" alt="chrismwaite" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/chrismwaite" title="Twitter page : Christopher Waite" rel="external">chrismwaite</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Christopher Waite)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> Great post... highly entertaining. You should do them more often.

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/chrismwaite/status/16869020648" rel="external">23-6-2010 18:43:19</a></span> 
				<span>from <a href="http://www.echofon.com/" rel="nofollow">Echofon</a></span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/16855434644" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div>
<p>Just imagine his gloat! The jerk…</p>
<p><span id="more-283"></span></p>
<h3>@deerTryingToSleepInTheRoadShoulder</h3>
<p>Zipping along, zipping along! I am trying to sleep here for God&#8217;s sake! All day long zipping along! And they had a red car too! Do you know people think red cars run faster? Well, is not true. But the drivers sure think they can! Agghh! Saw that one?! That guy didn&#8217;t even saw me!</p>
<p>But yes, of course I saw when it happened. Not like I could sleep, could I??? I knew there was going to be trouble the moment the other guy showed up. He is always trouble if you ask me. He is all soft worded and sneaky and then… Badaboom!</p>
<div class="quotedtweet" id="tw16881808212" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/SnappyTouch" title="Noel Llopis" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/SnappyTouch_n" alt="SnappyTouch" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/SnappyTouch" title="Twitter page : Noel Llopis" rel="external">SnappyTouch</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Noel Llopis)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> <a href="http://www.twitter.com/chrismwaite" rel="external">@chrismwaite</a> You know, that's not a bad idea. If we get <a href="http://www.twitter.com/georgesealy" rel="external">@georgesealy</a> and a couple more, we can have one post every day! :-)

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/SnappyTouch/status/16881808212" rel="external">23-6-2010 22:29:11</a></span> 
				<span>from <a href="http://seesmic.com/app" rel="nofollow">Seesmic Web</a></span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/16871555420" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div>
<p>Saw that? See how fast he invites himself and the Kiwi to the party? I bet he drives a red car.</p>
<h3>@sealShapedPawnWithSadFace</h3>
<p>Is the White Queen looking in this direction? Oomph, have you seen that knife she has? I bet she is thinking of skinning me on the next game. Oomph! :(</p>
<p>That guy looked crazy, OK? Almost as crazy as the White Queen. But at least he didn&#8217;t had a knife. Not one that I saw at least. What he had was one of those annoying iPhone cameras. Snap, snap all over the vitrine, with flash and everything. Do they make iPhones with flash now? I though that guy Seal Jobs was against flash, no? Oh well, the world is crazy, I tell you. </p>
<p>So yes, it was getting big by the minute. Lots of people were joining, don&#8217;t ask me why. Is crazy. </p>
<div class="quotedtweet" id="tw16888230384" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/OwenGoss" title="Owen Goss" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/OwenGoss_n" alt="OwenGoss" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/OwenGoss" title="Twitter page : Owen Goss" rel="external">OwenGoss</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Owen Goss)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> <a href="http://www.twitter.com/SnappyTouch" rel="external">@SnappyTouch</a> Have I been signed up to do blog posts while I was scraping paint off my storm windows? I can sure try! :)

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/OwenGoss/status/16888230384" rel="external">24-6-2010 00:18:27</a></span> 
				<span>from <a href="http://www.echofon.com/" rel="nofollow">Echofon</a></span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/16886258330" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div><br />
<div class="quotedtweet" id="tw16888492850" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/GavinBowman" title="Gavin Bowman" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/GavinBowman_n" alt="GavinBowman" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/GavinBowman" title="Twitter page : Gavin Bowman" rel="external">GavinBowman</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Gavin Bowman)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> <a href="http://www.twitter.com/snappytouch" rel="external">@snappytouch</a> What happened? I step away for a minute and now I have to write a blog post every week?

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/GavinBowman/status/16888492850" rel="external">24-6-2010 00:22:47</a></span> 
				<span>from <a href="http://itunes.apple.com/app/twitter/id333903271?mt=8" rel="nofollow">Twitter for iPhone</a></span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/16884722505" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div>
<p>They didn&#8217;t even have a name or a hash tag! Look!</p>
<div class="quotedtweet" id="tw16893615332" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/GeorgeSealy" title="George Sealy" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/GeorgeSealy_n" alt="GeorgeSealy" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/GeorgeSealy" title="Twitter page : George Sealy" rel="external">GeorgeSealy</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(George Sealy)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/OwenGoss" rel="external">@OwenGoss</a> <a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> <a href="http://www.twitter.com/frederictessier" rel="external">@frederictessier</a> <a href="http://www.twitter.com/GavinBowman" rel="external">@GavinBowman</a> <a href="http://www.twitter.com/Bob_at_BH" rel="external">@Bob_at_BH</a> <a href="http://www.twitter.com/SnappyTouch" rel="external">@SnappyTouch</a> Should we have a name for our blogging support group?

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/GeorgeSealy/status/16893615332" rel="external">24-6-2010 01:46:06</a></span> 
				<span>from web</span> 
				<span> in reply to <a href="http://twitter.com/OwenGoss/status/16890646385" rel="external">Owen Goss</a></span>
			</small>
		</p>
	</div>
</div>
<p>I mean, how can you be tweeting all day about something and not even have a hash tag? Crazy I tell you. They didn&#8217;t have a clue:</p>
<div class="quotedtweet" id="tw16937814869" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/SnappyTouch" title="Noel Llopis" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/SnappyTouch_n" alt="SnappyTouch" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/SnappyTouch" title="Twitter page : Noel Llopis" rel="external">SnappyTouch</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Noel Llopis)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> DailyDevBlog? Incredible iPhone Indies? Week Of Awesomness? iDevBlogs?

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/SnappyTouch/status/16937814869" rel="external">24-6-2010 15:34:56</a></span> 
				<span>from <a href="http://seesmic.com/app" rel="nofollow">Seesmic Web</a></span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/16930532267" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div>
<p>It was my idea. I… oomph, I know about Tweeter. I have been doing it for years and years now. I have the perfect covert too. I can tweet crap about the White Queen all day long, and she will never figure out if it was me or one of the other seven. Not that I have ever done that :( But in this case, it was totally me. I invented #iDevBlogADay. </p>
<p>And he didn&#8217;t even thank me :( Oomph!</p>
<h3>@babyReachingForACigar</h3>
<p><em>Chacho!</em> Can you tell him to stop doing that? Crap! Have been here trying to get to it for an hour and the damn<em> gorrino</em> just keeps moving it away! Stop it! You are not going to help, are you? Fuck it. That other guy didn&#8217;t help me either.</p>
<p>He was freaking out. Everybody wanted a piece of the cake by then. It was like a daycare. &#8220;My ideeea&#8221;, &#8220;I was here fiiirst&#8221;. The cunts. Look how they fight!</p>
<div class="quotedtweet" id="tw16897275819" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/Bob_at_BH" title="Bob Koon" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/Bob_at_BH_n" alt="Bob_at_BH" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/Bob_at_BH" title="Twitter page : Bob Koon" rel="external">Bob_at_BH</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Bob Koon)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/SnappyTouch" rel="external">@SnappyTouch</a> <a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> If you want to get technical, I started it yesterday. :)

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/Bob_at_BH/status/16897275819" rel="external">24-6-2010 02:44:24</a></span> 
				<span>from <a href="http://www.tweetdeck.com" rel="nofollow">TweetDeck</a></span> 
				<span> in reply to <a href="http://twitter.com/SnappyTouch/status/16897120489" rel="external">Noel Llopis</a></span>
			</small>
		</p>
	</div>
</div>
<div class="quotedtweet" id="tw17300389537" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/mysterycoconut" title="Miguel Á. Friginal" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/mysterycoconut_n" alt="mysterycoconut" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/mysterycoconut" title="Twitter page : Miguel Á. Friginal" rel="external">mysterycoconut</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Miguel Á. Friginal)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/SnappyTouch" rel="external">@SnappyTouch</a> That's a great idea! Wait, let me look on Address Book for someone that doesn't have to go to work tomorrow… ABCD… N! Noel! :)

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/mysterycoconut/status/17300389537" rel="external">29-6-2010 02:51:00</a></span> 
				<span>from <a href="http://twitter.com" rel="nofollow">Tweetie for Mac</a></span> 
				<span> in reply to <a href="http://twitter.com/SnappyTouch/status/17300068474" rel="external">Noel Llopis</a></span>
			</small>
		</p>
	</div>
</div>
<div class="quotedtweet" id="tw17126119515" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/HeadcaseGames" title="Headcase Games" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/HeadcaseGames_n" alt="HeadcaseGames" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/HeadcaseGames" title="Twitter page : Headcase Games" rel="external">HeadcaseGames</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Headcase Games)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> I just want some exposure :)

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/HeadcaseGames/status/17126119515" rel="external">27-6-2010 00:01:21</a></span> 
				<span>from web</span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/17119232180" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div>
<p>He was losing it. Then he decided enough was enough, and things got nasty. </p>
<div class="quotedtweet" id="tw16959539471" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/mysterycoconut" title="Miguel Á. Friginal" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/mysterycoconut_n" alt="mysterycoconut" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/mysterycoconut" title="Twitter page : Miguel Á. Friginal" rel="external">mysterycoconut</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Miguel Á. Friginal)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/GavinBowman" rel="external">@GavinBowman</a> look, is going to get nasty if you guys do that. Wednesdays are the only days people can skip.It was in the rules <a href='http://search.twitter.com/search?q=idevblogaday' rel='external'>#idevblogaday</a>

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/mysterycoconut/status/16959539471" rel="external">24-6-2010 20:34:15</a></span> 
				<span>from <a href="http://twitter.com" rel="nofollow">Tweetie for Mac</a></span> 
				<span> in reply to <a href="http://twitter.com/GavinBowman/status/16959011461" rel="external">Gavin Bowman</a></span>
			</small>
		</p>
	</div>
</div>
<p>He made a fucking waiting list and was ready to give the boot to a couple people. </p>
<div class="quotedtweet" id="tw17367020962" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/weheartgames" title="Mike Berg" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/weheartgames_n" alt="weheartgames" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/weheartgames" title="Twitter page : Mike Berg" rel="external">weheartgames</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Mike Berg)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> So if we miss a post, we get the boot?? No pressure!

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/weheartgames/status/17367020962" rel="external">29-6-2010 22:25:28</a></span> 
				<span>from <a href="http://www.echofon.com/" rel="nofollow">Echofon</a></span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/17364849817" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div>
<p>Somehow he got some support too:</p>
<div class="quotedtweet" id="tw17181659732" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/SnappyTouch" title="Noel Llopis" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/SnappyTouch_n" alt="SnappyTouch" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/SnappyTouch" title="Twitter page : Noel Llopis" rel="external">SnappyTouch</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Noel Llopis)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a> Sounds good. After all, the point is to motivate us to write. Getting kicked out isn't the end of the world <a href='http://search.twitter.com/search?q=idevblogaday' rel='external'>#idevblogaday</a>

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/SnappyTouch/status/17181659732" rel="external">27-6-2010 17:30:54</a></span> 
				<span>from <a href="http://seesmic.com/app" rel="nofollow">Seesmic Web</a></span> 
				<span> in reply to <a href="http://twitter.com/mysterycoconut/status/17180876932" rel="external">Miguel Á. Friginal</a></span>
			</small>
		</p>
	</div>
</div>
<p>And when I saw that I told him, &#8220;<em>Chacho,</em> to do all those dirty jobs you need thugs. And a cigar&#8221;.</p>
<div class="quotedtweet" id="tw17054473682" style="background-color:#eef;padding:5px;margin-bottom:5px">
	<div class="tw_user-info" style="padding:10px 10px 5px 0;float:left;text-align:center;width:100px;">
		<div class="tw_thumb">
			<a href="http://twitter.com/SnappyTouch" title="Noel Llopis" class="quoting_pic" rel="external"><img src="http://img.tweetimag.es/i/SnappyTouch_n" alt="SnappyTouch" /></a>
		</div>
		<div class="tw_screen-name">
			<em><a href="http://twitter.com/SnappyTouch" title="Twitter page : Noel Llopis" rel="external">SnappyTouch</a></em>
		</div>
		<div class="tw_full-name">
			<strong>(Noel Llopis)</strong>
		</div>
	</div>
	<div class="tw_content" style="float: left; width: 500px; font: 20pt Georgia, Verdana, sans-serif; font-style: normal;">
		<div class="tw_entry-content">
				<a href="http://www.twitter.com/frederictessier" rel="external">@frederictessier</a> Yes, back to work. Otherwise <a href="http://www.twitter.com/mysterycoconut" rel="external">@mysterycoconut</a>'s won't be the only wrath you'll have to face :-b

		</div>
	</div>
	<div style="clear: both; text-align: left;font-style:italic;margin-left:110px">
		<p class="tw_meta tw_entry-meta" style="margin: 0;padding-top:5px">
			<small>
				<span>On <a href="http://twitter.com/SnappyTouch/status/17054473682" rel="external">26-6-2010 00:30:58</a></span> 
				<span>from <a href="http://seesmic.com/app" rel="nofollow">Seesmic Web</a></span> 
				<span> in reply to <a href="http://twitter.com/frederictessier/status/17054384401" rel="external">Frederic Tessier</a></span>
			</small>
		</p>
	</div>
</div>
<p>So yeah, bad business all together. I would not trust any of the crooks to help a poor bab… fuck! Almost got it! Stop moving the fucking cigar, you idiot!</p>
<h3>@catWithWiseFaceSittingInJapaneseGarden</h3>
<p>Meow! #iDevBlogADay is a group of indie developers that want to blog more regularly. Each day of the week is assigned to 2 people. Each person writes in his own blog about whatever he wants, including silly stories that have nothing to do with real game development. Then they tweet about it with the <a href="http://search.twitter.com/search?q=%23iDevBlogADay">#iDevBlogADay</a> hash tag. If a person doesn&#8217;t blog during his assigned day, his spot is given to a different developer. You can read all the participating blogs through the group&#8217;s <a href="http://pipes.yahoo.com/pipes/pipe.run?_id=52b65f0bbfca4cc92db78d0b0408cac6&amp;_render=rss">RSS feed</a>. If you are an indie developer and you want to participate, ask <a href="http://twitter.com/mysterycoconut">@mysterycoconut</a> to be included in the waiting list.</p>
<p>Meow.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mysterycoconut.com/blog/2010/06/idevblogaday/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Levels</title>
		<link>http://mysterycoconut.com/blog/2010/06/levels/</link>
		<comments>http://mysterycoconut.com/blog/2010/06/levels/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 07:56:46 +0000</pubDate>
		<dc:creator>Miguel A. Friginal</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[idevblogaday]]></category>

		<guid isPermaLink="false">http://mysterycoconut.com/?p=240</guid>
		<description><![CDATA[Let&#8217;s imagine that you, being the entrepreneurial indie iPhone game developer you are, are making one of those games with multiple levels; maybe old school, but at least easy enough for you to make a few levels, sell your game, then add more levels if sales permit. You start programming and after a few quick [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s imagine that you, being the entrepreneurial indie iPhone game developer you are, are making one of those games with multiple levels; maybe old school, but at least easy enough for you to make a few levels, sell your game, then add more levels if sales permit. You start programming and after a few quick prototypes you have your little man running on the screen, bullets flying, dumb monsters chasing him. Since you have embraced the<em> rapid prototyping method,</em> and since you are having fun, you keep adding all kinds of stuff: flying quesadillas, cannibalistic herbivorous plants, trash cans full of cats (there need to be cats). For each new item you add to your test level, you write some code that more or less looks like this:</p>
<pre>struct CannibalisticHerbivorousPlant
{
    CannibalisticHerbivorousPlant()
        : position(0,0)
        , velocity(0,0)
        , hunger(HungerType::Atrocious)
    {}
    Vector2D position;
    Vector2D velocity;
    HungerType::Enum hunger;
};

CannibalisticHerbivorousPlant cannHerbPlants[MAX_PLANTS];

cannHerbPlants[0].position = Vector2D(10, 13);
cannHerbPlants[1].position = Vector2D(-5, 0);
cannHerbPlants[2].position = Vector2D(13, 0);
...</pre>
<p>I know, that doesn&#8217;t look like anything I would ever code myself, but we are talking about you after all, and you have to recognize that when you are in<em> rapid prototyping mode,</em> you are pretty sloppy.</p>
<p><span id="more-240"></span></p>
<p>Your development cycle at this point is something like this:</p>
<ol>
<li>Code furiously, adding the functionality for the new items or monsters, then their position and other state in your test level.</li>
<li>Compile. Go get coffee, the sloppy code is getting kind of big.</li>
<li>Run the app. Find that you put a plant in mid-air. Although you archive the idea for a future feature, you decide right now it just looks ridiculous.</li>
<li>Modify the position in your code.</li>
<li>Recompile. Go get another coffee.</li>
</ol>
<p>After a few dozen items, and some hundreds of modifications, your hands are shaking all over the keyboard, and you swear your IDE is spawning duplicate windows like Gauntlet ghosts. Time to take an extra shot, and think about your tools.</p>
<h3>Unsolicited Advice #1: Spend Time on Tools</h3>
<p>So the code is getting messy by the minute, and this is just the test level! In the long run you are going to need something that loads the different levels, and saves player progress. You have heard of this technique of just <a href="http://www.joelonsoftware.com/items/2008/02/19.html">dumping your memory into a binary file for a quick load/save</a>, so you do that. You ran your game once more, save the initial contents of memory into a file, then proceed to get rid of all the code that initialized your test level, and replace it with a nice simple call to your new load function. It works. Purrffect.</p>
<p>But wait, there is an upside down quesadilla just flying by! How did you managed to miss that? So you look at the hex dump of your level file and you wonder… is that <code>63A0</code> the orientation of the quesadilla? Or the grow rate of your zombie peppercorn?</p>
<p>Obviously, you need a better way to do this. You are sold on this prototype and want to go full steam ahead! What you need is a level editor to create and edit these files, one with a <a href="http://starcraft.org/files/382">user-friendly interface</a>. Even better if is one of those fancy GUI apps where you drag stuff around. That way there will be no more guessing, no more floating plants, no more quesadillas flying out of formation! It will increase the speed of your development cycle tenfold! Once it is done. And gosh, that sounds like a lot of extra work. Just thinking about it you don&#8217;t feel so agile anymore. So you prepare for the hardship hoping you can ship in a couple years if you don&#8217;t get fed up with the damn editor first. Well, I have something to tell you:</p>
<h3>Unsolicited Advice #2: Don&#8217;t Get Stuck!</h3>
<p>You are blocked. You have looked into doing an application with windows and stuff, and all that Model-View-Controller, event queue, menu managing crap weights like a tombstone on your game&#8217;s back. You need to look for alternatives. What do you need, really? An application with a GUI, and a file in your specific memory format at the end. Maybe you can use an <a href="http://www.mapeditor.org/">open source editor</a> and write an exporter for your format? Or write a command line tool that converts their format into yours?</p>
<p>So you keep thinking about that while you go to your daytime job where you maybe create animated Flash intros with no mute buttons, another one of those stupid drag-n-drop JavaScript shopping carts, and a website or two with a backend database full of <a href="http://www.google.com/images?q=nick+nack">nicknacks</a> that somebody expects to sell. You come back home still wondering how to make this GUI where you drag-n-drop your graphics, and somehow saves all that data without too much effort. You decide to go to the coffee shop, iPad under your arm, see if you get inspired by the barista of the day. Would not it be wonderful if you could run your editor right there in the coffee shop too? In your iPad?</p>
<p>If it was me, I sure would use all those <a href="http://www.apple.com/html5/">nice tools</a> <a href="http://plugins.jquery.com/">available out there</a> <a href="http://jsfromhell.com/classes/binary-parser">that I am used</a> <a href="http://us3.php.net/manual/en/function.fwrite.php">to work with</a>. Since we are talking about you, <a href="http://www.blender.org/">maybe you use</a> <a href="http://www.adobe.com/products/flash/">different tools</a>. But, just for the sake of it, let&#8217;s imagine you are like me. You start thinking of creating a &#8220;proper&#8221; Mac or Windows application, then you change your mind and change it into an iPad one, then you realize you will spend more time messing with code that has nothing to do with your levels than anything else. You change it into a website, with a MySQL or PostgreSQL database, and PHP scripts. But finally you go for the fastest solution: 200 lines of JavaScript, the browser&#8217;s SQLite database, a single PHP web service to export the files. A few hours later you have a working editor.</p>
<p>And that&#8217;s kind of the point: use whatever you think you can pull off faster. Use the tools you know best, or the ones that others have created before you, and concentrate only on your custom parts. Don&#8217;t get stuck on doing things a certain way just because that&#8217;s how everybody else with a multimillion dollar budget is doing it. You are an indie! Being small and being able to adapt to changes is your strength! You can change your code really fast, change your tools, change your goals. And at this point, almost anything is valid as long as you can continue concentrating in making your game.</p>
<h3>Unsolicited Advice #3:<br />
Faster Development != Faster Coding</h3>
<p>Is sunny again. You are sitting in the coffee shop showing the barista of the day your fancy editor running in Safari, having fun placing quesadillas in the sky. &#8220;Cool! Can I play it now?&#8221; she asks. Mmmm&#8230; let&#8217;s look at your development cycle again:</p>
<ol>
<li>You let the barista of the day change the quesadilla&#8217;s formation in your editor. You export the level.</li>
<li>You pull out your MacBook from the bag, start XCode, replace the level file. The barista of the day goes attend another client.</li>
<li>You compile your app while you sip your coffee nervously. You hear giggling coming from the far side of the counter.</li>
<li>After what seems like ages the game finally loads. You jump off your chair, iPhone in hand, to show it to her. She gives you the &#8220;who are you?&#8221; look, then continues talking with the other guy.</li>
</ol>
<p>Wait a moment! That doesn&#8217;t seem to be any faster than before! OK, but at least you don&#8217;t have any upside down quesadillas, that would have been embarrassing. But how do we make this faster? Maybe loading the level file on the fly? Haven&#8217;t you seen some video recently of a guy saying <a href="https://deimos.apple.com/WebObjects/Core.woa/BrowsePrivately/adc.apple.com.4088182973.04088182975.4092394208?i=1319390178">loading content from the web will make your designers wet themselves</a>?</p>
<p>So you modify your load function so it loads from a URL instead of from a local file, adding <code>#ifdef</code>s all over the place to make sure that only runs on your Debug build. Let&#8217;s rewind:</p>
<ol>
<li>You let the barista of the day change the quesadilla&#8217;s formation in your editor. Is that a… bunny head? Whatever. She clicks Save and the level is saved in the server.</li>
<li>You pull out your iPhone and start the game. She squeals with delight when the quesadillas fly by. Ooops. One of them hit a house.</li>
<li>She goes back to the editor giggling. Some guy leaves cause he was tired of waiting.</li>
</ol>
<p>Now we are talking. That kind of development cycle will let you tweak your levels to your hearts content! You will be so productive this will be done in like no time at all! Now, if you could only stop getting distracted by the barista of the day… seems she wants more bunnies. Maybe <a href="http://www.youtube.com/watch?v=XcxKIJTb3Hg">killer bunnies</a>. Back to coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysterycoconut.com/blog/2010/06/levels/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Not anymore&#8230; a 404</title>
		<link>http://mysterycoconut.com/blog/2009/02/welcome/</link>
		<comments>http://mysterycoconut.com/blog/2009/02/welcome/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 00:41:51 +0000</pubDate>
		<dc:creator>Miguel A. Friginal</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://mysterycoconut.com/?p=1</guid>
		<description><![CDATA[Hello there! Welcome to the site and blog of Mystery Coconut Games, aka that one person game company in Tacoma, Washington, that has not actually published any games yet.

First of all, let me get it out of the way: I am sorry. For three months now we have been selling one application for the iPhone/iPod [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-80" src="http://mysterycoconut.com/wp-content/uploads/2009/02/frankencat.png" alt="" width="120" height="162" />Hello there! Welcome to the site and blog of <strong>Mystery Coconut Games</strong>, aka that one person game company in Tacoma, Washington, that has not actually published any games yet.</p>
<p><span id="more-1"></span></p>
<p>First of all, let me get it out of the way: I am sorry. For three months now we have been selling one application for the iPhone/iPod Touch, the excellent <a href="/pip">Pip dice simulator</a>. In those three months around 700 people bought it. Seven hundred may not seem a lot to you, specially if you have been reading any iPhone developer success stories recently, but it is way more than I expected for an app that, even through really polished, was competing against a plethora of similar offers.</p>
<p>The thing is, for the whole three months, the Mystery Coconut site has only been a splash screen; no support page, no additional information about us or about Pip, no sign we were alive or even care about the product except for <a href="http://mysterycoconut.uservoice.com">our UserVoice pages</a>. I got an email the other day that nicely sums up what probably has been the unfortunate reaction of most people looking into Pip.</p>
<blockquote><p>No help page? No troubleshooting? No FAQ? Not even a list of those scrolling tips? Taking bug reports is great, but you need to give your customers a little more info.</p></blockquote>
<p>So true. Did I say sorry already?</p>
<p>The good news is the site is up, you are reading the first entry of the blog, we have support pages for Pip and news about the upcoming 1.1 version. We are alive and well, and if you are a customer, we have you covered (if you are not, try us out!). Being a one person company is not easy. I put lots of effort into the site and I hope the wait was worth it. I am still working on implementing search, more screenshots and videos for Pip, and some other features. Your feedback is as welcomed as ever, and this time way easier to send my way. So now, let&#8217;s roll!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysterycoconut.com/blog/2009/02/welcome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
