<?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>2DArray.net</title>
	<atom:link href="http://www.2darray.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.2darray.net</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 22:27:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Menus&#8230;</title>
		<link>http://www.2darray.net/2012/01/menus/</link>
		<comments>http://www.2darray.net/2012/01/menus/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 22:26:34 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=428</guid>
		<description><![CDATA[Since I&#8217;ve got a full collection of levels, I&#8217;ve been getting into the few remaining tasks left in the prequel&#8217;s code.  Right now, there are four important features that are still missing: A pause menu A comic strip viewer Save data Cheat codes The main menu is coded, and it includes a nice little level [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve got a full collection of levels, I&#8217;ve been getting into the few remaining tasks left in the prequel&#8217;s code.  Right now, there are four important features that are still missing:</p>
<ul>
<li>A pause menu</li>
<li>A comic strip viewer</li>
<li>Save data</li>
<li>Cheat codes</li>
</ul>
<p>The main menu is coded, and it includes a nice little level select grid with 25&#215;25 pixel thumbnails of each level (1/20th of normal scale).  These are rendered from bits of the game&#8217;s actual level data, which means that if I make changes to the levels, the thumbnails will automatically stay up-to-date.  Here are the thumbnails for the first two chapters.  How cute!</p>
<p><a href="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-30-at-5.13.04-PM.png"><img class="aligncenter size-full wp-image-429" title="And the grey pixels represent doors..." src="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-30-at-5.13.04-PM.png" alt="" width="283" height="72" /></a>Have a nice Monday night.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2012/01/menus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>January 26th:  The end of Design Levels December.</title>
		<link>http://www.2darray.net/2012/01/january-26th-the-end-of-design-levels-december/</link>
		<comments>http://www.2darray.net/2012/01/january-26th-the-end-of-design-levels-december/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 21:55:02 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=424</guid>
		<description><![CDATA[So&#8230;it took about twice as long as I was expecting, but I just finished the 40th level for Company&#8217;s prequel.  I&#8217;m still probably going to revise things here and there, but there are 40 functioning levels and all of the puzzles are in.  What a milestone! I&#8217;m feeling good about the game&#8217;s conclusion.  I&#8217;ve been [...]]]></description>
			<content:encoded><![CDATA[<p>So&#8230;it took about twice as long as I was expecting, but I just finished the 40th level for Company&#8217;s prequel.  I&#8217;m still probably going to revise things here and there, but there are 40 functioning levels and all of the puzzles are in.  What a milestone!</p>
<p>I&#8217;m feeling good about the game&#8217;s conclusion.  I&#8217;ve been planning it out during the past few months of work, and it&#8217;s pretty strange to finally see it in action.  It should work in completely different ways for the people who&#8217;ve played the original and the people who haven&#8217;t, which is exciting to me.</p>
<p>David&#8217;s music is also starting to come together, and it&#8217;s sounding marvelous.  What else would we expect from him at this point?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2012/01/january-26th-the-end-of-design-levels-december/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>More levels&#8230;</title>
		<link>http://www.2darray.net/2012/01/more-levels/</link>
		<comments>http://www.2darray.net/2012/01/more-levels/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 19:53:51 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=413</guid>
		<description><![CDATA[Level design continues.  I just finished the 37th out of 40!  Some of you might note some familiarity in this one&#8230; As has been the norm lately, this level doesn&#8217;t have any detail objects yet, so the final version will also have various nubbins and doodads decorating the scene. Ben&#8217;s illustrated comic panels are coming [...]]]></description>
			<content:encoded><![CDATA[<p>Level design continues.  I just finished the 37th out of 40!  Some of you might note some familiarity in this one&#8230;</p>
<p><a href="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-20-at-2.44.04-PM.png"><img class="aligncenter size-full wp-image-414" title="Teamwork!" src="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-20-at-2.44.04-PM.png" alt="" width="500" height="500" /></a></p>
<p>As has been the norm lately, this level doesn&#8217;t have any detail objects yet, so the final version will also have various nubbins and doodads decorating the scene.</p>
<p>Ben&#8217;s illustrated comic panels are coming along really well–there are now 10 out of 15 completed.  David is also still hard at work on the music (sound comes soon), but it&#8217;s tougher to gauge his progress with numbers.</p>
<p>Suddenly, it feels like we&#8217;re getting close to the end of the project.</p>
<p>Numbers are fun, so here are a few:  I just checked and the game currently has around seven hundred lines of dialogue.  For comparison, the original had about fifty lines of monologue.  Hooray!  Some might think that &#8220;more words&#8221; isn&#8217;t necessarily &#8220;more better,&#8221; and those people are exactly right.  However, the tone of this game is much more conversational (since it&#8217;s not all about a hermit this time around), and it&#8217;s much longer, too, so I think the extra text is appropriate.</p>
<p>Oh, also, the original game was under 2,000 lines of code in total, and the prequel is already past 6,000.  2,000 of those are just level data, though, and half of that 2,000 is just the tile maps.  Here&#8217;s the above screenshot&#8217;s tile map because&#8230;I dunno, it looks kinda neat.</p>
<pre>maps[36]=[[1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1],
          [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1]]</pre>
<p>This is just the map of the terrain–each level also needs data for game objects like switches, characters, and doors, plus scenario data like hotspots, dialogue, triggers for dialogue, etc&#8230;but those don&#8217;t look particularly interesting.  If you&#8217;re curious about the hotspots, dialogue triggering, and NPC behavior, you can check out <a href="http://www.2darray.net/2011/11/ai-for-fix/">this earlier post</a> that covers those topics .</p>
<p>Note that the data is a 1:1 representation of the level where each number is one 20&#215;20 pixel tile, but it&#8217;s mirrored across an imaginary diagonal line that extends from the top left to the bottom right.</p>
<p>Pop quiz for programmers who are interested in tile-based games:  What&#8217;s the purpose of that mirroring?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2012/01/more-levels/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Swampiness</title>
		<link>http://www.2darray.net/2012/01/swampiness/</link>
		<comments>http://www.2darray.net/2012/01/swampiness/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 00:25:52 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=410</guid>
		<description><![CDATA[First things first:  We&#8217;re now up to 24 properly dressed levels.  They look awesome.  Go team! I&#8217;m still revising nine more levels after the dressed ones, and then there are seven remaining that don&#8217;t exist at all yet.  We&#8217;re getting close! The polish is also starting to show, which is incredibly satisfying.  Here&#8217;s a new screenshot [...]]]></description>
			<content:encoded><![CDATA[<p>First things first:  We&#8217;re now up to 24 properly dressed levels.  They look <em>awesome.</em>  Go team!</p>
<p>I&#8217;m still revising nine more levels after the dressed ones, and then there are seven remaining that don&#8217;t exist at all yet.  We&#8217;re getting close!</p>
<p>The polish is also starting to show, which is incredibly satisfying.  Here&#8217;s a new screenshot of chapter four (The Swamp) with various tweaks and changes.  Note that this level isn&#8217;t dressed yet, so there are no scenery objects.</p>
<p style="text-align: center;"><a href="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-13-at-7.04.00-PM.png"><img class="aligncenter size-full wp-image-411" title="And for people who are paying extra close attention, the grass is different every time the level reloads, Company-style." src="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-13-at-7.04.00-PM.png" alt="" width="595" height="617" /></a></p>
<p>The most recent addition is the layer of grass on top of the tiles.  It&#8217;s fancier than you might expect at first glance–since materials in the game (like the default Swamp material) can have randomly bumpy edges, the grass has to conform to those curves.  Luckily I found a simple way to handle this, and it looks nice, even up close!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2012/01/swampiness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Level dressing</title>
		<link>http://www.2darray.net/2012/01/level-dressing/</link>
		<comments>http://www.2darray.net/2012/01/level-dressing/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 00:05:42 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=406</guid>
		<description><![CDATA[Hey there–hope your years are off to a collectively good start! First off, lookie there, our &#8220;beginning of the year&#8221; deadline has whizzed by.  What a surprise!  It&#8217;s all good, though–we&#8217;re continuing to make solid progress, and we&#8217;re getting closer to the end all the time.  The game&#8217;s art is close to being finished, for [...]]]></description>
			<content:encoded><![CDATA[<p>Hey there–hope your years are off to a collectively good start!</p>
<p>First off, lookie there, our &#8220;beginning of the year&#8221; deadline has whizzed by.  What a surprise!  It&#8217;s all good, though–we&#8217;re continuing to make solid progress, and we&#8217;re getting closer to the end all the time.  The game&#8217;s art is close to being finished, for instance!  I&#8217;ve been working with Ben on the game&#8217;s visual polish a lot over the past few days, so here&#8217;s a nice new screenshot for you to check out.  Ben placed all the detail objects in this scene (chairs, shelves, etc), so it looks much more aesthetically pleasing than before.</p>
<p><a href="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-08-at-6.56.42-PM.png"><img class="aligncenter size-full wp-image-407" title="Screen shot 2012-01-08 at 6.56.42 PM" src="http://www.2darray.net/wp-content/uploads/2012/01/Screen-shot-2012-01-08-at-6.56.42-PM.png" alt="" width="595" height="617" /></a>Also, will you check out that <em>sweet-ass</em> purple carpet?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2012/01/level-dressing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Preloader Hijinks</title>
		<link>http://www.2darray.net/2011/12/preloader-hijinks/</link>
		<comments>http://www.2darray.net/2011/12/preloader-hijinks/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 22:59:49 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=404</guid>
		<description><![CDATA[Normally, the preloader is one of the very last parts of the game that I write.  It&#8217;s just a loading bar, so it never seems like the Most Important Thing To Do, but as a result, I always just slap a preloader together at the tail end of the project, and I&#8217;m never particularly happy [...]]]></description>
			<content:encoded><![CDATA[<p>Normally, the preloader is one of the very last parts of the game that I write.  It&#8217;s just a loading bar, so it never seems like the Most Important Thing To Do, but as a result, I always just slap a preloader together at the tail end of the project, and I&#8217;m never particularly happy with it, but it&#8217;s Good Enough.</p>
<p>But no more!  I took some time yesterday and today to make a really spiffy preloader for Company&#8217;s prequel.  The preloader isn&#8217;t just a loading bar in this context–in an online game, it&#8217;s also the very first thing that the user sees, which means it&#8217;s a valuable chance to make a good first impression.  If the user sees that special care has been put into even the loading bar at the start, then they know that I&#8217;m for real.</p>
<p>But enough talk–let&#8217;s play with the thing!  You can move the mouse left to right to change the &#8220;loading status&#8221; (left is unloaded, right is fully loaded), and you can also move the mouse up and down for added fun.  In the actual game, the horizontal control will obviously be replaced with an actual progress meter, but the vertical control is cute so I&#8217;ll be leaving it in.</p>
<p><a href="http://www.2darray.net/etcetera/cig.html" target="_blank">Click to try the Preloader Demo</a></p>
<p>Oh, and I&#8217;ve also got a possible title:  &#8221;The Customs of Myself.&#8221;  It&#8217;s got some class, some mystery, and it clearly recalls the original, so people are more likely to realize that the games are related without being told so.  What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2011/12/preloader-hijinks/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Happy Holidays</title>
		<link>http://www.2darray.net/2011/12/happy-holidays/</link>
		<comments>http://www.2darray.net/2011/12/happy-holidays/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 22:12:44 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=401</guid>
		<description><![CDATA[I hope everyone&#8217;s having a nice winter, and if Christmas is your thing, merry Christmas!  Please be sure to thank everyone thoroughly and sincerely if you get any presents. Here&#8217;s a screenshot of the (work-in-progress) visuals for Chapter 4, &#8220;The Swamp.&#8221;  It&#8217;s still missing all of the foliage and detail objects, so you can expect [...]]]></description>
			<content:encoded><![CDATA[<p>I hope everyone&#8217;s having a nice winter, and if Christmas is your thing, merry Christmas!  Please be sure to thank everyone thoroughly and sincerely if you get any presents.</p>
<p>Here&#8217;s a screenshot of the (work-in-progress) visuals for Chapter 4, &#8220;The Swamp.&#8221;  It&#8217;s still missing all of the foliage and detail objects, so you can expect much more densely detailed scenery in the actual game.</p>
<p><a href="http://www.2darray.net/wp-content/uploads/2011/12/Screen-shot-2011-12-25-at-5.04.49-PM.png"><img class="aligncenter size-full wp-image-402" title="Screen shot 2011-12-25 at 5.04.49 PM" src="http://www.2darray.net/wp-content/uploads/2011/12/Screen-shot-2011-12-25-at-5.04.49-PM.png" alt="" width="497" height="499" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2011/12/happy-holidays/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Design-Levels-December continues&#8230;</title>
		<link>http://www.2darray.net/2011/12/design-levels-december-continues/</link>
		<comments>http://www.2darray.net/2011/12/design-levels-december-continues/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 00:53:47 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=396</guid>
		<description><![CDATA[I&#8217;m still at a loss for a title, but as of now, I&#8217;ve got 23 functional levels for Company&#8217;s prequel (and they&#8217;re coming along beautifully!).  This means I&#8217;m more than halfway there!  Ben Jelter has mainly been working on end-of-chapter comic strips, and David Carney is cooking away at the music.  We&#8217;re still aiming to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still at a loss for a title, but as of now, I&#8217;ve got 23 functional levels for Company&#8217;s prequel (and they&#8217;re coming along beautifully!).  This means I&#8217;m more than halfway there!  Ben Jelter has mainly been working on end-of-chapter comic strips, and David Carney is cooking away at the music.  We&#8217;re still aiming to be done some time around the end of the year, but it&#8217;ll take a little time after then to have the game totally set for release.  Still, it seems safe to expect to see the game go live some time in January.</p>
<p>And because you asked so nicely, here&#8217;s a screenshot from Chapter 2.  Note that all of the previous levels shown and this one, too, will eventually be dressed up by Ben to look prettier.</p>
<p><a href="http://www.2darray.net/wp-content/uploads/2011/12/damsel.png"><img class="aligncenter size-full wp-image-397" title="Oh look, it's Jackass McToolbag." src="http://www.2darray.net/wp-content/uploads/2011/12/damsel.png" alt="" width="496" height="497" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2011/12/design-levels-december-continues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Chapter One rough drafts</title>
		<link>http://www.2darray.net/2011/12/chapter-one-rough-drafts/</link>
		<comments>http://www.2darray.net/2011/12/chapter-one-rough-drafts/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 20:14:42 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=380</guid>
		<description><![CDATA[Hey everybody.  I&#8217;ve finally (!!!) started working on levels for the prequel to The Company of Myself.  I&#8217;ve got a nice roadmap for all 40 planned levels, and I have at least a rough plan for almost all of the game&#8217;s puzzles.  This is all much better planned out than the original game, so expect [...]]]></description>
			<content:encoded><![CDATA[<p>Hey everybody.  I&#8217;ve finally (!!!) started working on levels for the prequel to The Company of Myself.  I&#8217;ve got a nice roadmap for all 40 planned levels, and I have at least a rough plan for almost all of the game&#8217;s puzzles.  This is all much better planned out than the original game, so expect better pacing and a fuller/more satisfying utilization of mechanics–in the first game, for instance, the Checkpoint mechanic is only used in <em>one</em> level, and that&#8217;s just plain goofy.</p>
<p>So far, I&#8217;ve made &#8220;rough drafts&#8221; for all eight of the first chapter&#8217;s levels.  These will all be adjusted to some extent before they&#8217;re ready to ship, but all of the gameplay scenarios, dialogue, etc are working as intended so far.  Since my last post was a massive wall of text, I&#8217;ll shut up for a bit and let you look at some screenshots.  Note that there&#8217;s still various bits of placeholder art strewn around (the corner of thought bubbles and the doors are most notable in these shots).</p>
<p><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-1.png"><img class="aligncenter size-full wp-image-381" title="Humble beginnings with Henry the psychologist" src="http://www.2darray.net/wp-content/uploads/2011/12/level-1.png" alt="" width="500" height="500" /></a></p>
<p><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-2.png"><img class="aligncenter size-full wp-image-382" title="Platformer training and strange furnishings" src="http://www.2darray.net/wp-content/uploads/2011/12/level-2.png" alt="" width="500" height="500" /></a></p>
<div><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-3.png"><img class="aligncenter size-full wp-image-383" title="Everyone needs a pillar level..." src="http://www.2darray.net/wp-content/uploads/2011/12/level-3.png" alt="" width="500" height="500" /></a></div>
<div><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-4.png"><img class="aligncenter size-full wp-image-384" title="Batman sees no problem with this layout in a living space" src="http://www.2darray.net/wp-content/uploads/2011/12/level-4.png" alt="" width="500" height="500" /></a></div>
<div><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-5.png"><img class="aligncenter size-full wp-image-385" title="Actually, almost anyone would be too stressed for laser beams" src="http://www.2darray.net/wp-content/uploads/2011/12/level-5.png" alt="" width="500" height="500" /></a></div>
<div><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-6.png"><img class="aligncenter size-full wp-image-386" title="Switches and a quick chat in the kitchen" src="http://www.2darray.net/wp-content/uploads/2011/12/level-6.png" alt="" width="500" height="500" /></a></div>
<div><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-7.png"><img class="aligncenter size-full wp-image-387" title="A whole bunch of switches and doors, with a side order of personal reflection" src="http://www.2darray.net/wp-content/uploads/2011/12/level-7.png" alt="" width="500" height="500" /></a></div>
<div><a href="http://www.2darray.net/wp-content/uploads/2011/12/level-8.png"><img class="aligncenter size-full wp-image-388" title="The man, the legend." src="http://www.2darray.net/wp-content/uploads/2011/12/level-8.png" alt="" width="500" height="500" /></a>Have a nice weekend!</div>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2011/12/chapter-one-rough-drafts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>AI for Fix</title>
		<link>http://www.2darray.net/2011/11/ai-for-fix/</link>
		<comments>http://www.2darray.net/2011/11/ai-for-fix/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 20:55:40 +0000</pubDate>
		<dc:creator>2DArray</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.2darray.net/?p=365</guid>
		<description><![CDATA[Fair warning:  The following is a lengthy deconstruction of a very simple idea (&#8220;NPCs that walk around on their own and stuff&#8221;).  If you just want to see a video of the system in action, you can go here.  _____________________________________ The AI for Fix is nearly complete, so I can talk about its overall structure [...]]]></description>
			<content:encoded><![CDATA[<p>Fair warning:  The following is a lengthy deconstruction of a very simple idea (&#8220;NPCs that walk around on their own and stuff&#8221;).  If you just want to see a video of the system in action, you can go <a title="Company of Myself Prequel–Scripting demo" href="http://www.youtube.com/watch?v=SpPROp3boTg" target="_blank">here</a>.</p>
<p style="text-align: center;"> _____________________________________</p>
<p>The AI for Fix is nearly complete, so I can talk about its overall structure with some confidence now.  This part of the code is immensely important to me, since this game is very character-driven.  The characters need to behave in a believable way so that players can forget that they&#8217;re made of sheets of sprites and just think about them as characters, or maybe even as people.</p>
<p>This game&#8217;s AI has turned out to be relatively complicated, and it consists of five layers of abstraction (!!!).  From least to most abstracted, they are Trivial Moves, Paths, Behaviors, Scripts, and Triggers.</p>
<p>So what does all that actually mean?  Well, we&#8217;re going to have to start at the beginning&#8230;</p>
<p><strong>1)  Trivial Moves</strong></p>
<p>A Trivial Move is an instruction so simple that it requires no analysis to follow.  In this particular case, where we&#8217;re just talking about making NPCs move around a level, they are capable of three Trivial Moves:</p>
<p>Walk:  Walk any distance to the left or right.</p>
<p>Drop:  Walk off a ledge and fall.</p>
<p>Jump:  Jump up a step, across a gap, etc.</p>
<p>Sometimes, an NPC needs to move somewhere and one of the three Trivial Moves can get him there.  These are the simplest problems to solve, since they only need to figure out which of the three Moves is applicable.  If none of the three Trivial Moves can reach the destination, though, we need to think of something else.  Something like&#8230;</p>
<p><strong>2)  Paths</strong></p>
<p>If an NPC is physically capable of reaching a particular destination, then their movements to get there can be defined as an ordered list of Trivial Moves.  Think about MapQuest or Google Maps–Cars can only drive on roads, so they find the shortest path from A to B that follows the roads.  Fix uses a similar system to find a path from A to B that only consists of Trivial Moves.</p>
<p>The general idea is to start at the position of the NPC and find every possible way that they could potentially move.  This system examines the collision data that is already being used for the level.  It finds all of the possible paths simultaneously, expanding them outward from the character at the same rate.  Since they all grow at the same speed, the first one that (accidentally) reaches the destination must be the fastest way to get there.  It&#8217;s a very brute-force method, but since the NPCs have a pretty limited range of motion (the presence of gravity makes a huge difference in terms of navigation), they never have that many possible paths to test.</p>
<p>But even if we know how to get from A to B, how do we even know where B is?  The answer is&#8230;</p>
<p><strong>3)  Behaviors</strong></p>
<p>A Behavior defines what an NPC is trying to accomplish at any given time.  &#8221;Follow the player&#8221; is a simple example of a Behavior.</p>
<p>A more complex Behavior is &#8220;Move to a hotspot.&#8221;  A hotspot can be any chunk of the level (and a level can contain any number of hotspots).  Though this is an instruction that&#8217;s very easy for us to understand, it involves several instructions for different situations.</p>
<p>If the character wants to move to the top floor of a level, for instance, they need to start by checking whether or not they&#8217;re already there.  If they&#8217;re not, they&#8217;ll try to find a path to get there.  If they can&#8217;t find one, they&#8217;ll wander around until a path opens.  Once they reach the top floor, they&#8217;ll wander around some more (making sure to stay inside their destination hotspot) until they receive another instruction.</p>
<p>But wait, where do instructions come from?</p>
<p><strong>4)  Scripts</strong></p>
<p>Gameplay scripting is becoming very popular.  While game engines are written in low-level, high-performance languages like C, scenarios for levels are often written in more abstracted languages.  <a title="Overgrowth–Wolfire Games" href="http://blog.wolfire.com/" target="_blank">Overgrowth</a>, for instance, uses <a href="http://www.angelcode.com/angelscript/" target="_blank">AngelScript</a> for gameplay scripting.  Flash is already built on this type of structure–any code I write for my games is written in Actionscript, an abstracted scripting language.  The Flash Player, which is written in a low-level language, interprets this script.</p>
<p>For Fix, gameplay scripts look less like scripts of code and more like theatric scripts.  At least at the time that I&#8217;m writing this, if you hit the &#8220;Fix Demo&#8221; tab at the top of the page, you can see a demo that reads the following script.</p>
<p>(The three floors of the level are defined as hotspots which are named bottomFloor, middleFloor, and topFloor.)</p>
<pre>(Jack moves to topFloor)
Jack:  I'm going to the top floor.
Jack:  …boop boop boop…
(Jack moves to bottomFloor)
Jack:  And now I'm going to the bottom floor…
Jack:  …
(Jack moves to middleFloor)
Jack:  And now the middle floor.</pre>
<p>&nbsp;</p>
<p>Aside from the inherent cuteness of this solution, it&#8217;s ridiculously easy for me to write these scripts.  Also note that the game&#8217;s dialogue is read from these same scripts, so it&#8217;ll be very easy for me to write and implement conversations (of which there will be&#8230;many).</p>
<p>So that&#8217;s all well and good, but how do we know when to start a conversation?</p>
<p><strong>5)  Triggers</strong></p>
<p>Triggers have two parts:  A condition and a conversation to start.  A condition is something like &#8220;Kathryn reaches bottomFloor&#8221; or &#8220;doorOne is open.&#8221;  Conditions can be combined, like &#8220;Kathryn reaches bottomFloor and Jack reaches topFloor.&#8221;  Once all conditions for a given Trigger are met, it starts up its target conversation.</p>
<p style="text-align: center;"> _____________________________________</p>
<p>So&#8230;yeah.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.2darray.net/2011/11/ai-for-fix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

