<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Twenty Sided</title>
	<atom:link href="http://www.shamusyoung.com/twentysidedtale/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.shamusyoung.com/twentysidedtale</link>
	<description>A Website for your Internet</description>
	<lastBuildDate>Wed, 16 May 2012 19:05:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<copyright>Copyright &#xA9; Twenty Sided 2012 </copyright>
	<managingEditor>twentysidedtale@shamusyoung.com (Twenty Sided)</managingEditor>
	<webMaster>twentysidedtale@shamusyoung.com (Twenty Sided)</webMaster>
	<image>
		<url>http://www.shamusyoung.com/twentysidedtale/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Twenty Sided</title>
		<link>http://www.shamusyoung.com/twentysidedtale</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>A Website for your Internet</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>Twenty Sided</itunes:author>
	<itunes:owner>
		<itunes:name>Twenty Sided</itunes:name>
		<itunes:email>twentysidedtale@shamusyoung.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.shamusyoung.com/twentysidedtale/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Alan Wake EP14: Stabbed in the Brain</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15922</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15922#comments</comments>
		<pubDate>Wed, 16 May 2012 19:05:29 +0000</pubDate>
		<dc:creator>Shamus</dc:creator>
				<category><![CDATA[Lets Play]]></category>
		<category><![CDATA[alan wake]]></category>
		<category><![CDATA[spoiler warning]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15922</guid>
		<description><![CDATA[Link (YouTube) The headache stabbed me in the brain. And then I wrote a novel. Sounds about right. Let&#8217;s see: Goofy puzzles. Occasionally awkward dialog. A wall between story and gameplay. A seemingly boring jerk for a protagonist. Repetitive foes. Terrible lip sync. Checkpoint saves. We&#8217;ve accused Alan Wake of all of these, and I<span class="readmore"> &#0133; <a rel="bookmark" title="Alan Wake EP14: Stabbed in the Brain" href="http://www.shamusyoung.com/twentysidedtale/?p=15922">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p>
<table cellspacing='0' width='600' cellpadding='0' align='center' border='0'>
<tr>
<td><object width="600" height="470"><param name="movie" value="http://www.youtube.com/v/B5ApSnJVEWM&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/B5ApSnJVEWM&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="470"></embed></object><br/><small><a href='http://www.youtube.com/watch?v=B5ApSnJVEWM'>Link (YouTube)</a></small></td>
</tr>
</table>
<p><a href="http://www.shamusyoung.com"><img class="author-pic" src="http://www.gravatar.com/avatar/c931d01ed6734679f51fcda738075264?r=x&#038;s=60" align="left" valign="top" title="Posted by Shamus" alt="Shamus" border="0" /></a>The headache stabbed me in the brain. And then I wrote a novel. Sounds about right.</p>
<p>Let&#8217;s see:  Goofy puzzles. Occasionally awkward dialog. A wall between story and gameplay. A seemingly boring jerk for a protagonist. Repetitive foes. Terrible lip sync. Checkpoint saves. </p>
<p>We&#8217;ve accused Alan Wake of all of these, and I don&#8217;t think we&#8217;re wrong.  But I think all of those problems are even <em>worse</em> in Silent Hill 2, which<a href="?p=341"> I still regard as one of the more powerful games I&#8217;ve experienced</a>. I&#8217;m still gnawing on this, and I can&#8217;t speak for the rest of the cast, but I suspect that if the game had connected with me on an emotional level (dread, sorrow, anger, whatever) then I wouldn&#8217;t be focusing on these problems.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15922</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Alan Wake 13: Is Your Refrigerator Flying?</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15915</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15915#comments</comments>
		<pubDate>Tue, 15 May 2012 21:21:28 +0000</pubDate>
		<dc:creator>Shamus</dc:creator>
				<category><![CDATA[Lets Play]]></category>
		<category><![CDATA[alan wake]]></category>
		<category><![CDATA[spoiler warning]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15915</guid>
		<description><![CDATA[Link (YouTube) &#8220;As I approached the Spoiler Warning I saw it was covered in dark shadows. The shadows blocked out the light so I could only see darkness and shadows. It was terrifying. After gathering up some batteries and watching half an hour of crappy television, I approached the darkness and drew near to the<span class="readmore"> &#0133; <a rel="bookmark" title="Alan Wake 13: Is Your Refrigerator Flying?" href="http://www.shamusyoung.com/twentysidedtale/?p=15915">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p>
<table cellspacing='0' width='600' cellpadding='0' align='center' border='0'>
<tr>
<td><object width="600" height="470"><param name="movie" value="http://www.youtube.com/v/-cfeqo-Xz2E&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/-cfeqo-Xz2E&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="470"></embed></object><br/><small><a href='http://www.youtube.com/watch?v=-cfeqo-Xz2E'>Link (YouTube)</a></small></td>
</tr>
</table>
<p>&#8220;As <a href="http://www.shamusyoung.com"><img class="author-pic" src="http://www.gravatar.com/avatar/c931d01ed6734679f51fcda738075264?r=x&#038;s=60" align="left" valign="top" title="Posted by Shamus" alt="Shamus" border="0" /></a>I approached the Spoiler Warning I saw it was covered in dark shadows.  The shadows blocked out the light so I could only see darkness and shadows. It was terrifying. After gathering up some batteries and watching half an hour of crappy television, I approached the darkness and drew near to the edges of the dark shadows that blocked out the light, making things darker and spookier.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15915</wfw:commentRss>
		<slash:comments>124</slash:comments>
		</item>
		<item>
		<title>Project Octant Part 8: The Time-Hole</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15904</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15904#comments</comments>
		<pubDate>Tue, 15 May 2012 10:37:16 +0000</pubDate>
		<dc:creator>Shamus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[octant]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15904</guid>
		<description><![CDATA[So let&#8217;s talk about data structures. I&#8217;ve mentioned way back at the start of the project that there are certain costs to using an octree. An octree will make interfacing with ALL blocks a hundred times faster but make dealing with a specific block several times slower. I&#8217;m curious how&#8230; Hang on. My program has<span class="readmore"> &#0133; <a rel="bookmark" title="Project Octant Part 8: The Time-Hole" href="http://www.shamusyoung.com/twentysidedtale/?p=15904">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shamusyoung.com"><img class="author-pic" src="http://www.gravatar.com/avatar/c931d01ed6734679f51fcda738075264?r=x&#038;s=60" align="left" valign="top" title="Posted by Shamus" alt="Shamus" border="0" /></a>So let&#8217;s talk about data structures.  I&#8217;ve mentioned way back at the start of the project that there are certain costs to using an octree. An octree will make interfacing with ALL blocks a hundred times faster but make dealing with  a specific block several times slower. I&#8217;m curious how&#8230;</p>
<p>Hang on. My program has been behaving oddly recently.  It&#8217;s like it will suddenly stop building new blocks and I&#8217;ll end up stuck on this island floating in empty space.  I&#8217;ve got the program set to aim for 60fps, and if one thing starts eating too much CPU then the block-building gets choked off.  Let&#8217;s see where these CPU cycles are going.</p>
<p>I add a little benchmarking loop.  Right now there are just five systems running:</p>
<p><span id="more-15904"></span></p>
<ol>
<li>Avatar: This moves the camera around and does a little super-cheap collision detection.
</li>
<li>World: During block generation, world allocates these tables of handy values to speed up building.  This part just looks for out-of-use tables and unloads them.
</li>
<li>Scene: This is the heavy hitter. It does those crazy <a href="?p=15843">heavy-duty noise calculations</a>, places the blocks, maintains the octree, and turns the blocks into textured polygons.
</li>
<li>Window: This bit really does almost nothing. It checks for keypresses.
</li>
<li>Qt: Ah. This is where Qt gets a chance to process stuff.  Qt is the platform I&#8217;m using to write this.  Go back to <a href="?p=15758">part 3</a> if you need a refresher.
</li>
</ol>
<p>Let&#8217;s see where the time is going:</p>
<p><!--more--></p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant8_1.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>I don&#8217;t have access to a microsecond timer here, so we have to make due with milliseconds. This is like wanting to measure how long a man&#8217;s stride is when he walks, but your ruler is only marked off in terms of kilometers. You have to measure a lot of individual steps to figure it out.  These measurements were taken over the course of a second. There&#8217;s a thousand milliseconds in a second, so we&#8217;re looking to account for those thousand milliseconds.  Note that there&#8217;s a tiny bit of overhead to taking these measurements and we&#8217;re likely to miss a tick-tock here or there on really short tasks, but this is good enough to give us a broad understanding of where the time is going.</p>
<p>Note that the item &#8220;Qt &#038; Rendering&#8221; is there because I do my rendering <em>during</em> the bit where Qt gets a timeslice. The two items in parenthesis break that number down.  (Rendering) is how much time I spend shoving polygons at the graphics card, and (Qt) is how much time Qt eats doing&#8230; whatever it is that Qt does.</p>
<p>Hm.</p>
<p>This is not good. In fact, this is exactly what I was afraid of <a href="?p=15758">back when I started using Qt</a>.  Over half of my CPU cycles are being eaten by Qt, doing&#8230; what? I have no idea.  Qt is in charge of I/O, so it&#8217;s doing some keyboard and mouse processing.  But that stuff is so fast that I shouldn&#8217;t be able to measure it with this clock.  It&#8217;s also in charge of drawing that black box with the checkboxes and text in it. </p>
<p>Could that be it? Is Qt burning six tenths of a second on a rectangle of text with a couple of checkboxes?  Hm.  If I get rid of the box then I won&#8217;t be able to see these results.  Let&#8217;s get rid of the checkboxes and see if that changes anything.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant8_2.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>That made a big difference. Qt is now &#8220;only&#8221; using half of the CPU to draw this stupid black rectangle and text.  For contrast, during the <em>other</em> half of the second I&#8217;m rendering millions and millions of polygons.  Picture two guys in a library. In the same hour, one of them reads the complete three-volume set of <a href="http://en.wikipedia.org/wiki/The_Baroque_Cycle">The Baroque Cycle</a> and the other guy reads a single <a href="http://en.wikipedia.org/wiki/Family_circus">Family Circus</a> strip. </p>
<p>Let&#8217;s do another test. Let&#8217;s give Qt a bunch more controls and see how it reacts.  </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant8_3.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>I&#8217;ve added a little text label, another text box, and a couple of progress bars. (I dunno. They look kind of like health bars or something.  Seems like a reasonable thing to expect if this was a game environment.)   And now Qt is eating 71% of our CPU. This would be funny if it wasn&#8217;t so sad. This makes it pretty clear why nobody&#8217;s ever tried to use this thing for a game. A real game interface would be even more complex than this.</p>
<p>Keep in mind that these controls aren&#8217;t changing. I&#8217;m not altering the position of the faux-health bars or anything else that would create a need for them to be re-drawn every frame. The text boxes only update once a second. </p>
<p>With performance like this, I might as well go use Visual Basic. (No, not really.)  Note that this doesn&#8217;t mean that Qt is <strong>bad</strong>.  It&#8217;s just built with different goals.  Getting a cross-platform windowing system to play nice with 3D rendering like this requires a <em>lot</em> of levels of abstraction.  A normal Qt application is just some kind of interface with buttons and sliders and whatnot, without any 3D rendering going on.  In those circumstances, the user isn&#8217;t going to notice a few missing milliseconds.  My program is sensitive to single-digit millisecond usage, but a human being generally isn&#8217;t going to notice until it&#8217;s in the hundreds, and they probably won&#8217;t care until it&#8217;s near a thousand. The performance needs of Qt are at least two orders of magnitude from the performance needs of a 3D game. </p>
<p>I find <a href="http://labs.qt.nokia.com/2010/01/11/qt-graphics-and-performance-the-cost-of-convenience/">this page</a>, which seems to be from one of the developers behind Qt. It confirms my worst fears: This CPU cost is an inescapable reality of using Qt.  Even if all of those optimization techniques worked for me, and even if they applied to every little interface item, and even if I made maximum gains from all of them, it <em>still</em> wouldn&#8217;t do more than cut the CPU usage in half, which would still be ten times more than it should be. </p>
<p>If I disable the Qt drawing entirely (and have it print out the timing info to the console window instead) then we get:</p>
<p><code>FPS: 179</p>
<p>Avatar: 0<br />
World: 1<br />
Scene: 25<br />
Window: 0<br />
Qt&#038;Render: 962<br />
(Qt): 251<br />
(Render): 711<br />
Qt ms per Frame: 1</code></p>
<p>So the real overhead of using Qt is only ~1ms per frame.  That&#8217;s reasonable. It&#8217;s just that the Qt drawing tools are too slow to be useful. A shame, really.  &#8220;A platform-independent interface&#8221; was the main selling point of Qt for me. I&#8217;ve found a lot of other things to like about it since then, but losing the GUI is pretty much a deal-breaker. </p>
<p>When my processing began choking off I wanted to come in here and look for ways to optimize the octree or something. But it looks like the first order of business is &#8220;stop using qt&#8221; if I care about speed. I had a bunch of ideas for how I might tackle <a href="http://www.sea-of-memes.com/LetsCode32/LetsCode32.html">the crazy challenges that Goodfellow faced in part 32 of his series</a>.  Seems sort of pointless now.  There&#8217;s no reason to agonize over the aerodynamics of your car while you&#8217;ve got a half-ton of cinderblocks in the back seat. </p>
<p>Oh sure, I <em>could</em> work on my optimizations like this, but the CPU drain of Qt is noisy, so measuring performance would be like trying to play Jenga on horseback.  Also, experience has taught me that trying to monitor performance by reading a continuous spew of text in a console window is really aggravating. </p>
<p>I suppose I could take my code and go back to Visual Studio and <a href="http://www.libsdl.org/">SDL</a>, which is what Project Frontier used.  But that means shopping for a suite of image loading, interface-drawing, font-reading tools. Yuck. I don&#8217;t want to unravel some idiotic chain of dependencies.  I don&#8217;t want to download a dozen different <acronym title="Software Development Kit">SDK</acronym>&#8216;s, spew their files all over my hard drive and then try to get them to compile and link with my project. I don&#8217;t want to have to choose between the package that only solves half the problem, the package that sucks to use, or the package that ties me to Windows. I don&#8217;t want to have to learn a new programming language. </p>
<p>I just &#8211; this external packages stuff is such a dang killjoy for me.  I really, really, really hate it. It takes all the fun out of programming. When I was younger I tolerated it, but now I seem to have lost my patience.  I know why this problem exists and I understand why there aren&#8217;t easy solutions. I just don&#8217;t have the desire to put up with it these days.</p>
<p>Maybe I&#8217;ll work a bit more on this project before I shelve it.  Maybe I&#8217;ll migrate back over to Visual Studio and just muddle along with no interface.  Maybe I&#8217;ll just stop here.  I don&#8217;t know. I&#8217;m going to walk away from it for a bit and see how I feel about it then.</p>
<p>Onward?</p>
<p>EDIT: I&#8217;ve been meaning to ask: For those of you who played around with Project Frontier, what was the biggest hassle in porting it?  I know the capitalized filenames were a problem. &#8220;Main.cpp&#8221; instead of &#8220;main.cpp&#8221;.  I was obliged to use the former professionally for years, and eventually it became a habit that I didn&#8217;t question.  I&#8217;ve since been making sure everything is lowercase, but what other headaches did you encounter? (Aside from, you know, bugs and stuff.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15904</wfw:commentRss>
		<slash:comments>116</slash:comments>
		</item>
		<item>
		<title>Project Octant Part 7:Slopes</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15892</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15892#comments</comments>
		<pubDate>Mon, 14 May 2012 09:47:31 +0000</pubDate>
		<dc:creator>Shamus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[octant]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15892</guid>
		<description><![CDATA[Now that we have a world based entirely around the idea of cubes, you know what we need? Slopes. This is something that&#8217;s been on my mind for ages. I&#8217;ve run around the Minecraft landscape and wondered, &#8220;What would this look like if the cubes could slope to form beveled outlines?&#8221; Slopes aren&#8217;t really a<span class="readmore"> &#0133; <a rel="bookmark" title="Project Octant Part 7:Slopes" href="http://www.shamusyoung.com/twentysidedtale/?p=15892">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shamusyoung.com"><img class="author-pic" src="http://www.gravatar.com/avatar/c931d01ed6734679f51fcda738075264?r=x&#038;s=60" align="left" valign="top" title="Posted by Shamus" alt="Shamus" border="0" /></a>Now that we have a world based entirely around the idea of cubes, you know what we need? Slopes. This is something that&#8217;s been on my mind for ages.  I&#8217;ve run around the Minecraft landscape and wondered, &#8220;What would this look like if the cubes could slope to form beveled outlines?&#8221;</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_14.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Slopes aren&#8217;t really a foreign idea to an octree-based world. Minecraft has steps, which are basically slopes for the purposes of blocking light (they don&#8217;t) and collision. I want to take this one further and make slopes a part of the natural landscape. Like a lot of the stuff with this project, I&#8217;m not sure how well this will work out.  </p>
<p>The trick here will be that the software needs to be able to look at a landscape and figure out which blocks should be turned into ramps, which ones should be turned into corners, which ones should remain cubes, and which way the slopes should face.  </p>
<p>First, I need to set some parameters:</p>
<p><span id="more-15892"></span></p>
<ol>
<li><strong>Slopes should happen automatically.</strong>  I&#8217;m picturing some sort of special block that has auto-sloping properties associated with it.  For my tests here, I&#8217;ll be doing it on grass, but I imagine it would also apply to sand, gravel, and that sort of thing. I&#8217;ll be calling these blocks &#8220;soft&#8221; blocks.  So now there are three states for a cube of space: It&#8217;s either solid (like stone) soft (like grass) or empty. (Like, air, see?)
</li>
<li><strong>No deep analysis.</strong> When analyzing which way to slope, individual blocks can only examine their immediate neighbors, and not look at more distant blocks.  Two reasons for this: First, there&#8217;s a tiny bit of overhead to looking up blocks.  Alone, it&#8217;s not a big deal. But if every soft block needs to look two or three spaces away, then we&#8217;re talking about a LOT of lookups.  Also, if the orientation of a block can change based on stuff happening three blocks away, then this might lead to madness and confusion for a player. Example: You change/remove a block in front of you, and 3 meters away a bunch of landscape suddenly changes. Yuck.</li>
<li><strong>Soft blocks must be blind to the orientation of other soft blocks.</strong> I want to orient all soft blocks in a single pass. If block A needs to know what block B is doing (is it sloping away from me? Towards me?) then that means I need to do block B first. But what if B isn&#8217;t done yet? What if B is waiting on C? What if B doesn&#8217;t exist yet because it&#8217;s on the edge where terrain is still being created / loaded?  Since we&#8217;re doing this with an octree, we can&#8217;t count on blocks appearing in any particular order. </li>
<li><strong>These slopes are only for making hills.</strong>  Walls will still run at ninety degree angles and we&#8217;re not going to slope ceilings.  While it might be kind of interesting to make some kind of <a href="http://en.wikipedia.org/wiki/Non-uniform_rational_B-spline">NURBS</a>-based scenery, that&#8217;s not what I&#8217;m after today. Still, that would make for an amazing experiment.  It&#8217;s insane how, over a year after Minecraft became a mega-hit, we&#8217;re still not seeing more people at least <em>play around</em> with these ideas. I think you could spend a year pumping out different octree-based cube prototypes and still not see everything this technology has to offer. I mean, check out <a href="http://www.sea-of-memes.com/LetsCode22/LetsCode22.html">Sea of Memes</a>, where Michael Goodfellow was remixing Minecraft like a DJ.  You could read through that series and run off with half a dozen game designs.
</li>
</ol>
<p>The solution I came up with is that the program will make one quick pass over the scenery.  It looks for soft blocks. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_1.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Overhead view. Green = soft blocks. Red=hard blocks. White = empty space.  It looks like this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_4.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>I apologize for how hard it is to make out shapes. This will stop being a problem once we have proper lighting.</p>
<p>It examines each soft block. If there&#8217;s another block on top of it, it&#8217;s marked as solid.  If it&#8217;s surrounded on four sides by other blocks (soft or solid) then it&#8217;s marked as solid.  </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_2.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Now it runs through the soft blocks again, this time making them &#8220;lean&#8221; against any nearby solids.  </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_3.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>This was kind of crazy. I spent a lot of time experimenting with rules for which blocks would slope, and under what circumstances. </p>
<p>Sadly, I got pretty wrapped up in the process and forgot about taking screenshots, so I can&#8217;t show you all the ways that this went hilariously wrong and stupid and was broken in ways that I hadn&#8217;t even considered. Here&#8217;s one example:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_5.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Two opposing slopes wound up next to each other. The resulting gap in the scenery lets you see through the ground to the&#8230; lava. (Disclosure: Not really lava, from a gameplay perspective. I just re-colored my checkerboard base with a lava texture for fun, and found it was super-helpful in letting me spot gaps in the terrain at a distance.)</p>
<p>Remember that when slopes are being created, they can&#8217;t query each other and see which way the others are facing, because those other slopes might not be in position yet.  I could have it look for neighbors that <em>have</em> been set, but that would create relationships that are difficult or impossible for the player to understand.  You&#8217;d wind up with stuff like, &#8220;If you&#8217;re building on an odd-numbered block on the world grid then the south-most or west-most neighbor dictates which way the slope will go, while on even-numbered blocks you&#8217;ll get&#8230;&#8221;  And so on.</p>
<p>The upshot is that if slopes are decided by looking at neighbors, then a player would be able to build the same exact arrangement of blocks in 4 different places and end up getting 4 different results, depending on where their structures fell on the world grid and the powers-of-two scale. Madness.  No, if this is going to work, then soft blocks have to make their decisions without regard to what other soft blocks are doing.</p>
<p>Not to keep you in suspense, I do manage to come up with a working set of rules that produces slopes and (so far) doesn&#8217;t seem to leave holes in the terrain.  The result is a set of rules that is so complicated I can barely follow them.  If I have to come back to this in six months I&#8217;m going to hate myself. Here is my little test scene, now with slopes:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_6.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Here is what that looks like in my example drawing:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_3.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Note the block in column 4, row 3.  That&#8217;s an inside corner. To give you an idea of the complexity involved, here are the rules controlling this block:</p>
<ol>
<li>The northwest block must be empty.
</li>
<li>The north and west blocks must be soft. (We can&#8217;t know which way they&#8217;re facing, but we know they&#8217;re soft.)
</li>
<li>The northeast and southeast blocks must be non-empty. (Solid or soft.)
</li>
<li>The east, south, and southeast neighbors must be solid.
</li>
</ol>
<p>In code, it looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="c" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">//The diagrams below represent this cell (center) and the cells directly</span>
  <span style="color: #666666; font-style: italic;">//adjacent to it.</span>
  <span style="color: #666666; font-style: italic;">//# Indicates a cell that MUST be solid.</span>
  <span style="color: #666666; font-style: italic;">//@ Indicates a cell must be non-empty. (Solid or soft.)</span>
  <span style="color: #666666; font-style: italic;">//x Indicates a cell that MUST be empty.</span>
  <span style="color: #666666; font-style: italic;">//? Indicates the contents of the cell are ignored.</span>
  <span style="color: #666666; font-style: italic;">//S The cell MUST be soft.</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//    xS@</span>
  <span style="color: #666666; font-style: italic;">//    S/#</span>
  <span style="color: #666666; font-style: italic;">//    @##</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>cell<span style="color: #009900;">&#91;</span>C_NORTHWEST<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Empty</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> cell<span style="color: #009900;">&#91;</span>C_NORTH<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Soft</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span>
             <span style="color: #339933;">!</span>cell<span style="color: #009900;">&#91;</span>C_NORTHEAST<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Empty</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> cell<span style="color: #009900;">&#91;</span>C_WEST<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Soft</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span>
             cell<span style="color: #009900;">&#91;</span>C_EAST<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Solid</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>cell<span style="color: #009900;">&#91;</span>C_SOUTHWEST<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Empty</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span>
             cell<span style="color: #009900;">&#91;</span>C_SOUTH<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Solid</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> cell<span style="color: #009900;">&#91;</span>C_SOUTHEAST<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">Solid</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    facing <span style="color: #339933;">=</span> FACING_NW_INNER<span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//etc... </span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Yes, those comments are really part of the code.  The code on lines 13-17 might be the most complicated conditional statement I&#8217;ve ever personally written. </p>
<p>In practice, the world looks like this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_7.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>(Ignore the stray single floating blocks.  I built those as part of my testing / screwing around process.)</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_8.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Was it worth it? I dunno. It&#8217;s kind of different.  I think the gameplay fares better than the visual aspect of the thing.  You can run up and down these hills without needing to hop like Q-Bert, which makes getting around kind of fun. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant7_9.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15892</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
		<item>
		<title>Alan Wake EP12: Murder and Coffee Thermoses</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15889</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15889#comments</comments>
		<pubDate>Sat, 12 May 2012 22:44:24 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Lets Play]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15889</guid>
		<description><![CDATA[Link (YouTube) And the (very late) final episode of the week. Fortunately, it&#8217;s completely topical and we don&#8217;t spend fifteen minutes driving cars into trees.]]></description>
			<content:encoded><![CDATA[<p>
<table cellspacing='0' width='600' cellpadding='0' align='center' border='0'>
<tr>
<td><object width="600" height="470"><param name="movie" value="http://www.youtube.com/v/EvyspnBu3Ao&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/EvyspnBu3Ao&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="470"></embed></object><br/><small><a href='http://www.youtube.com/watch?v=EvyspnBu3Ao'>Link (YouTube)</a></small></td>
</tr>
</table>
<p><a href="http://www.shamusyoung.com/twentysidedtale/"><img class="author-pic" src="http://www.gravatar.com/avatar/e3c10f181b3670353d80ef9cad7d89d4?r=x&#038;s=60" align="left" valign="top" title="Posted by Josh" alt="Josh" border="0" /></a>And the (very late) final episode of the week. Fortunately, it&#8217;s completely topical and we don&#8217;t spend fifteen minutes driving cars into trees.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15889</wfw:commentRss>
		<slash:comments>167</slash:comments>
		</item>
		<item>
		<title>Josh Plays Shogun 2 Part 19: Holding it Together</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15885</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15885#comments</comments>
		<pubDate>Sat, 12 May 2012 20:09:21 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Lets Play]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15885</guid>
		<description><![CDATA[Yes, it&#8217;s finally back! After gathering vital intelligence at PAX and fighting off the vile ninja minions of Rutskarn, Oda Nobunaga has finally returned to conquer Japan! Now let&#8217;s see, where were we? Oh yes, we fought some siege battles, had half of Japan declare war on us (including the largest and most powerful clan<span class="readmore"> &#0133; <a rel="bookmark" title="Josh Plays Shogun 2 Part 19: Holding it Together" href="http://www.shamusyoung.com/twentysidedtale/?p=15885">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/splash_shogun2_josh.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p><a href="http://www.shamusyoung.com/twentysidedtale/"><img class="author-pic" src="http://www.gravatar.com/avatar/e3c10f181b3670353d80ef9cad7d89d4?r=x&#038;s=60" align="left" valign="top" title="Posted by Josh" alt="Josh" border="0" /></a>Yes, it&#8217;s finally back! After gathering vital intelligence at PAX and fighting off the vile ninja minions of Rutskarn, Oda Nobunaga has finally returned to conquer Japan! Now let&#8217;s see, where were we? Oh yes, we fought some siege battles, had half of Japan declare war on us (including the largest and most powerful clan in the entire country, the sea-ruling Mori) and extended our domain to the doorstep of Kyoto and the ruling Ashikaga Shogunate.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun18-21.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Oh yeah, and we converted to Christianity so we could crash our entire economy and insult every other clan on the island for the slim chance that we can build some European-style galleons to stop the inevitable Mori naval invasion before it happens.</p>
<p>If our own citizens don&#8217;t get us first.</p>
<p><span id="more-15885"></span>Let&#8217;s take a look at one of our individual provinces so I can better explain how this whole religion conversion process works.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-1.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Here we can see a complete breakdown of our capital, Owari, from its food production to income. Notably, you can see that the old Shinto-Buddhist religion is declining in favor of Christianity at a rate of about 3.1% per turn. This is more or less consistent with the conversion rate across the entire clan. The “zeal” it mentions (“Christian vs. Buddhist zeal: +4.0”), is – I think – supposed to increase the rate at which people in that province convert, but I&#8217;m not sure it&#8217;s ever worked right. Or if it does, it doesn&#8217;t increase the rate very much, since Owari has a Naban port and thus a fairly high zeal modifier.</p>
<p>But Owari&#8217;s had a number of turns to convert to Christianity – people have been converting ever since we finished the port &#8211; and isn&#8217;t in any serious danger of revolt.</p>
<p>Let&#8217;s have a look over at neighboring Mikawa to get a better idea of how bad things are going to get.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-2.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>With only a season since our conversion to Christianity, only 2.8% of the population has converted here. Additionally, you can see how mad the Buddhists are already getting. If you look at the Public Order section in the center, you can see one icon in the negatives bar of two hands clasped in prayer. This represents people in the province that are unhappy because the clan religion differs from their own. You can also see that another point of that unhappiness is predicted next turn. This is a problem, since Mikawa is only barely under our control: the positive side, repression – is currently equal to the negative side. If unhappiness overtakes repression, the province will be in danger of revolt.</p>
<p>It will actually take a bit longer for this to become a problem for Mikawa, since upgrades to the province&#8217;s castle will be finished next turn which will increase repression. Additionally, if things get really bad, I can exempt the province from taxation altogether, which will greatly reduce unhappiness, but of course, cost me all of the income I&#8217;d get from taxing the province.</p>
<p>And things are going to get a lot worse before they get better, too. When the dominant religion in a province is not the clan religion, religions unhappiness will increase quite quickly. When it&#8217;s as dominant as it is in most of our provinces, it increases at a rate of one point per turn. This isn&#8217;t an “if” it&#8217;s a “when”. Very soon, I will have to exempt most of my provinces from taxation, and then we&#8217;ll have to see just how robust our economy is. </p>
<p>In the mean time &#8211; HEY LOOK, MORE DECLARATIONS OF WAR!</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-3.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Funny story behind this one. Last turn I requested trade with this clan. They accepted. This turn, they broke the trade agreement. And now at the end of the turn, they&#8217;ve declared war on me. Swell. Fortunately, they control only two provinces and are hardly a threat.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-4.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Hey, remember that son I used as a hostage bargain to get the Date to ally with me? The one I said would never come of age in time to do anything useful? Yeah well&#8230; I&#8217;m a terrible dad.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-5.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-5thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>The Ikko Ikki seem to be diverting their forces in an attempt to counter-attack our recent offensive into the region around the capital. The large army to the northeast could be an ominous sign – I literally can&#8217;t take a single new province without triggering realm divide now, so there&#8217;s no easy way to close the defensive hole that Omi represents, and Nobuyuki could be in trouble without assistance if that army heads south. Rather than let them destroy my army in small pieces, I&#8217;ve abandoned my garrison in Iga and pulled Nobuyuki back towards Yamato.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-6.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>I&#8217;ve also begun to recruit Christian missionaries at the churches I&#8217;ve been building. Missionaries are the Christian counterpart to Monks and perform the same functions – they spread their religion to any province they&#8217;re in, as well as increase the conversion zeal (whatever that does) and slightly increase the happiness of local citizens. They can also demoralize armies, cause other characters to rethink their chosen path in life, and most devastatingly, incite religious rebellions in neighboring provinces. Although that&#8217;s a little hard to do if there aren&#8217;t any Christians in a province, isn&#8217;t it?</p>
<p>For now they&#8217;ll be sticking around my provinces, increasing happiness and helping to convert the rest of the clan to Christianity.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-7.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-7thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>Huh, that big Ikko Ikki army turned east instead and marched right towards Owari&#8230;</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-8.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-8thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>And if you&#8217;re wondering what they&#8217;re going to do to a castle with all of that cavalry, then&#8230; so am I. That kind of army would be deadly on an open field &#8211; like, say, chasing down Nobuyuki and his army while he regroups. Naturally then, the logical course of action is to attack the heavily fortified Oda capital with it instead.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-9.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-9thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>Most of the enemy army focuses on fording the river on one side of the castle, which gives my matchlock ashigaru plenty of time to shoot up the advancing enemy infantry.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-10.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-10thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>A contingent also attempts to climb the adjacent wall, but one of the fun things you can do with ninjas on defense is put them on a wall and order them to throw their bombs down on the enemy as they try to climb.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-11.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-11	thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>Between my ninjas, matchlocks, and spearmen, most of the enemy infantry is crushed. But look out! Here comes the cavalry.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-12.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-12thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>The&#8230; dismounted, low morale, badly trained cavalry that&#8217;s climbing the walls while my matchlocks shoot their general. So I guess the answer to the question about what the cavalry will do is, “Not a whole damn lot.”</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-13.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-13thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>As the last enemy units flee, I send Nobunaga outside and have him scare off all the horses – just for fun. Look at them all scatter!</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-14.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>You know, close victories happen too often in this game. If that wasn&#8217;t a decisive victory, I don&#8217;t know what is.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-15.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-15thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>Ambush! No, that&#8217;s not me being ambushed, that&#8217;s me ambushing an enemy by accident. You can hide your armies in forests on the strategic map just like you can hide your units in forests in battle. If any enemy army walks too close, you get the opportunity to ambush them, which gives you a huge deployment area on the battle map and generally leaves them deployed in a very disorganized fashion.</p>
<p>Thing is, I&#8217;m much too proactive and aggressive as a general to ever actually just leave my armies in forests and wait for some unsuspecting enemy army to wander by, so I&#8217;ve only ever fought one or two of these before and don&#8217;t really know exactly what to expect. Plus, this guy has a lot of swordsmen and I could easily find myself getting chewed up by them, so I&#8217;m just going to decline to attack and let them wander by without revealing myself.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-16.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-16thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>Bringing the garrison from Yamato to help allows for an easy, auto-resolve win anyhow.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-17.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>After finishing off the last remnants of the Ikko-Ikki army that attacked him last turn, Oda Nobunaga has leveled up to rank three. Just one more level and he can get Stand and Fight and win at everything.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-18.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Our economy is already starting to feel the effects of all of this religious unrest. Fortunately, we&#8217;ve finally made contact with the very last clan we hadn&#8217;t yet met before. And they also happen to be the one and only other clan in the entire nation that&#8217;s converted to Christianity. Considering they&#8217;re right in the middle of Mori territory, that they&#8217;ve survived this long is a feat in itself. They&#8217;re eager to trade, which should help to alleviate some of our tax problems.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-19.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-19thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>Since Taneyori decided to make me look bad and come of age in time to do something useful, I decided to send him after another small Ikko-Ikki army trying to sneak through the forests north of Owari.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-20.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>He somehow manages to lose more men than the enemy while forcing them to retreat.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-21.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-21thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>The Honma – the clan that accepted and then canceled a trade agreement with me over the period of a single turn back at the beginning of this post – have also decided to make their bid at attacking us, bringing a force consisting of&#8230; mostly archers to attack our northeastern border. The results are predictable, and Takayama Tadamoto wastes little time cutting down the entire thousand-man force.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-22.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-22thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>I&#8217;ve been watching Mori fleets pass by our trade route with the Sagara and Chosokabe clans to the west since we formed them, and now they seem to be heading in our direction. We&#8217;re still upgrading our port to a full Nanban Quarter – the only port large enough to construct galleons – and I doubt we&#8217;ll finish it in time to stop their initial offensive.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-23.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>There is one other ship I can build that might give the Mori pause – the Siege Tower Bune. These aren&#8217;t particularly large ships, but they have tall towers built atop their decks where arquebusiers can rain down fire on approaching enemy ships. This is extremely advantageous, as most other ships in the game are manned with archers and not gunmen, and arquebuses can deal a lot of damage to other ships, even to the point of inflicting serious damage to their wooden hulls. The few I can build in the time I have left probably won&#8217;t be enough to halt the Mori navy, but they might be able to slow them down.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-24.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-24thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>But at this point, that might be the least of my worries. The Mori have expanded so far eastward that they&#8217;ve actually made it to Kyoto with one of their more experienced armies.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><a href='images/shogun19-25.jpg'><img src='http://www.shamusyoung.com/twentysidedtale/images/shogun19-25thumb.jpg'   alt='' title='' border='0'/></a></td>
</tr>
</table>
<p>They waste very little time taking the lightly defended Ikko-Ikki provinces, and continue directly towards Yamato. I never expected this would happen, but it looks like our first encounter with the Mori is actually going to be over land, not sea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15885</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Alan Wake EP11: Physics and Pasties</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15881</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15881#comments</comments>
		<pubDate>Fri, 11 May 2012 18:10:20 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Lets Play]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15881</guid>
		<description><![CDATA[Link (YouTube) So this wasn&#8217;t actually a short week or anything; I didn&#8217;t delay this post because we didn&#8217;t have a fourth episode. No, I was just sick Thursday morning. I suspect Shamus might be trying to get back at me for crushing all of those sleeping pills into his tea last week. Also, for<span class="readmore"> &#0133; <a rel="bookmark" title="Alan Wake EP11: Physics and Pasties" href="http://www.shamusyoung.com/twentysidedtale/?p=15881">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p>
<table cellspacing='0' width='600' cellpadding='0' align='center' border='0'>
<tr>
<td><object width="600" height="470"><param name="movie" value="http://www.youtube.com/v/AGHdY1mZaJQ&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AGHdY1mZaJQ&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="470"></embed></object><br/><small><a href='http://www.youtube.com/watch?v=AGHdY1mZaJQ'>Link (YouTube)</a></small></td>
</tr>
</table>
<p><a href="http://www.shamusyoung.com/twentysidedtale/"><img class="author-pic" src="http://www.gravatar.com/avatar/e3c10f181b3670353d80ef9cad7d89d4?r=x&#038;s=60" align="left" valign="top" title="Posted by Josh" alt="Josh" border="0" /></a>So this wasn&#8217;t actually a short week or anything; I didn&#8217;t delay this post because we didn&#8217;t have a fourth episode. No, I was just sick Thursday morning. I suspect Shamus might be trying to get back at me for crushing all of those sleeping pills into his tea last week.</p>
<p>Also, for those of you interested, Josh Plays is totally actually really coming back tomorrow. For real this time. Like, the post is (almost) all written, I just need to finish the last bit and compile all of the images for upload. And of course there will be the fourth Spoiler Warning episode next week too. And hey, Shamus might have even written an article for the Escapist this week! (But I get bonus points if Shamus only remembers that he was supposed to do that when he reads this post.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15881</wfw:commentRss>
		<slash:comments>106</slash:comments>
		</item>
		<item>
		<title>Project Octant Part 6:Tiling</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15867</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15867#comments</comments>
		<pubDate>Fri, 11 May 2012 10:28:00 +0000</pubDate>
		<dc:creator>Shamus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[octant]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15867</guid>
		<description><![CDATA[So here we are, six entries into this series and we haven&#8217;t really done much in the way of making software. I actually find this kind of liberating. In Project Frontier I felt driven to get my core features in there. I like that this project is more an excuse for endless digressions. It&#8217;s a<span class="readmore"> &#0133; <a rel="bookmark" title="Project Octant Part 6:Tiling" href="http://www.shamusyoung.com/twentysidedtale/?p=15867">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shamusyoung.com"><img class="author-pic" src="http://www.gravatar.com/avatar/c931d01ed6734679f51fcda738075264?r=x&#038;s=60" align="left" valign="top" title="Posted by Shamus" alt="Shamus" border="0" /></a>So here we are, six entries into this series and we haven&#8217;t really done much in the way of making software. I actually find this kind of liberating. In Project Frontier I felt driven to get my core features in there. I like that this project is more an excuse for endless digressions. It&#8217;s a lot easier to navigate when you don&#8217;t care where you&#8217;re going. </p>
<p>Still, I guess we&#8217;d better get started with the actual thing and stop whinging on about technology and development platforms. First, let&#8217;s look at texture mapping&#8230;</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_2.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>(We don&#8217;t have a lighting system yet, so I&#8217;m just painting the sides of cubes darker than the top. That&#8217;s close enough for now.) </p>
<p>I&#8217;ve slapped the default stone texture from Minecraft onto this landscape so I can illustrate the thing I want to work on.  As in Minecraft, flat stone can look kind of dull if you see too much of it at once, and I&#8217;ve deliberately designed this scene to show us way, way too much of it. </p>
<p>This texture is kind of bland. I mean, it&#8217;s a scattering of grey values that barely deviate from each other.  Of course, this is by design. Notch knew what he was doing when he made his textures. Some well-meaning modders come along and try to make the textures more &#8220;interesting&#8221;, and you wind up with:</p>
<p><span id="more-15867"></span></p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_3.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Which sends you right into quilt-world. Sometimes people try to compensate for this by bumping up the resolution.  That can mitigate the problem, but it&#8217;s not a solution.  The issue at hand is that textures repeat exactly one per cube-face, so looking at lots of cubes means lots of repetition.  This isn&#8217;t a design <em>flaw</em> or anything. It&#8217;s part of Minecraft&#8217;s distinctive look. </p>
<p>But what if we broke from that?  What if textures covered larger areas? Let me grab a random texture from Google image search and set up the texture system to stretch the texture over 16 blocks.  I&#8217;ll be using this texture:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_6.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>And it looks like this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_4.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>You can see that spanning many blocks lets us have large patterns.  We could use this to have colored strata of rock or variations in brightness.  I know my texture here isn&#8217;t ideal, but I&#8217;m content that this would look better with more suitable art. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_5.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>However, this leads to some problems mapping textures. All this fancy detail will work against us if we can&#8217;t get it to line up.  Think of it like hanging strips of wallpaper.  We can put two strips next to each other, and their patterns will line up to create a seamless whole.  But if some deformation makes one part of the wall &#8220;longer&#8221; than the other&#8230;</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_7.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>At the top of the wall the two strips line up, but then the one on the left has to fill an alcove, which covers 3 meters of wall instead of just 1.  By the time we exit the alcove, the strip on the left has run too long and there will be an ugly seam where it meets its neighbor.</p>
<p>Texture mapping theory can get kind of dense. It&#8217;s basically a more convoluted version of the age-old <a href="http://en.wikipedia.org/wiki/Map_projection">map projection problem</a>.  Or I suppose it&#8217;s the map problem in reverse: We have a square image and we want to project it onto a complex world with as little distortion as possible. It&#8217;s not a problem you &#8220;solve&#8221;, but a series of trade-offs you juggle. </p>
<p>In <em>Half-Life 2: Episode 2</em>, Valve actually created a custom shader that would wrap a texture onto the complex topology of a cave.  They did this so that an artist wouldn&#8217;t have to drive themselves mad trying to get <em>rectangles</em> to line up on stalagmites and other topologically difficult items.  It just smears a generic rock texture all over everything. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_caves.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>This works because &#8220;rock walls&#8221; don&#8217;t have an expected orientation, and are very forgiving with regards to stretching. (Nobody&#8217;s going to look at the wall and think the rocks are &#8220;sideways&#8221; or &#8220;too big&#8221;. If you tried this with a brick texture it would look ridiculous. </p>
<p>We are <strong>not</strong> going in that direction.  We&#8217;re aiming for low tech. We&#8217;re aiming for simple. We want something that will produce working results on shapeless rock and dirt, and also on non-rotatable stuff like bricks.  </p>
<p>So here is my super-secret ninja technique:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> u <span style="color: #339933;">=</span> x <span style="color: #339933;">+</span> y<span style="color: #339933;">;</span>
<span style="color: #993333;">int</span> v <span style="color: #339933;">=</span> z<span style="color: #339933;">;</span></pre></div></div>

<p>I know, right? Brilliant. I&#8217;ve already filed for the patent and everything. </p>
<p>This is as simple as it gets.  The texture follows the world coordinates.  If you move one unit in the world, you&#8217;ll move one texture frame.  Here, let me apply a test texture:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_8.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>I suggest using a texture like this one whenever you&#8217;re dealing with texture mapping problems.  It&#8217;s orient-able. (You can tell if it&#8217;s backwards or upside-down, which doesn&#8217;t matter in our case but can be a problem if you&#8217;re working on something where textures need to face a certain way.) The letters form a clear progression from left to right, so if your texture doesn&#8217;t line up you&#8217;ll see the letters stop following natural order.  Same goes for the rainbow color-shift: If you see purple next to green, then you&#8217;ve botched something. If the textures are working right, both the lettering and color-change should progress naturally. </p>
<p>Let&#8217;s apply it to our world:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_9.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>We&#8217;re just worried about walls right now, so I&#8217;ve made the floor solid color just to avoid confusion.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_10.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>You can see the rows I&#8217;ve highlighted here. They line up whenever they meet, even though the walls have different shapes. You can see there&#8217;s a hole in the wall on the right, where an &#8220;N&#8221; block is missing.  This means that row is longer than the other two, yet <em>even then it lines up</em>.  The texture can wrap around a mountain, or a continent, or a one-meter pillar, and you&#8217;ll always be able to walk all the way around it without seeing a seam.</p>
<p>Here&#8217;s the backside of the hill:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_12.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Sure, the letters are backwards, but in the case of terrain textures this generally doesn&#8217;t matter. </p>
<p>The rule is simple:  When we move east or north, increase the texture by 1 section.  Corollary: If we move west or south, decrease the texture by 1. The only downside is:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_11.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Let&#8217;s assume we&#8217;re looking at a really big pillar from above. (Note also that the vertical arrow should point UP, assuming the top of the image is north. No big deal. The principle is the same.)</p>
<p>The problem areas are where you&#8217;ve got a wall running up one axis but down the other.  It moves east, goes forward one letter, then it goes south, and goes back a letter, then forward, backward.  It looks like this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_13.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>We we end up looking at repetition and mirroring. See what I mean about trade-offs?  We&#8217;ve left behind the drawbacks of Minecraft&#8217;s texture system and are using a new set of drawbacks.  </p>
<p>Lemme put a really busy texture up.  Also, we&#8217;ll put a different texture on all of the surface blocks so we have even more contrast.  Here are some high-contrast textures at work:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_14.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>And here is the same hill from the &#8220;bad&#8221; side:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_15.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>I&#8217;d say the texture itself is more ugly than the mirroring and repetition, so maybe this wasn&#8217;t an ideal test. Anyway. You get the idea. </p>
<p>Next up is something I&#8217;ve wanted to do for over a decade.  Since my time at Activeworlds, I&#8217;ve always wanted to make a borderless tiling world.  A world where you can go off one edge of the map and seamlessly enter on the other, where if you travel in a straight line you&#8217;ll eventually end up back where you started.  The last time I saw that in a game was in <a href="http://en.wikipedia.org/wiki/Magic_Carpet_(video_game)">Magic Carpet</a> in the mid 90&#8242;s. </p>
<p>I like borderless environments so much better than games like Fallout 3 or Oblivion where it just puts an invisible wall around your playpen and tells you &#8220;NO!&#8221; when you try to leave.  I also like it because it lets you walk around the world, which is kind of neat.  </p>
<p>Let&#8217;s try it:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_18.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>I guess&#8230; I guess you can&#8217;t show this off in screenshots.  Oh! Unless I make the world really, really tiny.  Let me adjust the size down, and build some distinctive landmark:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_16.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>And if we look up:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant6_17.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>The world map is 32&#215;32 meters.  Just enough space for a suburban house with a modest yard, I think.  Our view reaches 144m in every direction. Keep in mind those question marks in the distance are the exact same question mark I have in front of me.  They&#8217;re not copies.  Those are the same polygons and blocks. If I break a block in front of me, I see it vanish from the pattern in the distance. </p>
<p>All three of my kids saw this in turn, and each one asked: Will you be able to see yourself like this?</p>
<p>Well, keep in mind that right now there IS no concept of a &#8220;self&#8221; model. Or any kind of model.  There are cubes.  That&#8217;s all we have, and there aren&#8217;t even any systems in place for drawing other sorts of stuff. (Items, foes, NPC&#8217;s, space marines, etc.) But if I keep with this project and if I follow the plan in my head, then looking all the way &#8220;around&#8221; the world like this would cause you to see everything <em>except</em> yourself. (Because your character model isn&#8217;t usually drawn in a first-person game.) </p>
<p>But this is academic.  The point isn&#8217;t to make a bizzaro world where you can see things tile.  The point is to make a borderless world, and this little stunt proves that it works. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15867</wfw:commentRss>
		<slash:comments>79</slash:comments>
		</item>
		<item>
		<title>Alan Wake EP10: Nightingale, Agent Nightingale</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15864</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15864#comments</comments>
		<pubDate>Wed, 09 May 2012 19:52:55 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Lets Play]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15864</guid>
		<description><![CDATA[Link (YouTube) And we almost made it through a whole episode without fighting any darkness-related creatures. Damn. Oh well. At least we have coffee.]]></description>
			<content:encoded><![CDATA[<p>
<table cellspacing='0' width='600' cellpadding='0' align='center' border='0'>
<tr>
<td><object width="600" height="470"><param name="movie" value="http://www.youtube.com/v/Mk54OviryfE&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Mk54OviryfE&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="470"></embed></object><br/><small><a href='http://www.youtube.com/watch?v=Mk54OviryfE'>Link (YouTube)</a></small></td>
</tr>
</table>
<p><a href="http://www.shamusyoung.com/twentysidedtale/"><img class="author-pic" src="http://www.gravatar.com/avatar/e3c10f181b3670353d80ef9cad7d89d4?r=x&#038;s=60" align="left" valign="top" title="Posted by Josh" alt="Josh" border="0" /></a>And we almost made it through a whole episode without fighting any darkness-related creatures. Damn.</p>
<p>Oh well. At least we have coffee.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15864</wfw:commentRss>
		<slash:comments>132</slash:comments>
		</item>
		<item>
		<title>Project Octant Part 5:The Rainbow Collection</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15843</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15843#comments</comments>
		<pubDate>Wed, 09 May 2012 09:16:42 +0000</pubDate>
		<dc:creator>Shamus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[octant]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15843</guid>
		<description><![CDATA[Today we&#8217;re finally going to start adding some features to make this thing look a bit more&#8230; What? You say you want another digression on noise filtering and interpolation techniques? You sure? Okay then! (Nerd!) If you remember from last time, we&#8217;re taking tables of random white noise and expanding them to create &#8220;interesting&#8221; patterns.<span class="readmore"> &#0133; <a rel="bookmark" title="Project Octant Part 5:The Rainbow Collection" href="http://www.shamusyoung.com/twentysidedtale/?p=15843">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shamusyoung.com"><img class="author-pic" src="http://www.gravatar.com/avatar/c931d01ed6734679f51fcda738075264?r=x&#038;s=60" align="left" valign="top" title="Posted by Shamus" alt="Shamus" border="0" /></a>Today we&#8217;re finally going to start adding some features to make this thing look a bit more&#8230; What? You say you want another digression on noise filtering and interpolation techniques? You sure? Okay then! </p>
<p>(Nerd!)</p>
<p>If you remember from last time, we&#8217;re taking tables of random white noise and expanding them to create &#8220;interesting&#8221; patterns.  Stuff like this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_1.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Now, I really don&#8217;t want to have the next bunch of images be black &#038; white scramble squares.  That&#8217;s boring and it&#8217;s actually hard to see the effect I&#8217;m talking about.  So I&#8217;ve altered my program to output example images that will use color-blending to make the gradients more clear.  So the above image now looks like this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_2.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Just remember we&#8217;re not <em>really</em> dealing with color data right now.  We&#8217;re actually just generating heaps of numbers between zero (dark blue) and one (red) and this color-fade makes it easier to see what we&#8217;re doing. Okay? Great. </p>
<p><span id="more-15843"></span>In the image above we&#8217;re looking at around 16&#215;16 pixels, give or take the partials on the edges.  We need to be able to expand this data and come up with values between these points. </p>
<p>In the <a href="?p=15777">previous entry</a>, I put in a system based on cutting a quad (rectangle) into a pair of triangles and blending across it. Doing so yields this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_3.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>(Am I the only one who thinks that circle with a tail in the middle of the image looks kind of like the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot set</a>?)</p>
<p>I&#8217;ve been using this snippet of code for years. It wasn&#8217;t until I posted the last entry that I even questioned it. Someone asked why I wasn&#8217;t using <a href="http://en.wikipedia.org/wiki/Bilinear_filtering">bilinear filtering</a> and I realized I didn&#8217;t have a good reason. There might <em>be</em> a good reason, but I hadn&#8217;t even considered the question.  I&#8217;ve been using the quad-fade code for so long I just sort of take it for granted. </p>
<p>See, the quad code has two important features:</p>
<ol>
<li>It is fast. This is probably the fastest possible method that won&#8217;t create nasty seams.
</li>
<li>It breaks things into triangles.</li>
</ol>
<p>The triangles thing is important in certain cases. Like, in collision detection.  It&#8217;s handy if the player is standing on a square of terrain and I want to see if they&#8217;re ankle-deep, or floating above it, so that I can nudge them up or drop them down according to the long-understood rules of gravity and&#8230; walking up hills.   If they&#8217;re walking on a triangle (and you are always walking on triangles in a 3D game) then I don&#8217;t want to treat the surface like it&#8217;s rounded.  That will not look right. </p>
<p>So I used this code out of habit. I saw a blend-four-values problem and pulled out the hammer I always use on four-value problems. But is that the right choice to make here?</p>
<p>The quad blending begins with four values. Say you&#8217;ve got four pixels you want to blend together:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_6.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>We take this square and divide it into a pair of triangles. We can do this by cutting from upper-right to lower-left, or from upper-left to lower-right. Whatever. It&#8217;s best to alternate your cuts in a checkerboard pattern to avoid ugly artifacts. (Alternating our cuts will lead to the &#8220;diamond&#8221; pattern you see in the earlier image.)</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_7.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>If the point we&#8217;re trying to generate falls in the lower triangle, then we blend between those three points.  If it falls in the upper triangle, we use the corners of the other triangle. If I&#8217;m generating point X on the image above, then I create a value that is 1/4 cyan (upper left) and 3/4 orange (lower left) because we&#8217;re about 3/4 of the way down the image.  Then I take that blended value and mix it half and half with dark blue (lower right) because we&#8217;re halfway across the image. It might sound confusing, but the code to accomplish this is actually a good bit smaller than this paragraph and only slightly less readable.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_8.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>The downside of this is that the points aren&#8217;t given equal weight. The two points that form the right angles can&#8217;t effect the middle. The exact center is a blend of the two blues, without any weighting from the orange or green.  (Please don&#8217;t correct me and explain that these are peach and avocado or whatever artists call these colors. I&#8217;m making polygons, not a salad. I&#8217;m an engineer, and the only color names I know are the ones from the Crayola 8-box. <a href="http://thedoghousediaries.com/1406">Doghouse Diaries</a> and <a href="http://blog.xkcd.com/2010/05/03/color-survey-results/">XKCD</a> have already slain this horse and gave it a good pummeling afterward. (Insert &#8220;pummel horse&#8221; joke here.) Let&#8217;s move on.)</p>
<p>Instead, let&#8217;s try bilinear filetering. (&#8220;bi&#8221; meaning two-way. Yes, just like the sex thing, you <em>complete</em> juvenile. &#8220;linear&#8221; meaning in a straight line. So, a couple of lines? Let&#8217;s try it.)</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_10.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Bilinear filtering gives the values a more equitable distribution. To solve for the same x as before, we would blend halfway between the top two pixels for point A. Then we blend halfway between the bottom two for point B.  Then we blend 75% of the way from A to B for x. Clear? I hope so, because I want to move on.</p>
<p>Oh, the same square with biliner filering looks like this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_9.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Note that we needed to do three blending operations to get this value, as opposed to two blends for the cheapo blend I&#8217;ve been using.  Now, a single blend is nothing. A few math operations.  But remember what we&#8217;re doing with this data. We need to do three blends per pixel.  But we&#8217;re doing this in three dimensions, so we need to generate <em>two</em> pixels and blend <em>those</em> together for a single octave of noise. And we generally want to combine about 8 octaves to make our noise interesting. So&#8230; </p>
<p><center><code>(3 blends * 2 pixels + 1 blend) * 8 octaves = 56 blend operations</code></center></p>
<p>That&#8217;s per cube. Oh, and most cubes need 2 bits of noise. (One to shape hills and one to dig caves, for example.)  And a single 16-meter block of the world needs 4,096 cubes. And in a scene, even at the <strong>lowest possible</strong> visibility settings you&#8217;ve probably got around 400 such blocks rolling around in memory.   (I think Notch calls them chunks. I&#8217;ve taken to calling them nodes.) </p>
<p>So even a crappy low-visibility scene needs to perform 183,500,800 blend operations. Also keep in mind that a single blend operation is&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">inline</span> <span style="color: #993333;">float</span> Lerp <span style="color: #009900;">&#40;</span><span style="color: #993333;">float</span> n1<span style="color: #339933;">,</span> <span style="color: #993333;">float</span> n2<span style="color: #339933;">,</span> <span style="color: #993333;">float</span> delta<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> n1 <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color:#800080;">1.0f</span> <span style="color: #339933;">-</span> delta<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> n2 <span style="color: #339933;">*</span> delta<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Looks like a subtract, a couple of multiply operations, and an add. We need to do that, one hundred and eighty-three million times. That will wipe the smug off the face of your quad-core 4Ghz processor in a hurry. Your machine is going to <em>work</em> for this scenery, kiddo. So no, increasing the number of blends we need to do by 50% is not something to be done lightly. We need a really good reason before we start dumping more CPU juice on the problem. We need something important, like marginally better graphics or something.</p>
<p>Anyway. So this is what we have now:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_3.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>And here is the same thing generated with bilinear filtering:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_4.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>So&#8230; is it worth it? It&#8217;s hard to tell.  Obviously it looks better in RAINBOW VIEW, but that&#8217;s not what the data is used for.  In our program, the data is used to make caves.  Does it make better caves? </p>
<p>True story bro: As of writing this paragraph, I have yet to try it.  I honestly don&#8217;t know, 1,200 words into this post, if this is a complete waste of time or not.  Let&#8217;s find out.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant_brb.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>That didn&#8217;t take long. Okay, so I made a huge volume of noise caves with the threshold set at 0.5. (In English, it should be a roughly even 50-50 mix of air and solid&#8230; block stuff.) First, I take a screenshot of a nice bit of cave using the discount triangle-interpolation blending:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_old_busted.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>And now the exact same location, but generated with bilinear whatsits:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_new_hotness.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Is one of these really better than the other? It&#8217;s hard to say. What&#8217;s &#8220;better&#8221;? More visually interesting? More fun to explore? More realistic? Is the slow one really 50% slower? </p>
<p>This sounds like a decision to make later, when one of these variables matters. I&#8217;ve got both systems sitting side-by-side and can flip between them as I need. I guess for testing it makes sense to stick with the faster system anyway. If I stick with this project then eventually I&#8217;ll have to add a bunch of timers to keep track of where all the CPU is going, and that would be a good time to come back to this.</p>
<p>Also, in the process of writing the new filter, I managed to mess up and make this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant5_5.png'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>(I was blending between the wrong corners.) It&#8217;s useless, but kind of pretty in a strange way.  I like it because it looks like one of those shuffle puzzles. I suppose it would be considered evil to present this as a shuffle puzzle and let someone drive themselves insane trying to get things to match up?</p>
<p>So that&#8217;s what we accomplished today&#8230; nothing! This riveting series will continue in the next entry unless there isn&#8217;t one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15843</wfw:commentRss>
		<slash:comments>68</slash:comments>
		</item>
		<item>
		<title>Alan Wake EP9: But You Can Hit People With Cars!</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15841</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15841#comments</comments>
		<pubDate>Tue, 08 May 2012 19:55:02 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Lets Play]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15841</guid>
		<description><![CDATA[Link (YouTube) I&#8217;ve done it! I finally got rid of Shamus! Now I rule Twenty Sided! Mwahahahaha! Good thing Rutskarn was able to hire those Algerian terrorists. Even though they might not have actually been terrorists. Or Algerians. Or people. Okay, so Shamus might have just gotten sick and didn&#8217;t make it to the recording<span class="readmore"> &#0133; <a rel="bookmark" title="Alan Wake EP9: But You Can Hit People With Cars!" href="http://www.shamusyoung.com/twentysidedtale/?p=15841">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p>
<table cellspacing='0' width='600' cellpadding='0' align='center' border='0'>
<tr>
<td><object width="600" height="470"><param name="movie" value="http://www.youtube.com/v/sfTN49epH5E&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/sfTN49epH5E&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="470"></embed></object><br/><small><a href='http://www.youtube.com/watch?v=sfTN49epH5E'>Link (YouTube)</a></small></td>
</tr>
</table>
<p><a href="http://www.shamusyoung.com/twentysidedtale/"><img class="author-pic" src="http://www.gravatar.com/avatar/e3c10f181b3670353d80ef9cad7d89d4?r=x&#038;s=60" align="left" valign="top" title="Posted by Josh" alt="Josh" border="0" /></a>I&#8217;ve done it! I finally got rid of Shamus! Now <i>I</i> rule Twenty Sided! Mwahahahaha!</p>
<p>Good thing Rutskarn was able to hire those Algerian terrorists. Even though they might not have actually been terrorists. Or Algerians.</p>
<p>Or people.</p>
<p>Okay, so Shamus might have just gotten sick and didn&#8217;t make it to the recording session. Which means he could recover and be back to posting  on this blog any day now. Cherish the Shamelessness while it lasts!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15841</wfw:commentRss>
		<slash:comments>88</slash:comments>
		</item>
		<item>
		<title>Project Octant Part 4: The Beautiful Noise</title>
		<link>http://www.shamusyoung.com/twentysidedtale/?p=15777</link>
		<comments>http://www.shamusyoung.com/twentysidedtale/?p=15777#comments</comments>
		<pubDate>Mon, 07 May 2012 09:44:05 +0000</pubDate>
		<dc:creator>Shamus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[octant]]></category>

		<guid isPermaLink="false">http://www.shamusyoung.com/twentysidedtale/?p=15777</guid>
		<description><![CDATA[Perlin Noise is a technique for quickly generating a metric crapload of really interesting pseudo-randomness. &#8220;Interesting&#8221; in that it forms nice organic patterns instead of pure random noise. &#8220;Pseudo Random&#8221; in that you can give it the same input and get the same output. &#8220;Crapload&#8221; means that you can make a final data set thousands<span class="readmore"> &#0133; <a rel="bookmark" title="Project Octant Part 4: The Beautiful Noise" href="http://www.shamusyoung.com/twentysidedtale/?p=15777">read more of this</a><span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.shamusyoung.com"><img class="author-pic" src="http://www.gravatar.com/avatar/c931d01ed6734679f51fcda738075264?r=x&#038;s=60" align="left" valign="top" title="Posted by Shamus" alt="Shamus" border="0" /></a>Perlin Noise is a technique for quickly generating a metric crapload of really interesting pseudo-randomness. &#8220;Interesting&#8221; in that it forms nice organic patterns instead of pure random noise.  &#8220;Pseudo Random&#8221; in that you can give it the same input and get the same output.  &#8220;Crapload&#8221; means that you can make a final data set thousands of times larger than the noise you start with.</p>
<p>Note that in the context of this project I&#8217;m going to <em>discuss</em> Perlin in terms of 2D images, but I&#8217;m <em>using</em> it in 3D.  It&#8217;s just easier to show you what we&#8217;re doing in 2D.</p>
<p>We begin with a basic image of really random noise, which I will depict as a 2D greyscale image.  The more random the better. We want areas of light, dark, and medium brightness. We want it to be really diverse overall, but have small local clusters of bright or darkness. We don&#8217;t want large areas to be homogeneous, and we don&#8217;t want the small areas just just be a scatter of white and black pixels. We can accomplish this a lot of ways.  I could churn out a bunch of values in a random number generator, for example. Or, we can just open up a new image in your Photoshop of choice, crank up the noise filter on a blank image, and hit save.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_1.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Awesome, right? </p>
<p><span id="more-15777"></span>No. Obviously pure noise is boring. </p>
<p>To make Perlin noise&#8230;</p>
<div class="dmnotes">Stop!</p>
<p>Okay. According to <a href="http://www.shamusyoung.com/twentysidedtale/?p=15777&#038;cpage=1#comment-277055">Chris Serson below</a>, this is not Perlin noise. This is&#8230; It&#8217;s complicated. The point is, when I Google&#8217;d for Perlin noise I ran into multiple pages that made the same error I made here. To avoid perpetuating this mis-naming of noise systems, I&#8217;m adding this note here.  </p>
<p>I will say that it is hard to find a proper implementation of either Perlin Noise or the (sometimes preferred) Simplex noise.  Most of the stuff I find is:</p>
<ol>
<li>Impenetrable jargon.
</li>
<li>Pages of indecipherable, Greek-laden maths.
</li>
<li>Example images of what the system can do, provided you can figure it out.
</li>
<li>A history of all the noise systems Ken Perlin has made, how he used them, and how people keep mis-attributing other noise systems to him.
</li>
</ol>
<p>So&#8230; not much in the way of code out there. In the end, what I have here works well enough for my purposes.  If I need something more robust I can go on the quest for the One True Noise Algorithm at another time.  Let&#8217;s just get on with this.</p>
</div>
<p>&#8230;we have to sample this image at different resolutions.  Massive resolutions.  Bigger than we would want to bother keeping in memory, really. What we do is take this noise and kind of zoom in on it. For example, here are the four pixels in the upper-left of our noise image.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_6.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Blending between these four values, we can come up with values in between.  If it asks for the value 20% of the way across and 80% of the way down, we get this:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_7.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>To be clear: We&#8217;re not calculating ALL of these values.  It only creates the one pixel that was requested. I&#8217;m just showing you how it arrives at that value.</p>
<p>The neat thing is, I already had 90% of the code needed for Perlin Noise. For those of you reading through Project Frontier, check out <code>MathInterpolateQuad ()</code>.  It has everything you need for doing the above. </p>
<p>The terrain generator is feeding us coordinates.  We&#8217;re dividing those values by a thousand, so that it would require a thousand samples (a thousand meters of scenery) to cover the gradient from one edge of this four-pixel square to the other.  Of course, if we stopped here we would have some really boring, super-flat scenery. </p>
<p>So we take another sample.  Instead of <sup>1</sup>/<sub>1,000</sub>, this one is taken at <sup>1</sup>/<sub>500</sub>.  Then we take another sample at <sup>1</sup>/<sub>250</sub>, and another at <sup>1</sup>/<sub>125</sub>.  Each level of noise is at twice the frequency of the one before. Then we add all of these samples together, <em>giving them all equal weight</em>.  We average them.</p>
<p>The upshot of all of this is that we get this large pattern of interesting noise. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_2.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>This might not look terribly useful, but we can use this to generate interesting topography.  Obviously we could use this to make hills where brighter = taller.  But we can also use it to generate underground scenery. Let&#8217;s say we set a threshold.  Everything above a certain brightness will be hollow, and everything below that threshold will be solid rock.</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_3.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>Which gives us a system of caves.  If we set the threshold higher, then instead of large caves we&#8217;ll get little pockets, like Swiss Cheese. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_4.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>If we take a narrow range of values above one point and below another, then we get a bunch of passages, all twisty-like. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_5.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>So let&#8217;s take this noise and feed it into our cube-world and see how it looks:</p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_8.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>This is just raw Perlin output.  I&#8217;m not doing anything fancy with it at this point. Eventually it might be worthwhile to combine different sets of noise. (Perhaps one to make hills, and another to bore tunnels in the hills.) Or to set up different ways of deciding what&#8217;s solid and what&#8217;s empty. (Mess with the thresholds.)  Maybe I&#8217;ll stretch noise along one axis to make tall or long caves.  Or flatten out the bottoms to make Star-Trek style caves with lumpy walls and floors level enough for championship billiards. (A classic trope. Actually, is it a trope? I&#8217;ve never seen it <a href="http://tvtropes.org/pmwiki/search_result.php?cx=partner-pub-6610802604051523%3Aamzitfn8e7v&#038;cof=FORID%3A10&#038;ie=ISO-8859-1&#038;q=cave+level&#038;siteurl=tvtropes.org%2Fpmwiki%2Fpmwiki.php%2FMain%2FPlatonicCave&#038;ref=www.google.com%252Furl%253Fsa%253Dt%2526rct%253Dj%2526q%253D%2526esrc%253Ds%2526source%253Dweb%2526cd%253D1%2526ved%253D0CH0QFjAA%2526url%253Dhttp%253A%252F%252Ftvtropes.org%252F%2526ei%253DElSnT4r6J-eg6QGl3sG9BA%2526usg%253DAFQjCNFXyqvffDkbQu7TCFs8F8Ymx_WHng">officially listed</a>.) </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_9.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>One of the things I wanted for this project was to experiment with noise like this, and see what other sorts of shapes and places one can make. </p>
<table cellspacing='8'   cellpadding='0' align='center'>
<tr>
<td><center><img src='http://www.shamusyoung.com/twentysidedtale/images/octant4_10.jpg'   alt='' title='' border='0'/></td>
</tr>
</table>
<p>So now we have a foundation for making scenery. I&#8217;m sure we&#8217;ll come back to this when it&#8217;s time to work on the output. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.shamusyoung.com/twentysidedtale/?feed=rss2&#038;p=15777</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
	</channel>
</rss>

