<?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; AS3</title>
	<atom:link href="http://jaketastic.com/blog/tag/as3/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>Flash Slideshow for pods, etc.</title>
		<link>http://jaketastic.com/blog/flash-slideshow-for-pods-etc/</link>
		<comments>http://jaketastic.com/blog/flash-slideshow-for-pods-etc/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 19:11:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[pods plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=199</guid>
		<description><![CDATA[I&#8217;ve made a simple slide show in flash to work with the pods plugin for wordpress. In principle, you can use the slide show in any situation, because it uses a &#8216;magic&#8217; string to get the images, links etc it needs to load. The compiled .swf is just under 4kB and uses a config_slideshow.txt file [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a simple slide show in flash to work with the pods plugin for wordpress. In principle, you can use the slide show in any situation, because it uses a &#8216;magic&#8217; string to get the images, links etc it needs to load.</p>
<p>The compiled .swf is just under 4kB and uses a config_slideshow.txt file to get itself started.</p>
<p>The slideshow.swf looks for config_slideshow.txt in the same directory (as itself) and loads some configuration variables from it. (Don&#8217;t rename slideshow.swf or config_slideshow.txt.) The config_slideshow.txt will look like this:</p>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;">url=http://your domain.com/flash_slideshow/<span class="sc1">&amp;delay=6&amp;suppressLoadInfo=false&amp;linkText=Click here to learn more.</span></div>
</div>
<p>The format for the magic string the slideshow will read is:</p>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;">title of image^http://my domain.com/path_to_image.jpg.gif.png.bmp^http://link when you click the linkText^image description text in simple html or txt#<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a>&gt;</span><br />
title of image2^http://my domain.com/path_to_image2.jpg.gif.png.bmp^http://link when you click the linkText^<br />
image description text in simple html or txt#<span class="sc2">&lt;<a href="http://december.com/html/4/element/br.html"><span class="kw2">br</span></a>&gt;</span></div>
</div>
<p>etc&#8230;<br />
You can see the magic string uses carrots &#8220;^&#8221; and &#8220;#&lt;br&gt;&#8221; to break into usable data. The order of the elements in the magic strings is important, but you may leave an element blank if you like: &#8220;^^&#8221;</p>
<p>Here is an example with intentional missing images to show how errors are handled:</p>

		<span class="flash">
		<object width="400" height="300">
			<param name="movie" value="http://jaketastic.com/blog/wp-content/themes/jaketastic/slideshow.swf"></param>
			<param name="allowFullScreen" value="true"></param>
			<param name="allowscriptaccess" value="always"></param>
			<embed src="http://jaketastic.com/blog/wp-content/themes/jaketastic/slideshow.swf" type="application/x-shockwave-flash"allowscriptaccess="always" allowfullscreen="true" width="400" height="300"></embed>
		</object>
		</span>
		
<p>Here are the files:</p>
<p><a href="http://jaketastic.com/blog/wp-content/uploads/2009/09/slideshow.zip">Flash slideshow files and source</a></p>
<p>Still to do:<br />
back/forward buttons. + configure in config_slideshow.txt file.<br />
Fullscreen button. + on/off in config_slideshow.txt file.<br />
Play music .mp3 or midi with the slideshow. +config_slideshow.txt file controlled.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/flash-slideshow-for-pods-etc/feed/</wfw:commentRss>
		<slash:comments>2</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>
		<item>
		<title>jaketastic.com</title>
		<link>http://jaketastic.com/blog/jaketasticcom/</link>
		<comments>http://jaketastic.com/blog/jaketasticcom/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 21:24:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash remoting]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://jaketastic.com/blog/?p=63</guid>
		<description><![CDATA[To demonstrate my flash skills as well as showcase my other work, I&#8217;ve made jaketastic.com into a little operating system-ish application. On the left is the file browser. It can be used to explore all the files and subfolders in the jaketastic.com/browse/ directory. When you click an item in the file browser, it will begin [...]]]></description>
			<content:encoded><![CDATA[<p>To demonstrate my flash skills as well as showcase my other work, I&#8217;ve made jaketastic.com into a little operating system-ish application.</p>
<div id="attachment_64" class="wp-caption alignleft" style="width: 430px"><a href="http://jaketastic.com"><img class="size-full wp-image-64" title="ui" src="http://jaketastic.com/blog/wp-content/uploads/2009/03/ui.jpg" alt="jaketastic.com user interface" width="420" height="218" /></a><p class="wp-caption-text">jaketastic.com user interface</p></div>
<p>On the left is the file browser. It can be used to explore all the files and subfolders in the jaketastic.com/browse/ directory. When you click an item in the file browser, it will begin loading in it&#8217;s own little feature rich window. You can move this window around, resize, minimize and close it.  Tabs appear along the bottom for minimized items.</p>
<p>Because the file browser uses a php service to build the directory listings, content management is a snap. If I want to add an image, flash movie, .flv video, or html to the portfolio, I merely upload it to the browse directory and it instantly appears in the file browser. Furthermore, if  I want to add a description to a file, I need only upload a .txt file with the same name to the same directory, and that .txt file will load in the window as well.</p>
<p>Jaketastic.com also allows you to chat with anyone else on the site in real time with the handy chat widget that I&#8217;ve made. Just type in a message and press enter and the message appears for everyone to see!</p>
<p>Jaketastic.com uses <a href="http://www.amfphp.org/" target="_blank">Amfphp 2.0</a> and a modified version <a href="http://www.joshstrike.com/" target="_blank">Strike Remoting</a> for server communications.  For video playback, I&#8217;ve added a slider and fixed some bugs in <a href="http://code.google.com/p/flvplayerlite/">FLVPlayerLite</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaketastic.com/blog/jaketasticcom/feed/</wfw:commentRss>
		<slash:comments>0</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>1</slash:comments>
		</item>
	</channel>
</rss>

