<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Error_Success</title>
	
	<link>http://error-success.piku.org.uk</link>
	<description>My BLT drive just went AWOL</description>
	<lastBuildDate>Wed, 16 May 2012 21:49:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Error_success" /><feedburner:info uri="error_success" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Error_success</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Over intense foam-at-the-mouth visuals and engine testing</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/tZQbOY2u3gA/</link>
		<comments>http://error-success.piku.org.uk/2012/05/16/over-intense-foam-at-the-mouth-visuals-and-engine-testing/#comments</comments>
		<pubDate>Wed, 16 May 2012 21:49:57 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[collision detection]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=426</guid>
		<description>Yeah, so&amp;#8230; you&amp;#8217;ve seen bullet-hell style shoot-em-up games. Well how about baddie-hell ones then? No, this is quite obviously not sane and nothing at all like the intended gameplay. Let&amp;#8217;s...</description>
			<content:encoded><![CDATA[<div id="tweetbutton426" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Ferror-success.piku.org.uk%2F2012%2F05%2F16%2Fover-intense-foam-at-the-mouth-visuals-and-engine-testing%2F&amp;text=Over%20intense%20foam-at-the-mouth%20visuals%20and%20engine%20testing&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2012%2F05%2F16%2Fover-intense-foam-at-the-mouth-visuals-and-engine-testing%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div id="attachment_428" class="wp-caption aligncenter" style="width: 630px"><img class="size-large wp-image-428" title="IMG_0460" src="http://error-success.piku.org.uk/files/2012/05/IMG_0460-900x675.png" alt="" width="620" height="465" /><p class="wp-caption-text">OMG I CAN&#39;T SEE WHAT&#39;S GOING ON! THIS GAME IS RUBBISH!</p></div>
<p>Yeah, so&#8230; you&#8217;ve seen bullet-hell style shoot-em-up games. Well how about baddie-hell ones then?</p>
<p>No, this is quite obviously not sane and nothing at all like the intended gameplay. Let&#8217;s just say I might have a few bugs in my enemy generation code. Mind you, it is a rather good test of the whole update and draw loop &#8211; every one of those enemies is being mindlessly collision tested against every one of the orange bullets and the player. Using a simple circle-circle test. No fancy space partitioning or trees of objects, just a lot of</p>
<pre>For all the enemies
    For all the bullets
        If the bullet and the enemy are touching
            bullet-you-just-hit-enemy(enemy)
            enemy-you-just-hit-bullet(bullet)</pre>
<p>And then some moderately complex code to rip the objects apart into their component triangles so they explode in a pleasing way &#8211; it&#8217;s kind of the modern 3D equivalent of Robotron&#8217;s sprite shatter effect.</p>
<p>Exploding the 3D objects is easy, just draw each triangle a set distance from the centre of the object along its surface normal. It&#8217;s a single line in the shader.</p>
<p>I figure that if it goes really slow when I make the enemies do more taxing things than slide down the screen then I&#8217;ll look at improving the code.</p>
<p>Here&#8217;s a video. Next on the list &#8230; making enemies appear slightly slower with more interesting behaviours.</p>
<p><a href="http://error-success.piku.org.uk/2012/05/16/over-intense-foam-at-the-mouth-visuals-and-engine-testing/"><em>Click here to view the embedded video.</em></a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/wVEuR-lIrRe2HxN34hRXBVX6DHM/0/da"><img src="http://feedads.g.doubleclick.net/~a/wVEuR-lIrRe2HxN34hRXBVX6DHM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/wVEuR-lIrRe2HxN34hRXBVX6DHM/1/da"><img src="http://feedads.g.doubleclick.net/~a/wVEuR-lIrRe2HxN34hRXBVX6DHM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/tZQbOY2u3gA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2012/05/16/over-intense-foam-at-the-mouth-visuals-and-engine-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2012/05/16/over-intense-foam-at-the-mouth-visuals-and-engine-testing/</feedburner:origLink></item>
		<item>
		<title>How to make XCode 4.3.2 templates</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/ob9YAb18gEA/</link>
		<comments>http://error-success.piku.org.uk/2012/04/27/how-to-make-xcode-4-3-2-templates/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 15:20:43 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=418</guid>
		<description>Here&amp;#8217;s how to make a new custom code template in XCode 4. It&amp;#8217;s surprisingly simple to customise your empty C++ files to remove the useless iostream include and the boilerplate...</description>
			<content:encoded><![CDATA[<div id="tweetbutton418" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2mg&amp;text=How%20to%20make%20XCode%204.3.2%20templates&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2012%2F04%2F27%2Fhow-to-make-xcode-4-3-2-templates%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Here&#8217;s how to make a new custom code template in XCode 4. It&#8217;s surprisingly simple to customise your empty C++ files to remove the useless iostream include and the boilerplate junk at the top.</p>
<p><a href="http://error-success.piku.org.uk/files/2012/04/Screen-Shot-2012-04-27-at-14.51.47.png"><img class="aligncenter size-full wp-image-419" title="Screen Shot 2012-04-27 at 14.51.47" src="http://error-success.piku.org.uk/files/2012/04/Screen-Shot-2012-04-27-at-14.51.47.png" alt="" width="733" height="495" /></a></p>
<p>That&#8217;s what we&#8217;re aiming for, a separate entry in the list on the left and then a template to choose from.</p>
<h3>Step 1 &#8211; Copy some files</h3>
<p>We have XCode from the Appstore, it doesn&#8217;t live in /Developer any more so ignore anything that tells you to copy stuff out of /Developer/Xcode because they&#8217;re now wrong.</p>
<p><img class="alignleft size-full wp-image-420" title="Screen Shot 2012-04-27 at 15.39.39" src="http://error-success.piku.org.uk/files/2012/04/Screen-Shot-2012-04-27-at-15.39.39.png" alt="" width="326" height="213" /></p>
<p>Instead&#8230;</p>
<p>Go into <em>/Applications</em> and right click <strong>XCode</strong> and choose <strong>Show Package Contents</strong>. Then navigate to <em>Contents/Developer/Library/Xcode/Templates/File Templates.</em></p>
<p>This is where all your templates live.</p>
<p><strong>Do not edit these files, ignore anyone who tells you to, they are going to cause you pain and suffering in six months when you absent-mindedly update Xcode.</strong></p>
<p>Instead we will make our own copy in our home directory; this is Unix and we can do clever things that save us time and effort later when how to do this has leaked from our brains.</p>
<p>&nbsp;</p>
<p>So open a second Finder window and navigate to <em>~/Library/Developer/Xcode</em>. <strong>If these folders don&#8217;t exist you will need to create them,</strong> but bear in mind that certain folders are hidden in Lion. Try using the &#8216;Go&#8217; menu in Finder and typing in the path manually.</p>
<p>You&#8217;ll need a folder called Templates and inside that one called File Templates</p>
<p><img class="alignleft size-medium wp-image-421" title="Screen Shot 2012-04-27 at 15.46.39" src="http://error-success.piku.org.uk/files/2012/04/Screen-Shot-2012-04-27-at-15.46.39-300x131.png" alt="" width="300" height="131" /></p>
<p>In there copy the relevant folder from the equivalent in Xcode&#8217;s package. I copied the <strong>C and C++</strong> folder. Once copied, rename this folder to something more meaningful, the name of this folder appears on the left of the &#8216;Choose a new template&#8217; window. I called mine &#8216;<a href="http://ncot.piku.org.uk" target="_blank">NCOT</a> C and C++&#8217;.</p>
<p>Start XCode and check you see the new template choice. If you don&#8217;t, you put the files in the wrong place.</p>
<h3> Step 2 &#8211; Edit the template</h3>
<p>This is the easy bit, just open the files you copied and make changes. If you do this on Lion you&#8217;ll need to &#8216;unlock&#8217; the files first.</p>
<p>If you copy the C++ header template and the C++ code template into the same folder Xcode will generate both at the same time for you&#8230; just like it used to do in Xcode 3.</p>
<p>Oh, and I know this is more effort than simply hacking the contents of the master templates but at least this way if you delete Xcode and reinstall it your changes are preserved.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/TxQt33gM46EAqUAscdRd8ECooxI/0/da"><img src="http://feedads.g.doubleclick.net/~a/TxQt33gM46EAqUAscdRd8ECooxI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TxQt33gM46EAqUAscdRd8ECooxI/1/da"><img src="http://feedads.g.doubleclick.net/~a/TxQt33gM46EAqUAscdRd8ECooxI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/ob9YAb18gEA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2012/04/27/how-to-make-xcode-4-3-2-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2012/04/27/how-to-make-xcode-4-3-2-templates/</feedburner:origLink></item>
		<item>
		<title>The 80/20 rule… Engine now 80% complete, game 20% complete</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/B2HueO09m0Y/</link>
		<comments>http://error-success.piku.org.uk/2012/04/14/the-8020-rule-engine-now-80-complete-game-20-complete/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 23:35:27 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[game design]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=409</guid>
		<description>Here&amp;#8217;s some more progress on my iOS shooty game. There&amp;#8217;s now things to shoot at and a more usable control system. Click the video below to watch&amp;#8230; Righto now you&amp;#8217;ve...</description>
			<content:encoded><![CDATA[<div id="tweetbutton409" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2mf&amp;text=The%2080%2F20%20rule%26%238230%3B%20Engine%20now%2080%25%20complete%2C%20game%2020%25%20complete&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2012%2F04%2F14%2Fthe-8020-rule-engine-now-80-complete-game-20-complete%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div id="attachment_410" class="wp-caption aligncenter" style="width: 310px"><a href="http://error-success.piku.org.uk/files/2012/04/IMG_0083.png"><img class="size-medium wp-image-410 " title="IMG_0083" src="http://error-success.piku.org.uk/files/2012/04/IMG_0083-300x225.png" alt="" width="300" height="225" /></a><p class="wp-caption-text">It&#39;s a canyon, there&#39;s stuff to shoot at... it appears to be shooting back at you.</p></div>
<p>Here&#8217;s some more progress on my iOS shooty game. There&#8217;s now things to shoot at and a more usable control system. Click the video below to watch&#8230;</p>
<p><a href="http://error-success.piku.org.uk/2012/04/14/the-8020-rule-engine-now-80-complete-game-20-complete/"><em>Click here to view the embedded video.</em></a></p>
<p>Righto now you&#8217;ve seen the pretty video, here&#8217;s a short explanation of what&#8217;s going on&#8230;</p>
<p>The main attract screen contains the name of the game, spinning neatly in space. I constructed it using the pretty cool Milkshape 3D since it contains a feature to produce 3D renditions of text. Under that is a spinning collection of all the 3D models the game knows about, some of them might look vaguely familiar. Please ignore the washed-out look of them, that&#8217;s my phone&#8217;s camera&#8217;s fault. And under the spinning ships is a good old textured quad.</p>
<p>All games need attract screens, there&#8217;s no point in having a menu or anything with a game this simple. At some point there&#8217;ll be a thing to click on to view high scores and commune with the sacred OpenFeint but that&#8217;ll be one of the last things to go in.</p>
<p>The main &#8216;game&#8217; now has the ability to place enemies which have the freedom to move around the screen and shoot at the player in whatever manner they decide. Currently you can see some pretty spinning enemies that fart out neat sprays of bullets at timed intervals, when I enable collision detection they&#8217;re going to be proper pains to deal with! They are also a good test of the basic entity handling and bullet management code I wrote and now I also know how many bullets is &#8216;enough&#8217; for the screen.</p>
<p>The ship is controlled by sliding your finger on the screen. It&#8217;s a bit twitchy but when trying to avoid being blown up there&#8217;s nothing more annoying than laggy controls or half-baked inertia that sends you skidding across the screen. I may fiddle with it later when there&#8217;s actual threat to the player, but for now it&#8217;s OK. You&#8217;ll also notice the player&#8217;s ship shoots constantly; the whole game is controlled using a single finger with not a hint of onscreen joystick nastyness. Back in the 80s we used to pay money for joysticks with autofire so that our shooting games didn&#8217;t require constant mashing of the fire button&#8230; consider how fun it isn&#8217;t to repeatedly mash a finger against a glass iOS screen to simulate the same thing. No, it&#8217;s not fun so let&#8217;s have the ship fire all the time shall we? Yes.</p>
<p>Although there might be a power-down that switches your guns off briefly and a whole load of powerups that alter how your bullets move so it won&#8217;t be quite so &#8216;wave your finger randomly to kill everything&#8217;.</p>
<p>So what&#8217;s next?</p>
<p>Well, apart from the collision detection code the main &#8220;engine&#8221; of the game is complete enough to produce a playable game. Now it&#8217;s time for the other 80% of making a game &#8211; the actual bit where I make a game! I need to sit down and decide on fun enemy designs and movement patterns. I&#8217;ve decided the focus on this game will be a wide variety of enemies and behaviours. I tend to get bored of shooters pretty quickly once I&#8217;ve seen all the enemies and died in the bullet hell they produce, so having plenty of different things to blow up should add some interest.</p>
<p>So lots of careful &#8216;research&#8217; and staring closely at paused emulators and YouTube to look at chunky 90s 3D models is in order&#8230; plus playing the odd shooty game <img src='http://error-success.piku.org.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>No 3D engines were harmed in the creation of this software, it&#8217;s all written using nothing more complex than OpenGL ES 2.0, C++ and as little Objective-C as I can get away with. While writing code this week my Mac&#8217;s SSD died so I lost a fair chunk of time restoring my backups onto a regular HDD. I didn&#8217;t lose any data though <img src='http://error-success.piku.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  The videos are recorded by hand using my iPhone&#8217;s camera, it&#8217;s a tricky business balancing the brightness of the screen and avoiding any glare on the shiny iPad display. Since these are just test videos I shovel them straight into YouTube rather than spending time editing them.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/HJivghZ2HrCJwJsXm3dpqx8lC2s/0/da"><img src="http://feedads.g.doubleclick.net/~a/HJivghZ2HrCJwJsXm3dpqx8lC2s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HJivghZ2HrCJwJsXm3dpqx8lC2s/1/da"><img src="http://feedads.g.doubleclick.net/~a/HJivghZ2HrCJwJsXm3dpqx8lC2s/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/B2HueO09m0Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2012/04/14/the-8020-rule-engine-now-80-complete-game-20-complete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2012/04/14/the-8020-rule-engine-now-80-complete-game-20-complete/</feedburner:origLink></item>
		<item>
		<title>Processing lists of names using Microsoft Excel</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/S9jrwNgqZCo/</link>
		<comments>http://error-success.piku.org.uk/2012/03/20/processing-lists-of-names-using-microsoft-excel/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 12:10:30 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[planning]]></category>
		<category><![CDATA[teaching]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=399</guid>
		<description>The Problem I need to make lists of students using Excel so I can track their grades and so on. I have real-world amounts of data to process &amp;#8211; 15 groups...</description>
			<content:encoded><![CDATA[<div id="tweetbutton399" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2me&amp;text=Processing%20lists%20of%20names%20using%20Microsoft%20Excel&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2012%2F03%2F20%2Fprocessing-lists-of-names-using-microsoft-excel%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><h3>The Problem</h3>
<p>I need to make lists of students using Excel so I can track their grades and so on. I have real-world amounts of data to process &#8211; 15 groups of students, each group containing on average 20 students. The aim is to do this chore without wasting too much time as I actually need to use the spreadsheet for a purpose, rather than just for learning how to make a spreadsheet.</p>
<h3>Getting Data</h3>
<p>Fortunately to save a lot of effort the school registration system lets its users export data in a tab-delimited CSV file. The output looks like this</p>
<p><a href="http://error-success.piku.org.uk/files/2012/03/names-2.png"><img class="aligncenter size-full wp-image-403" title="names-2" src="http://error-success.piku.org.uk/files/2012/03/names-2.png" alt="" width="216" height="112" /></a>From this you can see the &#8216;Student Name&#8217; column contains the student names as a single field with a comma between them. This is a bit of a pain when it comes to mail-merging student reports and generally organising the information.</p>
<p>The names need splitting up and that horrid UPPER CASE text correcting &#8211; it looks a bit unprofessional if a student&#8217;s ICT report contains &#8216;BROWN, Paul&#8217; at the top instead of &#8216;Paul Brown&#8217;.</p>
<h3>Splitting the text</h3>
<p>Splitting this up is as easy as pressing the &#8216;Text to columns&#8217; button in Excel but it has a few drawbacks such as overwriting the columns around the data it is expanding. You&#8217;ll also discover it leaves the space between the comma and the first name.</p>
<p>And if the list changes, you need to remember to do it again. I&#8217;ll be doing this every year with all my classes, so having a master spreadsheet I can simply copy and then fill in will save hours. And the easier I make this process the more likely I am to remember how to do it.</p>
<h3>Working smarter, not harder</h3>
<p>Let&#8217;s use Excel for its intended function shall we? I.e processing data using formulae.</p>
<p><a href="http://error-success.piku.org.uk/files/2012/03/names-1.png"><img class="aligncenter size-full wp-image-404" title="names-1" src="http://error-success.piku.org.uk/files/2012/03/names-1.png" alt="" width="322" height="140" /></a>Now all I have to do is paste the raw names from the tab-delimited file and the rest of the sheet updates itself automatically. Now, at the start of the school year all I have to do is</p>
<ol>
<li>Copy any of last year&#8217;s class spreadsheets to a new file</li>
<li>Export the class list from the registration system</li>
<li>Copy the raw list of student names and paste into the spreadsheet</li>
</ol>
<p>No complicated button clicking procedures just simple and mindless copy-and-paste.</p>
<p>The formula looks like this, assuming a column of data in <em>&#8216;LASTNAME, Firstname&#8217;</em> format</p>
<pre>=PROPER(LEFT(A2, FIND(",", A2)-1))</pre>
<pre>=PROPER(RIGHT(A2, LEN(A2)-FIND(" ", A2)))</pre>
<h3>How they work</h3>
<p><em>Find()</em> takes two parameters &#8211; the character string to find and the cell to look in.</p>
<p><em>Left()</em> takes two parameters &#8211; the cell to look in and the number of characters to extract. If you notice I&#8217;ve taken 1 from the value <em>find()</em> returns so that the comma isn&#8217;t included.</p>
<p><em>Proper()</em> just converts whatever text you give it into Proper Case.</p>
<p>The second formula does a very similar thing, except a bit of extra faff is required because <em>Right()</em> returns the rightmost number of characters from a string, but <em>Find()</em>  only tells us where in the string a given character is. However a bit of common sense should tell you that if you know the length of a string (using <em>Len()</em>) and take off the position <em>Find()</em> gives you, it&#8217;ll return the number of characters to the end of the string.</p>
<p>Later I might document how to mail-merge data using an Excel spreadsheet as the source.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/HDtTfPX8kBEfDi3NzkpAUC2XA0E/0/da"><img src="http://feedads.g.doubleclick.net/~a/HDtTfPX8kBEfDi3NzkpAUC2XA0E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HDtTfPX8kBEfDi3NzkpAUC2XA0E/1/da"><img src="http://feedads.g.doubleclick.net/~a/HDtTfPX8kBEfDi3NzkpAUC2XA0E/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/S9jrwNgqZCo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2012/03/20/processing-lists-of-names-using-microsoft-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2012/03/20/processing-lists-of-names-using-microsoft-excel/</feedburner:origLink></item>
		<item>
		<title>Faking physics</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/fY3zaTrfexc/</link>
		<comments>http://error-success.piku.org.uk/2012/02/19/faking-physics/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 20:31:30 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[collision detection]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=395</guid>
		<description>This week&amp;#8217;s learning point &amp;#8211; your game only needs to be convincing enough, it doesn&amp;#8217;t need to model reality&amp;#8230; This week started with me having the simple challenge of &amp;#8220;stop...</description>
			<content:encoded><![CDATA[<div id="tweetbutton395" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2m9&amp;text=Faking%20physics&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2012%2F02%2F19%2Ffaking-physics%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>This week&#8217;s learning point &#8211; your game only needs to be convincing enough, it doesn&#8217;t need to model reality&#8230;</p>
<div id="attachment_396" class="wp-caption alignleft" style="width: 234px"><a href="http://error-success.piku.org.uk/files/2012/02/IMG_1079.jpg"><img class="size-medium wp-image-396" title="IMG_1079" src="http://error-success.piku.org.uk/files/2012/02/IMG_1079-224x300.jpg" alt="Mmm Euler integration" width="224" height="300" /></a><p class="wp-caption-text">Mmm Euler integration</p></div>
<p>This week started with me having the simple challenge of &#8220;stop the ship going off the screen&#8221; and this lead me on a merry trip trying to <a href="http://gamedev.stackexchange.com/questions/23840/how-do-i-calculate-collision-response-between-a-sphere-and-a-plane">calculate reflection angles for spheres intersecting planes</a> and after some rather hideous problems deciding to look at a proper physics engine. Calculating physics is kind of hard so surely a pre-made physics engine is a great idea &#8211; more writing game, less making &#8216;engines&#8217;.</p>
<p>Yeah. And I&#8217;m sure it is if you want to make a game where physics is the main &#8216;thing&#8217; and where you already have a fairly good grasp of physics. I spent a productive hour creating a new XCode project, importing my old code, deleting a load of unused code and generally tidying things up and then I dropped the <a href="http://bulletphysics.org/wordpress/">Bullet Physics</a> source in there. Bullet looks quite impressive but be prepared for a lot of digging around in source code &#8211; its documentation is rather thin. There&#8217;s a comprehensive list of API functions to read in that fantastic machine generated way Doxygen &#8220;documentation&#8221; is, and there&#8217;s a PDF that gives a brief overview.</p>
<p>After a few days of trying to figure out how to get beyond the &#8216;bouncing cube on a surface&#8217; demo to something more game-like I decided I don&#8217;t really need a physics engine. I&#8217;ll stick with trying to learn 3D coding for now, physics engines can wait until I&#8217;ve got everything else sorted. Their black-box nature confuses me somewhat.</p>
<p>So, using nothing more than some simple pretend physics and bounds checking I have this working&#8230; The ship won&#8217;t go outside the game area and its little bullets will destroy the oncoming enemy ships. All done using 1980s style computation. Retro gameplay, retro coding style <img src='http://error-success.piku.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://error-success.piku.org.uk/2012/02/19/faking-physics/"><em>Click here to view the embedded video.</em></a></p>
<p>From watching the video you will no doubt have realised a few things that inhibit gameplay &#8211; everything feels a bit &#8216;stiff&#8217;, there&#8217;s no sense of motion from the enemy ships and they&#8217;re impossible to hit. Oh, and you can&#8217;t see them. And this is all stuff I can work on now that I&#8217;m not spending hours trying to learn advanced maths.</p>
<p>The next thing to work on is how to represent waves of enemies and control when they appear.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Il0LE7ZkhkLRvsXXTSN_6msCxcg/0/da"><img src="http://feedads.g.doubleclick.net/~a/Il0LE7ZkhkLRvsXXTSN_6msCxcg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Il0LE7ZkhkLRvsXXTSN_6msCxcg/1/da"><img src="http://feedads.g.doubleclick.net/~a/Il0LE7ZkhkLRvsXXTSN_6msCxcg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/fY3zaTrfexc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2012/02/19/faking-physics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2012/02/19/faking-physics/</feedburner:origLink></item>
		<item>
		<title>Welcome to my universe</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/-xn8c5in3Ts/</link>
		<comments>http://error-success.piku.org.uk/2012/02/15/welcome-to-my-universe/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 01:15:01 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[bullet-physics]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[maths]]></category>
		<category><![CDATA[physics]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=389</guid>
		<description>Where the laws of physics are optional and not quite as they should be. If you&amp;#8217;ve ever heard people talking about physics simulations &amp;#8220;exploding&amp;#8221; and wondered what it looks like...</description>
			<content:encoded><![CDATA[<div id="tweetbutton389" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2m8&amp;text=Welcome%20to%20my%20universe&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2012%2F02%2F15%2Fwelcome-to-my-universe%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div id="attachment_390" class="wp-caption alignleft" style="width: 310px"><a href="http://error-success.piku.org.uk/files/2012/02/Screen-shot-2012-02-15-at-00.59.44.png"><img class="size-medium wp-image-390" title="Why we don't write our own physics libraries" src="http://error-success.piku.org.uk/files/2012/02/Screen-shot-2012-02-15-at-00.59.44-300x181.png" alt="" width="300" height="181" /></a><p class="wp-caption-text">In my universe the apple would have fallen through the earth, then shot off into space...</p></div>
<p>Where the laws of physics are optional and not quite as they should be. If you&#8217;ve ever heard people talking about physics simulations &#8220;exploding&#8221; and wondered what it looks like when that happens, watch the first video <img src='http://error-success.piku.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If you want to see what a physics simulation written by someone who has a clue looks like, go watch the second.</p>
<p>I had a simple looking item on my TODO list &#8211; &#8220;Collisions between terrain and ship&#8221;. It seemed fairly straight forward if I pretend the terrain is a box, rather than a lumpy collection of triangles. Just make sure the player can&#8217;t go outside a suitable sized bounding box. And if this was 2D it would be quite simple, but it&#8217;s 3D so it&#8217;s a bit less simple&#8230; and god help you if you put &#8220;3D collision detection&#8221; into Google &#8211; you&#8217;ll be off researching  RK4 integrators before breakfast.</p>
<p>It&#8217;s possible to fake a fair amount of this using the good old &#8216;position += velocity&#8217; type stuff, but once you try to make things collide (or rather, make things be solid) &#8211; and more importantly <em>work out what to do when things have collided</em> it gets kind of complex very quickly.</p>
<p>So, after a few hours buggering about with dot products, vectors and graph paper I did what any mathematically challenged coder does &#8211; starts looking for code to &#8216;borrow&#8217;. There&#8217;s tons, and once you ignore everyone who says &#8220;use Unity&#8221; and the few misguided people who say &#8220;Use Cocos2d&#8221; (yeah, people can&#8217;t read and interpret things&#8230;) you find <a href="http://http://bulletphysics.org/">Bullet Physics</a> which <a href="http://www.conormccluskey.com/archives/167">if you do some digging</a> <a href="http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World">isn&#8217;t so hard</a> to bolt onto an XCode 4 project.</p>
<p><a href="http://error-success.piku.org.uk/2012/02/15/welcome-to-my-universe/"><em>Click here to view the embedded video.</em></a></p>
<p>I think, by adding an entire physics and collision resolution system into my code, that I&#8217;ve gained a load of stuff for free. Tomorrow I&#8217;m going to strip out all my hand made physics code and thoughtfully mesh Bullet in there instead. Maybe by the end of tomorrow I&#8217;ll get things moving and bouncing off each other, or maybe I&#8217;ll unpick another thread that leads me on a merry path of learning (these things start off as simple enough sounding questions. I&#8217;m sure this learning curve is fractal&#8230;).</p>
<p><a href="http://error-success.piku.org.uk/2012/02/15/welcome-to-my-universe/"><em>Click here to view the embedded video.</em></a></p>
<p>I managed this by following a quick copy-and-paste &#8216;Hello World&#8217; tutorial and a bit of guess-the-method-using-intellisense coding (type a class, press &#8216;.&#8217;, choose a likely looking method, Google its documentation, have a go). It&#8217;s a bit rough but it works and the ship doesn&#8217;t escape.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/XEgeei9PlxOWJsoBmGvernLo2-E/0/da"><img src="http://feedads.g.doubleclick.net/~a/XEgeei9PlxOWJsoBmGvernLo2-E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/XEgeei9PlxOWJsoBmGvernLo2-E/1/da"><img src="http://feedads.g.doubleclick.net/~a/XEgeei9PlxOWJsoBmGvernLo2-E/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/-xn8c5in3Ts" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2012/02/15/welcome-to-my-universe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2012/02/15/welcome-to-my-universe/</feedburner:origLink></item>
		<item>
		<title>2011 Review</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/nwYaEIV-Yuo/</link>
		<comments>http://error-success.piku.org.uk/2011/12/31/2011-review/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 17:50:49 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=348</guid>
		<description>I did this last year, and it might be fun to review what I wrote&amp;#8230; So let&amp;#8217;s see, I ended last year&amp;#8217;s post with this So, by this time next...</description>
			<content:encoded><![CDATA[<div id="tweetbutton348" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2lx&amp;text=2011%20Review&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2011%2F12%2F31%2F2011-review%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I did this <a href="http://error-success.piku.org.uk/2010/12/31/2010-review/">last year</a>, and it might be fun to review what I wrote&#8230; So let&#8217;s see, I ended last year&#8217;s post with this</p>
<blockquote><p>So, by this time next year I’ll be happy if I’ve created at least one complete game of some description. I don’t even care if it’s just Pong with a computer opponent you can’t beat. Let’s set the bar nice and low to start with.</p></blockquote>
<p>And if you go over to <a href="http://itunes.apple.com/app/id458479549">iTunes</a> you&#8217;ll see I did indeed manage to create a game called <a href="http://ncot.piku.org.uk/ship-goes-up/">Ship Goes Up</a> <img src='http://error-success.piku.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It took me a number of months and was somewhat fiddly. Some people that bought it even commented that it was quite fun to play. I think that constitutes success. I also managed to help out a <a href="http://www.tcksoft.co.uk/2011/10/09/retro-blitz-my-first-android-game/">friend</a> with an Android game called <a href="http://ncot.piku.org.uk/retro-blitz-for-ios/">Retro Blitz</a> that he&#8217;d wanted to put on the App Store (it was created using some cross-platform tool so converting it to an iOS app was as difficult as compiling the supplied XCode project, tarring it with the App Store glue and waiting for Apple to do their thing).</p>
<p>In other news I received a <a href="http://diary.piku.org.uk/2011/12/26/christmas-1985-all-over-again/">BBC Micro</a> for Christmas along with a <a href="http://diary.piku.org.uk/2011/12/27/building-my-own-computer-from-components/">Fignition</a> AVR-based computer. The BBC Micro needs me to buy an SD card reader for it, and the Fignition needs me to learn Forth. I have ideas to type out some of the simple &#8220;games&#8221; from several 80s computer books that I own. It might make a nice diversion from the other thing I spent this year doing&#8230;</p>
<p>If you&#8217;ve read this blog recently you&#8217;ll have seen several videos of me slowly getting to grips with &#8216;Real&#8217; OpenGL ES 2.0. Real, full-fat OpenGL ES, complete with me having to learn basic linear algebra and other highly confusing concepts. All I can say is that learning something confusing like what a &#8216;ModelViewMatrix&#8217; is takes more than an afternoon of playing in OpenGL. Learning all this stuff seemed to follow the pattern of me reading a book or blog entry about it, getting confused, reading several others, asking some questions, fiddling around for a week or so, then re-reading the books and blogs while thinking &#8220;oh right, that now makes sense!&#8221;. I can&#8217;t learn the stuff without reading the books first, and I can&#8217;t make sense of the books without fiddling with the examples.</p>
<p>Go and learn proper 3D maths now, it&#8217;s really hard <img src='http://error-success.piku.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, in the name of progress I want to achieve two things next year</p>
<ol>
<li>Make a fun 3D game that people play for more than 30 seconds</li>
<li>Have it sell more than 10 copies</li>
</ol>
<p>so that it&#8217;s worth me renewing my iOS dev license in August. I mean, £59 isn&#8217;t so bad &#8211; it&#8217;s more fun than spending the equivalent on an XBox Live Gold account or shovelling money into WoW or Rift (and I can&#8217;t play those games anyway, I don&#8217;t see a level 50 warrior elf running through the forest, I see a scenegraph apply matrix transformations to a 3D mesh while the entire world is translated down the Z axis).</p>

<p><a href="http://feedads.g.doubleclick.net/~a/7gNslFJ2_SzwJ69rZ0RiP3_j6TY/0/da"><img src="http://feedads.g.doubleclick.net/~a/7gNslFJ2_SzwJ69rZ0RiP3_j6TY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7gNslFJ2_SzwJ69rZ0RiP3_j6TY/1/da"><img src="http://feedads.g.doubleclick.net/~a/7gNslFJ2_SzwJ69rZ0RiP3_j6TY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/nwYaEIV-Yuo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2011/12/31/2011-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2011/12/31/2011-review/</feedburner:origLink></item>
		<item>
		<title>Scenegraphs are cool…</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/ts5P-HYu8kM/</link>
		<comments>http://error-success.piku.org.uk/2011/12/28/scenegraphs-are-cool/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 22:43:27 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[maths]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[scene graph]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=350</guid>
		<description>Many things are cool, like this screenshot of XCode for example&amp;#8230; this is what happens when debugging iOS apps that use OpenGL, there&amp;#8217;s a handy button to click that lets...</description>
			<content:encoded><![CDATA[<div id="tweetbutton350" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2lw&amp;text=Scenegraphs%20are%20cool%26%238230%3B&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2011%2F12%2F28%2Fscenegraphs-are-cool%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Many things are cool, like this screenshot of XCode for example&#8230;</p>
<div id="attachment_352" class="wp-caption aligncenter" style="width: 586px"><a href="http://error-success.piku.org.uk/files/2011/12/Screen-shot-2011-12-28-at-21.51.31.jpg"><img class=" wp-image-352 " title="Screen shot 2011-12-28 at 21.51.31" src="http://error-success.piku.org.uk/files/2011/12/Screen-shot-2011-12-28-at-21.51.31.jpg" alt="" width="576" height="345" /></a><p class="wp-caption-text">The &#39;Capture OpenGL ES Frame&#39; view in XCode 4</p></div>
<p>this is what happens when debugging iOS apps that use OpenGL, there&#8217;s a handy button to click that lets you poke around in the OpenGL ES state. It shows running GLSL programs and the state of the buffers. Quite useful when you&#8217;re confronted with a black screen.</p>
<p>Anyway, that&#8217;s not what a <a href="http://gamedev.stackexchange.com/questions/8210/scene-graph-as-object-container">scene graph</a> is, I&#8217;m not even sure if what I constructed is really a <a href="http://en.wikipedia.org/wiki/Scene_graph">scene graph</a> either. I do know it&#8217;s a really handy concept that has made structuring my 3D code so much simpler. I always had the problem of how to put a 3D object in the game world at one position, and then have something like a &#8216;drone&#8217; ship orbit that object, or make &#8216;bullets&#8217; shoot out of the ship. Or something simple sounding like have a camera that follows an object (this is not simple BTW, it effectively involves undoing all the transforms made to your scene so that the bit the &#8216;camera&#8217; looks at is positioned at 0,0,0. The maths is horrid but this thread explains <a href="http://www.gamedev.net/topic/180189-matrix-inverse/">matrix inversions</a> well enough).</p>
<p><a href="http://error-success.piku.org.uk/2011/12/28/scenegraphs-are-cool/"><em>Click here to view the embedded video.</em></a></p>
<p>What I created was a simple tree structure that holds the relationships between game entities. Each Entity object has a list of pointers to child Entity objects and so on. This is just an STL vector of pointers to &#8216;Entity&#8217; objects. There&#8217;s an update function that recursively goes down the tree calculating the ModelView matrix of each entity based on the ModelView matrix of its parent. Recursion is cool like that, if you&#8217;ve got a tree you need recursion it makes calculating things very easy.</p>
<p>However, traversing a deeply nested tree isn&#8217;t so useful if I want to find a specific entity (like the player ship because the user just poked the screen), so rather than the tree being a container for all the entities it merely defines relationships between entities. The entities themselves live in a bog standard array that I can quickly loop through pulling out things to draw on the screen, etc. Making an Entity first involves finding a free slot in the master Entity array, then adding its pointer to a suitable parent Entity.</p>
<p>Oh in the demo video ignore the missing right-hand edge of the canyon, I was testing out different camera angles. One day I&#8217;ll work out how to smoothly move the camera from one angle to another to do fly-bys and different game modes. I&#8217;ll probably work that out on the same day I make the enemy ships fly by themselves since it&#8217;s the same thing <img src='http://error-success.piku.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next thing &#8211; multi touch so there can be steering of the ship and shooting. I got rid of the tilt controls, they were annoying me (mostly because the light in my room was reflecting off the screen!).</p>

<p><a href="http://feedads.g.doubleclick.net/~a/dh2EFVpAln2eBs18UYwEIXWOXSE/0/da"><img src="http://feedads.g.doubleclick.net/~a/dh2EFVpAln2eBs18UYwEIXWOXSE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/dh2EFVpAln2eBs18UYwEIXWOXSE/1/da"><img src="http://feedads.g.doubleclick.net/~a/dh2EFVpAln2eBs18UYwEIXWOXSE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/ts5P-HYu8kM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2011/12/28/scenegraphs-are-cool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2011/12/28/scenegraphs-are-cool/</feedburner:origLink></item>
		<item>
		<title>Speeding over the icy wastelands of $insert_name_here</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/uYaNZZiMvcI/</link>
		<comments>http://error-success.piku.org.uk/2011/12/14/speeding-over-the-icy-wastelands-of-insert_name_here/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 22:12:25 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=342</guid>
		<description>There has been progress on my &amp;#8220;fly endlessly down some sort of canyon&amp;#8221; iPad thing. Quite a lot of this progress has been non-visual infrastructure code where I&amp;#8217;ve taken hastily...</description>
			<content:encoded><![CDATA[<div id="tweetbutton342" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2lq&amp;text=Speeding%20over%20the%20icy%20wastelands%20of%20%24insert_name_here&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2011%2F12%2F14%2Fspeeding-over-the-icy-wastelands-of-insert_name_here%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div id="attachment_343" class="wp-caption aligncenter" style="width: 310px"><a href="http://error-success.piku.org.uk/files/2011/12/Screen-shot-2011-12-14-at-21.51.51.png"><img class="size-medium wp-image-343" title="Screen shot 2011-12-14 at 21.51.51" src="http://error-success.piku.org.uk/files/2011/12/Screen-shot-2011-12-14-at-21.51.51-300x246.png" alt="" width="300" height="246" /></a><p class="wp-caption-text">It&#39;s getting a bit nippy out</p></div>
<p>There has been progress on my &#8220;fly endlessly down some sort of canyon&#8221; iPad thing. Quite a lot of this progress has been non-visual infrastructure code where I&#8217;ve taken hastily hacked test code and rewritten it in a more reusable and thoughtful manner. The main visual changes are that we&#8217;re now flying over ice and snow after I watched the BBC&#8217;s <em>Frozen Planet</em> series and decided the bit where we fly down a canyon carved out of the Arctic ice sheets looked kind of cool. It&#8217;s also winter and getting a bit cold outside.</p>
<p>I&#8217;ve also got some basic tilt controls working so that the ship moves left and right depending on how you tip the device. Tapping the screen makes the ship rise and fall. I need to adjust this as everything is a bit slow and smooth but for now it&#8217;ll be enough to let me try the next thing on my todo list. There&#8217;s a video to watch below.</p>
<p><a href="http://error-success.piku.org.uk/2011/12/14/speeding-over-the-icy-wastelands-of-insert_name_here/"><em>Click here to view the embedded video.</em></a></p>
<p>So what&#8217;s next? Maybe a few nights spent playing with Milkshape3D drawing low polygon ships to shoot at. I can do quite a lot of gamey stuff if there&#8217;s some opponents, rather than plugging away at invisible infrastructure code &#8211; I wrote some linar algebra to generate an orthographic view for the HUD (that&#8217;s the thing saying &#8216;Yo&#8217; on the screen) and worked out how to have two different shader programs running. All that effort to make a small square appear on the screen. And lots of effort working out how to make this automatically scale to different screen sizes, which works rather well and means an iPhone version just &#8220;plops&#8221; out the compiler with no effort.</p>
<p>It takes hours to make that stuff work, but since it doesn&#8217;t produce anything worth looking at I&#8217;ve not bothered writing about it! I really need to work out some sort of tripod arrangement for my iPhone so I can record videos better, one-handed iPad waving while holding a phone doesn&#8217;t work very well.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/VL8vPkUNfoMC9ZfSu-t3wpWUr0E/0/da"><img src="http://feedads.g.doubleclick.net/~a/VL8vPkUNfoMC9ZfSu-t3wpWUr0E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VL8vPkUNfoMC9ZfSu-t3wpWUr0E/1/da"><img src="http://feedads.g.doubleclick.net/~a/VL8vPkUNfoMC9ZfSu-t3wpWUr0E/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/uYaNZZiMvcI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2011/12/14/speeding-over-the-icy-wastelands-of-insert_name_here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2011/12/14/speeding-over-the-icy-wastelands-of-insert_name_here/</feedburner:origLink></item>
		<item>
		<title>Problems when your compiler defies sanity and logic</title>
		<link>http://feedproxy.google.com/~r/Error_success/~3/BXQBjDJ6kcQ/</link>
		<comments>http://error-success.piku.org.uk/2011/11/26/problems-when-your-compiler-defies-sanity-and-logic/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 17:25:26 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://error-success.piku.org.uk/?p=329</guid>
		<description>If you use XCode and have to deal with C++, Objective-C and Objective-C++ you might one day come across utterly mind-bending compiler errors that seem to defy logic. Weird things...</description>
			<content:encoded><![CDATA[<div id="tweetbutton329" class="tw_button" style=""><a href="http://twitter.com/share?url=http%3A%2F%2Fwww.piku.org.uk%2Fs%2F2lp&amp;text=Problems%20when%20your%20compiler%20defies%20sanity%20and%20logic&amp;related=pickoo&amp;lang=en&amp;count=horizontal&amp;counturl=http%3A%2F%2Ferror-success.piku.org.uk%2F2011%2F11%2F26%2Fproblems-when-your-compiler-defies-sanity-and-logic%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://error-success.piku.org.uk/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><div id="attachment_331" class="wp-caption aligncenter" style="width: 633px"><a href="http://error-success.piku.org.uk/files/2011/11/Screen-shot-2011-11-26-at-17.10.33.png"><img class="size-full wp-image-331 " title="Screen shot 2011-11-26 at 17.10.33" src="http://error-success.piku.org.uk/files/2011/11/Screen-shot-2011-11-26-at-17.10.33.png" alt="" width="623" height="120" /></a><p class="wp-caption-text">Uh oh... someone&#39;s deleted one of my standard C++ headers?!</p></div>
<p>If you use XCode and have to deal with C++, Objective-C and Objective-C++ you might one day come across utterly mind-bending compiler errors that seem to defy logic. Weird things like header files not being found, or GCC somehow forgetting what the keyword &#8216;class&#8217; or &#8216;template&#8217; means.</p>
<p>And it can take hours of head-banging to work out the cause. So here&#8217;s a hint&#8230;</p>
<p><strong>Make sure XCode thinks your source is the correct type. Is it compiling your crazy mix of C++ and Objective-C as Objective-C++, or has it got in a mess and is trying to compile it as Objective-C?</strong></p>
<p>This can happen quite innocently if you hand create an Objective-C++ source file and name it <em>foo.m</em> instead of <em>foo.mm.</em> Especially since nothing bad will happen <em>until you try to #include something that somewhere eventually #includes some C++</em>. So you might have a load of Obj-C that through a chain of #includes/#imports eventually tries to use some C++. And then it&#8217;ll all go wrong.</p>
<div id="attachment_335" class="wp-caption aligncenter" style="width: 664px"><a href="http://error-success.piku.org.uk/files/2011/11/Screen-shot-2011-11-26-at-17.12.26.png"><img class="size-full wp-image-335" title="Screen shot 2011-11-26 at 17.12.26" src="http://error-success.piku.org.uk/files/2011/11/Screen-shot-2011-11-26-at-17.12.26.png" alt="" width="654" height="159" /></a><p class="wp-caption-text">The compiler doesn&#39;t seem know what the &#39;template&#39; keyword means?!</p></div>
<p>You&#8217;ll know it&#8217;s gone wrong when illogical things happen. Things like a file that used to work fine suddenly no longer compiles, even though you&#8217;ve not altered anything inside it (all you did was #include it<em>).</em></p>
<p>Time to find bug &#8211; ten minutes. Time to fix bug &#8211; less than a second.</p>
<p>Coming next&#8230; how to find the location of those bizarre <em>backward_warning.h</em> #warnings.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/YbbXWDPEb6vvANzv4c6W3afHHp8/0/da"><img src="http://feedads.g.doubleclick.net/~a/YbbXWDPEb6vvANzv4c6W3afHHp8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/YbbXWDPEb6vvANzv4c6W3afHHp8/1/da"><img src="http://feedads.g.doubleclick.net/~a/YbbXWDPEb6vvANzv4c6W3afHHp8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Error_success/~4/BXQBjDJ6kcQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://error-success.piku.org.uk/2011/11/26/problems-when-your-compiler-defies-sanity-and-logic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://error-success.piku.org.uk/2011/11/26/problems-when-your-compiler-defies-sanity-and-logic/</feedburner:origLink></item>
	</channel>
</rss>

