<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Transient Insomnia</title>
	<atom:link href="http://electricskyline.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://electricskyline.wordpress.com</link>
	<description>Programming, Games, and Mathematics</description>
	<lastBuildDate>Thu, 12 Jun 2008 23:30:39 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='electricskyline.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/917ee5c784b9457b92d3eab9e78141ff?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Transient Insomnia</title>
		<link>http://electricskyline.wordpress.com</link>
	</image>
			<item>
		<title>Predation</title>
		<link>http://electricskyline.wordpress.com/2008/06/09/predation/</link>
		<comments>http://electricskyline.wordpress.com/2008/06/09/predation/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 04:01:36 +0000</pubDate>
		<dc:creator>Isaac Overacker</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://electricskyline.wordpress.com/?p=13</guid>
		<description><![CDATA[As a small diversion from final exams and Sins of a Solar Empire, I&#8217;ve started the analysis for a simple predator-prey system.  I&#8217;ve been wanting to code a simulation like this for years; I&#8217;m still not sure why I&#8217;ve put it off until now.
Take a look at my documentation so far, under a new tab [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=13&subd=electricskyline&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As a small diversion from final exams and Sins of a Solar Empire, I&#8217;ve started the analysis for a simple predator-prey system.  I&#8217;ve been wanting to code a simulation like this for years; I&#8217;m still not sure why I&#8217;ve put it off until now.</p>
<p>Take a look at my documentation so far, under a new tab at the top: <a href="http://electricskyline.wordpress.com/predation/">Predation</a>.  Any feedback, criticism, and commentary is welcome.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/electricskyline.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/electricskyline.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/electricskyline.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/electricskyline.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/electricskyline.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/electricskyline.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/electricskyline.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/electricskyline.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/electricskyline.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/electricskyline.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/electricskyline.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/electricskyline.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=13&subd=electricskyline&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://electricskyline.wordpress.com/2008/06/09/predation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a98961ec76677a628891616bef1cb79?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Isaac Overacker</media:title>
		</media:content>
	</item>
		<item>
		<title>Sins of a Solar Empire</title>
		<link>http://electricskyline.wordpress.com/2008/06/06/sins-of-a-solar-empire/</link>
		<comments>http://electricskyline.wordpress.com/2008/06/06/sins-of-a-solar-empire/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 01:59:51 +0000</pubDate>
		<dc:creator>Isaac Overacker</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[rts]]></category>

		<guid isPermaLink="false">http://electricskyline.wordpress.com/?p=11</guid>
		<description><![CDATA[I recently picked up Sins of a Solar Empire, a 4XRTS.  It&#8217;s a great game &#8211; well balanced, addictive, fun &#8211; the only con is the amount of time it takes to play.  A small sized map takes around 4 hours to conquer, and being an addictive game, I don&#8217;t want to put [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=11&subd=electricskyline&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I recently picked up <a href="http://www.sinsofasolarempire.com/">Sins of a Solar Empire</a>, a 4XRTS.  It&#8217;s a great game &#8211; well balanced, addictive, fun &#8211; the only con is the amount of time it takes to play.  A small sized map takes around 4 hours to conquer, and being an addictive game, I don&#8217;t want to put it down until I&#8217;ve wiped the interstellar phase lanes with the corpses of my enemies.</p>
<p>From a developer perspective, they did a lot of things right with this game.  The UI isn&#8217;t cluttered (and the empire tree is a fantastic addition), the graphics are great (but not top-of-the-line), the performance is great, and most importantly, it&#8217;s fun.  I&#8217;ve already wasted quite a bit of time taking over star systems, but I keep telling myself that I&#8217;m learning from it.  We&#8217;ll see.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/electricskyline.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/electricskyline.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/electricskyline.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/electricskyline.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/electricskyline.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/electricskyline.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/electricskyline.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/electricskyline.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/electricskyline.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/electricskyline.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/electricskyline.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/electricskyline.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=11&subd=electricskyline&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://electricskyline.wordpress.com/2008/06/06/sins-of-a-solar-empire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a98961ec76677a628891616bef1cb79?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Isaac Overacker</media:title>
		</media:content>
	</item>
		<item>
		<title>Relief, emergence.</title>
		<link>http://electricskyline.wordpress.com/2008/03/19/relief/</link>
		<comments>http://electricskyline.wordpress.com/2008/03/19/relief/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 05:38:18 +0000</pubDate>
		<dc:creator>Isaac Overacker</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[emergence]]></category>
		<category><![CDATA[emergent phenomena]]></category>
		<category><![CDATA[graph theory]]></category>
		<category><![CDATA[wildlife]]></category>

		<guid isPermaLink="false">http://electricskyline.wordpress.com/?p=10</guid>
		<description><![CDATA[Earlier today, I was sitting outside of Starbucks enjoying a warm cup of tea and a majestic clove, as I often do during the evenings.  This time, however, it was not the usual Barnes and Noble Starbucks &#8211; I went to the mall Starbucks.  Anyway, there&#8217;s a tree in the parking lot not far from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=10&subd=electricskyline&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Earlier today, I was sitting outside of Starbucks enjoying a warm cup of tea and a majestic clove, as I often do during the evenings.  This time, however, it was not the usual Barnes and Noble Starbucks &#8211; I went to the mall Starbucks.  Anyway, there&#8217;s a tree in the parking lot not far from the table I was sitting at, and since I was alone, I had a lot of time to think.  I noticed that there were nearly thirty birds in the tree.</p>
<p>I saw a <a href="http://en.wikipedia.org/wiki/Binary_tree" target="_blank">binary tree</a> with the birds as nodes and the branches as strange, nonlinear edges.  I became curious at that point about whether this binary bird tree was self-balancing or not, and whether it pruned from top-down or bottom-up.  After all, birds are known to exhibit certain <a href="http://en.wikipedia.org/wiki/Emergence" target="_blank">emergent phenomena</a> while flocking &#8211; is it really so crazy to think that they balance their weight in a tree as well?</p>
<p align="center">. . .</p>
<p>I added a few new features to SpriteViewer.  I&#8217;ve also created a dedicated page for it, so I won&#8217;t be littering the main page with updates about it henceforth.  Check back every so at the Sprite Viewer page at the top.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/electricskyline.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/electricskyline.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/electricskyline.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/electricskyline.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/electricskyline.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/electricskyline.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/electricskyline.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/electricskyline.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/electricskyline.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/electricskyline.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/electricskyline.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/electricskyline.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=10&subd=electricskyline&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://electricskyline.wordpress.com/2008/03/19/relief/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a98961ec76677a628891616bef1cb79?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Isaac Overacker</media:title>
		</media:content>
	</item>
		<item>
		<title>Sprite Viewer 0.9.0.0</title>
		<link>http://electricskyline.wordpress.com/2008/03/15/sprite-viewer-0900/</link>
		<comments>http://electricskyline.wordpress.com/2008/03/15/sprite-viewer-0900/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 05:36:16 +0000</pubDate>
		<dc:creator>Isaac Overacker</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://electricskyline.wordpress.com/?p=8</guid>
		<description><![CDATA[I made quite a few bug fixes and updates to the Sprite Viewer today.  The sprites are now bounded within the Panel in which they are rendered, and they can&#8217;t be dragged behind the form controls any longer.  Also, the FPS at which animated sprites are rendered can be changed.
Download it here.
  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=8&subd=electricskyline&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I made quite a few bug fixes and updates to the Sprite Viewer today.  The sprites are now bounded within the Panel in which they are rendered, and they can&#8217;t be dragged behind the form controls any longer.  Also, the FPS at which animated sprites are rendered can be changed.</p>
<p>Download it <a href="http://home.sou.edu/~overackei/electricskyline/SpriteViewer.zip" title="SpriteViewer 0.9.0">here</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/electricskyline.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/electricskyline.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/electricskyline.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/electricskyline.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/electricskyline.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/electricskyline.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/electricskyline.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/electricskyline.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/electricskyline.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/electricskyline.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/electricskyline.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/electricskyline.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=8&subd=electricskyline&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://electricskyline.wordpress.com/2008/03/15/sprite-viewer-0900/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a98961ec76677a628891616bef1cb79?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Isaac Overacker</media:title>
		</media:content>
	</item>
		<item>
		<title>Stalked by Ninjas</title>
		<link>http://electricskyline.wordpress.com/2008/03/14/new-game-project/</link>
		<comments>http://electricskyline.wordpress.com/2008/03/14/new-game-project/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 18:53:48 +0000</pubDate>
		<dc:creator>Isaac Overacker</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[game programming]]></category>

		<guid isPermaLink="false">http://electricskyline.wordpress.com/?p=7</guid>
		<description><![CDATA[I&#8217;ve teamed up with the artist over at Stalked by Ninjas to make a 2D side-scrolling platformer with very 8-bit inspired graphics.  We&#8217;ve been discussing ideas the last few days, and the project is merely in its infancy, but we&#8217;re starting to get to work on it.  Cole is working on some of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=7&subd=electricskyline&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve teamed up with the artist over at <a href="http://www.stalkedbyninjas.com" title="Stalked by Ninjas" target="_blank">Stalked by Ninjas</a> to make a 2D side-scrolling platformer with very 8-bit inspired graphics.  We&#8217;ve been discussing ideas the last few days, and the project is merely in its infancy, but we&#8217;re starting to get to work on it.  Cole is working on some of the early animated sprites and I&#8217;ve been pouring my time (or at least that which hasn&#8217;t already been allocated to relationships and school) into creating our first tool.  I&#8217;ve made a sprite viewer that loads static and animated sprites from their TGA, PNG, or BMP files and displays them for viewing on a variety of background colors.  It&#8217;s a fairly simple tool, but it has been interesting to write.  Download it <a href="http://home.sou.edu/~overackei/electricskyline/SpriteViewer.zip" title="SpriteViewer 0.8.5">here</a> (requires framework files found in &#8220;About&#8221; section of this blog).</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/electricskyline.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/electricskyline.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/electricskyline.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/electricskyline.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/electricskyline.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/electricskyline.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/electricskyline.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/electricskyline.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/electricskyline.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/electricskyline.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/electricskyline.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/electricskyline.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=7&subd=electricskyline&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://electricskyline.wordpress.com/2008/03/14/new-game-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a98961ec76677a628891616bef1cb79?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Isaac Overacker</media:title>
		</media:content>
	</item>
		<item>
		<title>Primality</title>
		<link>http://electricskyline.wordpress.com/2008/01/19/primality/</link>
		<comments>http://electricskyline.wordpress.com/2008/01/19/primality/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 20:06:19 +0000</pubDate>
		<dc:creator>Isaac Overacker</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[number theory]]></category>
		<category><![CDATA[primes]]></category>

		<guid isPermaLink="false">http://electricskyline.wordpress.com/2008/01/19/primality/</guid>
		<description><![CDATA[Prime numbers are one of the most interesting subsets of the integers.  Today, I was asked to provide an algorithmic primality test in my Probability class, and I fought with the problem for several minutes.  I of course thought of a naive algorithm to check each number between 2 and n &#8211; 1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=5&subd=electricskyline&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Prime numbers are one of the most interesting subsets of the integers.  Today, I was asked to provide an algorithmic primality test in my Probability class, and I fought with the problem for several minutes.  I of course thought of a naive algorithm to check each number between 2 and <i>n &#8211; </i>1 for divisibility with <i>n</i>, but that just isn&#8217;t satisfying (or fast) enough.  This really stimulated my thinking, and may have started a new obsession with primes.</p>
<p>One of the solutions presented by my professor was <b>Wilson&#8217;s Theorem</b> for testing primality:</p>
<p>if (<i>n &#8211; </i>1)! + 1 % <i>n</i> = 0, then <i>n</i> is prime.  However, the obvious problem with this is the factorial operator.  That&#8217;s going to generate an extremely large number, extremely fast.  It&#8217;s obviously <b>ridiculously inefficient</b>.</p>
<p>Another method presented was a probabilistic function attributed to <b>Gauss</b> for determining the probability that a given number is prime.  I didn&#8217;t see it as being very useful, so I&#8217;ve forgotten it to make room for more important things.</p>
<p>I was incorrectly under the impression that finding primes was an unsolved problem, however, a little research showed that it was <a href="http://www.cse.iitk.ac.in/users/manindra/algebra/primality_v6.pdf" title="AKS Primality test" target="_blank">solved</a> in 2002 by three brilliant Indian computer scientists.  Their algorithm builds upon Fermat&#8217;s Little Theorem.  I&#8217;m considering implementing it for use in my Probability class, since we seem to be finding primes and relative primes frequently.</p>
<p>Well, since that&#8217;s a solved problem, I&#8217;ve become interested in the ordering of the primes.  I saw a neat gif image showing the Sieve of Eratosthenes in action; perhaps I&#8217;ll expand that into a Java applet to start.  It will at least be entertaining.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/electricskyline.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/electricskyline.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/electricskyline.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/electricskyline.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/electricskyline.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/electricskyline.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/electricskyline.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/electricskyline.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/electricskyline.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/electricskyline.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/electricskyline.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/electricskyline.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=5&subd=electricskyline&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://electricskyline.wordpress.com/2008/01/19/primality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a98961ec76677a628891616bef1cb79?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Isaac Overacker</media:title>
		</media:content>
	</item>
		<item>
		<title>Pathfinding, Part I</title>
		<link>http://electricskyline.wordpress.com/2007/07/30/pathfinding-part-i/</link>
		<comments>http://electricskyline.wordpress.com/2007/07/30/pathfinding-part-i/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 18:44:30 +0000</pubDate>
		<dc:creator>Isaac Overacker</dc:creator>
				<category><![CDATA[graphics programming]]></category>
		<category><![CDATA[linear algebra]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://electricskyline.wordpress.com/2007/07/30/pathfinding-part-i/</guid>
		<description><![CDATA[Artificial intelligence has always interested me. Granted, the beginnings of my foray into pathfinding algorithms doesn’t surpass the tip of the great iceburg of artificial intelligence – in fact, it is more akin to an ice cube floating in a vast, slushy sea of knowledge – but this foray and its implications are important enough [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=4&subd=electricskyline&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;">Artificial intelligence has always interested me. Granted, the beginnings of my foray into pathfinding algorithms doesn’t surpass the tip of the great iceburg of artificial intelligence – in fact, it is more akin to an ice cube floating in a vast, slushy sea of knowledge – but this foray and its implications are important enough that I have chosen to document my findings here.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;">Pathfinding is a very small bay in the aforementioned vast sea that is artificial intelligence. The purpose of many of the algorithms is to find, as the name implies, the path from here to there in the most spatially and temporally efficient manner possible. Oftentimes it is not possible to be both spatially efficient, i.e. finding the </span><span style="font-family:Calibri,sans-serif;"><em>shortest</em></span><span style="font-family:Calibri,sans-serif;"> path, and temporally efficient &#8211; small <a href="http://en.wikipedia.org/wiki/Big_O_notation" target="_blank">big-O complexity</a>.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;">To start this learning adventure, I decided to code up a quick little application in C# to test basic straight-line pathfinding using a queue of waypoints. This is extremely simple from a programming standpoint, and hardly uses any &#8220;artificial intelligence&#8221; whatsoever. It is significant in that it provides the basic framework that I can expand upon easily for more complicated algorithms.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;">Consider two points in the plane. The shortest path between those two points is a <a href="http://en.wikipedia.org/wiki/Vector_%28spatial%29">vector</a> &#8211; let&#8217;s call it </span><span style="font-family:Calibri,sans-serif;"><strong>v</strong></span><span style="font-family:Calibri,sans-serif;">. This vector is, inherently, a straight line connecting those two points. The simplest way to calculate this vector is to simply subtract the two points. E.g., in the following figure, the vector </span><span style="font-family:Calibri,sans-serif;"><strong>v</strong></span><span style="font-family:Calibri,sans-serif;"> that happens to connect the points </span><span style="font-family:Calibri,sans-serif;"><em>a</em></span><span style="font-family:Calibri,sans-serif;"> and </span><span style="font-family:Calibri,sans-serif;"><em>b</em></span><span style="font-family:Calibri,sans-serif;"> is defined as [4-1, 5-2] = [3, 3].</span></p>
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;"><em>Figure 1.</em></span></p>
<p style="margin-bottom:0;"><img src="http://home.sou.edu/%7Eoverackei/math/images/vector1.gif" border="0" alt="This is a vector between (1,2) and (4,5), called v.  Its components are [3,3]." width="400" height="400" align="bottom" /></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;">What purpose does this vector serve? It can be used as a guide to get from point <em>a</em><span style="font-style:normal;"> to point </span><em>b</em><span style="font-style:normal;">. Consider any sort of animation framework. It consists of a series of still images being cycled rapidly (commonly between 30 and 60 frames per second) to create the illusion of motion. Thus, to cause a unit at </span><em>a</em><span style="font-style:normal;"> to move to </span><em>b</em><span style="font-style:normal;">, we simply add </span><span style="font-style:normal;"><strong>v</strong></span><span style="font-style:normal;"><span> to the position of the unit (</span></span><em><span>a</span></em><span style="font-style:normal;"><span>, which is also a vector, as any math professor would argue).</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;"><strong>a</strong><span>[1, 2] + </span><strong>v</strong><span>[3, 3]</span><strong> </strong><span>= </span><strong>b</strong><span>[4, 5].</span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;"><span>The only problem is that this move is done in one frame. It wouldn&#8217;t be a very enjoyable gaming experience if the enemy could instantly move to you no matter how far they happen to be from you. Thus, we need to “slow down” the movement over a series of frames. To accomplish this, we first </span><em><span>normalize</span></em><span style="font-style:normal;"><span> </span></span><strong><span style="font-style:normal;">v</span></strong><span style="font-style:normal;"><span> by dividing it by its length. To be mathematically accurate, we must find the </span></span><em><span>dot product</span></em><span style="font-style:normal;"><span> of </span></span><strong><span style="font-style:normal;">v</span></strong><span style="font-style:normal;"><span> and the reciprocal of its length, since vector division does not exist.</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;">L = sqrt(3^2 + 3^2)</span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;">= sqrt( 18 ) </span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;">= 4.24.</span></p>
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;"><span style="font-family:Calibri,sans-serif;"><span style="font-style:normal;"><strong>v </strong></span></span><span style="font-family:Calibri,sans-serif;"><span style="font-style:normal;"><span>· (1/L) = [3, 3] · (1 / 4.24) </span></span></span></span></p>
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;"><span style="font-family:Calibri,sans-serif;"><span style="font-style:normal;"><span>= [3 * (1 / 4.24), 3 * (1 / 4.24)] </span></span></span></span></p>
<p style="margin-bottom:0;"><span style="font-family:Calibri,sans-serif;"><span style="font-family:Calibri,sans-serif;"><span style="font-style:normal;"><span>= [0.71, 0.71].</span></span></span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;">Once the vector has been normalized, it can be scaled to whatever velocity the circumstances require by multiplying it by the necessary velocity scalar. For example, 4 pixels of movement per frame:</span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;"><span>4</span><strong>v</strong><span> = [0.71*4, 0.71*4] </span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;"><span>= [2.84, 2.84]</span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;"><span>(total displacement is the length of 4</span><strong>v</strong><span>, or 4.01 – accuracy lost due to rounding to the hundredths place)</span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;"><span>Each frame, the unit must update and move at a velocity of 2.84 pixels in the x and y directions, thereby moving at a constant 4 pixels per frame, reaching </span><em><span>b</span></em><span style="font-style:normal;"><span> in (theoretically) 0.75 frames. Of course, in application, the calculations are all mapped to integer values for individual pixels, and as such, accuracy is lost. The overall effect of this loss of accuracy is negligible in many instances.</span></span></span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;">Thus, finding the shortest path between two points (in two dimensions) is a very simple matter when there are no obstacles. The most difficult part, though not difficult in comparison to other problems in graphics programming, is getting the unit to behave properly and within the design specifications.</span></p>
<p style="margin-bottom:0;font-style:normal;"><span style="font-family:Calibri,sans-serif;">A zip file containing the program demonstrating straight-line pathfinding without obstacles can be found <a href="http://home.sou.edu/~overackei/electricskyline/PathStalker.zip">here</a>. It uses a queue of waypoints that are navigated in order. Simply right click to add a waypoint, and the squido guy will “find” his way to it. <strong>You&#8217;ll need both .NET framework updates (</strong><a href="http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;displaylang=en"><strong>1.1</strong></a><strong>, </strong><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&amp;displaylang=en"><strong>2.0</strong></a><strong>) and the </strong><a href="http://www.microsoft.com/downloads/details.aspx?familyid=A7DA4763-6807-4BD5-8D18-18C60C437F93&amp;displaylang=en"><strong>XNA framework</strong></a><strong>, which requires at least XP SP2.</strong> </span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/electricskyline.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/electricskyline.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/electricskyline.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/electricskyline.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/electricskyline.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/electricskyline.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/electricskyline.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/electricskyline.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/electricskyline.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/electricskyline.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/electricskyline.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/electricskyline.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=electricskyline.wordpress.com&blog=1440591&post=4&subd=electricskyline&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://electricskyline.wordpress.com/2007/07/30/pathfinding-part-i/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a98961ec76677a628891616bef1cb79?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Isaac Overacker</media:title>
		</media:content>

		<media:content url="http://home.sou.edu/%7Eoverackei/math/images/vector1.gif" medium="image">
			<media:title type="html">This is a vector between (1,2) and (4,5), called v.  Its components are [3,3].</media:title>
		</media:content>
	</item>
	</channel>
</rss>