<?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>#AltDevBlogADay &#187; Paul Evans</title>
	<atom:link href="http://www.altdevblogaday.com/author/paul-evans/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.altdevblogaday.com</link>
	<description>Each day a little more #gamedev love</description>
	<lastBuildDate>Thu, 17 May 2012 03:06:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>ActionScript Tips for Programmers of C#/C++</title>
		<link>http://www.altdevblogaday.com/2011/11/12/actionscript-tips-for-programmers-of-cc/</link>
		<comments>http://www.altdevblogaday.com/2011/11/12/actionscript-tips-for-programmers-of-cc/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 10:04:31 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Paul Evans]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=20018</guid>
		<description><![CDATA[Over the last few weeks I have been learning ActionScript on the job. I come from a C# and C++ background and would like to share a few tips for programmers experimenting with ActionScript 3. This is by no means a complete resource on the subject and I will correct this article based on feedback in the comments.]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Over the last few weeks I have been learning ActionScript on the job. I come from a C# and C++ background and would like to share a few tips for programmers experimenting with ActionScript 3. This is by no means a complete resource on the subject and I will correct this article based on feedback in the comments.</p>
<h2>Types</h2>
<p>ActionScript 3 has 32 bit integers but no 64 bit integers, signed or unsigned. The Number class is a IEEE-754 double-precision floating-point number, so does not cover the same range as a 64 bit integer (53 bits vs 64 bits). There are also warnings about performance in <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Number.html">Adobe Number documentation</a>.</p>
<p>Arrays are &#8220;<a href="http://en.wikipedia.org/wiki/Sparse_array">sparse arrays</a>&#8221; which are not necessarily a block of consecutive memory. An ActionScript array seems to be more like a table, where each position has a &#8220;next&#8221; redirection for the following defined value. There can be holes in the indexes that are undefined. The documentation warns against using a class to create associative arrays and suggests using the Object class instead. See <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Array.html">Adobe Array documentation</a> for more details.</p>
<p>Vectors are &#8220;dense arrays&#8221; where each element has a value. All elements are expected to be the same data type. Vectors seem closer to what programmers from other languages may think of as an array. The <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Vector.html">Adobe Vector documentation</a> lists pros and cons of using vectors over arrays, one of which is performance.</p>
<p>Without the <a href="http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7ea7.html">/g global flag</a> regular expressions (The <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/RegExp.html">RegExp</a> class) only matches the first item.</p>
<h2>Operator == vs ===</h2>
<p>There are a few more operators to look out for in ActionScript &#8211; a few existing ones have their meaning changed too. <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/operators.html">[Adobe Operators Documentation]</a></p>
<p>Lets start off with &#8216;strict equality&#8217; (<a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/operators.html#strict_equality">===</a>) versus &#8216;equality&#8217; (<a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/operators.html#equality">==</a>).</p>
<p>The <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/operators.html#equality">==</a> operator attempts to convert things to a common form for comparison and in the case of objects, arrays and functions falls back to being compared by reference. In short a string with the value &#8220;1&#8243; will match a numeric type with the value 1 through an implicit conversion.</p>
<p>The <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/operators.html#strict_equality">===</a> operator still tries to convert between different numeric based types (Boolean, int, Number and uint) but not for anything else. Variables representing anything else are compared by reference.</p>
<h2>Operator &gt;&gt; vs &gt;&gt;&gt;</h2>
<p>There are two types of shifting types to think about and in C++ the shift is context sensitive on the type.  The <a href="http://en.wikipedia.org/wiki/Logical_shift">logical shift</a> moves all bits in the operand.  In C++ this is what an &gt;&gt; operation does on an unsigned type; in ActionScript to do the same operation use the &gt;&gt;&gt; operator.</p>
<p>The alternative type of shift is an <a href="http://en.wikipedia.org/wiki/Arithmetic_shift">arithmetic shift</a> which happens in C++ on signed types.  Both C++ and ActionScript use the &gt;&gt; operation.</p>
<p>0111 1111 1111 1111 1111 1111 1111 1111 = 2147483657 = max value of 32 bit signed int</p>
<p>1111 1111 1111 1111 1111 1111 1111 1000 = -8 int or uint 4294967288</p>
<p>0111 1111 1111 1111 1111 1111 1111 1100 = 2147483644</p>
<p>1111 1111 1111 1111 1111 1111 1111 1100 = -4 int or uint 4294967292</p>
<p>1111 1111 1111 1111 1111 1111 1111 1110 = -2 int or uint 4294967294</p>
<p>1111 1111 1111 1111 1111 1111 1111 1111 = -1 int or uint 4294967295 = max value of 32 bit unsigned int</p>
<p>So the bit patterns between -8 &gt;&gt; 1 and -8 &gt;&gt;&gt; 1</p>
<p>1111 1111 1111 1111 1111 1111 1111 1000 = -8 Input</p>
<p>1111 1111 1111 1111 1111 1111 1111 1100 = -4 Output ActionScript &gt;&gt;</p>
<p>0111 1111 1111 1111 1111 1111 1111 1100 = 2147483644 Output ActionScript &gt;&gt;&gt; or unchecked C# &gt;&gt;</p>
<p>Note how &gt;&gt; keeps a 1 on the first bit, where &gt;&gt;&gt; puts a zero in the left most bit.</p>
<p>For further information, see the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/operators.html#bitwise_unsigned_right_shift">code examples in Adobe documentation</a>.</p>
<h2>Conclusion</h2>
<p>This article is ripe for expansion. Please link to other resources in the clients, and if any other authors want to discuss this, go ahead!</p>
<p>EDIT: Please read the comments, people have already been contributing good tips. :0)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/11/12/actionscript-tips-for-programmers-of-cc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Idempotent &#8211; A Word in the Cloud</title>
		<link>http://www.altdevblogaday.com/2011/10/09/idempotent-a-word-in-the-cloud/</link>
		<comments>http://www.altdevblogaday.com/2011/10/09/idempotent-a-word-in-the-cloud/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 19:19:12 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[Paul Evans]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=18076</guid>
		<description><![CDATA[<p>While learning how to use <a href="http://aws.amazon.com/">Amazon Web Services</a>, a new word entered my vocabulary &#8211; idempotent. It is a disconcerting word, sounding a little like something that unlucky men might want to get a prescription to treat.</p>
<p><a href="http://www.altdevblogaday.com/2011/10/09/idempotent-a-word-in-the-cloud/" class="more-link">Read more on Idempotent &#8211; A Word in the Cloud&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p>While learning how to use <a href="http://aws.amazon.com/">Amazon Web Services</a>, a new word entered my vocabulary &#8211; idempotent. It is a disconcerting word, sounding a little like something that unlucky men might want to get a prescription to treat.</p>
<p><a href="http://en.wikipedia.org/wiki/Idempotence">Idempotence</a> within a system means that repetitions of an action do not effect the outcome. I am not going to go in to the etymology or the mathematical definitions of the concept, but I will attempt to explain why as a programmer this is interesting.</p>
<h2><a href="http://altdevblogaday.com/wp-content/uploads/2011/10/stage_round_rock-640x428.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/10/stage_round_rock-640x428_thumb.jpg" alt="stage_round_rock (640x428)" width="244" height="164" border="0" /></a></h2>
<h2>The Audition</h2>
<p>No matter how many times a function is performed with the same inputs, the output is the same. The time has come for the audition, the curtain raises, enter stage right the programmer, beaming at the audience.</p>
<p>Programmer mutters under her breath the reassuring mantra &#8220;<em>arrange, act, assert</em>&#8221; takes a bow and shows the audience a few empty boxes. She has done this all before; she knows what to expect. She requests a few valuable items from members of the audience and through a myriad of different impressive feats, these items fly through the air and land in the boxes. Then she shows the results to the audience members who respond with enthusiastic applause.</p>
<p>Between each routine, the programmer arranges everything back to a known starting point, emptying the boxes. She requests a single item from each audience member. Using magic, she transports each item to a box. She shows the approving audience that yes, the right item is in the right box then returns it.</p>
<p>This kind of magic is possible when the audience is well behaved and predictable. A request for one item results in one item given.</p>
<p>There&#8217;s a few unfamiliar faces who come in late and sit at the front. They heckle, they have their own magic. Programmer on stage thinks she can handle them using the same tricks she has always known. Amazon sisters <a href="http://aws.amazon.com/sqs/">SQS</a> and <a href="http://aws.amazon.com/simpledb/">SimpleDB</a> know differently.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/10/swim_with_the_fishes-640x428.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/10/swim_with_the_fishes-640x428_thumb.jpg" alt="swim_with_the_fishes (640x428)" width="244" height="164" border="0" /></a></p>
<h2>The Heckle</h2>
<p>Some of the Amazon web services like SQS and SDB promise that something will happen at least once. While the programmer is used to receiving one or more item from the audience, she starts noticing something a little strange about the things coming from these Amazon hecklers. At some point in midair it appears that one unique item becomes two or more. She has to work harder to catch these clones.  She is glad she was prepared and had asserted what she was expecting; or those clones could have flown by unnoticed and turned in to nasty dangerous bugs.  The kind that have crept up behind others and caused nasty injuries.  She hates bugs.</p>
<p>What value is there in letting this disruptive element to the show?  Are these non-idempotent Amazon services providing any benefit? There are two forms of scalability to consider &#8211; <em>up</em> and <em>out</em>.</p>
<p><em>Scaling up</em> is a more traditional solution. This requires adding capacity to a service provided on a machine which is achieved by means of adding memory, processors and hard drive space.</p>
<p><em>Scaling out </em>is to add more (cheaper) machines to handle traffic to a service. Instead of one mega server machine, many drones can provide the same service while it may appear as one mega machine to the outside world. Keeping the worker drones synchronized is difficult. While eventually all the drones will know what the others have done, the overhead of synchronization means they will not know instantly.</p>
<p>Server capacity can be added by adding another drone during peak demand. Drones can be quietly dispatched when they are no longer required, saving energy and money. A well architected system is more resilient because a new drone can take over seamlessly from a failed one.</p>
<p>The challenge of potentially large lag times before data is consistent forces a programmer to think differently. Similar challenges exist in writing well-behaved multithreaded systems; except here there are more things to go wrong during data transmission and storage.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/10/opening_the_gates-640x428.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/10/opening_the_gates-640x428_thumb.jpg" alt="opening_the_gates (640x428)" width="244" height="164" border="0" /></a></p>
<h2>Solutions</h2>
<p>There were two approaches she decided to take in order to deal with these clones.</p>
<p>For tricks where a single item was expected back, she arranged a box to vaporize the old when receiving the new. This was a simple variable overwrite; each new unique value had a unique box that was created if it did not exist.  If it did exist, the contents were replaced by the next received item.  Unfortunately that did not solve tricks that required aggregation. The vaporizing box was no good for keeping count of things.</p>
<p>The second approach she attempted was to remember the items she had already seen and throw the unexpected clones off stage. This was okay when she could keep all that information in memory. There was a limit to how many unique things she could remember before she has to ask for timeouts. She had to start to use a list to check against things she has already dealt with to weed out the mischievous clones.</p>
<p>The programmer was just one consumer; the audience producing the items to store away could scale out to hundreds… thousands… millions. While some of the audience were okay with waiting, others grew unimpressed and left. Being an idempotent consumer was turning out to be a bottle neck.</p>
<p>The trick with different models of watches all going to the same box no longer worked. The audience would believe six watches were thrown, but the box would could contain many more &#8211; it was cluttered with clones.  Some audience members only cared if they could get their watch back, but for the accountants in the audience the total was important.</p>
<p>Timing and order was a challenge.  Sometimes item clones would pop out of the air a long time after receiving the original items. Things would pause midflight and arrive inexplicably after things thrown later.</p>
<p>The hecklers were introducing all kinds of complexity to what used to be a simple routine. Things would be dealt with eventually, but it was getting difficult to predict the end of an act.</p>
<h2><a href="http://altdevblogaday.com/wp-content/uploads/2011/10/sunset-640x428.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/10/sunset-640x428_thumb.jpg" alt="sunset (640x428)" width="244" height="164" border="0" /></a></h2>
<h2>Conclusion</h2>
<p>So the imagery is a little silly but with any luck if you are a programmer with any level of experience that did not know what idempotent meant… you have some idea now. Writing scalable idempotent consumption of a service that sends the same thing more than once can be tricky.</p>
<p>The Amazon Queue Service (SQS) may deliver a message more than once. Amazon SimpleDB may repeat a unique result across different query pages. A simple <em>for each</em> <strong>bar</strong> <em>do</em> <strong>foo </strong>will not suffice if <strong>foo </strong>should only be executed once per <strong>bar</strong>. <strong>Foo</strong> must be idempotent, or the collection of <strong>bar</strong> filtered.</p>
<p>The two common approaches I covered boil down to uniquely identifying everything and storing using that identity, and processing things stored by tracking the unique identify of things already processed.</p>
<p>Keeping track of data acted upon is necessary for things that should only happen once. For example, a cash machine should only ever deduct the money taken out of an account for a unique withdrawal transaction once; otherwise the account balance would be incorrect.</p>
<p>Work can be split up by techniques that involve using &#8220;<em>shards</em>&#8221; and &#8220;<em>map reduce</em>&#8221; &#8211; both out of scope for this particular article. Though as a note, the <em>reduce</em> part of <em>map reduce </em>in implementations I have seen must be idempotent.</p>
<p>Programmers with a functional language in their arsenal probably have an edge here over those purely from a purely object-oriented background because of the way those languages make you think about data.</p>
<p>Keep in mind two things if you are considering data processing to cloud technologies. Keep the word &#8220;idempotent&#8221; in mind and pay attention to the &#8220;at least once&#8221; small print in the documentation. Secondly some services only promise to be <em>eventually correct</em> &#8211; decide when that is good enough. Do your users really need to know what the state is as of right that second, or is a minute ago good enough?</p>
<p>I am still learning myself, so if you have any insight or articles of your own please share them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/10/09/idempotent-a-word-in-the-cloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Behind the Scenes of Bit By Bit Games First Release</title>
		<link>http://www.altdevblogaday.com/2011/09/09/behind-the-scenes-of-bit-by-bit-games-first-release/</link>
		<comments>http://www.altdevblogaday.com/2011/09/09/behind-the-scenes-of-bit-by-bit-games-first-release/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 03:12:15 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
				<category><![CDATA[Bizdev]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Danni Evans]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[games company]]></category>
		<category><![CDATA[indie]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[Kieran Nee]]></category>
		<category><![CDATA[Matthew Hanlon]]></category>
		<category><![CDATA[Paul Evans]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=16131</guid>
		<description><![CDATA[Matthew Hanlon is one of my friends back in the UK that has taken that leap of faith… he founded an independent self-publishing game studio. This guest post from Matt details the development of the studio's first release "Endless Lines". The post is from Matt's perspective (with an editorial pass from me).]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="http://twitter.com/#!/thebag1981">Matthew Hanlon</a> is one of my friends back in the UK that has taken <em>that</em> leap of faith… he founded an <a href="http://bitbybitgames.co.uk">independent self-publishing game studio</a>. This guest post from Matt details the development of the studio&#8217;s first release &#8220;<a href="http://itunes.apple.com/gb/app/endless-lines/id447835444?mt=8">Endless Lines</a>&#8220;. The rest of this post is from Matt&#8217;s perspective (with an editorial pass from me).</p>
<h2>A Studio Is Born</h2>
<p>It has been about a month since I released <a href="http://bitbybitgames.co.uk/Bit_By_Bit_Games/Endless_Lines.html">Endless Lines</a> so I thought I&#8217;d take a quick look back at its five weeks of development.</p>
<p>At the start of June I left my job at Lionhead Studios where I&#8217;d been working as a gameplay programmer for the previous seven years.  I went straight from school to university, spent six years at university and then immediately joined Lionhead.</p>
<p>At 30 I was suddenly in a world without a set structure for the first time since I started primary school at the age of 4.  Fortunately I was best man at a friend&#8217;s wedding the weekend I was leaving Lionhead so I spent far more time worrying about the speech than being scared about leaving my job.</p>
<h2>The Plan</h2>
<p>My plan was to start with a small, simple project I could complete on my own.  My goals were to:</p>
<ul>
<li>Get used to working at home rather than in an office environment.</li>
<li>Get used to working on my own rather than part of 70+ person team.</li>
<li>Finish something to prove to myself I can see a project like this through to completion before moving onto larger, more ambitious games.</li>
</ul>
<p>I chose to use SDKs and middleware wherever possible to save reinventing the wheel.  These things aren&#8217;t a magic bullet that will do everything for you but they can significantly speed up your development process if used correctly.</p>
<p>My advice to anyone doing this themselves is to talk to others using an SDK and look at a wide range before deciding on one.  Every SDK and piece of middleware has its limitations and flaws so be sure to check their forums. Of course you have to know what you&#8217;re making and what your target platform is before you go looking for an SDK&#8230;</p>
<h2>A Concept</h2>
<p>The initial concept for the game that would become Endless Lines was an idea I had last Christmas. I thought about action puzzle games for the iPhone and control schemes based around the touch screen, rather than those using button controls or virtual D-pads.</p>
<p>I had an earlier concept filed away in my head about a falling block game where the blocks have lines on them.  The player arranges these blocks to form a line across the play area or forms a loop with them.</p>
<p>These two ideas merged into a game where there is a full board of blocks. The goal is to create paths/lines from one side of the board to the other. This is achieved by moving the columns up &amp; down rather than the block itself.</p>
<h2>Corona SDK</h2>
<p>After playing around with a few SDKs for iOS development I settled on <a href="http://www.anscamobile.com/corona/">Corona by Ansca Mobile</a>.  Corona is a 2D SDK targeting iOS and Android platforms, ideal for my needs.  It uses the Lua language &#8211; another positive for me as that’s what all the AI written for Fable 2 &amp; 3 used. I’d spent the previous five years with my coding split between C++ and Lua.</p>
<p>I imagine most people with experience of developing games evaluating Corona have the same reaction as me – Where’s my game loop? How do I set up objects? How do I associate this function with this thing, input?</p>
<p>Corona is designed to make development quick and easy, especially on the graphics and interaction side.  Once you get a handle on how it works, it becomes very easy and fast to work with.</p>
<p>I’ll give you some examples of what I mean.  Retina support is all taken care of for you as long as you supply a .png &amp; a @2x.png and use the correct display function. For Open Feint leaderboards I would set aside a day to get them into the game&#8230; but a few lines of code later and it was done.</p>
<p>The best thing about Corona is the community that has grown up around it. The community share code and help each other out.  There are people giving away chunks of code just to help the community. For example if you want some code to manage the scenes in the game then look no further than <a href="http://rauberlabs.blogspot.com/">Ricardo Rauber’s Director class</a>.  How about some extensions to SDK functions and a great wrapping of the save load system? Then check out <a href="http://www.crawlspacegames.com/crawl-space-corona-sdk-library/">CrawlSpace Games’ CrawlSpaceLib</a>.  I took advantage of both of these. If you are using Corona you should check them out too.</p>
<p>There are some things I think need improved with Corona. A visual debugger would be a most welcome addition, but I’m not going to go on about it as they are constantly updating and improving the product. They are very good about listening to feedback.</p>
<h2>Prototype</h2>
<p>I took a couple of days to make my technology choices with confidence after familiarising myself with the SDK and looking at other people’s code. Now it was time to start my game.</p>
<p>After the first day, I had a basic playable prototype up and running:</p>
<p><a href="http://bitbybitgames.co.uk/BitBlog/wp-content/uploads/2011/09/6yks1v.png"><img style="margin: 0px;padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/09/clip_image001.png" alt="clip_image001" width="243" height="244" border="0" /></a></p>
<p>Not a looker with the titles quickly drawn in Paintbrush (some of the edges don&#8217;t even match up) but it was functional. The columns could be moved and the game recognised paths, but didn’t remove them yet.</p>
<h2>Path Finding</h2>
<p>Since it was designed for mobile platforms, I was always concerned with the code for the path-finding taking up too much CPU time.  The path-finding code had to do two things:</p>
<ol>
<li>Highlight blocks that are connected to the left edge of the board and therefore are part of a possible path.</li>
<li>Recognise a complete path from the left to the right side of the board.</li>
</ol>
<p>The first uses a simple flood fill style recursive algorithm to find which blocks are connected to the left edge of the board.  If a block is connected to the left edge, then it checks all the blocks around it. If it is connected to any of those, they then perform the same check.  This continues until it’s flagged all the blocks that have a connection to the left edge.</p>
<p>There is only a complete path when one of the blocks in the right most column is flagged as having a connection to the left edge.  When this is the case, code is run which finds the path across the board from right to left only looking at blocks that are flagged.</p>
<p>Splitting it this way gave me code which never impacted the game&#8217;s performance. It was written once and remains unchanged.</p>
<h2>Evolving Design</h2>
<p>A significant change from the original concept was allowing the rows to be moved as well as the columns.  During the first couple of weeks of development if a path was detected, it was immediately removed. This was changed so paths weren’t found until after the player have finished moving; paths were cleared on the player’s terms.  These two changes allowed the creation of longer, more satisfying, high scoring paths.</p>
<p>This type of gameplay lends itself very well to timed gameplay modes.  To me Blitz and Sprint are the core of the game, Zen is essentially a practice mode which I considered not including.</p>
<p>The time-focused core modes made the special blocks almost pick themselves.  There are three of these blocks:</p>
<ul>
<li>Multipliers – These appear when more than a certain amount of blocks are removed in one go.  They simply increase the points value per block.</li>
<li>Bombs – These take out all the blocks in the row and column they are in.  Originally they just removed the blocks surrounding them but that wasn’t enough of an incentive to make players go for them.</li>
<li>Locks – These prevent the row &amp; column they are in from being moved.  These are ideal for Sprint mode where the player is trying to reach a target score as quickly as possible because they are a small obstacle to be overcome along the way.  Locks were also in Blitz mode, but just removed all the fun from the mode when they appeared so were removed.</li>
</ul>
<p>In Sprint mode the sequence of bombs &amp; locks is always the same for each of the three targets (each target has a different sequence).  This was suggested by my <a href="http://twitter.com/#!/kieran_nee">flat-mate</a> when testing the game. This way everyone has the same challenge so times are achieved based on skill rather than luck helping them get the quickest time.</p>
<p><a href="http://bitbybitgames.co.uk/BitBlog/wp-content/uploads/2011/09/tiles_example.png"><img style="margin: 0px;padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/09/clip_image002.png" alt="clip_image002" width="244" height="64" border="0" /></a></p>
<h2>Art</h2>
<p>My biggest worry was always the art. For this game, I was doing everything myself so I had to pick an art style I could produce.  In the end, I decided to try and make the blocks look like they were physical board game tiles.</p>
<p>The art was always the slowest part.  I decided to add an email feedback button to the main menu, the code to add this functionality was trivial, creating a button that looked good and read well took hours.</p>
<p>I got very familiar with Photoshop again and abused all the tricks I’ve picked up over the years.  I’m happy with the work I produced for the game, but in the future I will be looking for an artist to work with.</p>
<p><a href="http://bitbybitgames.co.uk/BitBlog/wp-content/uploads/2011/09/ELScreens1.png"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/09/clip_image003.png" alt="clip_image003" border="0" /></a></p>
<p>The only thing I didn’t do myself was the music, which I licensed.  This was quicker than doing it myself but it still took two days going through various music licensing sites listening to samples.</p>
<h2>Release</h2>
<p>Five weeks after I started Endless Lines, I submitted it to Apple.</p>
<p>The main aim of this first project was to get used to working like this rather than as a cog in a big machine and it worked.  I’ve released one update for Endless Lines so far. There will be more but right now I’m working on a couple of other projects.</p>
<p>During most of the development of Endless Lines I kept &#8220;normal&#8221; working hours. As things went on, I worked at the weekend and did a few hours in the evening but nothing crazy and it was never a chore; I wanted to work on it.</p>
<p>Overall I’m happy with how Endless Lines turned out, especially given its short development time. It&#8217;s picked up some good reviews; you can find the links in previous blog entries (<a href="http://bitbybitgames.co.uk/BitBlog/?p=10">here</a> and <a href="http://bitbybitgames.co.uk/BitBlog/?p=25">here</a>).</p>
<p><a href="http://itunes.apple.com/app/endless-lines/id447835444"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/09/clip_image004.png" alt="clip_image004" width="154" height="56" border="0" /></a></p>
<p>&nbsp;</p>
<h3>About This Article</h3>
<p>Matthew can be found on twitter as <a href="http://twitter.com/#!/thebag1981">@thebag1981</a>.  Another Lionhead Studios alumni Kieran Nee (<a href="http://twitter.com/#!/kieran_nee">@kieran_nee</a>) has recently joined Matt at <a href="http://bitbybitgames.co.uk">Bit By Bit Games</a>.   The original version of this article can be found <a href="http://bitbybitgames.co.uk/Bit_By_Bit_Games/Endless_Lines.html">here</a> on <a href="http://bitbybitgames.co.uk/BitBlog/">their blog</a>.</p>
<p><a href="http://dannievans.com/">Danni Evans</a> and <a href="http://paulecoyote.com/">Paul Evans</a> (<a href="http://twitter.com/#!/paulecoyote">@paulecoyote</a>) edited the article for AltDevBlogADay.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/09/09/behind-the-scenes-of-bit-by-bit-games-first-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Travel Tips from an Englishman in Texas</title>
		<link>http://www.altdevblogaday.com/2011/08/25/travel-tips-from-an-englishman-in-texas/</link>
		<comments>http://www.altdevblogaday.com/2011/08/25/travel-tips-from-an-englishman-in-texas/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 04:49:06 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
				<category><![CDATA[General Interest]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[flying]]></category>
		<category><![CDATA[Paul Evans]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[travel]]></category>
		<category><![CDATA[uk]]></category>
		<category><![CDATA[usa]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=15068</guid>
		<description><![CDATA[The games industry often sees talent moving across borders. I thought some back in Blighty may be interested in a few tips for travelling to conferences and job hunting in the USA. Today I will just concentrate on flying.]]></description>
			<content:encoded><![CDATA[<p>Earlier this year I left the UK to hunt for opportunities in America; specifically in Austin, Texas, USA. The games industry often sees talent moving across borders. I thought some back in Blighty may be interested in a few tips for travelling to conferences and job hunting in the USA. Today I will just concentrate on flying.</p>
<h2>Flying</h2>
<p>Check-in as soon as you are allowed; default allocated seats are often terrible unless you have high status with the airline. <a href="http://www.seatguru.com/">SeatGuru.com</a> can give you a good indication of what a good and bad seat is. Seats nearer the front tend to be preferable; if a connection becomes tight you will want off that plane as soon as you can. A little time can make the difference between gate open and gate closed.</p>
<p>Use e-tickets when you can &#8211; print them out and keep them with your passport. If you do not already have a travel wallet to keep that stuff together, consider it a worthy investment. Keep it somewhere you can easily double check when you leave the house, car, taxi, plane, etc.</p>
<p>For a long trip you may want to ask your own bank if they have preferential rates for booking some dollars early and compare the rates + fee to the Post Office. Check if the fees and rate for just taking out money from a cash machine with your debit card are unreasonable, if not you might just want to just wait and see if you need any cash. If you do take out cash abroad, take out enough to see you through rather than across lots of transactions, as there does tend to be a per-transaction fee. Do not wait until the airport to exchange money, their rates can be quite bad.</p>
<p>If you are flying out for an interview double check the dress code expected in the interview. In game industry interviews it might hurt you more to overdress rather than to be too casual as far as &#8220;cultural fit&#8221; impressions go. However, do not go as far as packing dirty clothes!</p>
<p>For clothes you are expecting to wear at an interview, use dry cleaning bags. If you have stayed in a hotel before you can usually find these in the wardrobe. They help keep clothes wrinkle free, especially if you hang things up when you get to your destination. For smart trousers, use those hangers with the clips. On the way back you can separate dirty from clean clothes with the dry cleaning bags.</p>
<p>Choose an airline you think you will use the most and stick to it, members of frequent flyer programs are more likely to be upgraded. Get a decent carry-on suitcase that is close to the maximum size of your selected airline. Do not go to the size limit, connecting flights may have smaller overhead bins. Go for a midrange or better case; cheap suitcases are often badly designed and made of inferior materials. If you are unsure test it out by rolling it around the shop to get a feel for how it will be like wheeling around an airport (perhaps at speed!)</p>
<p>Pack light. Choose one book and one magazine, you will not have time to read more anyway, no matter your intentions. If you want more to do save up for a Kindle or use another multipurpose device you are already travelling with. Audio books ripped to MP3s are another good concession to your &#8220;not enough to read&#8221; tendencies.</p>
<p>Only pack one pair of jeans, and pick smart ones. Jeans are great because they can be worn more than once without becoming disgusting, but they are bulky. Be sensible about how many changes of t-shirts and underwear you pack, if you need more, you can buy some cheaply at your destination.</p>
<p>Gadgets &#8211; pack only your most slim line multipurpose device. Pack a charger for that and a multipurpose USB charger/cable for your phone, MP3 player, etc. Do not take your desktop replacement laptop if your netbook will do. Make sure you have Skype credit and the application running in the background; some airport Wi-Fi hot-spots allow you to use Skype credit to pay for Internet access. A compact Bluetooth headset can be useful for making calls to just about anywhere via your computer and a Wi-Fi connection &#8211; save on roaming fees!</p>
<p>When packing, try and keep one change of clothes within easy access. If something is spilled on you during a flight, you will be glad of it. Even if it&#8217;s a particularly uncomfortable flight and you find yourself sticky, a change of clothes can really help you feel not so grotty.</p>
<p>Try to never check any baggage. If something does go wrong you have everything you need with you. You will also be easier to place on alternate flights.</p>
<p>Many airlines let you take a carry-on and a personal item (such as a backpack). Some even allow a laptop case on top of that. If taking a laptop I suggest getting a slim neoprene bag that can fit in your carry-on just in case. Check with your airline first. It would be a shame to check a bag after taking all the trouble to avoid it.</p>
<p>Have the airline&#8217;s phone number in your mobile phone. If your flight does get cancelled and you need to find an alternative flight and the queue is long, queue up and phone out at the same time. Often the person at the end of the phone line can help you almost as much as the person you are queuing to see.</p>
<p>If someone on your plane has a cold, you want to do your best to avoid it &#8211; the last thing you want is to be jet lagged AND have a cold. For this I suggest Vicks First Defense spray… it actually works really well and can be taken preventatively. If you wait until the first signs, then it can be just as effective.</p>
<p>Eyes tend to get dried out on planes, but there is a kind of eye spray you can pick up from Boots called Optrex ActiMist. You spray it on closed eye-lids and it seems to do just about as well as eye drops you put directly in your eyes. It is expensive but has a longer shelf life then normal eye drops. I have yet to find a good place to get an American equivalent. It is an easy way to feel more refreshed while travelling.</p>
<p>Do not bother with those travel pillows, they can take up a ton of room that can be put to better use. I expect you can improvise something to prop your head with (like an airline blanket) if necessary.</p>
<p>Do take your favorite headache medicine with you. Avoid taking medicine with caffeine on the plane though, you should aim to get as much sleep as possible. Buy a cheap travel shaver (Phillips do a pretty good AA powered one) if you normally wet shave, or just buy a disposable razor when you get there. Remember to keep any creams or liquids (including toothpaste) to travel size.  Keep in mind that if you are staying at a hotel they will have many things you are tempted to pack anyway. Try and fit your creams and liquid containers in to a small transparent resealable sandwich bag before you go; with any luck it will be the correct size or smaller. Keeping them separately in a bag will also help prevent any spills in your luggage.</p>
<p>There are a few ways you can help shift in to the destination time zone temporarily. A few days before you go try getting up and going to bed an hour or two earlier than normal&#8230; which might be easier said than done.</p>
<p>One thing that I found out quite recently that works for me to combat jet-lag is to time meals properly while travelling. Your metabolism can give your body clues about what time of day it thinks it is. On the plane refuse meals or eat light for meal times that do not match with your final destination time zone. Again sleeping on the plane helps, though do not use alcohol to induce sleep; that will just leave you dehydrated!</p>
<h2>Over to you</h2>
<p>I am sure you have your own flying tips, why not share them in the comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/08/25/travel-tips-from-an-englishman-in-texas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let me introduce you to Gameduino</title>
		<link>http://www.altdevblogaday.com/2011/07/11/let-me-introduce-you-to-gameduino/</link>
		<comments>http://www.altdevblogaday.com/2011/07/11/let-me-introduce-you-to-gameduino/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 05:03:14 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[Gameduino]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Paul Evans]]></category>
		<category><![CDATA[retro gaming]]></category>

		<guid isPermaLink="false">http://altdevblogaday.com/?p=11082</guid>
		<description><![CDATA[<p>What is a <a href="http://excamera.com/sphinx/gameduino/">Gameduino</a>? It is an <a href="http://www.arduino.cc/">Arduino</a> based gaming device that is a mixture between a science experiment and a classic gaming micro. It provides the kind of platform I grew up with (<a href="http://en.wikipedia.org/wiki/Oric#Oric-1">Oric-1</a>, <a href="http://en.wikipedia.org/wiki/Acorn_Electron">Acorn Electron</a>, <a href="http://en.wikipedia.org/wiki/ZX_Spectrum">ZX Spectrum</a>, <a href="http://en.wikipedia.org/wiki/Commodore_64">C64</a>, etc.) but with modern touches (USB, VGA, <a href="http://excamera.com/sphinx/gameduino/coprocessor.html#coprocessor">coprocessor</a>).</p>
<p><a href="http://www.altdevblogaday.com/2011/07/11/let-me-introduce-you-to-gameduino/" class="more-link">Read more on Let me introduce you to Gameduino&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p>What is a <a href="http://excamera.com/sphinx/gameduino/">Gameduino</a>? It is an <a href="http://www.arduino.cc/">Arduino</a> based gaming device that is a mixture between a science experiment and a classic gaming micro. It provides the kind of platform I grew up with (<a href="http://en.wikipedia.org/wiki/Oric#Oric-1">Oric-1</a>, <a href="http://en.wikipedia.org/wiki/Acorn_Electron">Acorn Electron</a>, <a href="http://en.wikipedia.org/wiki/ZX_Spectrum">ZX Spectrum</a>, <a href="http://en.wikipedia.org/wiki/Commodore_64">C64</a>, etc.) but with modern touches (USB, VGA, <a href="http://excamera.com/sphinx/gameduino/coprocessor.html#coprocessor">coprocessor</a>).</p>
<p>I supported the <a href="http://www.kickstarter.com/projects/2084212109/gameduino-an-arduino-game-adapter">Gameduino Kickstarter project</a> and my reward was recently sent to me by the creator of the project, <a href="http://excamera.com/sphinx/index.html">James Bowman</a>. The community around this device so far is small but friendly. It includes electronics and programmers buffs from all kinds of backgrounds.</p>
<h2>The Kit</h2>
<p>One of the things that struck me when I first opened the box was how exposed everything seems! At some point I would like to either buy a case or mod something to hold the device; but as I have just moved from the UK to the Austin area in to a little apartment, I do not have the tools to fashion something myself just yet.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image001.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image001_thumb.jpg" alt="clip_image001" width="644" height="420" border="0" /></a></p>
<p>Here you can see the interfaces of the board. The <a href="http://arduino.cc/en/Main/ArduinoBoardUno">ArduinoUno</a> has a connection for USB and another for power. The Gameduino board provides a VGA connection and audio jack. The final board is a Joystick shield from <a href="http://www.sparkfun.com/products/9760">SparkFun</a>.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image002.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image002_thumb.jpg" alt="clip_image002" width="644" height="434" border="0" /></a></p>
<p>I put a pen in shot to give a sense of scale to the pictures.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image003.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image003_thumb.jpg" alt="clip_image003" width="644" height="433" border="0" /></a></p>
<p>The boards communicate to each other via pins and slots which can be seen in the picture above. The shields are designed in such a way that plugging things in the correct way feels natural. On my kit, the audio jack and USB are stacked directly in a way that makes it impossible to push the board all the way home; however, the pins are long enough that it does not matter.</p>
<p>After I constructed the device, the next thing I wanted to do was sit on the sofa with it and play on the television. After asking a few questions on the <a href="http://answers.gameduino.com">Gameduino answers forum</a> I decided to try and use sixteen feet of VGA, USB and audio cable. I skipped buying a power supply as my television has a USB port &#8211; so I could buy a USB extension cable that is cheaper, less bulky and more generally useful.</p>
<p>Despite the length of the cable and low power draw of Gameduino, it works nicely (well for me anyway!) over that distance. So when playing the Gameduino, it only needs to be connected to the television &#8211; though granted via three cables. During development I use the laptop USB for both power and data transfer, while the TV acts as my screen.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image004.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image004_thumb.jpg" alt="clip_image004" width="644" height="425" border="0" /></a></p>
<p>Above you can see the boot screen of the Gameduino (which is on the right side of the Kinect under the television). It also plays a nice chord on startup.</p>
<h2>Specifications</h2>
<h3>ArduinoUno (<a href="http://arduino.cc/en/Main/ArduinoBoardUno">source</a>)</h3>
<table width="640" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="115">Processor</td>
<td valign="top" width="523"><a href="http://www.atmel.com/dyn/resources/prod_documents/doc8161.pdf">ATmega328</a> 8-bit microcontroller</td>
</tr>
<tr>
<td valign="top" width="115">Clock Speed</td>
<td valign="top" width="523">16 Mhz</td>
</tr>
<tr>
<td valign="top" width="115">Flash Memory</td>
<td valign="top" width="523">32KB &#8211; 0.5KB used by boot loader</td>
</tr>
<tr>
<td valign="top" width="115">SRAM</td>
<td valign="top" width="523">2KB</td>
</tr>
<tr>
<td valign="top" width="115">EEPROM</td>
<td valign="top" width="523">1KB</td>
</tr>
</tbody>
</table>
<h3>Gameduino (<a href="http://excamera.com/sphinx/gameduino/index.html#gameduino">source</a>)</h3>
<table width="640" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="116">Resolution</td>
<td valign="top" width="524">400&#215;300 &#8211; Compatible with any standard VGA monitor (800&#215;600 @ 72Hz)</td>
</tr>
<tr>
<td valign="top" width="116">Color</td>
<td valign="top" width="524">512 colors, processed internally at 15-bit precision</td>
</tr>
<tr>
<td valign="top" width="116">Background graphics</td>
<td valign="top" width="524">512&#215;512 pixel character background. 256 characters, each with independent 4 color palette. Pixel smooth X-Y scroll (wraparound)</td>
</tr>
<tr>
<td valign="top" width="116">Foreground graphics</td>
<td valign="top" width="524">Sprites are 16&#215;16 pixels with per-pixel transparency. Each can use 256, 16 or 4 colors. Four-way rotate and flip. 96 sprites per scan-line, 1536 texels per line. Pixel perfect sprite collision detection.</td>
</tr>
<tr>
<td valign="top" width="116">Audio</td>
<td valign="top" width="524">Stereo. 12-bit frequency synthesizer. 64 independent voices 10-8000 Hz. Per-voice sine wave or white noise. Sample playback channel.</td>
</tr>
<tr>
<td valign="top" width="116">Memory</td>
<td valign="top" width="524">32 KB &#8211; addresses are 15 bit, last bit indicates read or write (via SPI interface)</td>
</tr>
<tr>
<td valign="top" width="116"><a href="http://excamera.com/sphinx/gameduino/coprocessor.html#coprocessor">Coprocessor</a></td>
<td valign="top" width="524"><a href="http://www.excamera.com/sphinx/fpga-j1.html">J1 Forth CPU</a>. 16-bit internal bus, 8-bit memory interface. 50 MIPS. Direct access to entire Gameduino memory. Executes code from set 256 byte range. Machine instructions very close to Forth. Single-cycle 16&#215;16 bit multiply, plus barrel shifter. Fast, efficient stack machine.</td>
</tr>
</tbody>
</table>
<h2>Why</h2>
<p>I wanted to get back to basics a little bit. My favorite language these days is C# but for a long time it was C++.</p>
<p>I believe constraints can force creativity in some interesting ways. Necessity is the mother of invention after all. The Gameduino is constrained with its specification, though has many interesting quirks I look forward to learning about. For example, the co-processor needs instructions in Forth!</p>
<h2>Next</h2>
<p>Practicing skills and learning new things is always more interesting when trying to accomplish something rather than just going through exercises. I plan to have a little game of my own running on it in time. I have not got that far yet, but below is a sneak peak.</p>
<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image005.jpg"><img style="padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px" src="http://altdevblogaday.com/wp-content/uploads/2011/07/clip_image005_thumb.jpg" alt="clip_image005" width="644" height="452" border="0" /></a></p>
<p><a href="http://blog.kaetemi.be/">Jan Boon</a> has written an excellent emulator &#8220;<a href="http://code.google.com/p/gdemu/">gdemu</a>&#8221; that provides a pretty good simulation of the hardware that has been allowed me to develop in Visual Studio without deploying to the Gameduino each time. I forked it on <a href="http://code.google.com/r/pauldevans-gdemu/">google code</a>, but as I am also teaching myself <a href="http://help.github.com/set-up-git-redirect">git</a> and <a href="http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/">git flow</a> I imported that over to <a href="http://github.com/PaulECoyote/gdemu">github</a>.</p>
<p>I have started to get used to the <a href="http://arduino.cc/en/Guide/Environment">processing based environment provided for Arduino</a>. Projects are called sketches and basically include all the c/c++ source and header files in a folder. It is an IDE that provides a way to compile and upload your program, plus serial monitor which is helpful for sending debug messages. I do not think there is a way of stepping through code on the device without more hardware though.</p>
<p>My aim is to try some test driven development with the Gameduino now I have explored it a little. Ideally I would like my own project to be built and deployed to the device via a single line on the command line or a double click of an icon… I am not there yet though.</p>
<p>If anyone has any Gameduino projects to share or has worked on similar devices, please say something in the comments. It would be nice to know that people are reading this!</p>
<h2>Further Reading</h2>
<p>&nbsp;</p>
<ul>
<li><a href="http://excamera.com/sphinx/gameduino/index.html#gameduino">Gameduino site</a></li>
<li><a href="http://code.google.com/p/gdemu/">gdemu</a> Gameduino Emulator &#8211; <a href="http://blog.kaetemi.be/">Jan Boon</a> (<a href="http://answers.gameduino.com/question/6/gameduino-emulator">via forum</a>)</li>
<li><a href="http://answers.gameduino.com/question/15/gameduino-reference-manual-v0">Gameduino Reference Manual</a> (<a href="http://files.me.com/djwildstar/kp5b9s">pdf</a>) via <a href="http://answers.gameduino.com/users/4/derek/">Derek</a></li>
<li><a href="http://www.artlum.com/gameduino/gameduino.html">Gameduino Tutorial</a> via <a href="http://answers.gameduino.com/users/3/fungus/?sort=stats">Fungus</a></li>
<li><a href="http://arduino.cc/en/Guide/Environment">Arduino development environment</a></li>
<li><a href="http://excamera.com/sphinx/gameduino/coprocessor.html#id17">Gameduino Coprocessor</a></li>
<li><a href="http://excamera.com/files/gameduino/synth/doc/gen/poster.pdf">Gameduino Reference Poster</a></li>
<li><a href="http://excamera.com/files/gameduino/synth/sketches/Gameduino.zip">Gameduino sample programs and library</a></li>
<li><a href="http://excamera.com/sphinx/gameduino/python.html">Gameduino Python Package</a></li>
<li><a href="http://excamera.com/sphinx/gameduino/artists.html">Gameduino for Artists</a></li>
<li><a href="http://answers.gameduino.com/questions/">Gameduino Answers</a></li>
<li><a href="http://twitter.com/#!/gameduino">Gameduino twitter</a> &#8211; tweeting and retweeting community activity with the Gameduino</li>
<li><a href="http://brainwagon.org/category/gameduino/">Gameduino articles</a> by <a href="http://twitter.com/#!/brainwagon">Mark VandeWettering</a></li>
<li><a href="http://dave-r.posterous.com/gameduino-sprite-tutorial-1">Gameduino sprite tutorial</a> by <a href="http://twitter.com/#!/biomood">David Roberts</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/07/11/let-me-introduce-you-to-gameduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Micro Talks</title>
		<link>http://www.altdevblogaday.com/2011/06/25/micro-talks/</link>
		<comments>http://www.altdevblogaday.com/2011/06/25/micro-talks/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 23:39:34 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=9717</guid>
		<description><![CDATA[This is a quick write up of my thoughts about the micro talk format, its use in Lionhead's "Creative Day" and the talks organized by IGDA Austin held at historic Studio 6A (home of Austin City Limits show).]]></description>
			<content:encoded><![CDATA[<p>This is a quick write up of my thoughts about the micro talk format, its use in Lionhead&#8217;s &#8220;Creative Day&#8221; and the talks organized by <a href="http://austingamedevs.org/">IGDA Austin</a> held at historic Studio 6A (home of <a href="http://www.klru.org/blog/category/austin-city-limits/">Austin City Limits show</a>).</p>
<h2>The &#8220;Micro Talk&#8221; format</h2>
<p>Every participant is given ten minutes to talk. A time keeper near the front of the stage flashes up cards when the speaker is near the end of their session so they can wrap up the talk. There is also a longer message for when a speaker goes over that limit.</p>
<p>There are variations where the time limit is less strict.  Sometimes there is a defined period of time for Q&amp;A that may be filled. I recall as part of my Bachelors degree we had strict time limits and a QA for presentations on projects; so those from an academic background may be familiar with this style already.</p>
<p>Ten minutes is time enough to cover a large subject at a very high level or a very specific topic in detail. This forces focus and sets the pace for all the talks.</p>
<p>For the speaker ten minutes should be relatively easy to fill about something they know about. If anything, reducing things down to ten minutes may be an issue.</p>
<p>For the audience ten minute bite-sized chunks of content should be digestible even if it is something individual members have little interest in.</p>
<h2>Creative Day 2011 at Lionhead Studios</h2>
<p>A similar format was used for Creative Day at <a href="http://lionhead.com/">Lionhead Studios</a>.  We did not use the term “micro talks” but that is what the format was at the core (though without the very strict time keeping). Everyone who participated was given a short time to introduce their project and demonstrate it. Some ran under and some ran over but every presentation got part or all of the audience interested. Each team was given a couple of days of studio time to complete their own project (and as much of their own time as they wanted of course).</p>
<p>The Lionhead event has been quite well covered in the industry press. The project I worked on was one of the lower profile ones that just gets a mention in Edge. I worked with developer <a href="http://www.linkedin.com/pub/pete-coward/1/756/b77">Pete Coward</a> and musician <a href="http://twitter.com/#!/KaiChiChan">Kai Chi Chan</a> on a reimplementation of <a href="http://en.wikipedia.org/wiki/Populous">Populous</a> in HTML5, which used a multiplayer server implemented using <a href="http://nodejs.org/">node.js</a>.  Our proof of concept was implemented in a few days.</p>
<p>The demo itself had a few technical problems due to us trying to improvise a wireless network.  It got a bit overwhelmed by a cinema full of developers trying to connect to it with laptops, iPads and mobile phones… but overall the presentation was well received and the multiplayer capability was demonstrated. We kept things going long enough to show Peter drowning little people by lowering some land in to the ocean, which got a good laugh.</p>
<p>It was an emotionally charged experience presenting to all the talent of the studio &#8211; especially considering some of the mind blowing things that were demoed before we were up.  Keep in mind that most of the people presenting were not at all used to being in the public eye. In the relatively safe environment of that cinema full of colleagues, everyone shone. Every single presentation had something interesting to give and add to the day. People really got to know each other better that day.</p>
<p>If IGDA Guildford ever gets going again – meetings in this format should happen.  There are enough people working there to support it!</p>
<h2>IGDA Austin Micro Talks (2011-06-25)</h2>
<p>My first IGDA Austin meeting was in the micro talk format and provided a great introduction for me to some of the people in the chapter.  The talks took place in a television studio and were recorded – so should end up on YouTube at some point in the future.  See the <a href="http://austingamedevs.org/microtalks-june-2011">austingamedevs.org</a> website for further details.</p>
<p><a href="http://austingamedevs.org/about">John Henderson</a> acted as master of ceremonies, introducing each speaker and announcing breaks between the speakers. At the end of the breaks he took the opportunity to introduce some of the volunteers around the hall that were running the event.</p>
<p><a href="http://twitter.com/#!/jonjones/">Jon Jones</a> opened up the evening with a talk about making yourself more attractive on the job market by differentiating yourself. His example used a character artist portfolio with a few stereotypes that got laughs from the audience. The drive of the talk was to be a little different by thinking creatively and to actively network. Many of his own career advances had come from networking and he said that he pushed himself to get out there. He made special note to try not and make enemies, as you never know how that will come back to bite you later.</p>
<p><a href="http://www.prismnet.com/~dloubet/">Denis Loubet</a> made a presentation about how much luck there is involved in creating a profitable iPhone game. He made his presentation without aid of slides. The message I took away from that was that it was better to prototype an idea and ship early before investing too much, as you can never be quite sure where lightening will strike. Rovio made a few games before their success with Angry Birds.</p>
<p><a href="http://twitter.com/#!/sjschubert">Sara Jensen Schubert</a>’s session was about using a spreadsheet to balance progression in an RPG. Consistency was highlighted as an imported factor in progression. Second to that was modeling enemy stats close to that of the player to make things easier to manage later on. It immediately reminded me of systems I had seen used around Lionhead that our tools supported. I think Sara and my friends back in the UK, <a href="http://www.linkedin.com/pub/mike-west/1/872/385">Mike West</a> and <a href="http://kalevtait.blogspot.com/">Kalev Tait</a> &#8211; would have a good talk about their various ideas for balancing.</p>
<p><a href="http://www.linkedin.com/pub/fred-schmidt/8/b83/402">Fred Schmidt</a> made the case for how awesome Austin is, the history of the area and how the creative industry fuels the economy. There needs to be more engagement across the educational, public and private sectors to better support the many small companies doing amazing things in the area.</p>
<p><a href="http://www.zenofdesign.com/">Damion Schubert</a> spoke about the power of innovation &#8211; where it is useful and when it should be reined in. Innovation can take many forms, from simplification of an idea to something completely new. An innovative game should be explainable in a sentence and have true resonance with the audience. Swing big, make sure the players get to use your innovation and support it through every other element of game play. Remember that an idea is only innovative if it is better, and that it should be less expensive than making a &#8220;me-too&#8221; product.</p>
<p>&#8220;From Startup to Survival&#8221; by <a href="http://www.linkedin.com/pub/quoc-tran/0/19b/824">Quoc Tran</a> was an interesting study in what can make the difference between success and failure in a start up. It boiled down to focus, underdo the competition and release early. Remember that resources are limited and that if cash is a problem, ship sooner. The feedback generated and market position achieved by shipping sooner is more important than a complete feature set.</p>
<p><a href="http://www.ameripriseadvisors.com/carl.a.canga/">Carl Canga</a> made a presentation about how important investing for retirement is. Despite the presentation slides not working, Carl went on to make a well rehearsed presentation. It was certainly a sobering talk for me and something I will make a priority as soon as my means allow it.</p>
<h2>Conclusion</h2>
<p>Presenting and demonstrating things in front of an audience even just for ten minutes may seem daunting but there is no doubt in my mind it is worth it. It is a great introduction to public speaking and one I personally intend to try again. I encourage you to try it out &#8211; either at your studio, an IGDA meeting or wherever you can.</p>
<p>The conversations during the breaks at events like these are also invaluable. It is a great way to make friends and eventually introduce people who can help each other out. Get yourself out there!</p>
<p>Never under estimate how important it is to communicate the knowledge you have to other people. What you write or present will never be useful to everyone &#8211; but even if you help a few people out, it is worth it.  Why not try <a href="http://altdevblogaday.com/authors-getting-started/">writing for #AltDevBlogADay</a>?</p>
<h3>About this article</h3>
<p>I wrote this in <a href="http://www.starcocoffee.com/">Star Coffee</a> in Round Rock, TX while slowly drinking an iced mocha. It is written from my own notes made in OneNote last night and some others that <a href="http://dannievans.com/">Danni</a> (my wife) made. While writing this I&#8217;m listening to a Blue Grass jam session. I&#8217;ve only been in the Austin area for a few weeks &#8211; and although I am still adjusting to the baking hot weather it has been a good experience so far. I have no doubt that this place is another great creative hub.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/06/25/micro-talks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The XmlSerializer class in C# is asymmetric</title>
		<link>http://www.altdevblogaday.com/2011/06/10/the-xmlserializer-class-in-c-is-asymmetric/</link>
		<comments>http://www.altdevblogaday.com/2011/06/10/the-xmlserializer-class-in-c-is-asymmetric/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 22:30:56 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=8158</guid>
		<description><![CDATA[C# coders choosing XmlSerializer for their game data beware.  When using the DefaultValueAttribute on members of a class being later processed by XmlSerializer, a perfect copy of an object written may not be read back later.  This post demonstrates the behavior.]]></description>
			<content:encoded><![CDATA[<p>C# coders choosing XmlSerializer for their game data beware.  When using the DefaultValueAttribute on members of a class being later processed by XmlSerializer, a perfect copy of an object written may not be read back later.  This post demonstrates the behavior.</p>
<h2>XmlSerializer versus DefaultValueAttribute</h2>
<p>The DefaultValue attribute is useful for giving hints to the user interface controls, particularly ones that inspect objects such as the PropertyGrid.  It allows objects to be created using their  default constructor then have their default value set later by the control responsible for it.</p>
<p>The XmlSerializer also takes this value in to consideration when writing an xml representation of the object.  If the class member being serialized has a value that matches the value declared by the DefaultValue attribute it skips writing the value all together.  Less written, less to read back – looks good.</p>
<p>XmlSerializer does not restore the value of DefaultValue to a member when reading an xml representation of an object, it uses the default as defined by the member type (null for classes, 0 for integers, etc.).  This is the potential source of confusion; you cannot rely on the XmlSerializer to create perfect deep copies of your objects.  It does not assume missing xml means “use the default value attribute”.  XmlSerializer has implicitly set the expectation on your code to restore the default values from the attributes.</p>
<h2>Demonstration</h2>
<p>I have embedded commented code in the post below that demonstrates the above.  I have also uploaded it to <a title="*Direct* github link for demo so no stats (by request), but say hi if useful @paulecoyote :0)" href="https://github.com/PaulECoyote/blog/tree/master/AsymmetricXmlSerializer">github</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// See Clue class to change demo behavior.</span>
<span style="color: #008080; font-style: italic;">// Uncomment one of the fixes below to observe different behaviors.</span>
<span style="color: #008080; font-style: italic;">// Search for FIX1 or FIX2 to see where the changes have been made.</span>
<span style="color: #008080; font-style: italic;">//// #define FIX1  // Do *not* use DefaultValue attribute, taken in to account serializing but not de-serializing.</span>
<span style="color: #008080; font-style: italic;">//// #define FIX2  // Set default value of variable to same as DefaultValue attribute during construction.</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> AsymmetricXmlSerializer
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.ComponentModel</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Diagnostics</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Xml</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Xml.Serialization</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Class to be serialized and demo point for asymmetric XmlSerializer behavior.</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008000;">&#91;</span>Serializable<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> Clue
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Comment out DefaultValue attribute and it will succeed.</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;remarks&gt;Set variable to 'Nothing To See Here'to to work around.&lt;/remarks&gt;</span>
<span style="color: #008080;">#if !FIX1</span>
        <span style="color: #008000;">&#91;</span>DefaultValue<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Nothing To See Here&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
<span style="color: #008080;">#endif</span>
<span style="color: #008080;">#if !FIX2</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> text<span style="color: #008000;">;</span>
<span style="color: #008080;">#else</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> text <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Nothing To See Here&quot;</span><span style="color: #008000;">;</span>
<span style="color: #008080;">#endif</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Demo program for asymmetric XmlSerializer behavior with DefaultValueAttribute.</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #0600FF; font-weight: bold;">sealed</span> <span style="color: #6666cc; font-weight: bold;">class</span> Program
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// If initial value is the same as DefaultValueAttribute for variable declaration,</span>
            <span style="color: #008080; font-style: italic;">// it is not persisted by XmlSerializer.</span>
            Clue clue <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Clue<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            clue<span style="color: #008000;">.</span><span style="color: #0000FF;">text</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Nothing To See Here&quot;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Buffer for writing.</span>
            StringBuilder buffer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StringBuilder<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Don't need namespaces.</span>
            XmlSerializerNamespaces no_namespaces <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlSerializerNamespaces<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            no_namespaces<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span>, <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Don't need xml declaration.</span>
            XmlWriterSettings writer_settings <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlWriterSettings<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> OmitXmlDeclaration <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span> <span style="color: #008000;">&#125;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Serialise the clue...</span>
            XmlSerializer xml_serializer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> XmlSerializer<span style="color: #008000;">&#40;</span><span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span>Clue<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            StringWriter string_writer <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StringWriter<span style="color: #008000;">&#40;</span>buffer<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>XmlWriter xml_writer <span style="color: #008000;">=</span> XmlWriter<span style="color: #008000;">.</span><span style="color: #0000FF;">Create</span><span style="color: #008000;">&#40;</span>string_writer, writer_settings<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                xml_serializer<span style="color: #008000;">.</span><span style="color: #0000FF;">Serialize</span><span style="color: #008000;">&#40;</span>xml_writer, clue, no_namespaces<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            <span style="color: #6666cc; font-weight: bold;">string</span> serialized <span style="color: #008000;">=</span> buffer<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Show serialised version of the clue...</span>
            Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Clue text value: {0}&quot;</span>, clue<span style="color: #008000;">.</span><span style="color: #0000FF;">text</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Clue serialized: {0}&quot;</span>, serialized<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Deserialise the clue...</span>
            Clue clue_read<span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>StringReader sr <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StringReader<span style="color: #008000;">&#40;</span>serialized<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                clue_read <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>Clue<span style="color: #008000;">&#41;</span>xml_serializer<span style="color: #008000;">.</span><span style="color: #0000FF;">Deserialize</span><span style="color: #008000;">&#40;</span>sr<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Show clue 2 on console</span>
            <span style="color: #008080; font-style: italic;">// Reset and reuse write buffer.</span>
            buffer<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>XmlWriter xml_writer <span style="color: #008000;">=</span> XmlWriter<span style="color: #008000;">.</span><span style="color: #0000FF;">Create</span><span style="color: #008000;">&#40;</span>string_writer, writer_settings<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                xml_serializer<span style="color: #008000;">.</span><span style="color: #0000FF;">Serialize</span><span style="color: #008000;">&#40;</span>xml_writer, clue_read, no_namespaces<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
&nbsp;
            <span style="color: #6666cc; font-weight: bold;">string</span> reserialized <span style="color: #008000;">=</span> buffer<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Read Clue text value: {0}&quot;</span>, clue_read<span style="color: #008000;">.</span><span style="color: #0000FF;">text</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Read Clue serialized: {0}&quot;</span>, reserialized<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Debug<span style="color: #008000;">.</span><span style="color: #0000FF;">Assert</span><span style="color: #008000;">&#40;</span>clue<span style="color: #008000;">.</span><span style="color: #0000FF;">text</span> <span style="color: #008000;">==</span> clue_read<span style="color: #008000;">.</span><span style="color: #0000FF;">text</span>, <span style="color: #666666;">&quot;Written &amp; read clue's text should match&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">/* NOTES
 * FIX1: Don't use DefaultValueAttribute.
 *
 * You would want to use DefaultValueAttribute to avoid persisting the
 * default value to the xml representation.
 * Although this does prevent the default value being persisted, on read the
 * DefaultValueAttribute is ignored so the value is never set to that of
 * the DefaultValueAttribute.
 * DefaultValueAttribute is also used for value hints for UI.
 * See: http://msdn.microsoft.com/en-us/library/2cws2s9d.aspx
 *
 *
 * FIX2: Use DefaultValueAttribute AND default value at construction.
 *
 * To use DefaultValueAttribute and have the object be recreated
 * properly when reading it back, you must to explicitly set the
 * default value during construction of the object being read.
 * Using this method means the xml is concise and the object
 * is accurately recreated.
 */</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/06/10/the-xmlserializer-class-in-c-is-asymmetric/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JS1K Oregon Trail. Games &amp; Demos in 1k of Javascript</title>
		<link>http://www.altdevblogaday.com/2011/04/26/js1k-oregon-trail-games-in-1k-of-source/</link>
		<comments>http://www.altdevblogaday.com/2011/04/26/js1k-oregon-trail-games-in-1k-of-source/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 22:24:52 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=4833</guid>
		<description><![CDATA[<p><a title="Link to JavaScript Demo" href="http://bit.ly/g3JSTR"><img class="alignright size-full wp-image-4834" src="http://altdevblogaday.com/wp-content/uploads/2011/04/paule-js1k-Oregon-Trail.png" alt="Paul Evans js1k Oregon Trail entry screen grab" width="261" height="260" /></a>I decided to create a <a href="http://bit.ly/g3JSTR">game</a> for the last <a href="http://js1k.com/2011-dysentery/">JavaScript 1k competition</a> that recently ended themed around the <a href="http://en.wikipedia.org/wiki/The_Oregon_Trail_(video_game)">Oregon Trail computer game</a>.  It was a good exercise in scoping something small, iterating on it a few times and learning a little more about the language.</p>
<p><a href="http://www.altdevblogaday.com/2011/04/26/js1k-oregon-trail-games-in-1k-of-source/" class="more-link">Read more on JS1K Oregon Trail. Games &#38; Demos in 1k of Javascript&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a title="Link to JavaScript Demo" href="http://bit.ly/g3JSTR"><img class="alignright size-full wp-image-4834" src="http://altdevblogaday.com/wp-content/uploads/2011/04/paule-js1k-Oregon-Trail.png" alt="Paul Evans js1k Oregon Trail entry screen grab" width="261" height="260" /></a>I decided to create a <a href="http://bit.ly/g3JSTR">game</a> for the last <a href="http://js1k.com/2011-dysentery/">JavaScript 1k competition</a> that recently ended themed around the <a href="http://en.wikipedia.org/wiki/The_Oregon_Trail_(video_game)">Oregon Trail computer game</a>.  It was a good exercise in scoping something small, iterating on it a few times and learning a little more about the language.</p>
<p>I am most familiar with Perforce for source control these days because that is what we use for a lot of the code at the studio, so I also took this as an opportunity to try and host something on github: <a href="http://bit.ly/fbbnJc">https://github.com/PaulECoyote/js1k/tree/master/3.oregon</a></p>
<p>Unlike compiled languages that can use excellent crunching software like <a href="http://crinkler.net/">Crinkler</a> to compress the executing code down (<a href="http://bit.ly/g0ds5k">excellent article about the process</a>), the interpreted <em>source code</em> has to be 1024 bytes or less.  As JavaScript has 16bit character strings, submissions had to take care they were within the byte limit rather than just counting characters.</p>
<h2>Design</h2>
<p>First of all I have to admit it, I never played the Oregon Trail game on the Apple II.  I was born and grew up in the UK where I used great 8-bit machines like the Oric-1, Acorn Electron, BBC Micro (at school), Spectrum and C64.  Apparently there was a version for the C64 but I missed out.  Helpfully the demo organizers linked to <a href="http://bit.ly/gflxlH">a play-through on YouTube</a> (just to warn you, there’s some raw language in there).  So one Saturday morning when I got up way too early for my own good, I decided to watch it.</p>
<p>Apparently people often die of <a href="http://en.wikipedia.org/wiki/Dysentery">Dysentery</a> (eek!) while playing, though that did not happen on the play-through I watched.  I thought of trying to do a simple inventory management trade game, but the sheer volume of text and inputs made me think again.  I then thought I could do something about crossing the river but some people had already made something similar to what I was thinking.</p>
<p>Finally I settled on the idea of traveling down the trail itself.  There was already a nice wagon graphics demo there but with no game play, so the idea was unique enough.  A lot of the game during the play-through seemed to center around a wagon travelling down a trail and stopping at landmarks and rivers.  Crossing rivers involved complex decisions that would take me down the complex text simulation route again.  I decided that my wagon in 1848 had a crazy inventor that fitted the wagon with excellent suspension and a spring wound so tight that it provided a KITT like turbo boost to jump rivers.  It was my little game, I could have some creative license!</p>
<h2>Implementation</h2>
<p>I started out by looking at tutorials at the <a href="https://developer.mozilla.org/en-US/">MDN</a>.  First I drew a background using a linear gradient with the help of <a href="https://developer.mozilla.org/samples/canvas-tutorial/4_9_canvas_lineargradient.html">this tutorial</a>.</p>
<p>Next up I wanted to draw a wagon, I decided to keep it simple and use rectangles and circles to keep the source code simple.  After that I wanted to show movement, so next up was drawing a tree moving along the landscape.  The <a href="https://developer.mozilla.org/en/Canvas_tutorial/Drawing_shapes">drawing shapes tutorial</a> helped me figure out how to create the shapes and I wrote the game update function within an interval set every twenty milliseconds.</p>
<p>So I had a wagon that looked like it was moving, then I wanted a river.  I experimented with a few different shapes but a thickly drawn blue line took up little space and got the feeling across of the river.  I animated this at a slightly different speed to the tree to try and get the feeling across that the tree was in the background and the river was in the foreground.</p>
<p>The game never ended, so collision detection with the river was next – as the wagon never moved along the x axis, it was quite simple.  Then to implement the turbo boost – collision with the river only happened when the wagon was at ground level.  Playing the game at that point there was a way to multiple jump… which was kind of fun but made the game too easy.</p>
<p>When the wagon collides with a river the game comes to an end.  Refreshing the browser auto starts a new game.</p>
<p>I needed to display the score next which made it feel more like a score attack game.  The game seemed too easy to me though, so I made the river slowly grow.</p>
<p>Looking at the file size it was over twice the 1k limit, so time to shrink the file.  First I removed all the comments, then all the whitespace.  Still way over.  Renaming the variables to single or double character names shrunk the file to just under the 1k limit.</p>
<h2>Future</h2>
<ul>
<li>Use some kind of automated code shrinking tool. <a href="http://dean.edwards.name/packer/">packer</a> by Dean Edwards looks like a good place to start.</li>
<li>Animate the wheels</li>
<li>Have scrolling hills going at slower speed than the tree in the background to add more feeling of depth</li>
<li>Use mechanized abbreviation to shrink the code further, as explained by <a href="http://marijnhaverbeke.nl/js1k/">Marijn Haverbeke</a>.</li>
<li>Experiment more with git – <a href="http://nvie.com/posts/a-successful-git-branching-model/">gitflow</a> look interesting</li>
</ul>
<h2>Conclusion</h2>
<p>It was a fun little experiment and a nice project to learn a few new things.  The source code is <a href="http://bit.ly/fbbnJc">here</a> – I am sure there are a hundred ways to improve on it.  The other entries in this competition can be found <a href="http://js1k.com/2011-dysentery/demos">here</a>.  Visit <a href="http://js1k.com/">js1k.com</a> to see the entries for all three of the competitions that have happened so far.  It really is incredible what can be done with so little source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/04/26/js1k-oregon-trail-games-in-1k-of-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Indies, how do you make a living?</title>
		<link>http://www.altdevblogaday.com/2011/04/11/indies-how-do-you-make-a-living/</link>
		<comments>http://www.altdevblogaday.com/2011/04/11/indies-how-do-you-make-a-living/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 21:48:15 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=3699</guid>
		<description><![CDATA[<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/04/2011-04-11_paul-silly-pose-cd-tshirt.jpg"><img class="size-full wp-image-3700 alignright" src="http://altdevblogaday.com/wp-content/uploads/2011/04/2011-04-11_paul-silly-pose-cd-tshirt.jpg" alt="Paul in Creative Day T-shirt" width="200" height="287" /></a>Mike Acton (<a href="http://twitter.com/#!/mike_acton">@mike_acton</a>) threw down a challenge in the discussion group – to openly show ignorance about a subject.  The idea of working on something small where I would have large amounts of creative input and would actually own (at least a piece) is seductive.  I know people personally and by reputation who manage to make a living making independent games for a living.  However being reliant on that success to put food in my mouth is quite frankly scary. </p>
<p><a href="http://www.altdevblogaday.com/2011/04/11/indies-how-do-you-make-a-living/" class="more-link">Read more on Indies, how do you make a living?&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/04/2011-04-11_paul-silly-pose-cd-tshirt.jpg"><img class="size-full wp-image-3700 alignright" src="http://altdevblogaday.com/wp-content/uploads/2011/04/2011-04-11_paul-silly-pose-cd-tshirt.jpg" alt="Paul in Creative Day T-shirt" width="200" height="287" /></a>Mike Acton (<a href="http://twitter.com/#!/mike_acton">@mike_acton</a>) threw down a challenge in the discussion group – to openly show ignorance about a subject.  The idea of working on something small where I would have large amounts of creative input and would actually own (at least a piece) is seductive.  I know people personally and by reputation who manage to make a living making independent games for a living.  However being reliant on that success to put food in my mouth is quite frankly scary. </p>
<h2>The Challenge</h2>
<blockquote><p><em>Here&#8217;s a challenge. (For those of you that haven&#8217;t already written your next posts.)</em></p>
<p><em>A very human problem and one that censors many of us all too often, is the fear of looking stupid.</em></p>
<p><em>I challenge everyone to confront that fear head on. Think of that something that you wish you knew more about. That you feel slightly insecure about. And rush in head on. Talk about your fear. Admit it. And share your thoughts. Share what you do know. And what you wish you knew. Invite people to help you grow. </em></p>
<p><em>Shine some light into those dark areas of yourself. ;)</em></p>
<p><em>I&#8217;ll do the same.</em></p>
<p><em>Mike.</em></p></blockquote>
<h2>What I know</h2>
<p>I know that just because something is scary does not mean you should not give it a go.  Failure is not something to be afraid of, but to learn from and grow.  Obviously you want to try and stack the odds in your favor though.  Making a living from products that you have created, sell and own sounds great to me.  Though it does sound&#8230; dangerous.</p>
<p>I have gathered requirements for business products, specified, programmed, deployed and supported them in the field.  In the games industry I’ve worked on development tasks centered around tools and deployed them across the studio.  I helped out with the odd game bug here and there.  Although credited on excellent AAA titles, I have not shipped and sold a game independently.</p>
<p>I had a great conversation with Tak Fung (<a href="http://twitter.com/#!/mrfungfung">@mrfungfung</a>) at <a href="http://indiegamesarcade.com/world-of-love/">Winter World of Love 2</a> about his transition from being a coder working on AAA titles at <a href="http://lionhead.com/">Lionhead Studios</a> to living solely from his own creations <a href="http://www.supermono-studios.com/games/minisquadron/">MiniSquadron</a>, <a href="http://www.rexbox.co.uk/epicwin/">EpicWin</a> and <a href="http://www.supermono-studios.com/games/fox-vs-duck/">Fox vs. Duck</a>.  He swapped full time work for contracting which helped him make contacts and wean himself off a monthly wage – a self-bootstrapping slow transition.  Tak works from home and contracts out things to make his games as necessary.  I hope a video of his talk appears online at some point, I think many people would be interested in it.</p>
<p>I met up for pizza with Byron Atkinson-Jones (<a href="mailto:x@xiotex">@xiotex</a>), Jeffrey Sheen (<a href="http://twitter.com/#!/stargazystudios">@stargazystudios</a>), Matthew Hanlon (<a href="http://twitter.com/#!/thebag1981">@thebag1981</a>) and Cliff Harris (<a href="http://twitter.com/#!/cliffski">@cliffski</a>) after Winter World of Love.  Some design and money talk was had over pizza and beer.  To get an idea of some of the conversation (guidelines about how much money you need to make etc.), watch Cliff’s talk from 2010 at a <a href="http://vimeo.com/18630215">Winter World of Love 2010</a>.</p>
<p>Matthew Wiggins (<a href="http://twitter.com/#!/wiggo">@wiggo</a>) co-founded <a href="http://www.wonderlandsoftware.com">Wonderland Software</a> who have released <a href="http://www.ngmoco.com/godfinger/">GodFinger</a> – I do not have many details there but I believe they managed to get some outside investment.  They (<a href="http://twitter.com/#!/wonderlandsoft/us">twitter list</a>) have a decent game on the market, a nice office and have been making a living from their creation.</p>
<p><a href="http://twitter.com/#!/hellogames">Sean Murray</a> of <a href="http://www.hellogames.org/">Hello Games</a> spoke at <a href="http://vimeo.com/17518940">Winter World of Love 2010 (video)</a> about Joe Danger and doing it yourself.  Sean started off talking about how he got started programming young, ended up at EA then founded Hello Games.  He goes on to talking about the passion behind Joe Danger and how risk adverse publishers are.  The money a publisher would have put in came from themselves.</p>
<p>Keith Judge (<a href="http://twitter.com/#!/keefjudge">@KeefJudge</a>) is leaving Lionhead this week to be an independent developer.  He has a wife and child to support, but has enough confidence to try the lifestyle out.  I hear people all the time saying they want to try, but have too much responsibility to try and work for themselves.  Take a look at his <a href="http://altdevblogaday.com/2011/04/10/workstation-setup-for-gamedevs/">first blog post on #AltDevBlogADay</a>.</p>
<h2>What I don’t know</h2>
<p><strong>Business plans</strong>.  I can recall bits and pieces of some business modules during my Computer Studies degree, and a GCSE in Business Studies more years ago then I would like to think about right now.  I am able to handle my personal finances pretty well with a steady income – though I can only believe it gets much harder when your personal finances are linked with the successes and failures of your products and services.</p>
<p><strong>Real numbers</strong>. What can someone expect, how do they budget?  How do you manage the risks, set the price point?  How on earth do people make money from the free Flash games you see on websites?  Or from free games at all?  Is “free” really just “shareware” under a new name?  How do you combat piracy – is DRM even worth it anymore?</p>
<p><strong>Art</strong>. If I were to program my own independent game I really do not know what a fair price for art and music is. A revenue share? A fixed price upfront? I feel there is a tension there between getting eye catching art that generates sales against art that is good enough to sell a game and still profit. How do you decide how much to spend on a games assets and not end up losing money?</p>
<p><strong>Publicity</strong>.  I find blogging and tweeting quite natural, though I have never had to professionally market anything apart from myself.  I am very proud of the projects I have been involved with at Lionhead and tweet links etc about that… but press packs, getting interviews and press coverage?  People *want* to talk to Peter Molyneux; game journalists contact the studio all the time to talk to the man.  I am pretty sure restricting press access for games is not how it usually works &#8211; especially for an independents!</p>
<h2>What do you know?</h2>
<p>Here are some more links to related articles I have found interesting in no particular order.</p>
<ul>
<li><a href="http://2dboy.com/2011/02/08/ipad-launch/">Analysis: World of Goo’s iPad Launch</a></li>
<li><a href="http://gamasutra.com/blogs/AndyMoore/20110315/7225/SteamBirds_Survival__By_The_Numbers.php">SteamBirds: Survival &#8211; By The Numbers</a></li>
<li><a href="http://www.lostgarden.com/">http://www.lostgarden.com/</a></li>
<li><a href="http://www.gamesbrief.com/2011/02/12-business-tips-for-indie-game-developers/">12 business tips for indie game developers</a></li>
<li><a href="http://greyaliengames.com/blog/can-you-make-money-on-xblig/">Can you make money on XBLIG?</a></li>
<li><a href="http://bitmob.com/articles/making-money-in-xbox-360-indie-game-development-is-it-possible">Making money in Xbox 360 indie game development: Is it possible? </a></li>
<li><a href="http://greyaliengames.com/blog/getting-your-game-on-big-fish-games/">Getting your game on Big Fish Games</a></li>
<li><a href="http://www.conversationmarketing.com/2011/01/marketing-dungeons-dragons-2011.htm#ixzz1IavTsmtx">Everything I ever learned about marketing I learned from Dungeons and Dragons</a></li>
<li><a href="http://hoth.entp.com/2011/4/5/more-tender-by-the-redacted-numbers">More Tender By The (Redacted) Numbers</a></li>
<li><a title="http://www.gamesbrief.com/" href="http://www.gamesbrief.com/">http://www.gamesbrief.com/</a></li>
<li><a href="http://justinvincent.com/page/1421/bootstrappers-kickstarter-kit-no-investment-required">Bootstrappers’ Kickstarter Kit – No Investment Required</a></li>
<li><a href="http://thesavvyfreelancer.com/31-days-to-start-freelancing">31 Days to Start Freelancing</a></li>
<li><a title="http://unicornfree.com/" href="http://unicornfree.com/">http://unicornfree.com/</a></li>
<li><a href="http://fairyengine.blogspot.com/2011/02/free-is-good.html">Free is good</a></li>
<li><a href="http://taptaptap.com/blog/kill-yr-ads-the-donts-of-iphone-app-marketing/">Kill yr ads… the don’ts of iPhone app marketing</a></li>
<li><a href="http://positech.co.uk/cliffsblog/?cat=3">Cliff Harris Business Blogs</a></li>
<li><a title="http://www.indiecity.com/blog/" href="http://www.indiecity.com/blog/">http://www.indiecity.com/blog/</a></li>
</ul>
<p>In the comments please share insights and links about the business of creating independent games. I am sure there is no one right answer, but many.  I am certain that many reading this blog may have written some things themselves… please link to them here.</p>
<p>Update: Links from feedback</p>
<ul>
<li><a title="Celsius Game Studios" href="http://celsiusgs.com/">Celsius Game Studios</a> (@<a title="Celsius Game Studios" href="http://twitter.com/#!/celsiusgs">celsiusgs</a>) <a title="Indie Gamedevs: You’re (Probably) Doing it Wrong" href="http://www.celsiusgs.com/blog/?p=229">Indie Gamedevs: You’re (Probably) Doing it Wrong</a> </li>
<li><a title="Four Door Lemon" href="http://www.fourdoorlemon.com/">Four Dour Lemon</a> (<a title="Simon Barratt Twitter" href="http://twitter.com/#!/barog">@barog</a>)- Indie Studio Considerations <a title="Indie studio considerations Part 1" href="Indie studio considerations">Part 1</a> <a title="Indie studio considerations Part 2" href="http://www.fourdoorlemon.com/2010/12/11/indie-studios-pt-2/">Part 2</a> <a title="Link to Indie studios part 3" rel="bookmark" href="http://www.fourdoorlemon.com/2010/12/25/indie-studios-part-3/">Part 3</a></li>
<li>Ed Bartley ( <a title="@FishFPG" href="http://twitter.com/FishFPG/">@FishFPG</a> ) &#8211; <a title="What's your Indie Strategy?" href="http://altdevblogaday.com/2011/03/26/whats-your-indie-strategy/">What&#8217;s your Indie Strategy?</a></li>
<li>Noel Llopis (<a title="Noel Llopis" href="http://twitter.com/#!/noel_llopis">@noel_llopis</a>) &#8211; <a href="http://gamesfromwithin.com/">http://gamesfromwithin.com/</a></li>
<li>Paul Firth (<a title="Paul Firth" href="http://twitter.com/#!/paul_m_firth">@paul_m_firth</a>) &#8211; <a title="The reality of being a new developer on Facebook" href="http://www.wildbunny.co.uk/blog/2011/03/08/the-reality-of-being-a-new-developer-on-facebook/">The reality of being a new developer on Facebook</a></li>
<li>Christopher Waite (<a title="Christopher Waite" href="http://twitter.com/#!/chrismwaite">@chrismwaite</a>) - <a title="10 don'ts of iphone game development" href="http://www.bytesizeadventures.com/blog/10-donts-of-iphone-game-development/">10 don&#8217;ts of iphone game development</a>, <a title="World of Love 2 – an indie games conference" href="http://www.bytesizeadventures.com/blog/world-of-love-2-an-indie-games-conference/">World of Love 2 – an indie games conference</a></li>
<li>Bob Koon (<a href="http://twitter.com/#!/Bob_at_BH">@Bob_at_BH</a>) &#8211; <a href="http://altdevblogaday.com/2011/04/12/your-new-life-as-an-indiecontractor/">Your New Life As An Indie/Contractor</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/04/11/indies-how-do-you-make-a-living/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Pop your head up</title>
		<link>http://www.altdevblogaday.com/2011/03/27/pop-your-head-up/</link>
		<comments>http://www.altdevblogaday.com/2011/03/27/pop-your-head-up/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 20:42:24 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=2593</guid>
		<description><![CDATA[<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/03/Meerkat_feb_09-wikipedia.jpg"><img class="size-medium wp-image-2592 alignleft" src="http://altdevblogaday.com/wp-content/uploads/2011/03/Meerkat_feb_09-wikipedia-300x200.jpg" alt="Meerkat looking into the distance (full size @ http://en.wikipedia.org/wiki/File:Meerkat_feb_09.jpg)" width="300" height="200" /></a></p>
<p>There are times when people just want to get their head down and get their stuff done.   As a coder myself, I know the importance of having a stretch of uninterrupted time to finish a thought when coding.  Switching tasks abruptly can ruin the rhythm and flow of the creative process – it can take time to regain that momentum once you have been disturbed.</p>
<p><a href="http://www.altdevblogaday.com/2011/03/27/pop-your-head-up/" class="more-link">Read more on Pop your head up&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://altdevblogaday.com/wp-content/uploads/2011/03/Meerkat_feb_09-wikipedia.jpg"><img class="size-medium wp-image-2592 alignleft" src="http://altdevblogaday.com/wp-content/uploads/2011/03/Meerkat_feb_09-wikipedia-300x200.jpg" alt="Meerkat looking into the distance (full size @ http://en.wikipedia.org/wiki/File:Meerkat_feb_09.jpg)" width="300" height="200" /></a></p>
<p>There are times when people just want to get their head down and get their stuff done.   As a coder myself, I know the importance of having a stretch of uninterrupted time to finish a thought when coding.  Switching tasks abruptly can ruin the rhythm and flow of the creative process – it can take time to regain that momentum once you have been disturbed.</p>
<p>Constant interruption slowing down completing your tasks might cause you to seek solitude.  Solitude is useful at times and a good producer / manager will shield you, as a creator, from interruptions or interference when what you have to finish is more critical than anything that you could be interrupted for.  The danger is that prolonged isolation causes segregation – information becomes filtered from what you need to know to what <em>someone else thinks </em>you need to know.  Communication happens on the side of the listener, but a listener has no chance of communicating if they are being shielded from what is being said.</p>
<p>The funny part of all this is that a person can be in both situations at once.  They can be told too much and expected to be reactionary to one type of thing and not find out about something else that would help them be more effective.  This kind of dysfunction can occur internally in a team, but is perhaps more likely to occur between different teams where information exchange is naturally more guarded.</p>
<p>To counteract too many interruptions, try learning the power of saying no – do not take on more than what you can do.  Make sure if you are being constantly interrupted that this is accounted for in your estimates.  Let the person know that if you do x, that will mean y will have to wait.</p>
<p>If you are feeling left out of the loop make sure you take time to talk to people.  Build some time in to your day to keep in touch – instead of waiting at your desk for a long build to complete, go interact with someone.  Studios and companies are defined by their people and their interactions; without people you just have some office furniture in an empty building.  If you are work for a big company, during lunch try introducing yourself to different people now and again.  If you are a programmer that always hangs out with programmers, why not try and make a connection with an artist.  Try and dispel any “them and us” if you start to feel it.</p>
<p>Connecting with your colleagues can be a very rewarding endeavor – you begin to be able to introduce people to each other that can solve each other’s problems.  It enables you to help more people, because even if you cannot help someone, you know someone who might.  Connecting people might mean effort is not wasted or duplicated, and help work to be co-ordinated.  You can get a better understanding of how a company works as a whole and through these small social actions make things better.</p>
<p>I have heard it said that many important conversations happen during smoking breaks.  Relationships are sometimes forged during drunken nights out.  Personally I don’t smoke and tend not to drink very much… but you do not have to smoke or drink to excess to join in these things  now and again.  Making new connections deserves some effort – people who seem to have many strong connections worked hard at it.</p>
<p>For small studios and companies it makes sense to make room in your calendar for local and industry events.  The gaming conferences I have been to have had some amazing lectures.  A person who just went to those and did not try and socialize missed out on an opportunity though.  For smaller companies in particular it is vital to have trusted peers you can share ideas with and swap tips; so many important things happen as a side effect of the main event.</p>
<p>At the end of <a href="http://bit.ly/fptZoS">Mike and Matt’s recent #AltDevBlogADay podcast (March 17th)</a> they stated an aim for <a href="http://altdevblogaday.com">#AltDevBlogADay</a> is to be like a perpetual game conference.  Although the web can never be a substitute for physically meeting people, it is a worthy goal and participating in it does feels a bit like a conference.  If you are interested in game development and want to try and engage with more professionals, try a guest post on this site.  Get your voice out there and start some discussions about something that is important to you – it could make a positive difference to your career!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/03/27/pop-your-head-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>(Audio Post) Round Table: DLC</title>
		<link>http://www.altdevblogaday.com/2011/03/12/audio-post-round-table-dlc/</link>
		<comments>http://www.altdevblogaday.com/2011/03/12/audio-post-round-table-dlc/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 23:59:36 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=1874</guid>
		<description><![CDATA[<p>I decided to gather a few friends from around the studio to informally discuss downloadable content around a table over lunch.  This is the first time I have tried anything like this so please keep that in mind!  This is all personal opinion too, not that of our employer.</p>
<p><a href="http://www.altdevblogaday.com/2011/03/12/audio-post-round-table-dlc/" class="more-link">Read more on (Audio Post) Round Table: DLC&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I decided to gather a few friends from around the studio to informally discuss downloadable content around a table over lunch.  This is the first time I have tried anything like this so please keep that in mind!  This is all personal opinion too, not that of our employer.</p>
<p>High level summary of what we discussed:</p>
<ul>
<li>What is your favorite DLC &amp; why?</li>
<li>Is DLC on the disk ethical?</li>
<li>Discussion around DLC pricing.</li>
<li>How can DLC effect game balance?</li>
<li>DLC and player status.</li>
</ul>
<p>The voices you hear in order of appearance:</p>
<ul>
<li><a title="Paul Evans blog" href="http://bit.ly/paulecoyote">Paul Evans</a> <a title="Paul Evans on Twitter" href="http://bit.ly/paultwitter">@PaulECoyote</a> (Programmer).</li>
<li><a href="http://bit.ly/eh04kA">David Addis</a> (Programmer).</li>
<li>Kalev Tait <a title="Kalev Tait on Twitter" href="http://bit.ly/gmE6Ko">@KalevTait</a>  (Designer).</li>
<li>Keith Judge <a href="http://bit.ly/g6gBZ4">@KeefJudge</a> (Programmer).</li>
<li><a title="Byrn Davies Website" href="http://bit.ly/icd9W1">Bryn Davies</a> <a title="Bryn Davies on Twitter" href="http://bit.ly/gpEP5O">@LH_ClarkyCat</a> (Designer).</li>
</ul>
<p>Thanks to everyone who took part.  Special thanks goes to my wife who spent some of her time over the weekend post-producing this.  Should I try this again with any luck I will do a better job with the advice she has given me.</p>
<p><strong>Update</strong>: The original audio files linked have been updated.  <a href="http://www.stomp224.co.uk">Michael Taylor</a> <a href="http://twitter.com/#!/stomp224">@stomp224</a> (Audio Designer) kindly offered to clean up the audio some more.  Find him at <a href="http://www.stomp224.co.uk">http://www.stomp224.co.uk</a></p>
<p>As with Mike Acton’s audio posts, this comes with no warranty, transcription or satisfaction guarantee!</p>
<p><img src="http://altdevblogaday.com/wp-content/uploads/2011/01/some_satisfaction-300x276.png" alt="" /></p>
<p><a class="wpaudio" href="http://altdevblogaday.com/wp-content/uploads/2011/03/2011-04-12-altdevblogaday-dlc-roundtable-p1stomp224.mp3">Round Table: DLC (Part 1 of 2)</a></p>
<p><a class="wpaudio" href="http://altdevblogaday.com/wp-content/uploads/2011/03/2011-04-12-altdevblogaday-dlc-roundtable-p2stomp224.mp3">Round Table: DLC (Part 2 of 2)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/03/12/audio-post-round-table-dlc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Do or do not</title>
		<link>http://www.altdevblogaday.com/2011/02/25/do-or-do-not-2/</link>
		<comments>http://www.altdevblogaday.com/2011/02/25/do-or-do-not-2/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 09:00:58 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/?p=1183</guid>
		<description><![CDATA[<p>Assertion is a valuable tool that many languages provide, but recently I have come to think it is used too much and in the wrong places. I put forward the idea that asserts should not be found anywhere in the main body of your code. Permanently burying asserts deep inside your code could end up causing more problems than they seek to solve. Asserts embedded in methods are useful while debugging, but should rarely be committed to source control.</p>
<p><a href="http://www.altdevblogaday.com/2011/02/25/do-or-do-not-2/" class="more-link">Read more on Do or do not&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Assertion is a valuable tool that many languages provide, but recently I have come to think it is used too much and in the wrong places. I put forward the idea that asserts should not be found anywhere in the main body of your code. Permanently burying asserts deep inside your code could end up causing more problems than they seek to solve. Asserts embedded in methods are useful while debugging, but should rarely be committed to source control.</p>
<p>I extend this thought to other defensive practices like checking for nulls indiscriminately &#8211; even where there never should be one. Sanitization of external data is prudent and necessary, but once things are safely inside your own codebase you have control of the expected range of values and should be able to trust that.</p>
<h2>What an assert does</h2>
<p>An assert stops execution and flashes up a message when a condition fails. If there is a debugger attached then if it can it will direct the programmer to the source where the assert fired. Great for the programmer trying to track something down, rubbish for someone else who has to skip the message (perhaps many times) to do what they are trying to do.</p>
<p>Asserts disrupting workflow for other programmers and disciplines have been mitigated in a few ways. The following are some more common methods:</p>
<ul>
<li>Builds with asserts turned off</li>
<li>Asserts with a concept of levels or categories that can be toggled</li>
<li>Assert instance toggle &#8211; it will appear once but as well as skip there&#8217;s an option to ignore</li>
</ul>
<h2>Crying wolf</h2>
<p>Asserts that continually fire create too much noise; unless the game completely falls over then people start to not take any of them seriously. Just like compiler warnings there is a point where many eyes just glaze over the number and a number above zero becomes an excepted part of life&#8230; perhaps even becoming a joke.</p>
<h2>Do or do not, there is no try</h2>
<p><img src="http://altdevblogaday.com/wp-content/uploads/2011/02/do-or-do-not-yoda.png" alt="Yoda: 'Do, or do not!  There is no try'." width="300" height="299" /></p>
<p>Asserts show a lack of confidence of an operation being successful &#8211; so much so that a human being should be warned. It is a developer communicating with themselves and others that at some point something is in a state so dire that normal execution must be interrupted so someone can take a look. I do not believe having that kind of warning permanently buried and hidden is healthy. It is preferable to either formally test and handle the situation if it really is expected, or get to the real root of the problem and prevent that invalid state from ever occurring.</p>
<p>Sanitize the data once properly rather than repeatedly sanitizing the same data in the same way throughout the program just in case. Every time a conditional statement is encountered there is a computational cost associated with that. A code block could have its own setup and destruction costs &#8211; perhaps more so if exception handling is being used. This may seem like premature optimization but clear concise code is easier to digest for man, compiler and machine. After all the best kind of processing is the processing you can eliminate &#8211; look to improve your algorithm.</p>
<p>Asserts in the middle of a method after a long conditional block could indicate that the method could be broken in to smaller more focused testable methods. If possible architect so that a method will always succeed in some measure to allow callers to expect the same predictable outcome. If a function should always return a populated something, use a default something rather than null. For example use a valid bright pink texture for missing data and log the error rather than just returning null and forcing everything from that point on to check for nulls.</p>
<h2>Silent but deadly</h2>
<p>A badly written assert may cause a side effect as part of testing the condition perhaps without the programmer even realizing it. When an assert like that is disabled it causes different behavior between types of builds.</p>
<p>Worse is when an assert expects to be heeded in the same way as exception. Ignored or absent through compilation options, execution blunders on and states become corrupted, going on to cause unpredictable problems later. Perhaps that problem will even mask itself as an issue with a completely unrelated system. In the worst case corrupt data could be persisted, ruining a saved game.</p>
<p>Asserts encourage a codebase that constantly tries to correct itself rather than addressing the real problem. Methods no longer trust each other to fulfill their remit. Expectations of callers change from &#8220;I should only give it foo&#8221; to &#8220;I can give it foo, bar or nothing at all&#8221;. Those expectations can virally spread throughout the codebase causing more methods to second-guess each other and bloat.</p>
<h2>The truth is out there</h2>
<p>Earlier I stated that asserts in the main body of code shows a lack of confidence and are used to try to mitigate bad states. Used in the context of test functions they serve to communicate an expectation of success. The tests can be run independent of running the game or application itself and provided with sample of runtime data to consume. Instead of the same assertions being made in multiple places against the same method scattered across the codebase, an expectation for a specific scenario can be stated exactly once.</p>
<p>Asserted expectations can be gathered in a test suite to form a living document in code that provides examples of use that are easily found. Compile time can be quicker for coders because tests can be separated out in to different projects &#8211; run only during the testing phase of a change and on the build machine.</p>
<h2>Conclusion</h2>
<p>Asserts in the main body of your code clutter the logic and could be expressed more concisely elsewhere. Programming too defensively could blur the responsibility of what is being written. Do not always code &#8220;just in case&#8221; otherwise callers will start to rely on the defensive parts. Either set the expectation of a method to always sanitize (and perhaps hint at that extra processing in the name) or fail as gracefully and quickly as possible. Many applications and games are closed systems that have predictable points of failure, only the input from the boundaries should be considered for sanitization.  Failed asserts should be a point of immediate failure &#8211; though I would argue there are better ways of indicating failure.</p>
<p>Asserts are very useful for debugging, but be wary of the costs of permanently committing them to the main body of your source code. Logging error messages and substituting inert values can be far less obtrusive then relying on asserts breaking execution and popping up message boxes. It is outrageous for a tool that is supposed to run unattended to stop everything waiting for input, just fail and exit.</p>
<p>Asserts do belong in source control when used to formally test methods and when they clearly express specifications.  This kind of living documentation created by asserts is a form of <a href="http://paulecoyote.com/2011/02/10/cover-fire-for-coders/">cover fire</a>.  If you cannot separate asserts in to formal test methods to create clear behavior specifications, try and gather them together close to where the bad state will first occur.  Group them close as possible to where an errant call could first appear on the stack, rather than scattering the expectations around deep in the code.  Let the developer see everything that is expected at a glance.  Asserts should help avoid detective work after all!</p>
<p>There are many advantages to taking asserts scattered through your code and creating test suites from them &#8211; see my previous article <a href="http://paulecoyote.com/2011/02/10/cover-fire-for-coders/">Cover Fire for Coders</a>.</p>
<h2>Further Reading</h2>
<p>Some other related <a href="http://bit.ly/h75gZN">#AltDevBlogADay</a> articles about debugging and asserts you might be interested in:</p>
<ul>
<li><a href="http://altdevblogaday.com/2011/01/25/tips-and-tricks-for-debugging-optimized-code/">Tips and Tricks for Debugging Optimized Code</a> by Max Burke (<a href="http://bit.ly/dKAGfO">@maximilianburke</a>)</li>
<li><a href="http://altdevblogaday.com/2011/02/07/debugging-tools/">Debugging Tools</a> by Justin Liew (<a href="http://bit.ly/e6Se41">@justin_liew</a>)</li>
<li><a href="http://altdevblogaday.com/2011/01/16/looks-like-im-up/">Looks like I’m up</a> by Jaymin Kessler (<a href="http://bit.ly/idzXSv">@okonomiyonda</a>)</li>
<li><a href="http://altdevblogaday.com/2011/02/16/elegance-in-failure-how-and-when-to-crash-horribly/">Elegance in Failure: How and when to crash horribly</a> by Ben Carter (<a href="http://bit.ly/grOU8R">@CarterBen</a>)</li>
<li><a href="http://altdevblogaday.com/2011/01/18/think-low-level-write-high-level/">Think low level, write high level</a> by Chris Kosanovich</li>
<li><a href="http://altdevblogaday.com/2011/02/25/handy-developer-tools-the-sandbox/">Handy Developer Tools: The Sandbox</a> by Max Burke (<a href="http://bit.ly/dKAGfO">@maximilianburke</a>)</li>
<li><a href="http://altdevblogaday.com/category/programming-2/">#AltDevBlogADay programming category</a></li>
<li><a href="http://altdevblogaday.com/2011/02/10/cover-fire-for-coders/">Cover Fire for Coders</a> by Paul Evans (<a href="http://bit.ly/paultwitter">@paulecoyote</a>)</li>
</ul>
<p>Some books you might be interested in:</p>
<p lang="en-US"><strong>McConnel, Steve (2004). <span style="font-style: italic">Code Complete &#8211; 2nd Edition</span>. Microsoft Press. ISBN: 0-7356-1967-0 </strong><a href="http://amzn.to/feNSgv"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/gIc0oJ"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hOmmia"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/eDouOo"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hkBxNr"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p>Chapter 8 covers the split between debugging tools and effectively handling failure in production code. It supports quite some things that I advocate in this article in a much more detailed discussion. One of my favorite quotes from the chapter: &#8220;Sometimes the best defence is a good offense. Fail hard during development so that you can fail softer during production&#8221;.</p>
<p><strong>Keith, Clinton (2010). Agile Game Development With Scrum. Addison Wesley. ISBN-13: 978-0-321-61852-8 </strong><a href="http://amzn.to/9froZn"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/9Ax7yj"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hqWGJL"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/htwGih"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/efokV8"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p>This book covers how spending time eliminating technical debt can help create a more predictable schedule and end up with a more focused, polished game.</p>
<p><span style="font-style: italic">[Paul Evans is a central technology programmer at Lionhead Studios. He has worked on the Fable II, Fable III and other unreleased titles. You can find him on </span><a href="http://linkd.in/pevans"><span style="font-style: italic">Linkedin</span></a><span style="font-style: italic">, see other things he has written on his personal </span><a href="http://bit.ly/paulecoyote"><span style="font-style: italic">blog</span></a><span style="font-style: italic">, and follow him on </span><a href="http://bit.ly/paultwitter"><span style="font-style: italic">twitter</span></a><span style="font-style: italic">. Everything in this article is Paul's opinion alone and does not necessarily reflect his employers views. Copyright </span>©2011, Paul Evans.]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/02/25/do-or-do-not-2/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Cover Fire for Coders</title>
		<link>http://www.altdevblogaday.com/2011/02/10/cover-fire-for-coders/</link>
		<comments>http://www.altdevblogaday.com/2011/02/10/cover-fire-for-coders/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 20:41:13 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/2011/02/10/cover-fire-for-coders/</guid>
		<description><![CDATA[<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">You are coding away and suddenly realize that there is a vital piece of new data you need to propagate through the battlefield of your game (or application) for your change.  Your heart sinks… you are going to have to take drastic action.  It will be tricky to safely create and navigate that vital piece of data through the lines.</p>
<p><a href="http://www.altdevblogaday.com/2011/02/10/cover-fire-for-coders/" class="more-link">Read more on Cover Fire for Coders&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">You are coding away and suddenly realize that there is a vital piece of new data you need to propagate through the battlefield of your game (or application) for your change.  Your heart sinks… you are going to have to take drastic action.  It will be tricky to safely create and navigate that vital piece of data through the lines.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">A complex web of method signatures fill the field like barbed wire between your data and its goal &#8211; painful for both friend and foe.  Tracing back from your goal, you come across comments from generals that have trodden a similar path in the past and shudder at their remarks.  Some of them had to do some rather unsavory things, some warn against the consequences of using exactly the method you were thinking of.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">You wipe sweat from your brow; is it really worth it to try and guide this plucky new data across such a hideous mine field?  A message from the tower tells you that you have no choice.  Reluctantly you make a plan for the fresh data recruit to cut through the battlefield at a certain point.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span>Your data makes it through and helps fortify the frontline &#8211; it all looks good.  Only three months later does a subtle change you made show up as having a hideous side-effect on the entire outcome of the war.  A halfling managed to make it behind the lines and is causing all kinds of problems.   But your plan was reviewed by one or more generals!  No one saw anything wrong with it!  Until that day when it *all* went wrong and now the </span><span>Eye of Sauron </span><span>is focused squarely on you&#8230; </span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span>If only there was an alarm hooked up… a simple safe guard to indicate there was something amiss. </span><span>Find a way to test, this story need not be about you! </span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">Allow time for tests</span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Managers and leads, please allow time for tests in schedules.  Programmers, include extra slack in estimates for writing them.   There are many reasons why &#8211; but it all comes back to your definition of done.  Is &#8220;it works for me&#8221; good enough?  Is it enough to set things up and assume everything will go to plan?  When is something really signed off?</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">Scott Evil:</span> Wait aren&#8217;t you even going to watch them?  They could get away!</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">Dr. Evil:</span> No, no, no; I&#8217;m going to leave them alone and not actually witness them dying.  I&#8217;m just going to assume it all went to plan, what?</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in"><img src="http://paulecoyote.files.wordpress.com/2011/02/austinpowersdipping.png" alt="Austin Powers versus the Ill Tempered Sea Bass" width="442" height="345" /></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><a href="http://bit.ly/dYIg0m">…</a> and Austin Powers escapes.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">Benefits of automated testing</span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">For the coder it is like cover fire.  Every test is another sniper covering some small part of the code for you.  If something flashes up in their scope they can immediately warn of some nasty bug lurking.  That regressive bug never gets a chance to get a foothold.  Each extra test watches out over your software at a different angle and cumulatively they become a very useful force.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">A well written test reviews your code &#8211; not on how you wrote something like a human reviewer might &#8211; just against an expected result.  A rational coder can not argue their code is decent if it fails a good test.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Tests form a kind of living functional documentation that any written form can never hope to compete with.  If a test becomes obsolete it is changed to fit a new requirement or even removed entirely.  Anyone that can write code can understand and write the tests.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">A good test suite can even aide the gung-ho programmer that is desperate to rewrite a big chunk of code (<a href="http://bit.ly/hH8is4">ahem Alex Evans</a> :-) ).  As long as the new code satisfies the integration tests and functionally achieves the same thing &#8211; have at it.  But before rewriting create some tests to measure performance, then after the rewrite the new work can have proven value.  If another change in the future reduces performance an alarm bell will go off.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Code passing a good set of tests in a branch can give any coder the confidence that a clean get from source control will result in a successful build of useful software.  That could be a pivotal moment for getting together something presentable for that last minute demo.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">If you cannot test something, then it is unlikely that the code in question is fully understood.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">But I can’t test</span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-style: italic">I can&#8217;t test because I don&#8217;t know where to start… there is just so much already there!</span></p>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Some tests are better than none.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Try &#8220;Tracer Bullets&#8221;[2] to shoot down bugs and introduce tests to your game / application:</span>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Create a test that tests the bug and fails.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Fix the bug, make sure the test now passes.</span></li>
<li><span style="font-family: Calibri;font-size: 11.0pt">Commit and resolve.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Now if </span><span style="font-weight: bold;font-family: Calibri;font-size: 11.0pt">anyone</span><span style="font-family: Calibri;font-size: 11.0pt"> regresses the behavior, your test will catch that right away.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Test coverage is cumulative &#8211; more bugs fixed in this way increase coverage at valuable pain points.</span></li>
</ul>
</li>
</ul>
<p style="margin: 0in;margin-left: .75in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-style: italic">I can&#8217;t test because I don&#8217;t know what I expect yet.  I&#8217;m still figuring that out.</span></p>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Prototype to investigate the problem domain. </span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">It would be helpful to set a time box around the research period (a &#8220;spike&#8221; [4]).</span>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Setting a time limit will allow you to :</span>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Step back before going too deep down a rabbit hole.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Concentrate on estimating the size of the problem domain.</span></li>
</ul>
</li>
</ul>
</li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Concentrate on figuring out what to test &#8211; the tests are likely to be usable even if the prototype code is not.</span></li>
</ul>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-style: italic">I can&#8217;t test it because there is no one expected state.</span></p>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Just think creatively while writing the test.  For example :</span>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">If a test is for randomness, then obviously there is no one predictable state.  But there can be a fitness function that defines how random something should be.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">If looking for problems in a scene screenshot, perhaps a test could ensure a reserved color used for missing textures is not present.</span></li>
</ul>
</li>
</ul>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-style: italic">I can&#8217;t test it because I cannot isolate the behavior to test</span></p>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">This could indicate:</span>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Possibly blurring of responsibility with highly dependent and coupled code (perhaps </span><span style="font-style: italic;font-family: Calibri;font-size: 11.0pt">too</span><span style="font-family: Calibri;font-size: 11.0pt"> general).</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Code could be reaching through objects, violating the principle of least knowledge.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="circle">
<li><span style="font-family: Calibri;font-size: 11.0pt">Architecturally a lot of cruft is required to access useful behavior. </span></li>
<li><span style="font-family: Calibri;font-size: 11.0pt">Code has been added to workaround a prior issue rather than refactored for a new requirement, adding to the cruft.</span></li>
</ul>
</li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Rework to be testable if you can, try to isolate and retire if you cannot.Rework to be testable if you can, try to isolate and retire if you cannot.</span></li>
</ul>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-style: italic">I can’t do all these tests, it would increase build time</span></p>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Keep tests in separate project or solution, you can run them only before committing to source control.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Ensure each test does not take long to run, mock where necessary.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Partition tests that must run for a long time.  Perhaps only run them on the build server.</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Partition tests per module so that only particular module and integration tests are executed.   This gives the coder the choice to only run the tests they need.</span></li>
</ul>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-style: italic">I can&#8217;t write tests, I just do not have the time</span></p>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">This one is the hardest thing to overcome if there is no management buy-in to testing.  As a programmer at any level try your best to campaign for more scheduled time. </span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Writing tests gets quicker as a programmer gains experience (just arrange, act and assert one thing in each test).</span></li>
</ul>
<ul style="direction: ltr;margin-top: 0in;margin-bottom: 0in" type="disc">
<li><span style="font-family: Calibri;font-size: 11.0pt">Once tests start proving there are fewer regressions being reported in the bug database, it is an easier sell.  Gather any time saving metrics you can.</span></li>
</ul>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">Summary</span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">To many game developers I am sure tests don&#8217;t seem very rock &amp; roll… not something they may have considered to be part of their role in the industry.  So I expect many do not test their work.  Writing elegant tests can present interesting engineering challenges and can be a good way to understand something that is new to you.  There is satisfaction to be had when all your tests pass after a big change, or when you realise a test saved you from an obscure bug or bad design choice.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Testing is no silver bullet, but try to think of it as an investment against that <span style="font-style: italic">same</span> bug being reopened many times later on.  Wouldn&#8217;t you rather spend time on polishing something else then finding and squashing the same bug again?</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-weight: bold">Further Reading</span></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><a href="http://bit.ly/paulealtdev">Other articles on AltDevBlogADay by Paul</a>.  Text about testing and asserts is <a href="http://bit.ly/hJMw6D">&#8220;Do or do not&#8221;</a>.  <a href="http://bit.ly/paulecoyote">Paul&#8217;s personal blog</a>.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">Clinton Keith&#8217;s book is written for game developers that want to think about different ways of prioritizing and scheduling tasks during game development.  It includes many reasons for testing and many interesting stories from the front line.  (For the purposes of disclosure he was also kind enough to acknowledge me for helping him out a little bit).</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">The other books listed are not specifically about game development but software excellence in general.</p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span>[1] Keith, Clinton (2010).  Agile Game Development With Scrum. </span><span>Addison Wesley</span><span>.  ISBN-13: 978-0-321-61852-8 </span><a href="http://amzn.to/9froZn"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/9Ax7yj"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hqWGJL"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/htwGih"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/efokV8"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">[2] Richardson, Jared &amp; Gwaltney, William (2005).  <span style="font-style: italic">Ship It! A Practical Guide to Successful Software Projects.</span> ISBN: 0-9745140-4-7 <a href="http://amzn.to/hKLomz"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/htkspP"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/dFWV8N"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hSYgWU"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/fp7HZb"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">[3] Martin, Robert C. (2003). <span style="font-style: italic">Agile Software Development: Principles, Patterns and Practices.</span> ISBN: 0-13-597444-5 <a href="http://amzn.to/hUjSZI"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/gmHa2s"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hL7OD3"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/ektxIn"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hgXSlj"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span>[4] </span><span>Pryce, Nat </span><span>(2010). </span><span style="font-style: italic">Growing Object-Oriented Software, Guided by Tests</span><span style="font-style: italic">.</span><span> </span><span>Beck Signature. </span><span>ISBN-13: </span><span>978-0321503626 </span><a href="http://amzn.to/h2Sqo9"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/eqU7FK"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/gWmRYp"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/exYuFt"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hgXSlj"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">[5] McConnel, Steve (2004).  <span style="font-style: italic">Code Complete &#8211; 2nd Edition</span>.  Microsoft Press.  ISBN: 0-7356-1967-0 <a href="http://amzn.to/feNSgv"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/gIc0oJ"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hOmmia"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/eDouOo"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hkBxNr"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">[6] Subramaniam, Venkat &amp; Hunt, Andy (2006).  <span style="font-style: italic">Practices of an Agile Developer: Working in the Real World.</span> ISBN: 0-9745140-8-X <a href="http://amzn.to/e0FcZa"><img src="http://paulecoyote.files.wordpress.com/2011/02/uk.png" alt="UK Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/eUTbV8"><img src="http://paulecoyote.files.wordpress.com/2011/02/us.png" alt="USA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/fOdTma"><img src="http://paulecoyote.files.wordpress.com/2011/02/ca.png" alt="CA Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/hdI7ak"><img src="http://paulecoyote.files.wordpress.com/2011/02/de.png" alt="DE Amazon Flag" width="25" height="15" /></a><a href="http://amzn.to/gHo3Hy"><img src="http://paulecoyote.files.wordpress.com/2011/02/fr.png" alt="FR Amazon Flag" width="25" height="15" /></a></p>
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt">
<p style="margin: 0in;font-family: Calibri;font-size: 11.0pt"><span style="font-style: italic">Paul Evans is a central technology programmer at Lionhead Studios.  He has worked on the Fable II, Fable III and other unreleased titles.  You can find him on </span><a href="http://linkd.in/pevans"><span style="font-style: italic">Linkedin</span></a><span style="font-style: italic">, see other things he has written on his personal </span><a href="http://bit.ly/paulecoyote"><span style="font-style: italic">blog</span></a><span style="font-style: italic">, and follow him on </span><a href="http://bit.ly/paultwitter"><span style="font-style: italic">twitter</span></a><span style="font-style: italic">.  Everything in this article is Paul&#8217;s opinion alone and does not necessarily reflect his employers views. Copyright </span>©2011, Paul Evans.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/02/10/cover-fire-for-coders/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cats have nine lives</title>
		<link>http://www.altdevblogaday.com/2011/01/26/cats-have-nine-lives/</link>
		<comments>http://www.altdevblogaday.com/2011/01/26/cats-have-nine-lives/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 14:23:11 +0000</pubDate>
		<dc:creator>Paul Evans</dc:creator>
		
		<guid isPermaLink="false">http://altdevblogaday.org/2011/01/26/cats-have-nine-lives/</guid>
		<description><![CDATA[<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&#8220;Oh no I died again!&#8221; &#8211; not something you generally get to say in real life is it?  Yet gamers readily accept death as a temporary failure state &#8211; just a blip towards achieving their goal.  Death has been abstracted in games in many varied ways over the years and in some games abstracted away completely.  It has been used to provoke emotion, to punish,  to teach, to up the stakes or just to increase a score.</p>
<p><a href="http://www.altdevblogaday.com/2011/01/26/cats-have-nine-lives/" class="more-link">Read more on Cats have nine lives&#8230;</a></p>
]]></description>
			<content:encoded><![CDATA[<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&#8220;Oh no I died again!&#8221; &#8211; not something you generally get to say in real life is it?  Yet gamers readily accept death as a temporary failure state &#8211; just a blip towards achieving their goal.  Death has been abstracted in games in many varied ways over the years and in some games abstracted away completely.  It has been used to provoke emotion, to punish,  to teach, to up the stakes or just to increase a score.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">But the cat came back the very next day&#8230;</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Arcades with video games and pinball machines are quite rare now in the UK (now they are full of fruit machines) but are still a good starting point for looking in to players&#8217; lives in games.  Lives in Pinball are represented by identical silver balls &#8211; a limited resource per game.  A player may start with three balls and might even win extra balls but eventually the game will end with a score.  Score is used as a measure of success across all of your lives, with each finite reincarnation another chance at increasing the net accomplishment.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://en.wikipedia.org/wiki/Space_invaders">Space Invaders</a> sees the player&#8217;s ship explode and be replaced with an identical clone  a limited number of times.  <a href="http://en.wikipedia.org/wiki/Pac-Man_(series)">PacMan</a> actually shrivels up in to nothing and makes a pitiful whining noise as his little spherical body implodes at the touch of Inky, Blinky, Pinky or Clyde… but another identical PacMan takes his place.  These games are over thirty years old but the themes of credits, lives and scores still permeate throughout modern games in all sorts of disguises.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">This kind of death and credit system is useful to monetize failure.  Want to see more of the game?  Well okay then… you have ten seconds to cough up the money and we will let you see some more.  If you do not come up with the money then back to the start for you!  Progression therefore will cost you, mastery of skills and patterns only earned after costly failure.  Is it worth antagonizing a player with this kind of death in games that are not pay-per-play?</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://en.wikipedia.org/wiki/Mario_(series)">Mario</a> and <a href="http://en.wikipedia.org/wiki/Sonic_(series)">Sonic</a> teach via death.  I cannot believe that these games were designed so that a brand new player could get through the entire game without learning through a fatal kind of trail and error.  Punishment for death can increase from the arcades where you can always bribe your way through a section, because in some games you pay in time instead.  After dying a few times in a row the punishment goes from a pained animation to having to restart an entire area &#8211; taking away hard fought progress from the player.  While some players thrive on this type of this type of challenge I would argue this action can be demotivating.  Only a certain kind of player continues on to conquer this, others will just walk away in frustration.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://bit.ly/hJ1pXe">&#8216;Splosion Man</a> has death but you just bounce right back in a glorious  splodey sentient cloud of insanity.  The game has levels and stages to clear and it is not possible to save your progress in the middle of a stage.  The game does offer the player an option to skip to the next stage if you die in a section too many times in a row.  So a frustrated player can skip forward to see new content and get some sense of progress.  I never took up the option… too much gamer pride.  But I did hear something about a pink tutu <a href="http://bit.ly/fZRCr7">you have to wear</a> in the next stage if you do!</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Games with lives and credits often also keep score, either in terms of points or fastest times.  They promote competition through leaderboards, with players trying to out do each other for bragging rights.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">If it bleeds we can kill it (apart from if it is the player)</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Courier New; font-size: 11pt;">There is a snowy mountain path continuing to the NORTH.  To the SOUTH a noisy group of villagers carrying flaming pitchforks are closing in on your location.  They all seem kind of angry.  Well apart from the springer spaniel that is wagging his tail furiously.  He seems to think this is the best walk ever.</p>
<p style="margin: 0in; font-family: Courier New; font-size: 11pt;">
<p style="margin: 0in; font-family: Courier New; font-size: 11pt;">&gt; NORTH</p>
<p style="margin: 0in; font-family: Courier New; font-size: 11pt;">
<p style="margin: 0in; font-family: Courier New; font-size: 11pt;">You tripped over something and fell off the cliff, a whooshing sound fills your ears followed by a very nasty crunching noise.  Breathing heavily and looking up you see the villagers standing where you were laughing.  One shouts down to your broken body &#8220;enjoy your trip?&#8221;  Another takes your INFRARED SUNGLASSES that fell from your pocket before your tumble and puts them on.  &#8220;OOOh INFRARED SUNGLASSES, I&#8217;ve always wanted a pair of these! I&#8217;m seeing red&#8230; oh look at that INVISIBLE TRIP WIRE across the path!&#8221;  Rolling your eyes, you promptly expire.</p>
<p style="margin: 0in; font-family: Courier New; font-size: 11pt;">
<p style="margin: 0in; font-family: Courier New; font-size: 11pt;">THE END.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">If only the player would have typed USE GLASSES.  Ah well.  It was all great playing that text adventure until you died, then you had to consider if you really wanted to play through all *that* again.  It is like not being able to cheat in a &#8220;<a href="http://en.wikipedia.org/wiki/Gamebook">Choose Your Own Adventure</a>&#8221; book.  Part of the reason I like Monkey Island II so much was that you could not get in to that situation.  Sure you could get stuck, but Guybrush could not die (but could certainly embellish the stories <a href="http://bit.ly/grHxEz">he told about it</a>).  The lack of death (but the presence of peril) made the game a very accessible adventure game.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">In <a href="http://bit.ly/glmOSo">Fable III</a>, you get knocked down, but you get up again.  There is a price though; you get scarred up and you could lose some experience towards your next guild seal.  This cosmetic toll is unbearable to some &#8211; I have known people to quit to the dashboard to avoid the auto save kicking in and saving their character in a knocked out state.  Of course others play well but get knocked out on purpose… because scars are cool and perhaps they like the villagers making negative comments about their looks (just another reason to take the safety off).</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">The player in these games has one life that is constantly threatened but never ends.  It gives a player license to experiment without fear of a sticky end.  Games where the player cannot die often focus on telling a story rather than keeping score.  They might also have to fight against the perception of being &#8220;easy&#8221;.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">Ouch that really stings</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">There are a breed of games where death is both an inconvenience and a common occurrence.  Gone are the limits on lives and credits.  A player can retry many different things in different ways without fear of being sent back to an arbitrary check point a designer decided would be a good place to start again.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">In <a href="http://bit.ly/grYpim">Braid</a>, everything fades and pauses… whoops better <a href="http://bit.ly/ecaxy9">rewind time to before that death happened</a>.  No penalty really, unless the backwards noise really grates against you.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://bit.ly/dNRncJ">Crackdown</a> and <a href="http://marketplace.xbox.com/en-US/Product/BioShock/66acd000-77fe-1000-9115-d802545407d8?cid=search">Bioshock</a> have the concept of clones… so just like Pacman and the hero&#8217;s ship in Space Invaders there is always a new vessel for a player to jump in too.  Though in Crackdown &amp; Bioshock the effects of the previous clone are still present in the world.  You literally are a player clone army and in Crackdown II there is actually an achievement rewarded for finding all the ways an agent can die.  Death then can be its own reward.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://en.wikipedia.org/wiki/Demon's_Souls">Demon&#8217;s Souls</a> adds a community aspect to death.  Death can come completely out of the blue but blood stains can be used to communicate to other wary players what is in store for them &#8211; death is a form of shared learning experience.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://bit.ly/hKa6r4">Limbo</a> sees the little boy avatar you control dying over and over again with very little game penalty.  I take it back, the deaths are really quite disturbing and stomach churning though I&#8217;m sure there are those reading that just think it is funny!  Heck it is probably a good way of acclimatizing to that kind of horror.  Each death is over so quickly and so little ground is lost that it hardly costs any player time at all to die.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">These games attempt to limit the frustration of death by placing the player close to the point of failure.  They dust off the player and say &#8220;have another go, try something different&#8221;.  Many of these games want you to complete them and know that some of the challenges they offer are tough.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">No you really are dead</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Something that computers and home consoles can do that I have not known in the arcades is the game save.  A precious area of memory where a player can save their progress through the game and return to it at will.  This allows the paradox of a player dying and a game ending, yet able to return to a certain point of time before that happened.  Kind of like <a href="http://www.youtube.com/watch?v=T_yDWQsrajA">Ground Hog Day</a>, where the entire world in unaware that all this has happened before (and all this will happen again).  The player though has hopefully gleaned some knowledge to progress past that sticky point, so perhaps after x amount of times it will actually happen differently!</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">The downside of this is that the game does not know you played through a section either, so if there are any sections of non-interactive play then a player is doomed to sit through them again and again.  As a player I really, really do hate times where I am forced to sit through sections of the game deemed so essential that I must watch them before interacting again.  Perhaps there is a happy compromise, a separate save file held that indicates if a player has experienced that oh-so-important content once even if they revert to a previous save?</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://en.wikipedia.org/wiki/Grand_Theft_Auto_IV">Grand Theft Auto IV</a> and <a href="http://en.wikipedia.org/wiki/Red_Dead_Redemption">Red Dead Redemption</a> do sometimes have fresh dialogue for retrying a totally failed mission from a checkpoint.  GTA does exact a penalty for death (or at least lack of heath) &#8211; the player does not automatically revert to a save but instead ends up in a hospital with the contents of their previously bottomless pockets empty.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Red Dead Redemption did rely on teaching me that I cannot disarm people in story mission duels via killing me off and reverting me to a save / checkpoint.  I really would have preferred disarmed opponents that <span style="font-style: italic;">had to die</span> to have killed themselves rather than gimping the disarm mechanic and killing me in duels.  Being quite a persistent gamer I believed them to just be formidable opponents, so I did try one particular duel over and over again for an hour before I caught on (sigh).</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">If a player veers away from where the story teller wants them to go, they are killed off and put back somewhere they can make a different choice.  It does become frustrating if that choice is not clear, or if a player sees what they are supposed to do but lacks the skill to do it.  Perhaps worse still, when the player remembers something from several hours ago that would change things now.  Arguably save slots offer redemption for mistakes&#8230; at the cost of perhaps many hours of player time.  Multiple save slots also potentially endanger the weight of player decisions.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Should a player be able to decide to &#8220;cheat&#8221; and turn the pages back, or should that temptation be removed?  Do you trust a player to not replay one part of the story again and again to see all the different outcomes?  Does it even matter if they do?  I don&#8217;t think so if the player is having fun, but <a href="http://bit.ly/dUGPdA">Mr. Resetti would disagree</a>!</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">You wear yellow, they wear red</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">When a hero dies there is a save point or usually a special something that allows them to fight another day.  The same cannot be said of other characters and things the player interacts with in a game world.  You are Captain Kirk, the other characters are <a href="http://bit.ly/hnjuMK">red shirts</a>.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Games in the <a href="http://en.wikipedia.org/wiki/Civilization_(series)">Civilization</a>, <a href="http://en.wikipedia.org/wiki/Age_of_empires">Age of Empires</a> and <a href="http://en.wikipedia.org/wiki/Command_and_Conquer">Command &amp; Conquer</a> series reward units that survive many battles with experience.  They reward the player for leadership that keeps the minions alive.   <a href="http://bit.ly/ebHvwc">Cannon Fodder</a> also had this but had an extra twist.  Giving my squad names and knowing the penalty of seeing a new grave on the hill at the end of the level made me work just that little bit harder to keep my squad alive (<a href="http://bit.ly/hrtCBC">see comments from other gamers on this vid</a>).</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Some game&#8217;s deaths actually are a vital part of the storyline and they expect the player to accept that.  Characters in <a href="http://en.wikipedia.org/wiki/The_Sims_(series)">The Sims</a> eventually die if you play with them.  Sure you could just switch characters, keep reverting to a save or allow them to continually imbibe from the water cooler of youth but you are always able to let time take its course and eventually death  will come to collect them.  Then they are gone.  Ok, well you might get a ghost hanging around but they are not remotely the same.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><a href="http://en.wikipedia.org/wiki/Mass_effect">Mass Effect</a> makes the player choose life or death for their own team members at points during the game.  <a href="http://en.wikipedia.org/wiki/Mass_Effect_2">Mass Effect  II</a> rewards good leadership and truly knowing the players own team with extra story and different outcomes.  There comes a point where deep knowledge of a the supporting cast strengths and weaknesses can save their lives.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Having a player care about their supporting cast is terrible when it feels unfair (why won&#8217;t this healing potion work on them this time&#8230; it worked the other thousand times?!)  When done right though it gives a player extra emotional investment in not only the avatar they control but more of the world they are experiencing.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">That&#8217;s all folks!</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">I would be very interested in hearing about how you think player death may evolve in the future, more examples of the above and your own personal experiences in the comments.  Many argue games are getting easier &#8211; some would say they are becoming more accessible.  A few designers have designed away player death completely in their games.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Death serves a few purposes, but chiefly to either completely end a score attempt or to impede progress through a larger game world.  <a href="http://bit.ly/hNkSeh">Geometry Wars</a> understands that smashing down a button lots of times should just let the player try again (a touch many gamers I am sure appreciate).  Other games use checkpoints and saves to snatch failed player actions out of the air as if they never happened; or return a carbon copy of that character back to the world sometimes none the wiser of the predecessors fate.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span>While writing this blog I asked an open question on Twitter about player and character death.   The many replies even then just go to show what a wide subject this is in both narrative and gameplay. </span><a href="http://en.wikipedia.org/wiki/Grim_Fandango"><span>Grim Fandango,</span></a><span> </span><a href="http://bit.ly/gDjOYn"><span>Planescape: Torment</span></a><span> and Die2Nite have been suggested to me as games that explore death itself, though that is a topic for a different article.  As a programmer and gamer I believe the way death is handled in a game very much defines how the game feels and plays overall.  I do hope this article sparks off a few interesting conversations.  You may leave comments here or try joining a conversation on Twitter &#8211; I suggest the hash tag #PlayerDeath </span><a href="http://bit.ly/paultwitter"><span>@paulecoyote</span></a><span>.</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">Thanks</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span>Tweeters that helped me out in no particular order: </span><a href="http://twitter.com/#!/DaveFeltham"><span>@DaveFeltham</span></a><span> </span><a href="http://twitter.com/#!/zackfreedman"><span>@zackfreedman</span></a><span> </span><a href="http://twitter.com/#!/lingmops"><span>@lingmops</span></a><span> </span><a href="http://twitter.com/#!/glamgeekgirl"><span>@glamgeekgirl</span></a><span> </span><a href="http://twitter.com/#!/oOSTVOo"><span>@oOSTVOo</span></a><span> </span><a href="http://twitter.com/#!/twonjosh"><span>@twonjosh</span></a><span> </span><a href="http://twitter.com/#!/paulnew"><span>@paulnew</span></a><span> </span><a href="http://twitter.com/#!/acroyear3"><span>@acroyear3</span></a><span> </span><a href="http://twitter.com/#!/BusterMcFearson"><span>@BusterMcFearson</span></a><span> </span><a href="http://twitter.com/#!/Stomp224"><span>@Stomp224</span></a><span> </span><a href="http://twitter.com/#!/JurieOnGames"><span>@JurieOnGames</span></a><span> </span><a href="http://twitter.com/#!/ChrisA9"><span>@ChrisA9</span></a><span> </span><a href="http://twitter.com/#!/ColleenDelzer"><span>@</span><span>ColleenDelzer</span></a><span> </span><a href="http://twitter.com/#!/Renmauzuo"><span>@Renmauzuo</span></a><span> </span><a href="http://twitter.com/#!/NaviFairyGG"><span>@NaviFairyGG</span></a><span> </span><a href="http://twitter.com/#!/FatalWebMunki"><span>@FatalWebMunki</span></a><span> </span><a href="http://twitter.com/#!/bjoernknafla"><span>@bjoernknafla</span></a><span> </span><a href="http://twitter.com/#!/daredevildave"><span>@daredevildave</span></a></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Also many thanks to my lovely wife proof reading this for me several times before I published it.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-style: italic;">Paul Evans is a central technology programmer at Lionhead Studios.  He has worked on the Fable II, Fable III and other unreleased titles.  You can find him on </span><a href="http://linkd.in/pevans"><span style="font-style: italic;">Linkedin</span></a><span style="font-style: italic;">, see other things he has written on his personal </span><a href="http://bit.ly/paulecoyote"><span style="font-style: italic;">blog</span></a><span style="font-style: italic;">, and follow him on </span><a href="http://bit.ly/paultwitter"><span style="font-style: italic;">twitter</span></a><span style="font-style: italic;">.  Everything in this article is Paul&#8217;s opinion alone and does not necessarily reflect his employer&#8217;s views, nor constitute a legal relationship.  Copyright ©2011, Paul Evans.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.altdevblogaday.com/2011/01/26/cats-have-nine-lives/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.900 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-17 03:10:41 -->
<!-- Compression = gzip -->
