<?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>Jaketastic &#187; glaze physics</title>
	<atom:link href="http://jaketastic.com/blog/tag/glaze-physics/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaketastic.com/blog</link>
	<description>Jake's Blog</description>
	<lastBuildDate>Tue, 22 Jun 2010 01:47:06 +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>Voronoi shattering complete!</title>
		<link>http://jaketastic.com/blog/voronoi-shattering-complete/</link>
		<comments>http://jaketastic.com/blog/voronoi-shattering-complete/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 05:15:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Game]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[glaze physics]]></category>
		<category><![CDATA[voronoi]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=278</guid>
		<description><![CDATA[With the wonderful Voronoi implementation by Alan Shaw I&#8217;ve managed to get the destructible blocks in my game crumbling in an elegant manner. The initial shattering of the breakable blocks splits them into the convex Voronoi regions, subsequent breaks are less complicated. go to demo Demo Controls: WASD=move direction .. SPACEBAR=shoot bullets .. T=tractor beam [...]]]></description>
			<content:encoded><![CDATA[<p>With the wonderful Voronoi implementation by <a title="nodename.com blog" href="http://nodename.com/blog/" target="_blank">Alan Shaw</a> I&#8217;ve managed to get the destructible blocks in my game crumbling in an elegant manner. The initial shattering of the breakable blocks splits them into the convex Voronoi regions, subsequent breaks are less complicated.</p>
<p><a title="Click here to try out the demo" href="http://jaketastic.com/game/NewProject.swf" target="_blank"><img class="alignnone size-full wp-image-280" title="Screenshot" src="http://jaketastic.com/blog/wp-content/uploads/2009/12/recent_scn.png" alt="Screenshot" width="551" height="567" /></a><br />
<a title="yes, click here or that large image above " href="http://jaketastic.com/game/NewProject.swf" target="_blank">go to demo</a><br />
Demo Controls:</p>
<p>WASD=move direction .. SPACEBAR=shoot bullets .. T=tractor beam .. ESC=menu/pause</p>
<p>click-&gt; &#8216;start new game&#8217;, then, click-&gt; &#8216;load test area&#8217;</p>
<p>Other new features include keyframed animation of physical objects, a new wall-hugger enemy type(he&#8217;s still buggy), some sounds, exits and entrances, a new control scheme for low gravity maps that uses the mouse to control direction, and numerous other things.</p>
<p>With such a wonderfully destructible environment I hope to put to good use my crazy <a title="my blog post on path finding" href="http://jaketastic.com/blog/further-down-the-ray-cast-path/" target="_blank">ray-casting-path-finding experiments</a>. I&#8217;m sure there is some overlap with voronoi and path finding here as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/voronoi-shattering-complete/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Heuristic, semi-informed, realtime-adaptive 2D pathfinding using ray casting.</title>
		<link>http://jaketastic.com/blog/heuristic-uninformed-realtime-adaptive-2d-pathfinding-using-ray-casting/</link>
		<comments>http://jaketastic.com/blog/heuristic-uninformed-realtime-adaptive-2d-pathfinding-using-ray-casting/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 07:56:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Game]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[glaze physics]]></category>
		<category><![CDATA[pathfinding]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=80</guid>
		<description><![CDATA[Despite it&#8217;s being a gawd-awful mouthful to describe, I&#8217;ve attempted to heuristically develop a real time, semi-informed, pathfinding technique using the ray casting in the 2D glaze physics engine for Flash AS3. Pathfinding in games is usually accomplished with a waypoint network or navigation mesh, and a little algorithm called A*.   These techniques work [...]]]></description>
			<content:encoded><![CDATA[<p>Despite it&#8217;s being a gawd-awful mouthful to describe, I&#8217;ve attempted to heuristically develop a real time, semi-informed, pathfinding technique using the ray casting in the 2D glaze physics engine for Flash AS3. Pathfinding in games is usually accomplished with a waypoint network or <a href="http://www.ai-blog.net/archives/000152.html"><em>navigation mesh</em></a>, and a little algorithm called<a href="http://en.wikipedia.org/wiki/A*"> A*</a>.   These techniques work great, but I don&#8217;t want to bother with constructing nodes for my maps, and I wanted an excuse to mess around with the ray-casting built into glaze, so I approached the problem from, (ahem), a different angle.</p>
<p>The problem is how to get the enemy to the player while the player is moving and obstacles (possibly moving) are in the way.</p>
<p>I&#8217;ve gone pretty easy on myself for the requirements of this particular pathfinding problem. The path finding solution can be wrong if the enemy&#8217;s behavior will look unexpected, unpredictable and interesting. The path can fail entirely and it can be interpreted that the enemy does not see the player or cannot perceive how to reach it until conditions change. Learning the weaknesses of the pathfinding algorithm becomes part of the challenge of the game.</p>
<p>The first step in my path finder is a ray cast in the direction of the destination.  I then use the line perpendicular to the  normal of the first obstacle obstructing the ray. This line follows the obstacle like a sidewalk until it encounters another obstacle, where another 2 rays are cast. One ray along the next  sidewalk, and the other in the direction of the destination. If the ray cast in the direction of the destination is obstructed, a waypoint is added. This process is repeated a few times until the destination ray is unobstructed or the algorithm gives up. The enemy then follows it&#8217;s waypoints to the destination, checking at each waypoint to make sure the player is not in line of sight.</p>
<p style="text-align: center;">Anyway, here is what a <em>very</em> rudimentary, and buggy start to a heuristic pathfinding algorithm using ray casting looks like:<br />
<strong><a href="http://jaketastic.com/h_test.swf"><img class="size-full wp-image-82 aligncenter" title="path-_demo" src="http://jaketastic.com/blog/wp-content/uploads/2009/03/path-_demo.png" alt="path-_demo" width="450" height="390" /></a></strong><strong>Keyboard Controls:</strong></p>
<p>Move = W, A, S, D<br />
Shoot = SPACEBAR (if you kill the blue enemy you have to reload)<br />
Press &#8220;P&#8221; to attempt to get Enemy Pathfinding solution&#8230;<br />
Cast ray from ship to mouse = R<br />
Amazingly, walking along the sidewalk and only taking right or left turns can sometimes get you in sight of your destination. More analysis is forthcoming.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/heuristic-uninformed-realtime-adaptive-2d-pathfinding-using-ray-casting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>None the Bitwiser</title>
		<link>http://jaketastic.com/blog/none-the-bitwiser/</link>
		<comments>http://jaketastic.com/blog/none-the-bitwiser/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 22:51:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[bitwise]]></category>
		<category><![CDATA[glaze physics]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=75</guid>
		<description><![CDATA[Bitwise Operations For those of us without computer science degrees, a lot of the lower level guts of programming often remain a benign mystery until we encounter them in some code we need to borrow. In the Glaze physics engine, layers delegate which collisions will happen between the bodies in the physics simulation. The layer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Bitwise_operations" target="_blank">Bitwise Operations</a><br />
For those of us without computer science degrees, a lot of the lower level guts of programming often remain a benign mystery until we encounter them in some code we need to borrow. In the Glaze physics engine, layers delegate which collisions will happen between the bodies in the physics simulation. The layer object is a unsigned integer expressed as hexadecemal:  &#8220;0xffff&#8221;    The function used to determine if Rigidbodies collide is a bitwise AND.</p>
<p>One needs to grasp hexadeciaml to binary conversion and bitwise operations to control all 32 layers of collisions.  I immediately wrote a function to  obfuscate these ugly bitwise things and assign a rigid body&#8217;s layer without suffering the unintuitive process of converting and comparing. I do appreciate that bitwise comparison is very appropriate for the collision layers, but it is very satisfying for me to spackle over it and never have to deal with it directly again.</p>
<p>Starting down the programming path by way of a flash designer, I have a rather mollycoddled perspective when it comes to coding.  I am not very interested in making a compiler, or noodleing with memory management or lower level tinkering&#8230; not yet anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/none-the-bitwiser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New physics engine.</title>
		<link>http://jaketastic.com/blog/new-physics-engine/</link>
		<comments>http://jaketastic.com/blog/new-physics-engine/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 22:41:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Game]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[glaze physics]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=52</guid>
		<description><![CDATA[I&#8217;ve been experimenting with physics engines for Flash AS3 with a mind to upgrading the one I made from scratch for my parallax scrolling game. Box2D is well known, very powerful and has extensive documentation, but after taking a look at the manual, I decided that it left out too many common tasks for the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with physics engines for Flash AS3 with a mind to upgrading the one I made from scratch for my parallax scrolling game.</p>
<p><a href="http://www.box2d.org/" target="_blank">Box2D</a> is well known, very powerful and has extensive documentation, but after taking a look at the manual, I decided that it left out too many common tasks for the sake of flexibility. Also I do not like converting pixels to meters. I may return to this if they get some more advanced features implemented for as3.</p>
<p><a href="http://http://www.cove.org/ape/" target="_blank">APE</a> was ridiculously easy to use and wonderfully documented. I was able to set up my game engine to use this is just a few hours, however, I quickly ran into a wall<span style="color: #008080;">†</span> when it came to the features I needed.</p>
<p><a href="http://code.google.com/p/glaze/" target="_blank">Glaze</a> is what I&#8217;m tinkering with currently. It has little to no AS3 documentation, but it is based on the <a title="chipmunk physics library" href="http://wiki.slembcke.net/main/published/Chipmunk" target="_blank">chipmunk</a> physics library and documented in it&#8217;s daddy&#8217;s C language. It&#8217;s amazingly fast, and so far, it&#8217;s making some sense to me. I&#8217;ve made it parse a MovieClip to build rigid bodies out of it&#8217;s children, sleep off screen bodies, and I&#8217;ve extended the RigidBody Class to handle different types of collisions.</p>
<p>Here is a little demo of where I am so far: (use keys: WASD, SPACEBAR)</p>
<p style="text-align: center;">
<div id="attachment_69" class="wp-caption aligncenter" style="width: 360px"><a href="http://jaketastic.com/test.swf" target="_blank"><img class="size-full wp-image-69" title="test_glaze_physics" src="http://jaketastic.com/blog/wp-content/uploads/2009/03/test_glaze_physics.png" alt="adapting glaze physics as3" width="350" height="253" /></a><p class="wp-caption-text">adapting glaze physics as3</p></div>
<p>It&#8217;s still missing a ton of features present in my current game <a title="My game" href="http://jaketastic.com/browse/current%20projects/open%20my%20game%20engine.html" target="_blank">work in progress</a>.</p>
<p><span style="color: #008080;">† What is the word for when a metaphor has 2 meanings? Like an idiomatic pun, but not a pun. UPDATE: it&#8217;s <em>double Entendre</em> or </span><span style="color: #008080;"><em>innuendo</em></span><span style="color: #008080;">.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/new-physics-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
