<?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>Planet Timmy</title>
	<atom:link href="http://www.planettimmy.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.planettimmy.com</link>
	<description>Planet of the Timmies</description>
	<lastBuildDate>Sun, 28 Aug 2011 17:05:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>A little something</title>
		<link>http://www.planettimmy.com/2011/08/28/a-little-something/</link>
		<comments>http://www.planettimmy.com/2011/08/28/a-little-something/#comments</comments>
		<pubDate>Sun, 28 Aug 2011 17:04:36 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/2011/08/28/a-little-something/</guid>
		<description><![CDATA[I think there could be some fun in here somewhere…]]></description>
			<content:encoded><![CDATA[<p align="left">I think there could be some <a href="http://www.planettimmy.com/unity/Sidescroller/2011_08_28/WebPlayer/WebPlayer.html" target="_blank">fun in here</a> somewhere…<a href="http://www.planettimmy.com/wp-content/uploads/2011/08/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://www.planettimmy.com/wp-content/uploads/2011/08/image_thumb1.png" width="420" height="350" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/08/28/a-little-something/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In which my brain has to dredge up ancient mathematical knowledge and Anti-Aircraft guns are added to the game.</title>
		<link>http://www.planettimmy.com/2011/04/05/in-which-my-brain-has-to-dredge-up-ancient-mathematical-knowledge-and-anti-aircraft-guns-are-added-to-the-game/</link>
		<comments>http://www.planettimmy.com/2011/04/05/in-which-my-brain-has-to-dredge-up-ancient-mathematical-knowledge-and-anti-aircraft-guns-are-added-to-the-game/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 23:04:59 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/2011/04/05/in-which-my-brain-has-to-dredge-up-ancient-mathematical-knowledge-and-anti-aircraft-guns-are-added-to-the-game/</guid>
		<description><![CDATA[So tonight I added in anti-aircraft guns into the game. Although they shoot, they don’t do any damage yet. The actual model is a handful of cylinders and boxes; but for now I’m not too interested in how it looks. The interesting bit today was the bit that works out aim the gun so that [...]]]></description>
			<content:encoded><![CDATA[<p>So tonight I added in anti-aircraft guns into the game. Although they shoot, they don’t do any damage yet. </p>
<p><span id="more-159"></span>
<p><a href="http://www.planettimmy.com/wp-content/uploads/2011/04/image.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.planettimmy.com/wp-content/uploads/2011/04/image_thumb.png" width="454" height="182" /></a></p>
<p>The actual model is a handful of cylinders and boxes; but for now I’m not too interested in how it looks. The interesting bit today was the bit that works out aim the gun so that the bullets travelling at speed <em>b</em> will collide with the plane travelling with velocity <em>v</em> at some time in the future <em>t</em>. My Maths is rather tragically rusty and it took me a considerable time to work out. </p>
<p>As it turns out you have end up having the bullet as a sphere of radius <em>st</em> on one side of the equation and the plane as a line parameterised by <em>t</em> on the other. If you rearrange the equation you can form it into a classic quadratic that you can then solve with the old <em>x = (-b +/- sqrt(b^2 – 4ac)) / 2a</em> formula. This normally gives you two possible times at which the bullet and the plane should collide, although one of them may be negative (in the past), in which case the only person you’ll hit is Dr. Who.</p>
<p>Once you have the time the bullet and the plane will collide you can work out where the plane will be at that time and aim there.</p>
<p>This currently only works for planes travelling in a straight line, but for now it’ll do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/04/05/in-which-my-brain-has-to-dredge-up-ancient-mathematical-knowledge-and-anti-aircraft-guns-are-added-to-the-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GUUUUUUUUUNS!</title>
		<link>http://www.planettimmy.com/2011/03/31/guuuuuuuuuns/</link>
		<comments>http://www.planettimmy.com/2011/03/31/guuuuuuuuuns/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 22:16:56 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/2011/03/31/guuuuuuuuuns/</guid>
		<description><![CDATA[That is all.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.planettimmy.com/wp-content/uploads/2011/03/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://www.planettimmy.com/wp-content/uploads/2011/03/image_thumb2.png" width="504" height="276" /></a> </p>
<p>That is all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/03/31/guuuuuuuuuns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In which pink silly string exits from the rear of the plane.</title>
		<link>http://www.planettimmy.com/2011/03/31/in-which-pink-silly-string-exits-from-the-rear-of-the-plane/</link>
		<comments>http://www.planettimmy.com/2011/03/31/in-which-pink-silly-string-exits-from-the-rear-of-the-plane/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 19:26:14 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/2011/03/31/in-which-pink-silly-string-exits-from-the-rear-of-the-plane/</guid>
		<description><![CDATA[Last night I spent a frustrating night trying to work out why my camera script was juddering. I spent ages debugging it, not being able to find anything wrong. In then end it turned out I had another camera script running on the camera simultaneously which I’d forgotten about. Such a silly mistake cost me [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I spent a frustrating night trying to work out why my camera script was juddering. I spent ages debugging it, not being able to find anything wrong. </p>
<p><span id="more-152"></span>
<p>In then end it turned out I had another camera script running on the camera simultaneously which I’d forgotten about. Such a silly mistake cost me about two hours. Anyway, during this time I set the plane up to leave a trail behind it so that I could examine its motion – it’s pink because I haven’t assigned a texture to it. Anyway, it’s kind of fun so I left it in for the time being.</p>
<p><a href="http://www.planettimmy.com/wp-content/uploads/2011/03/image1.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.planettimmy.com/wp-content/uploads/2011/03/image_thumb1.png" width="244" height="190" /></a> </p>
<p>The main thing I’d wanted to do was to add some extra camera modes for looking around the player, and I’ve now done that as well. At the moment it snaps between camera positions, but I’ll smooth out the transition soon.</p>
<p><a href="http://www.planettimmy.com/unity/2011_03_30/WebPlayer/WebPlayer.html" target="_blank">Click here to play.</a></p>
<p><strong>Controls:</strong></p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="200">Movement:</td>
<td valign="top" width="200">Mouse</td>
</tr>
<tr>
<td valign="top" width="200">Throttle:</td>
<td valign="top" width="200">&lt; &amp; &gt;</td>
</tr>
<tr>
<td valign="top" width="200">Cameras:</td>
<td valign="top" width="200">Cursor keys or ASWD</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/03/31/in-which-pink-silly-string-exits-from-the-rear-of-the-plane/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In Which I drop Networking and start on AI</title>
		<link>http://www.planettimmy.com/2011/03/24/in-which-i-drop-networking-and-start-on-ai/</link>
		<comments>http://www.planettimmy.com/2011/03/24/in-which-i-drop-networking-and-start-on-ai/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 23:28:46 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/2011/03/24/in-which-i-drop-networking-and-start-on-ai/</guid>
		<description><![CDATA[As I mentioned in my last entry, I started working on the Networking code. However I found it was just bogging me down too much. With a full-time job as a games programmer and a family I don’t find I have huge reserves of time and energy for writing a game on the side so [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.planettimmy.com/wp-content/uploads/2011/03/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.planettimmy.com/wp-content/uploads/2011/03/image_thumb.png" width="154" height="98" /></a> As I mentioned in my last entry, I started working on the Networking code. However I found it was just bogging me down too much. With a full-time job as a games programmer and a family I don’t find I have huge reserves of time and energy for writing a game on the side so I really need to pick my battles carefully. With that thought, I decided it would be better to get on with something more gameplay related. I need to keep my momentum going.</p>
<p>So what I’ve started on now is the AI. I knew I wanted to use something like a hierarchical finite state machine, and decided in the end to use behaviour trees, similar to <a href="http://www.gamasutra.com/gdc2005/features/20050311/isla_pfv.htm" target="_blank">those used in Halo 2</a>. At first I used an existing implementation written for Unity called ‘<a href="http://angryant.com/behave" target="_blank">Behave</a>’, but I don’t like the way you always have to compile the tree before you use it. In the end I decided I’d prefer to write my own simpler system. It may not have the snazzy graphical editor, but it seems to work.</p>
<p>So far I’ve only got basic Take-off and follow AI. More soon, hopefully.</p>
<p>As an aside, I think I need to separate some of the aspects of my flight model apart, so guess I may be doing some refactoring soon.</p>
<p>No playable version today, I’m afraid.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/03/24/in-which-i-drop-networking-and-start-on-ai/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinking about networking</title>
		<link>http://www.planettimmy.com/2011/03/01/thinking-about-networking/</link>
		<comments>http://www.planettimmy.com/2011/03/01/thinking-about-networking/#comments</comments>
		<pubDate>Tue, 01 Mar 2011 00:02:15 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ScarletHawk]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/2011/03/01/thinking-about-networking/</guid>
		<description><![CDATA[<table><tr><td><img src="http://www.planettimmy.com/wp-content/uploads/2011/03/scarlethawk3.jpg" width="104" height="78" /></td><td>In which I start waffling on about networking.</td></tr></table>]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="scarlethawk3" border="0" alt="scarlethawk3" align="left" src="http://www.planettimmy.com/wp-content/uploads/2011/03/scarlethawk32.jpg" width="104" height="78" /> One of the things about adding networked play to a game is that you’re always <em>much </em>better off putting the networking in right at the start than trying to stick it in later. This is all rather new to me – I’ve only ever worked on games where we tried to strap the networking on later, and it’s probably been around a decade since I tried to do any networking code myself.</p>
<p>Therefore, I’ve been reading around about the currently accepted wisdom for implementing networking, and it seems that Tim Sweeney’s <a href="http://udn.epicgames.com/Three/NetworkingOverview.html" target="_blank">Unreal Networking Architecture</a> is the model most people seem to be basing their code on. <a href="http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/" target="_blank">I found a quite good summary of it here</a>.</p>
<p>I have mixed feelings about this. It’s something I’d really like for the game, but I’d like to get more <em>gameplay</em>&#160; code done first. However, if I don’t want to submit myself to a lot of pain later on I really need to get it sorted out now.</p>
<p>I’m just not really looking forward to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/03/01/thinking-about-networking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redoing the flight model &#8211; Part VI(b)</title>
		<link>http://www.planettimmy.com/2011/02/28/redoing-the-flight-model-part-vib/</link>
		<comments>http://www.planettimmy.com/2011/02/28/redoing-the-flight-model-part-vib/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 23:42:44 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ScarletHawk]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/2011/02/28/redoing-the-flight-model-part-vib/</guid>
		<description><![CDATA[In which I pulish the latest version and talk a little about the difference between on-ground and in-sky simulation.]]></description>
			<content:encoded><![CDATA[<p>So I don’t think I’ve actually done much on the flight model since the last post, but I’ve decided it’ll do for now. There’s still a couple of things I’d like to work on a little; the transition between taking off and flying isn’t a smooth as I’d like, for instance.</p>
<p>Actually, the taking off is kind of interesting. When flying I don’t use any of the built-in <a href="http://www.nvidia.com/object/physx_new.html" target="_blank">PhysX</a> physical simulation that Unity provides, instead controlling all movement etc myself. This allows me to concentrate on the fun and feel of the flying without having to worry about the realism. However, one of the really useful things PhysX provides is collision detection – something that’s not so important in flight, but very important on the ground. Therefore when the plane is on the ground, its movement is controlled by applying various forces to it and allowing the simulation to run. Once the plane has taken off, I stop using the simulation completely, except to register damage to the plane if it hits the terrain.</p>
<p>Anyway, here’s the latest version:</p>
<p>Mouse controls movement</p>
<p>&lt; and &gt; (, and .) control throttle.</p>
<p><a href="http://www.planettimmy.com/unity/2011_02_28/WebPlayer/WebPlayer.html" target="_blank">Click here to play</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/02/28/redoing-the-flight-model-part-vib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redoing the flight model &#8211; Part VI</title>
		<link>http://www.planettimmy.com/2011/02/21/redoing-the-flight-model-part-vi/</link>
		<comments>http://www.planettimmy.com/2011/02/21/redoing-the-flight-model-part-vi/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 23:40:16 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ScarletHawk]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/?p=132</guid>
		<description><![CDATA[<table><tr><td><img src="http://www.planettimmy.com/wp-content/uploads/2011/02/scarlethawk21.jpg"</td/></td><td>In which I write the take-off and landing code, and shortly thereafter explode.</td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>Just a short post because I&#8217;m about to go to bed.</p>
<p>Recent improvements:<br />
* Takeoff / landing<br />
* On-ground behaviour<br />
* Health<br />
* Collision damage<br />
* Explosion and fire one you&#8217;re out of health!</p>
<p>I&#8217;m not quite ready to put a new version up, but there will be one soon. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/02/21/redoing-the-flight-model-part-vi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redoing the flight model &#8211; part V</title>
		<link>http://www.planettimmy.com/2011/02/17/redoing-the-flight-model-part-v/</link>
		<comments>http://www.planettimmy.com/2011/02/17/redoing-the-flight-model-part-v/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 23:03:09 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ScarletHawk]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/?p=127</guid>
		<description><![CDATA[In which I do a couple of small tweaks to the flight model.]]></description>
			<content:encoded><![CDATA[<p>Tonight I added:<br />
* altered turning circles depending on speed<br />
* maximum altitude &#8211; your engine power decreases once you get too high &#8211; eventually you&#8217;ll stall.</p>
<p>I didn&#8217;t have a lot of time to do much on this today, but it&#8217;s always nice to be able to tick something off the list :D .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/02/17/redoing-the-flight-model-part-v/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redoing the flight model &#8211; Part IV</title>
		<link>http://www.planettimmy.com/2011/02/16/redoing-the-flight-model-part-iv/</link>
		<comments>http://www.planettimmy.com/2011/02/16/redoing-the-flight-model-part-iv/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 23:41:48 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ScarletHawk]]></category>

		<guid isPermaLink="false">http://www.planettimmy.com/?p=123</guid>
		<description><![CDATA[<table><tr><td><img src="http://www.planettimmy.com/wp-content/uploads/2011/02/scarlethawk2.jpg"/></td><td>In which I add the climbing and diving code, and make the plane stall.</td></tr></table>]]></description>
			<content:encoded><![CDATA[<p>So previously the flight model took no account of the inclination of the plane &#8211; you could fly straight upwards and the plane wouldn&#8217;t stall &#8211; it wouldn&#8217;t even slow down. I&#8217;ve fixed that now.</p>
<p>For each plane type I can customise the amount of speed you can lose or gain depending on the angle that the plane is flying at. I&#8217;ve also got settings to adjust the maximum acceleration and deacceleration of the plane. All of this means that the plane will slowly slow down as you climb and you can get a real turn of speed as you dive. On the Sopwith I&#8217;ve set it so that you can accelerate faster than you can deaccelerate, which means that if you take a nice dive you can get up a nice bit of speed and keep going for a fair bit.</p>
<p>It&#8217;s not particularly realistic, but it seems to have quite a good feel to it.</p>
<p>I then decided I needed to add some stalling behaviour. It was a bit difficult to know the best way to do this; I don&#8217;t have any physics model that it would naturally fall out of so I had to think a bit about how I wanted it to behave. Stalling should:</p>
<ul>
<li>Cause the plane to lose altitude</li>
<li>Cause the plane to spin around a bit</li>
<li>Be a bit scary for the player</li>
<li>Be recoverable from, after a little bit</li>
</ul>
<p>So I started off by setting up a speed at which stalls kick in, and making the plane start to drop when you hit it, but the transition was very abrupt and didn&#8217;t give the player any warning &#8211; so I moved it to a system when the transition is gradual. To give the player a bit of warning, the plane now judders as it approaches a stall.</p>
<p>So I had it falling once the speed dropped between a certain level, with a fair warning to the player, but there was no way to escape from it, and it looked odd as it kept the same attitude as it fell. Therefore I made the plane gradually rotate down to face the ground; as it faces downwards it will speed up and eventually get beyond its stall speed and be able to fly properly again. I found that recovering from the stall was happening too quickly so I reduce the level of throttle just when in a stall, just to make it a bit harder to recover from.</p>
<p>Buahahaha.</p>
<p>Anyway, that&#8217;s still not enough &#8211; the plane just falls down a bit until it gets up enough speed to recover. Therefore I decided to make it spin, and I think that fulfils my requirements for a stall quite admirably.</p>
<p>After that I just had to spend a little time smoothing the transition between the pre-stall and stall modes, to make it look a little less &#8216;robotic&#8217;.</p>
<p>Try it out, and see what you think.</p>
<p>Instructions :<br />
Movement &#8211; mouse<br />
throttle , &#038; .</p>
<p><a href="http://www.planettimmy.com/unity/2011_02_16/WebPlayer/WebPlayer.html">Click here to play</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettimmy.com/2011/02/16/redoing-the-flight-model-part-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

