<?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>iPhone Dev Resource &#187; Development</title>
	<atom:link href="http://www.iphonedevresource.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iphonedevresource.com</link>
	<description>[i canHas:info];</description>
	<lastBuildDate>Thu, 01 Apr 2010 12:41:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone Game Collaboration Experiment</title>
		<link>http://www.iphonedevresource.com/2009/05/iphone-game-collaboration-experiment/</link>
		<comments>http://www.iphonedevresource.com/2009/05/iphone-game-collaboration-experiment/#comments</comments>
		<pubDate>Sat, 09 May 2009 08:50:55 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[App Store]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Collaboration]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Promo Codes]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=43</guid>
		<description><![CDATA[Well, if you haven&#8217;t already guessed, I&#8217;m the Founder and Lead Software Engineer of JSeuss Software (http://iphone.jseuss.com). After the success of some of my recent projects (Pegs in Space for example) and given our game engine has reached a certain level of maturity, it&#8217;s time to go that extra yard. 
That&#8217;s why I&#8217;m trying out something [...]]]></description>
			<content:encoded><![CDATA[<p>Well, if you haven&#8217;t already guessed, I&#8217;m the Founder and Lead Software Engineer of JSeuss Software (<a href="http://iphone.jseuss.com">http://iphone.jseuss.com</a>). After the success of some of my recent projects (<a href="http://iphone.jseuss.com/PegsInSpace.html">Pegs in Space</a> for example) and given our game engine has reached a certain level of maturity, it&#8217;s time to go that extra yard. </p>
<p>That&#8217;s why I&#8217;m trying out something different.  I&#8217;ve always liked isometric turn based games (XCom &#8211; UFO: Enemy Unknown being the classic) and now I&#8217;ve got some resources at my fingertips, I&#8217;m getting the team to put together an isometric strategy game made primarily for the iPhone.  But here&#8217;s the different part &#8211; I don&#8217;t want to develop this game in secret until the end.  I think it&#8217;s important to show what kind of things go on behind the scenes and to allow players to give feedback early and often.  And I&#8217;ll be letting some parts be totally influenced by the fans.</p>
<p>To start it off, a name has to be chosen for the new game.  All submissions welcome. Head over to <a href="http://game.jseuss.com">http://game.jseuss.com/</a> for more info -it&#8217;ll be up soon.  The person who comes up with the winning name will get an App Store Promo Code for Pegs In Space, and also for the new game once it&#8217;s released.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2009/05/iphone-game-collaboration-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing iPhone Games Part 1</title>
		<link>http://www.iphonedevresource.com/2009/01/writing-iphone-games-part-1/</link>
		<comments>http://www.iphonedevresource.com/2009/01/writing-iphone-games-part-1/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 07:29:09 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=37</guid>
		<description><![CDATA[It&#8217;s been a while since my last post, but that&#8217;s because I&#8217;ve been busy on my latest title &#8211; Pegs In Space.  You can check it out over at www.jseuss.com. It&#8217;s a puzzle/physics game.
Anyhow, what better reason than to share some things I&#8217;ve learnt along the way starting with &#8230;
Scope
Before writing any application you need [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since my last post, but that&#8217;s because I&#8217;ve been busy on my latest title &#8211; Pegs In Space.  You can check it out over at <a href="http://iphone.jseuss.com/Peggie" target="_blank">www.jseuss.com</a>. It&#8217;s a puzzle/physics game.</p>
<p>Anyhow, what better reason than to share some things I&#8217;ve learnt along the way starting with &#8230;</p>
<h3>Scope</h3>
<p>Before writing <em>any</em> application you need to set a goal that is both realistic and achievable.  And this seems to be more important for games than any other genre. For some reason, people who like <em>playing </em>games, think that equates to liking/being good at <em>writing</em> games.  If you&#8217;ve never written a game before it&#8217;s probably no surprise that you shouldn&#8217;t try to write an epic FPS with realistic gameplay and story line.  But a lot of people fall into the trap of underestimating the effort to produce a simple turn based strategy, or even more common, some sort of RPG.  </p>
<p>If you&#8217;re completely new to the scene, try something a little easier.  Graphics and artwork will either cost you money or time (or both) so pick a game that&#8217;s both easy to draw and easy to write.  Many solitaire games are very simple and will give you an idea of how to process and transition between game states (I&#8217;ll talk about this later).  It&#8217;ll also allow you to play with visual effects without the need for high responsiveness.</p>
<p> From there you can create board type games with a computer opponent, introducing AI, then perhaps branch into games with levels where object management comes into play.  The choice is yours really.  But remember to keep adding to your past experiences and release every app you build.  </p>
<p>But to get back to the point, keep your apps simple, with only a few features that are new to you and stick to the plan.  Release your app and start another rather than adding &#8216;one more thing&#8217; until you have a big messy pile of code.  </p>
<p>Next post I&#8217;ll be talking about different ways to approach reuse so each app is much easier than the last.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2009/01/writing-iphone-games-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audio Services Freezing App</title>
		<link>http://www.iphonedevresource.com/2009/01/audio-services-freezing-app/</link>
		<comments>http://www.iphonedevresource.com/2009/01/audio-services-freezing-app/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 05:05:29 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Audio Services]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[OpenAL]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod Touch]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=35</guid>
		<description><![CDATA[If you are using Audio Services to play sound effects, then you&#8217;re going to have problems if you&#8217;re also updating your program state at a high frame rate. 
Although incredibly simple to use, the Audio Services should really only be used for one off alerts or sounds, and never as the sound effect backend of a [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using Audio Services to play sound effects, then you&#8217;re going to have problems if you&#8217;re also updating your program state at a high frame rate. </p>
<p>Although incredibly simple to use, the Audio Services should really only be used for one off alerts or sounds, and never as the sound effect backend of a game or similar. </p>
<p>Like most Apple APIs, they use the technique of lazy loading.  That is, don&#8217;t bother doing anything like setting up audio buffers etc until you actually call the API into action for the first time.  This is useful for faster loading apps, and a smaller average memory footprint. </p>
<p>But the downside to this is that the first time you try to play a sound, the Audio Services will be initialized and your app will pause for tenths of a second.  After this, however, all will be fine. </p>
<p>A better way to go is to use OpenAL to handle audio playback.  It is much more flexible, and allows you to call the initialize function when your application loads, to avoid delays when you actually want sound to be played.  </p>
<p>The best place to start with this is to look at the Apple &#8216;Crash Landing&#8217; example.  It includes a &#8216;SoundEngine&#8217; module that can pretty much just be copied into your applications for use.  Remember to include the OpenAL framework though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2009/01/audio-services-freezing-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OpenGL ES 1.1 and the iPhone</title>
		<link>http://www.iphonedevresource.com/2008/12/opengl-es-11-and-the-iphone/</link>
		<comments>http://www.iphonedevresource.com/2008/12/opengl-es-11-and-the-iphone/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 23:17:53 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[OpenGL ES]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod Touch]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=31</guid>
		<description><![CDATA[What can make an iPhone developer sulk and refuse to program for two hours?  OpenGL ES is the answer, and it has nothing to do with OpenGL ES per se. 
Largely it&#8217;s my fault.  I should have done my research upfront. But with all the talk of the OpenGL ES 2.0 standard, I started to assume [...]]]></description>
			<content:encoded><![CDATA[<p>What can make an iPhone developer sulk and refuse to program for two hours?  OpenGL ES is the answer, and it has nothing to do with OpenGL ES per se. </p>
<p>Largely it&#8217;s my fault.  I should have done my research upfront. But with all the talk of the OpenGL ES 2.0 standard, I started to assume that it was supported on the iPhone.  After three hours of learning about vertex and fragment shaders in OpenGL ES 2.0, and writing a few to render a 2D blob for my upcoming iPhone physics engine (more on this later..) I got stuck trying to make it work on the iPhone itself.  </p>
<p>Not surprising really.  The hardware in the iPhone only supports the OpenGL ES 1.1 standard, and as such the API has no calls to any vector or fragment program related goodness.  </p>
<p>Lucky for me, I was just trying to do some shadows and shading of 2D sprites, so I could kinda fake it using some blending and scaling, but I guess the more adventurous effects will just have to wail until the next iPhone generation or later. </p>
<p>So before you end up crossed armed and sulking as hard as you can at your computer, only do things based on the 1.1 standard, not the 2.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2008/12/opengl-es-11-and-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing Objective C for iPhone</title>
		<link>http://www.iphonedevresource.com/2008/11/optimizing-objective-c-for-iphone/</link>
		<comments>http://www.iphonedevresource.com/2008/11/optimizing-objective-c-for-iphone/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 10:19:24 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=17</guid>
		<description><![CDATA[
There are so many apps out there for the iPhone that are doing some pretty graphics/algorithmically intensive stuff.  Most are right on the money when it comes to responsiveness, but some are just woeful!    
Perhaps it&#8217;s the promises of fame and fortune that seems synonymous with iPhone programming, but many developers new to Objective [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>There are so many apps out there for the iPhone that are doing some pretty graphics/algorithmically intensive stuff.  Most are right on the money when it comes to responsiveness, but some are just woeful!    </p>
<p>Perhaps it&#8217;s the promises of fame and fortune that seems synonymous with iPhone programming, but many developers new to Objective C are doing straight ports or just writing plain ObjC code until their app &#8216;works&#8217; then just release it.  There seems to be a feeling that if an app is slow, the device just can&#8217;t handle it.  </p>
<p>I&#8217;ve been stepping through the hoops of (relatively) computationally heavy apps at the moment with the creation of a generic physics engine for use in a bunch of 2D based games.  Because it was my first app with serious algorithms in it, I didn&#8217;t give optimization much thought. And if you believe most &#8216;Good Software Practice&#8221; guidelines, that was a good thing. (optimize last, or you&#8217;ll be optimizing things that need no optimization at all.)</p>
<p>But perhaps some thought is necessary.  At the beginning, it&#8217;s very nice to go down the path of using pure ObjC throughout your code.  Let&#8217;s face it &#8211; it has a nice set of design features that make you feel like you&#8217;re on a fluffy cloud rather than the hard stainless steel bench of C.  And if you&#8217;re particularly sick like me, [you setLovesSquareBrackets:YES]. But of course the nice features of ObjC come at a cost, and the biggest one is the passing of messages.  C/C++ programmers often forget that when invoking a method on an object in ObjC, you are actually passing a message to the object which has to be converted into a function call at runtime.  Great for flexible, extendable libraries &#8211; bad for speed.</p>
<p>So you can either start your development with core components using plain C calls, or you can do what I did and wait until the &#8216;end&#8217; and use the profiler.  The &#8216;Instruments&#8217; tool in conjunction with remote iPhone SDK debugging is great.  You can actually run the app on the device and get statistics about what you&#8217;re app is doing and when &#8211; without a huge penalty to performance.  </p>
<p>Take a typical recording and keep an eye out for the msg_send call, and how much time is spent there.  You may actually find that you&#8217;ve introduced a dependency lock that&#8217;s slowing things down or you may have an update timer that&#8217;s just being ridiculous and updating a billion times a second. </p>
<p>But if you find out that a lot of time is spent calling msg_send, all hope is not lost.  You can still do some optimizations that help out.  For the other things I&#8217;ll talk about them later. </p>
<p>In simple cases, you do some of the internal work of ObjC yourself and cut out the middle man (sourced from <a href="http://www.cs.helsinki.fi/u/ekarttun/objc/">here</a>):</p>
<pre>-naive {
  for(i=0; i&lt;50000000; i++)
    [obj hello];
}

-optimised {
  typedef id (*hello_t)(id, SEL, ...);
  hello_t ref = [obj methodFor:@selector(hello)];
  for(i=0; i&lt;500000000UL; i++)
    ref(obj,@selector(hello));
} </pre>
<p>which will work in a lot of cases.</p>
<p>But sometimes, you just have to revert to C.  Go back to the profiler and see what&#8217;s happening.  If there are still a lot of msg_send calls clogging up your execution time, then you&#8217;ll have to strip out the offenders and just write C functions.  It&#8217;s really not that bad..</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2008/11/optimizing-objective-c-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone/iPod Accelerometer Issues</title>
		<link>http://www.iphonedevresource.com/2008/11/iphoneipod-accelerometer-issues/</link>
		<comments>http://www.iphonedevresource.com/2008/11/iphoneipod-accelerometer-issues/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 08:06:46 +0000</pubDate>
		<dc:creator>J.Seuss</dc:creator>
				<category><![CDATA[Accelerometer]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[OpenGL ES]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>

		<guid isPermaLink="false">http://www.iphonedevresource.com/?p=8</guid>
		<description><![CDATA[If you&#8217;re struggling with odd behavior from your device&#8217;s accelerometer &#8216;every now and again&#8217; then you&#8217;re not alone.  
This post comments on the problem and some work arounds, and this is what I&#8217;ve found:
Problem:
A few devs out there have noticed the following symptoms

The accelerometer will not respond via the delegate at all in your app [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re struggling with odd behavior from your device&#8217;s accelerometer &#8216;every now and again&#8217; then you&#8217;re not alone.  </p>
<p>This <a href="http://discussions.apple.com/thread.jspa?messageID=8417664">post</a> comments on the problem and some work arounds, and this is what I&#8217;ve found:</p>
<h2>Problem:</h2>
<p>A few devs out there have noticed the following symptoms</p>
<ul>
<li>The accelerometer will not respond via the delegate at all in your app about 5% of the time when running your app</li>
<li>When combined with OpenGLES surfaces, the first drawn frame will be drawn between every new frame drawn to the surface.  This results in a flickering effect where a &#8216;ghost&#8217; of your initial drawing is interlaced with your normal frames.  </li>
</ul>
<p>Although some have reported these two problems being one and the same, I found them to be quite separate. I think many people are using the accelerometers+OpenGLES for games, and because the problems happen infrequently they seem related.  I could be wrong of course.  For the same reasons I could just be imagining that they <em>aren&#8217;t<span style="font-style: normal;"> related.</span></em></p>
<h2><em><span style="font-style: normal;">Work-arounds (not really solutions):</span></em></h2>
<h3>Accelerometer not working</h3>
<p>For the accelerometer, many have found (and I have too) that the problem seems to go away if you set the update frequency and delegate much later on in your app.</p>
<blockquote>
<pre><span>[[</span><span>UIAccelerometer</span><span> </span>sharedAccelerometer<span>] </span>setUpdateInterval<span>: (</span><span>1.0</span><span> / </span><span>kAccelerometerFrequency</span><span>)];</span>

<span><span>[[</span><span>UIAccelerometer</span><span> </span>sharedAccelerometer<span>] </span>setDelegate<span>:</span><span>self</span><span>];</span></span></pre>
</blockquote>
<p>Typically, you&#8217;ll call the above lines in</p>
<pre> - (<span>void</span>)applicationDidFinishLaunching:(<span>UIApplication</span> *)application</pre>
<p>but that&#8217;s what causes the problems.  Anyones best guess is that it just takes too long for the accelerometer to get ready some times and it just ignores your set delegate request. </p>
<h3>Flashing graphics</h3>
<p>I can&#8217;t confirm that this fix works, but some have reported that using kEAGLColorFormatRGBA8 instead of kEAGLColorFormatRGB565 on your OpenGLES surface will stop it happening.  I&#8217;ll give it a try and post my results here. If anyone can confirm or deny this fix, we&#8217;d love to hear from you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iphonedevresource.com/2008/11/iphoneipod-accelerometer-issues/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

