<?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>Andy Moore &#187; Box2D</title>
	<atom:link href="http://www.andymoore.ca/category/code/box2d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andymoore.ca</link>
	<description>Game Design and Programming</description>
	<lastBuildDate>Mon, 06 Sep 2010 15:57:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Bug: Destroyed</title>
		<link>http://www.andymoore.ca/2009/06/bug-destroyed/</link>
		<comments>http://www.andymoore.ca/2009/06/bug-destroyed/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 22:40:00 +0000</pubDate>
		<dc:creator>Andy Moore</dc:creator>
				<category><![CDATA[Box2D]]></category>
		<category><![CDATA[Protonaut]]></category>

		<guid isPermaLink="false">http://www.andymoore.ca/2009/06/bug-destroyed/</guid>
		<description><![CDATA[Another entire weekend devoted to a single bug! I thought it was a seperate hideous bug from last time, but it was in fact the same bug in a different disguise. After some help with the Box2D Community I was able to trace it down to a bug in the engine &#8211; and upgrading to [...]]]></description>
			<content:encoded><![CDATA[<p>Another entire weekend devoted to a single bug! I thought it was a seperate hideous bug from last time, but it was in fact the same bug in a different disguise.</p>
<div>After some help with the Box2D Community I was able to trace it down to a bug in the engine &#8211; and upgrading to the latest SVN (unstable) version fixed everything. There have been no intentional bug-fixing code put into place, but it appears it&#8217;s all better now.</div>
<div>The really good news is my stupid hatred shunt-code I put in a few days ago is overwritten and no longer necessary. Hooray!</div>
<div>So now I have an incremental update, <a href="http://www.andymoore.ca/chemistry/">build 11</a>, that just fixes the &#8220;flying around&#8221; glitch. :)</div>
<div>The FC community has been having some fun &#8211; there&#8217;s now around 110 levels generated, and I&#8217;ve only made half. :) Several people are getting really excited about the gameplay, which is making me excited in turn. Whee!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.andymoore.ca/2009/06/bug-destroyed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Critical Error</title>
		<link>http://www.andymoore.ca/2009/06/critical-error/</link>
		<comments>http://www.andymoore.ca/2009/06/critical-error/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 18:57:00 +0000</pubDate>
		<dc:creator>Andy Moore</dc:creator>
				<category><![CDATA[Box2D]]></category>
		<category><![CDATA[Protonaut]]></category>

		<guid isPermaLink="false">http://www.andymoore.ca/2009/06/critical-error/</guid>
		<description><![CDATA[I&#8217;m still working on the game. I&#8217;ve run into a critical crashing bug in the Box2D engine &#8211; and it&#8217;s one of those ones that, if unsolved, it ruins the entire premise of the game. I can&#8217;t put it off and work on it later, it&#8217;s going to have to be resolved before I can [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still working on the game. I&#8217;ve run into a critical crashing bug in the Box2D engine &#8211; and it&#8217;s one of those ones that, if unsolved, it ruins the entire premise of the game. I can&#8217;t put it off and work on it later, it&#8217;s going to have to be resolved before I can move on.</p>
<div>:(</div>
<div>I&#8217;m working with some folks in the Box2D community to figure out where the problem is, hopefully it&#8217;ll be repaired soon enough.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.andymoore.ca/2009/06/critical-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Platformer</title>
		<link>http://www.andymoore.ca/2009/05/the-platformer/</link>
		<comments>http://www.andymoore.ca/2009/05/the-platformer/#comments</comments>
		<pubDate>Tue, 19 May 2009 16:31:00 +0000</pubDate>
		<dc:creator>Andy Moore</dc:creator>
				<category><![CDATA[Box2D]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Protonaut]]></category>

		<guid isPermaLink="false">http://www.andymoore.ca/2009/05/the-platformer/</guid>
		<description><![CDATA[OK, here&#8217;s something I really hate. Coding how a player moves. It turns out there&#8217;s a lot of intricate guesswork going on behind the scenes of most platformers. For instance, did you know that many platformers change the amount of friction exerted on the player body depending on the current action? Or that bodies accelerate [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm3.static.flickr.com/2134/3546441690_6e04f4e712_m.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="float: left; margin: 0 10px 10px 0; cursor: hand; width: 240px; height: 180px;" src="http://farm3.static.flickr.com/2134/3546441690_6e04f4e712_m.jpg" border="0" alt="" /></a>OK, here&#8217;s something I really hate. Coding how a player moves.</p>
<div>It turns out there&#8217;s a lot of intricate guesswork going on behind the scenes of most platformers. For instance, did you know that many platformers change the amount of friction exerted on the player body depending on the current action?</div>
<div>Or that bodies accelerate nonlinearly?</div>
<div>There&#8217;s a million factors involved and they&#8217;re all fairly easy to code &#8211; but there&#8217;s no easy math behind it; no science. I&#8217;m just going to have to continuously pull numbers out of a hat until I find something that feels right. It&#8217;s quite frustrating &#8211; why can&#8217;t it be as easy as just running and jumping?</div>
<div><a href="http://www.andymoore.ca/chemistry/dev/2.swf">My latest upload</a> (public build #2) disabled movement while you&#8217;re in the air. This is how I want the game to be, and this is exactly how to make it un-fun, which I guess means my opinion isn&#8217;t worth anything in this case.</div>
<div><img style="float: right; margin: 0 0 10px 10px; cursor: hand; width: 240px; height: 157px;" src="http://farm4.static.flickr.com/3355/3248907776_21fac2a2b4_m.jpg" border="0" alt="" /></div>
<div>I haven&#8217;t pulled any of the levers or pushed any buttons yet when it comes to acceleration or friction. The game obviously has a sluggish feel to it here but it take shape over time; patience!</div>
<div>The buid <span style="font-style: italic;">does,</span> however, feature <a href="http://mile222.com/2009/05/im-starting-work-on-a-new-collaboration-with-andy-moore/">some of Greg&#8217;s artwork</a> actually applied to the assets in-game. I have to say it turned my game from looking <a href="http://andymoore.ca/chemistry/dev/1.swf">hideous</a> to <a href="http://andymoore.ca/chemistry/dev/2.swf">awesome</a> in a single build. I wouldn&#8217;t take it as anything near final though &#8211; just yesterday we took the game in an entirely new direction (artistically) and the next build I post here will likely be altogether different.</div>
<div>(I think I&#8217;ll post with more images from now on, because &#8211; let&#8217;s face it &#8211; a blog post without pictures is like a whore without makeup)</div>
]]></content:encoded>
			<wfw:commentRss>http://www.andymoore.ca/2009/05/the-platformer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a FrameWork</title>
		<link>http://www.andymoore.ca/2009/05/building-a-framework/</link>
		<comments>http://www.andymoore.ca/2009/05/building-a-framework/#comments</comments>
		<pubDate>Wed, 06 May 2009 00:25:00 +0000</pubDate>
		<dc:creator>Andy Moore</dc:creator>
				<category><![CDATA[Box2D]]></category>
		<category><![CDATA[Game Design]]></category>

		<guid isPermaLink="false">http://www.andymoore.ca/2009/05/building-a-framework/</guid>
		<description><![CDATA[I don&#8217;t know if &#8220;FrameWork&#8221; is the right word, but I&#8217;m stealing it for my own personal use. Towards the end of developing SpaceSquid, my poor programming was catching up with me. Writing code quickly != quick running code. I think I iterated through the entire world object list several times per tick&#8230; Anyway, I [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know if &#8220;FrameWork&#8221; is the right word, but I&#8217;m stealing it for my own personal use.</p>
<div>Towards the end of developing SpaceSquid, my poor programming was catching up with me. Writing code quickly != quick running code. I think I iterated through the entire world object list several times per tick&#8230;</div>
<div>Anyway, I wanted to sit down and actually write out a nice box of parts I could pull on to make Box2D games quickly and easily. <a href="http://www.andymoore.ca/framework/1.swf">Here&#8217;s what I&#8217;ve come up with so far</a>.</div>
<div>It&#8217;s nothing to exciting, in and of itself, but the back end is cool. Some controls:</div>
<div>
<ul>
<li>Mouse drag and drop to move the screen</li>
<li>Mousewheel for zoom</li>
<li>Keyboard arrows for moving the screen</li>
<li>Z/X to zoom In/Out</li>
<li>&lt;&gt; control the gravity.</li>
</ul>
<div>The simulation doesn&#8217;t really have much to it. The 4 objects that appear are representations; from left to right:</div>
<div>
<ul>
<li>A cellphone (the minimum Box2D object size, 0.1m)</li>
<li>A person (6ft)</li>
<li>An office story (12ft)</li>
<li>A bus (the maximum Box2D object size, 10m)</li>
</ul>
<div>For the time being I&#8217;ve given them all the density of water (1000 kg/m^2 [@ 4c]) and the gravity starts out at 9.81 m/s^2, so it&#8217;s fairly realistic and should behave normally out the door.</div>
<div>To make things more interesting, however, I gave the 4 objects a restitution of 101%, so they actually gain energy anytime they hit something.</div>
<div>If you carefully tap the &#8220;&lt;&#8221; key you can make it weightless and watch things drift around. Relaxing!</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.andymoore.ca/2009/05/building-a-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Research</title>
		<link>http://www.andymoore.ca/2009/04/research/</link>
		<comments>http://www.andymoore.ca/2009/04/research/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 18:13:00 +0000</pubDate>
		<dc:creator>Andy Moore</dc:creator>
				<category><![CDATA[Box2D]]></category>
		<category><![CDATA[Space Squid]]></category>

		<guid isPermaLink="false">http://www.andymoore.ca/2009/04/research/</guid>
		<description><![CDATA[I&#8217;ve been spending the last few days just researching &#8211; reading up on Flash forums and the Box2D common issues. I&#8217;ve learned quite a few things and have a better grip on how I&#8217;m going to implement this now. One bug that Fantastic Contraption has always had, is the &#8220;Collision skipping.&#8221; When an object moves [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending the last few days just researching &#8211; reading up on Flash forums and the Box2D common issues. I&#8217;ve learned quite a few things and have a better grip on how I&#8217;m going to implement this now.</p>
<div>One bug that Fantastic Contraption has always had, is the &#8220;Collision skipping.&#8221; When an object moves too quickly, it will clip right through another object without triggering the collision detection. Box2D has a feature to prevent this &#8211; flagging your objects as &#8220;Bullets&#8221; will instead sweep the object and halt the simulation at the first collision intersection, then continue on with the new vector.</div>
<div>I imagine it reduces performance, as each collision requires a new step in the physics process, but my benchmarking tests on my game don&#8217;t seem to have a large effect. I think I&#8217;ll keep it in. :)</div>
]]></content:encoded>
			<wfw:commentRss>http://www.andymoore.ca/2009/04/research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
