<?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; Flash Game</title>
	<atom:link href="http://jaketastic.com/blog/tag/flash-game/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.3.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>2</slash:comments>
		</item>
		<item>
		<title>Cracking the crumble.</title>
		<link>http://jaketastic.com/blog/cracking-the-crumble/</link>
		<comments>http://jaketastic.com/blog/cracking-the-crumble/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 11:11:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Game]]></category>
		<category><![CDATA[destructable environments]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=165</guid>
		<description><![CDATA[With any luck, I&#8217;ll be able to put my pathfinding explorations to good use with this destructable 2D environment. This screenshot really does not do justice to what is going on here.  Polygons are breaking all over the place. Also, loot is dropping.]]></description>
			<content:encoded><![CDATA[<p>With any luck, I&#8217;ll be able to put my pathfinding explorations to good use with this destructable 2D environment.</p>
<p>This screenshot really does not do justice to what is going on here.  Polygons are breaking all over the place. Also, loot is dropping.</p>
<p><a href="http://jaketastic.com/blog/wp-content/uploads/2009/08/crumble.png"><img class="alignleft size-medium wp-image-186" title="crumble" src="http://jaketastic.com/blog/wp-content/uploads/2009/08/crumble-300x253.png" alt="crumble" width="300" height="253" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/cracking-the-crumble/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Further down the ray-cast path..</title>
		<link>http://jaketastic.com/blog/further-down-the-ray-cast-path/</link>
		<comments>http://jaketastic.com/blog/further-down-the-ray-cast-path/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 08:26:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Game]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[pathfinding]]></category>
		<category><![CDATA[ray casting]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=97</guid>
		<description><![CDATA[Still very primative, but more progress has been made. WASD, spacebar P to attempt path solution R casts a ray at the mouse and shows the first sidewalk. The enemy will stop if it is to far offscreen.  It helps if you resize the flash window to make it bigger. To avoid needless backtracking and [...]]]></description>
			<content:encoded><![CDATA[<p>Still very primative, but more progress has been made.<br />
<a title="pathfinding flash game #2" href="http://jaketastic.com/pfind2.swf" target="_blank"><img class="alignleft size-full wp-image-103" title="path2-demo1" src="http://jaketastic.com/blog/wp-content/uploads/2009/03/path2-demo1.png" alt="path2-demo1" width="517" height="361" /></a><br />
WASD, spacebar</p>
<p>P to attempt path solution<br />
R casts a ray at the mouse and shows the first sidewalk.<br />
The enemy will stop if it is to far offscreen.  It helps if you resize the flash window to make it bigger.</p>
<p>To avoid needless backtracking and cut corners when possible, extra tests are now performed each time a way point is reached. These tests  cast more rays at way points further down the list. The furthest way point touched without obstruction will become the next way point and the points in between discarded. Every second or third way point reached will probably need to trigger a completely new path finding solution, because of the time it takes to travel that far.</p>
<p>I&#8217;ve added a coefficient of average obstacle size that for now is just a variable, but might (eventually) be set automatically after a few solution attempts. The coefficient helps by hinting when the path should to turn off the &#8216;sidewalk&#8217;. In spaces with small obstacles, you&#8217;ll want to get off the sidewalk sooner and the coefficient will be smaller.</p>
<p>It turns out, that a sparse,  empty space is ill suited to the ray casting approach, because it relies on bouncing rays off walls. Luckily, featureless spaces are simple in every other way, and often require no path finding whatsoever.</p>
<p>I&#8217;ll need to do some observation and tests to determine what order of left or right turns in a row is most likely to make progress towards the destination.  I&#8217;d like to think that a lot of this can be done at runtime, but I need to be careful not to push this project towards the <em>informed</em> sort of pathfinding. I&#8217;m determined to keep the AI in the first person. It will have to learn it&#8217;s own space by casting &#8216;learning rays&#8217;. A lot of the tests I&#8217;ll need to make will be towards finding the important characteristics of obstacle filled spaces, and hopefully finding a few soft rules to follow.</p>
<p>It&#8217;s fun to program a solution with such unpredictable results.  As I fly around and press P, I can see the rays cast, but if they were not shown, I&#8217;d anthropromophize the behavior of the pathfinding enemy. If the enemy was a bit faster and deadly to touch I think it&#8217;d be fun to try outsmart it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/further-down-the-ray-cast-path/feed/</wfw:commentRss>
		<slash:comments>2</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>
	</channel>
</rss>

