<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bytten</title>
	<atom:link href="http://bytten.net/devlog/feed/" rel="self" type="application/rss+xml" />
	<link>http://bytten.net/devlog</link>
	<description></description>
	<lastBuildDate>Sun, 13 May 2012 15:53:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Radio Silence</title>
		<link>http://bytten.net/devlog/2012/05/13/radio-silence/</link>
		<comments>http://bytten.net/devlog/2012/05/13/radio-silence/#comments</comments>
		<pubDate>Sun, 13 May 2012 15:53:24 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[lennasinception]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=532</guid>
		<description><![CDATA[It&#8217;s been a while since I last gave an update on Lenna&#8217;s Inception. I&#8217;m not dead and I have not ended the project; I&#8217;m just taking a much needed break. Soon I will continue work on it, albeit at a &#8230;<p class="read-more"><a href="http://bytten.net/devlog/2012/05/13/radio-silence/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I last gave an update on Lenna&#8217;s Inception. I&#8217;m not dead and I have not ended the project; I&#8217;m just taking a much needed break.</p>
<p>Soon I will continue work on it, albeit at a slower pace. My previous pace was unsustainable alongside a full-time job and a social life.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/05/13/radio-silence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Room Styling in Lenna&#8217;s Inception</title>
		<link>http://bytten.net/devlog/2012/04/22/room-styling-in-lennas-inception/</link>
		<comments>http://bytten.net/devlog/2012/04/22/room-styling-in-lennas-inception/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 22:18:36 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[proceduralgeneration]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=503</guid>
		<description><![CDATA[<a href="/devlog/2012/04/20/early-sss-13-filling-rooms/">This week</a> I implemented room styling in my game Lenna's Inception. Room styling builds upon my previous work to procedurally generate dungeons with lock and key puzzles, <a href="/devlog/tag/metazelda/">Metazelda</a>, to detail what is contained in each room down to the level of individual tiles.

<p style="text-align: center"><a href="/random/room-styles-in-lenna/11.png"><img src="/random/room-styles-in-lenna/11.png" alt="" width="256" height="192" /></a> </p><p class="read-more"><a href="http://bytten.net/devlog/2012/04/22/room-styling-in-lennas-inception/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="/devlog/2012/04/20/early-sss-13-filling-rooms/">This week</a> I implemented room styling in my game Lenna&#8217;s Inception. Room styling builds upon my previous work to procedurally generate dungeons with lock and key puzzles, <a href="/devlog/tag/metazelda/">Metazelda</a>, to detail what is contained in each room down to the level of individual tiles.</p>
<p>Before I explain how room styling works, it&#8217;s useful to understand a few things about the dungeons in Lenna&#8217;s Inception, because these form constraints on the kind of things the room styler can do, and provide useful simplifications.</p>
<p>First of all, all rooms are the same size – 16&#215;11 – and are aligned in a grid. Larger rooms can be faked by joining up four adjacent rooms with open edges. This is simplifies both Metazelda and the room styler, but there is no technical reason why variable-sized rooms cannot be done.</p>
<p>Each room has up to four exits – one in each compass direction. This again is a simplification, but it seems likely that I&#8217;ll eventually lift this limitation. Each exit can be one of these kinds:</p>
<p>A <em>normal</em> exit is simply a gap in the wall for the player to pass through to the next room.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/normal-exit.png"><img src="/random/room-styles-in-lenna/normal-exit.png" alt="" height="64" width="96" /></a></p>
<p>A <em>mob-locked</em> exit is a door that does not open until the player has killed all enemy mobs in the room.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/mob-lock.png"><img src="/random/room-styles-in-lenna/mob-lock.png" alt="" height="64" width="96" /></a></p>
<p><em>Red, green</em> and <em>blue locks</em> can only be opened by the player after collecting the key of the corresponding color.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/red-lock.png"><img src="/random/room-styles-in-lenna/red-lock.png" alt="" height="64" width="96" /></a> <a href="/random/room-styles-in-lenna/green-lock.png"><img src="/random/room-styles-in-lenna/green-lock.png" alt="" height="64" width="96" /></a> <a href="/random/room-styles-in-lenna/blue-lock.png"><img src="/random/room-styles-in-lenna/blue-lock.png" alt="" height="64" width="96" /></a></p>
<p>The generically-named <em>equipment lock</em>, which requires the player to have a particular piece of equipment to pass through the exit. For example, an equipment lock for the spring equipment, which enables the player to jump, might be a hole tile placed next to the exit so that the player has to jump over it. A lock for the sword might involve slashable bushes blocking the doorway.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/equipment-lock.png"><img src="/random/room-styles-in-lenna/equipment-lock.png" alt="" height="96" width="160" /></a></p>
<p>An <em>open edge</em> indicates that the entire wall on that side of the room has been removed to combine the room with the next one into a larger room.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/large-room.png"><img src="/random/room-styles-in-lenna/large-room.png" alt="" title="Four rooms joined with open edges." height="419" width="610" /></a></p>
<h2>Room styling</h2>
<p>By the time the room styler runs, several things have already happened:</p>
<ul>
<li><a href="/devlog/tag/metazelda/">Metazelda</a> has run and finished, providing the complete dungeon layout, including room positions, doorways between rooms and key and lock positions, etc.</li>
<li>Mob-locked doors&#8217; positions have been decided.</li>
<li>Cycles of rooms linked with normal exits have been turned into a larger 2&#215;2 screen room (these are the open edge exit kind).</li>
<li>The precise positioning of doors within the room (how far along the walls they are) has been decided.</li>
</ul>
<p>These decisions cannot be undone, so the room styler must first check that a style is compatible with the decisions already made before applying it.</p>
<h2>The room style interface</h2>
<p>The room styles are organized into a set of classes, each of which provide the following:</p>
<ul>
<li>A weight value, used to compute the probability of selecting this room style, relative to the other room styles&#8217; weight values. By default, the weight is 1.0.</li>
<li>A method to check that the preconditions for the room style are met. If the conditions are not satisfied, the room style is excluded from consideration.</li>
<li>A method to apply the styling to the room.</li>
</ul>
<h2>Plain and desert styles</h2>
<p>The plain and desert styles are the simplest room styles. They have no preconditions and so can always be used when others cannot. They each have weight 0.5.</p>
<p>The plain style will most frequently make no changes to the default contents of the room, but with a probability of 0.2 it will line the walls with alternative floor tiles.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/3.png"><img src="/random/room-styles-in-lenna/3.png" alt="" width="256" height="192" /></a></p>
<p>The desert room style replaces default floor tiles in the room with alternative floor tiles and places up to three randomly-positioned bushes in the room.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/6.png"><img src="/random/room-styles-in-lenna/6.png" alt="" width="256" height="192" /></a></p>
<h2>Vertical and horizontal divider styles</h2>
<p>Vertical and horizontal dividers split the room into two using a column or a row of blocks, with a gap at a random point along it. This produces an interesting effect on combat, as well as aesthetics. The player&#8217;s sword can reach over the blocks to attack enemies on the other side, and while passing through the gap the player is less able to escape an attack. This is interesting in rooms with skeletons, which do not approach the player and so cannot be hit from the other side of the divider. Skeletons fire arrows from a distance so the player must carefully time their approach through the gap to avoid being damaged.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/13.png"><img src="/random/room-styles-in-lenna/13.png" alt="" width="256" height="192" /></a> <a href="/random/room-styles-in-lenna/18.png"><img src="/random/room-styles-in-lenna/18.png" alt="" width="256" height="192" /></a> </p>
<p>The preconditions for the divider styles are:</p>
<ul>
<li>No open edges.</li>
<li>There are exits on the east and west sides of the room for a vertical divider.</li>
<li>There are exits on the north and south sides of the room for a horizontal divider.</li>
<li>No exits would be blocked or covered up by a divider going through the center of the room.</li>
</ul>
<h2>Block arrangement style</h2>
<p>The block arrangement styler produces symmetrical arrangements of blocks in the middle of the room. This can provide cover and/or obstacles during combat.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/11.png"><img src="/random/room-styles-in-lenna/11.png" alt="" width="256" height="192" /></a> <a href="/random/room-styles-in-lenna/16.png"><img src="/random/room-styles-in-lenna/16.png" alt="" width="256" height="192" /></a> </p>
<p>The way this works is by splitting the room into four quarters, producing a random arrangement of blocks in one quarter, and then reflecting it for the other three. To ensure it remains possible to reach all exits from the room, the original pattern that is reflected is either 4&#215;3 or 5&#215;2 in size. This means there is always either a vertical or horizontal path through the blocks, and there is a 2-tile gap between the blocks and the walls.</p>
<p>The preconditions for it at the moment are that there are no open edges, but this is not strictly necessary.</p>
<h2>Cross-divider style</h2>
<p>The cross-divider style splits the room into four compartments, in a similar style to the vertical and horizontal dividers, with three gaps to make each of them reachable. In addition to that, there is a 3&#215;1 space in each compartment that is randomly filled with pots, blocks, bushes and the default floor tile.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/14.png"><img src="/random/room-styles-in-lenna/14.png" alt="" width="256" height="192" /></a> <a href="/random/room-styles-in-lenna/15.png"><img src="/random/room-styles-in-lenna/15.png" alt="" width="256" height="192" /></a> </p>
<p>The preconditions check that there are no open edges, and that placing the blocks at the edges of the room will not cover up any exits.</p>
<h2>Bridge style</h2>
<p>The bridge style is the most advanced room style that Lenna&#8217;s Inception currently has. This style generates a bridge over a bottomless pit that takes up most of the room.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/20.png"><img src="/random/room-styles-in-lenna/20.png" alt="" width="256" height="192" /></a> <a href="/random/room-styles-in-lenna/22.png"><img src="/random/room-styles-in-lenna/22.png" alt="" width="256" height="192" /></a> </p>
<p>The preconditions are that there are no open edges. The weight is normally 1.0, but goes up to 4.0 if there is an equipment-locked exit in the room and the dungeon&#8217;s equipment is the spring.</p>
<p>There are many ways to produce a bridge that links up all of the exits, but the way I chose to do it was with a cellular automaton.</p>
<ol>
<li>The state of the automaton is a 10&#215;5 grid of cells representing the the state of the middle of the room – zero in a cell means a hole tile goes there, and non-zero represents a floor tile. Initially all cells are zero.</li>
<li>Each exit from the room is assigned a unique power of two.</li>
<li>For each exit, the cell nearest that exit is filled with the exit&#8217;s number.</li>
<li>The bitwise-or of all exit numbers is the exit mask.</li>
</ol>
<p>At this point the room looks as follows. The white box is the boundary of the grid, and the cell&#8217;s value is written over the tile. The southern exit is equipment-locked, and the equipment is the spring, which is why there is a hole between the tile inside the grid and the exit from the room.</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/23.png"><img src="/random/room-styles-in-lenna/23.png" alt="" width="512" height="384" /></a></p>
<p>Then the state is evolved as follows until every non-zero cell of the grid has a value equal to the exit mask:</p>
<pre>
For each cell X in the grid with non-zero value V:
    Choose one random compass direction, D
    If the cell Y in direction D from X is within the grid and does not have value V:
        If cell Y's value U != 0:
            Update every cell in the grid with either value U or value V to have value U|V
        Else:
            Set cell Y's value to V
</pre>
<p>This has the effect that the initial sets of floor tiles grow outwards organically until they meet each other:</p>
<p style="text-align: center"><a href="/random/room-styles-in-lenna/24.png"><img src="/random/room-styles-in-lenna/24.png" alt="" width="256" height="192" /></a> <a href="/random/room-styles-in-lenna/25.png"><img src="/random/room-styles-in-lenna/25.png" alt="" width="256" height="192" /></a><br />
<a href="/random/room-styles-in-lenna/26.png"><img src="/random/room-styles-in-lenna/26.png" alt="" width="256" height="192" /></a> <a href="/random/room-styles-in-lenna/27.png"><img src="/random/room-styles-in-lenna/27.png" alt="" width="256" height="192" /></a> </p>
<p>Grids for rooms with only one exit can be prevented from terminating too soon by adding another power of two to the exit mask and one random cell in the grid.</p>
<h2>Future work</h2>
<p>These are all the room styles I&#8217;ve implemented, but they are still extremely primitive. The design of the room styler is flexible and extensible, so more styles can easily be added in future. Some examples might be rooms containing jumping puzzles, mazes, or block-pushing puzzles such as Sokoban.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/04/22/room-styling-in-lennas-inception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Early SSS #13 &#8211; Filling Rooms</title>
		<link>http://bytten.net/devlog/2012/04/20/early-sss-13-filling-rooms/</link>
		<comments>http://bytten.net/devlog/2012/04/20/early-sss-13-filling-rooms/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 19:14:42 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[proceduralgeneration]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=493</guid>
		<description><![CDATA[This week I've added a few different room styles so dungeons don't look quite so bare. The video shows them off best, but there are screenshots below.

<div style="text-align:center"><iframe width="320" height="240" src="http://www.youtube.com/embed/p-SmqWBZvSc" frameborder="0" allowfullscreen></iframe></div>

<a href="/devlog/?p=493">More inside</a>.<p class="read-more"><a href="http://bytten.net/devlog/2012/04/20/early-sss-13-filling-rooms/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;ve added a few different room styles so dungeons don&#8217;t look quite so bare. The video shows them off best, but there are screenshots below.</p>
<div style="text-align:center"><iframe width="640" height="480" src="http://www.youtube.com/embed/p-SmqWBZvSc" frameborder="0" allowfullscreen></iframe></div>
<p style="text-align: center">
<a href="/random/sss13/0.png"><img src="/random/sss13/0.png" alt="" width="256" height="192" /></a> <a href="/random/sss13/1.png"><img src="/random/sss13/1.png" alt="" width="256" height="192" /></a><br />
<a href="/random/sss13/2.png"><img src="/random/sss13/2.png" alt="" width="256" height="192" /></a> <a href="/random/sss13/3.png"><img src="/random/sss13/3.png" alt="" width="256" height="192" /></a><br />
<a href="/random/sss13/4.png"><img src="/random/sss13/4.png" alt="" width="256" height="192" /></a> <a href="/random/sss13/5.png"><img src="/random/sss13/5.png" alt="" width="256" height="192" /></a><br />
<a href="/random/sss13/6.png"><img src="/random/sss13/6.png" alt="" width="256" height="192" /></a> <a href="/random/sss13/7.png"><img src="/random/sss13/7.png" alt="" width="256" height="192" /></a>
</p>
<p>The designs are produced with combinations of templates, randomness and cellular automata (<a href="/devlog/2012/04/22/room-styling-in-lennas-inception/">more information</a>). The problem I&#8217;m currently trying to work out is how to design rooms containing more interesting jumping puzzles that require the player to hop between multiple platforms. </p>
<p>I&#8217;m seriously considering investing in some graph paper for this.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/04/20/early-sss-13-filling-rooms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSS #12 &#8211; Linking up Lenna and Metazelda</title>
		<link>http://bytten.net/devlog/2012/04/14/sss-12-linking-up-lenna-and-metazelda/</link>
		<comments>http://bytten.net/devlog/2012/04/14/sss-12-linking-up-lenna-and-metazelda/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 23:02:00 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[metazelda]]></category>
		<category><![CDATA[proceduralgeneration]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=478</guid>
		<description><![CDATA[I've finally linked Metazelda and Lenna's Inception together to procedurally generate dungeon layouts.

<div style="text-align: center"><iframe width="320" height="240" src="http://www.youtube.com/embed/NH5ySWlOvyM" frameborder="0" allowfullscreen></iframe></div>

<p></p>

<a href="/devlog/?p=478">More inside</a>.<p class="read-more"><a href="http://bytten.net/devlog/2012/04/14/sss-12-linking-up-lenna-and-metazelda/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally linked Metazelda and Lenna&#8217;s Inception together to procedurally generate dungeon layouts.</p>
<div style="text-align: center"><iframe width="640" height="480" src="http://www.youtube.com/embed/NH5ySWlOvyM" frameborder="0" allowfullscreen></iframe></div>
</p>
<h2>Update to Metazelda</h2>
<p style="text-align: center"><a href="/random/sss12/map.png"><img src="/random/sss12/map.png" alt="Example output from Metazelda" /></a></p>
<p><a href="https://github.com/tcoxon/metazelda">Metazelda</a>, the library I wrote to procedurally generate lock-and-key puzzles (which I&#8217;ve <a href="/devlog/2012/01/25/procedural-dungeon-generation-part-1-5/">described</a> <a href="/devlog/2012/01/21/procedural-dungeon-generation-part-i/">before</a>), needed tweaking to make it produce consistent and interesting dungeons. I did this by subclassing the DungeonGenerator class and overriding the probabilistic, decision-making methods. The viewer will use the new generator if it is passed -lenna as a command-line option. There are a few differences:</p>
<ul>
<li>It more consistently produces dungeons of 15-25 rooms through a combination of tweaked probabilities and reattempting generation if the number of rooms is outside that range.</li>
<li>It produces dungeons containing exactly 4 key items.</li>
<li>There&#8217;s an extra room before the goal &#8211; the boss room.</li>
<li>It will reattempt generation if it has produced a dungeon containing too many corridor-like rooms.</li>
</ul>
<p>I&#8217;ve also added &#8220;intensity&#8221; as a property to rooms in Metazelda. This affects the default generator too. Intensity is used in Lenna&#8217;s Inception to determine what difficulty the room should have, and affects the mobs that appear in the room. It&#8217;s displayed on the Metazelda viewer as colors and numbers (blue or 0.0 &#8211; easy, red or 1.0 &#8211; hard).</p>
<h2>Lenna&#8217;s Inception</h2>
<p>The work I did on Lenna&#8217;s Inception this week was to place rooms, link doorways, and produce mixes of mobs in each room based on the room&#8217;s intensity. This can all be viewed in the screenshots below and the video above.</p>
<p>The rooms all look quite sparse and boring at the moment, but that&#8217;s only because I haven&#8217;t yet coded anything for decorations, item placement, etc.</p>
<p style="text-align: center">
<a href="/random/sss12/0.png"><img src="/random/sss12/0.png" alt="" width="256" height="192" /></a> <a href="/random/sss12/1.png"><img src="/random/sss12/1.png" alt="" width="256" height="192" /></a><br />
<a href="/random/sss12/2.png"><img src="/random/sss12/2.png" alt="" width="256" height="192" /></a> <a href="/random/sss12/3.png"><img src="/random/sss12/3.png" alt="" width="256" height="192" /></a><br />
<a href="/random/sss12/4.png"><img src="/random/sss12/4.png" alt="" width="256" height="192" /></a> <a href="/random/sss12/5.png"><img src="/random/sss12/5.png" alt="" width="256" height="192" /></a><br />
<a href="/random/sss12/6.png"><img src="/random/sss12/6.png" alt="" width="256" height="192" /></a> <a href="/random/sss12/7.png"><img src="/random/sss12/7.png" alt="" width="256" height="192" /></a><br />
<a href="/random/sss12/8.png"><img src="/random/sss12/8.png" alt="" width="256" height="192" /></a> <a href="/random/sss12/9.png"><img src="/random/sss12/9.png" alt="" width="256" height="192" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/04/14/sss-12-linking-up-lenna-and-metazelda/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screenshot Saturday #11</title>
		<link>http://bytten.net/devlog/2012/04/07/screenshot-saturday-11/</link>
		<comments>http://bytten.net/devlog/2012/04/07/screenshot-saturday-11/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 09:01:35 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=472</guid>
		<description><![CDATA[This Screenshot Saturday, I have a little bit of progress to show on dungeons. A lot of my effort this week has been spent organizing code into map and scene generators, and adding command line "cheats" for controlling them.


<div style="text-align: center"><iframe width="320" height="240" src="http://www.youtube.com/embed/37_RtEM50pk" frameborder="0" allowfullscreen></iframe></div>
<p></p>

<a href="http://bytten.net/devlog/?p=472">More inside</a>.<p class="read-more"><a href="http://bytten.net/devlog/2012/04/07/screenshot-saturday-11/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This Screenshot Saturday, I have a little bit of progress to show on dungeons. A lot of my effort this week has been spent organizing code into map and scene generators, and adding command line &#8220;cheats&#8221; for controlling them.</p>
<p>At the moment, the dungeons just contain the entrance room, the boss room, and the prize room, which contains the dungeon&#8217;s main treasure. The video and screenshots below show this off.</p>
<p>Next week and beyond I will be implementing the <a href="/devlog/tag/metazelda/">Metazelda</a> algorithm.</p>
<div style="text-align: center"><iframe width="640" height="480" src="http://www.youtube.com/embed/37_RtEM50pk" frameborder="0" allowfullscreen></iframe></div>
<div style="text-align: center">
<a href="/random/sss11/0.png"><img src="/random/sss11/0.png" width="256" height="192" alt="" /></a> <a href="/random/sss11/1.png"><img src="/random/sss11/1.png" width="256" height="192" alt="" /></a><br />
<a href="/random/sss11/2.png"><img src="/random/sss11/2.png" width="256" height="192" alt="" /></a> <a href="/random/sss11/3.png"><img src="/random/sss11/3.png" width="256" height="192" alt="" /></a><br />
<a href="/random/sss11/4.png"><img src="/random/sss11/4.png" width="256" height="192" alt="" /></a> <a href="/random/sss11/5.png"><img src="/random/sss11/5.png" width="256" height="192" alt="" /></a><br />
<a href="/random/sss11/6.png"><img src="/random/sss11/6.png" width="256" height="192" alt="" /></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/04/07/screenshot-saturday-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSS #10 &#8211; First boss and music</title>
		<link>http://bytten.net/devlog/2012/03/31/sss-10-first-boss-and-music/</link>
		<comments>http://bytten.net/devlog/2012/03/31/sss-10-first-boss-and-music/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 09:14:31 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=464</guid>
		<description><![CDATA[<p>This time, I added background music and the game's first boss. There are a few things that will eventually need cleaning up, but now there's nothing stopping me from progressing with procedural dungeon generation.</p>

<div style="text-align: center"><iframe width="320" height="240" src="http://www.youtube.com/embed/_sEKCMYcgVM" frameborder="0" allowfullscreen></iframe></div>
<p></p>

<p><a href="http://bytten.net/devlog/?p=464">Screenshots inside</a>.</p><p class="read-more"><a href="http://bytten.net/devlog/2012/03/31/sss-10-first-boss-and-music/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This time, I added background music and the game&#8217;s first boss. There are a few things that will eventually need cleaning up, but now there&#8217;s nothing stopping me from progressing with procedural dungeon generation.</p>
<div style="text-align: center"><iframe width="640" height="480" src="http://www.youtube.com/embed/_sEKCMYcgVM" frameborder="0" allowfullscreen></iframe></div>
</p>
<p>Music:</p>
<ul>
<li>John Torkington &#8211; The Opening</li>
<li>SirmXe &#8211; Sivdin Altogether 140bpm</li>
<li>Vicces1212 &#8211; c64</li>
</ul>
<p>Sound effects and music have been a pain to code thanks to PulseAudio being buggy on Ubuntu. My hope is that I won&#8217;t have to do any more of this now, but I haven&#8217;t tested it on Windows or OS X yet.</p>
<p>The boss has three stages. The way to beat the first two are hinted at by other enemies that you encounter before him, but the final one is a new experience. It&#8217;s stupidly difficult and it doesn&#8217;t work very well. I think I will move that stage onto a different boss and clean it up later on.</p>
<div style="text-align: center">
<a href="http://bytten.net/random/sss10/0.png"><img src="http://bytten.net/random/sss10/0.png" alt="screenshot" width="256" height="192" /></a> <a href="http://bytten.net/random/sss10/1.png"><img src="http://bytten.net/random/sss10/1.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="http://bytten.net/random/sss10/2.png"><img src="http://bytten.net/random/sss10/2.png" alt="screenshot" width="256" height="192" /></a> <a href="http://bytten.net/random/sss10/3.png"><img src="http://bytten.net/random/sss10/3.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="http://bytten.net/random/sss10/4.png"><img src="http://bytten.net/random/sss10/4.png" alt="screenshot" width="256" height="192" /></a> <a href="http://bytten.net/random/sss10/5.png"><img src="http://bytten.net/random/sss10/5.png" alt="screenshot" width="256" height="192" /></a> </p>
<div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/03/31/sss-10-first-boss-and-music/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSS #9 &#8211; Sound, keys and locks</title>
		<link>http://bytten.net/devlog/2012/03/24/sss-9-sound-keys-and-locks/</link>
		<comments>http://bytten.net/devlog/2012/03/24/sss-9-sound-keys-and-locks/#comments</comments>
		<pubDate>Sat, 24 Mar 2012 00:00:13 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=451</guid>
		<description><![CDATA[<p>This week was super-productive. I added sound effects (which make a huge difference!), keys, colored-key-locked doors, locked doors that open only after all the enemies have been defeated in the room, coins and random bush drops.</p><p>
</p><p>With the keys and locked doors, I'm now a huge step closer to being able to implement the  <a href="http://bytten.net/devlog/2012/01/25/procedural-dungeon-generation-part-1-5/">procedural dungeon generator</a> for real.</p>

<div style="text-align: center"><iframe width="320" height="240" src="http://www.youtube.com/embed/sqlaSIvd_Eg" frameborder="0" allowfullscreen></iframe></div>
<p></p>

<p><a href="http://bytten.net/devlog/?p=451">Screenshots inside</a>.</p><p class="read-more"><a href="http://bytten.net/devlog/2012/03/24/sss-9-sound-keys-and-locks/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>This week was super-productive. I added sound effects (which make a huge difference!), colored keys, colored-key-locked doors, locked doors that open only after all the enemies have been defeated in the room, coins and random bush drops.</p>
</p>
<p>With the keys and locked doors, I&#8217;m now a huge step closer to being able to implement the <a href="http://bytten.net/devlog/2012/01/25/procedural-dungeon-generation-part-1-5/">procedural dungeon generator</a> for real.</p>
<div style="text-align: center"><iframe width="640" height="480" src="http://www.youtube.com/embed/sqlaSIvd_Eg" frameborder="0" allowfullscreen></iframe></div>
</p>
<h2>Screenshots</h2>
<p style="text-align: center">
<a href="/random/sss9/0.png"><img src="/random/sss9/0.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss9/1.png"><img src="/random/sss9/1.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss9/2.png"><img src="/random/sss9/2.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss9/3.png"><img src="/random/sss9/3.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss9/4.png"><img src="/random/sss9/4.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss9/5.png"><img src="/random/sss9/5.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss9/6.png"><img src="/random/sss9/6.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss9/7.png"><img src="/random/sss9/7.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss9/8.png"><img src="/random/sss9/8.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss9/9.png"><img src="/random/sss9/9.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss9/10.png"><img src="/random/sss9/10.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss9/11.png"><img src="/random/sss9/11.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss9/12.png"><img src="/random/sss9/12.png" alt="screenshot" width="256" height="192" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/03/24/sss-9-sound-keys-and-locks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSS #8 &#8211; More bad guys</title>
		<link>http://bytten.net/devlog/2012/03/17/sss-8-more-bad-guys/</link>
		<comments>http://bytten.net/devlog/2012/03/17/sss-8-more-bad-guys/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 00:15:34 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=438</guid>
		<description><![CDATA[<p>Since the last update two weeks ago, I added more enemies to the game, heart pickups to replenish health, and (completely off-topic) I've spent a week in the Netherlands.</p>

<div style="text-align: center"><iframe width="320" height="240" src="http://www.youtube.com/embed/Lb3CgctyA5M" frameborder="0" allowfullscreen></iframe></div>

<p><a href="http://bytten.net/devlog/?p=438">More inside</a>.</p><p class="read-more"><a href="http://bytten.net/devlog/2012/03/17/sss-8-more-bad-guys/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Since the last update two weeks ago, I added more enemies to the game, heart pickups to replenish health, and (completely off-topic) I&#8217;ve spent a week in the Netherlands.</p>
<div style="text-align: center"><iframe width="640" height="480" src="http://www.youtube.com/embed/Lb3CgctyA5M" frameborder="0" allowfullscreen></iframe></div>
<p>The new enemies are skeletons, knights, and knights with shields.</p>
<h2>Skeletons and random walks</h2>
<div style="text-align:center">
<a href="/random/sss8/1.png"><img src="/random/sss8/1.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss8/2.png"><img src="/random/sss8/2.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss8/3.png"><img src="/random/sss8/3.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss8/4.png"><img src="/random/sss8/4.png" alt="screenshot" width="256" height="192" /></a>
</div>
<p>Skeletons do a random walk around the screen, and when you line up with them in either the X or Y axes, they turn towards you and fire an arrow.</p>
<p>If the server and client used different seeds for the random walk, the behavior of skeletons could get out of sync between updates from the server and look quite laggy. The hack I&#8217;m quite proud of is to use a combination of the mob&#8217;s position, GUID, and the number of seconds since the last time it took damage as the seed. As all this information is deterministic, but changes between successive random choices, the behavior is completely deterministic and tolerant of lag, but still looks quite random.</p>
<h2>Knights</h2>
<div style="text-align:center">
<a href="/random/sss8/5.png"><img src="/random/sss8/5.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss8/6.png"><img src="/random/sss8/6.png" alt="screenshot" width="256" height="192" /></a><br />
<a href="/random/sss8/7.png"><img src="/random/sss8/7.png" alt="screenshot" width="256" height="192" /></a> <a href="/random/sss8/8.png"><img src="/random/sss8/8.png" alt="screenshot" width="256" height="192" /></a>
</div>
<p>Knights reuse the skeleton&#8217;s code for random walks, but they behave differently when you line up with them in either the X or Y axes. Knights charge at the player with their swords out instead of firing arrows. Shielded knights (the lighter, grayer versions) also carry shields and so are impossible to damage from in front.</p>
<p>In practice they tend to be really quite tough to kill and to escape from. To soften them down a bit I&#8217;ve made them drop hearts upon death, and they will also blindly charge into holes. The best way to kill them seems to be to jump over them and attack from behind. In the released game I will limit them to one or two per screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/03/17/sss-8-more-bad-guys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screenshot saturday #7</title>
		<link>http://bytten.net/devlog/2012/03/03/screenshot-saturday-7/</link>
		<comments>http://bytten.net/devlog/2012/03/03/screenshot-saturday-7/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 00:45:57 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=421</guid>
		<description><![CDATA[<div style="text-align:center"><iframe width="320" height="240" src="http://www.youtube.com/embed/-OGews6miRI" frameborder="0" allowfullscreen></iframe></div>
<p></p>
<p><a href="http://bytten.net/devlog/?p=421">More inside</a>.</p><p class="read-more"><a href="http://bytten.net/devlog/2012/03/03/screenshot-saturday-7/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center"><iframe width="640" height="480" src="http://www.youtube.com/embed/-OGews6miRI" frameborder="0" allowfullscreen></iframe></div>
</p>
<p>I spent a little time this week going over my plans for the game, and after doing some estimation, I worked out that I could have an early playable demo release by June. This won&#8217;t have very many features, and it will probably have just a single procedurally-generated dungeon to complete, but it gives me deadlines and a fixed feature set.</p>
<p>There are now some really awful graphics on the title screen:</p>
<p style="text-align: center"><a href="/random/sss7/0.png"><img alt="screenshot" src="/random/sss7/0.png" width="256" height="192" /></a></p>
<p>I added another in-game map-editing tool, the <em>Cane of Somalia</em> (Zelda pun intended). This tool places tiles on the map. A little menu that pops up when you select it on the equipment menu allows you to choose which kind of tile you want to place:</p>
<p style="text-align: center">
<a href="/random/sss7/1.png"><img alt="screenshot" src="/random/sss7/1.png" width="256" height="192" /></a><br />
<a href="/random/sss7/2.png"><img alt="screenshot" src="/random/sss7/2.png" width="256" height="192" /></a><br />
<a href="/random/sss7/3.png"><img alt="screenshot" src="/random/sss7/3.png" width="256" height="192" /></a><br />
<a href="/random/sss7/4.png"><img alt="screenshot" src="/random/sss7/4.png" width="256" height="192" /></a>
</p>
<p>I added a new piece of equipment &#8211; the spring. It allows you to jump over holes and enemies without taking damage.</p>
<p style="text-align: center">
<a href="/random/sss7/5.png"><img alt="screenshot" src="/random/sss7/5.png" width="256" height="192" /></a><br />
<a href="/random/sss7/6.png"><img alt="screenshot" src="/random/sss7/6.png" width="256" height="192" /></a><br />
<a href="/random/sss7/7.png"><img alt="screenshot" src="/random/sss7/7.png" width="256" height="192" /></a><br />
<a href="/random/sss7/9.png"><img alt="screenshot" src="/random/sss7/9.png" width="256" height="192" /></a>
</p>
<p>Lastly, the shield now works, and it can be used to protect yourself from attacks and push back enemies.</p>
<p style="text-align: center">
<a href="/random/sss7/8.png"><img alt="screenshot" src="/random/sss7/8.png" width="256" height="192" /></a>
</p>
<p>I&#8217;m out of the country next week, so update #8 will be in two weeks&#8217; time!</p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/03/03/screenshot-saturday-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Screenshot Saturday #6</title>
		<link>http://bytten.net/devlog/2012/02/25/screenshot-saturday-6/</link>
		<comments>http://bytten.net/devlog/2012/02/25/screenshot-saturday-6/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 00:00:35 +0000</pubDate>
		<dc:creator>tomc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lennasinception]]></category>
		<category><![CDATA[screenshots]]></category>

		<guid isPermaLink="false">http://bytten.net/devlog/?p=392</guid>
		<description><![CDATA[<p>There's a long list of things I've done to the game this week. It seems like now that the hard stuff (networking, the core of the engine, etc.) has been done, I can add features at a rate of about one per day.</p>
<p>These new features work seamlessly on networked multiplayer.</p>

<div style="text-align: center;"><iframe width="320" height="240" src="http://www.youtube.com/embed/Zi1_F4sEqA4" frameborder="0" allowfullscreen></iframe></div>
<p></p>

<p><a href="http://bytten.net/devlog/?p=392">More inside</a>.</p><p class="read-more"><a href="http://bytten.net/devlog/2012/02/25/screenshot-saturday-6/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a long list of things I&#8217;ve done to the game this week. It seems like now that the hard stuff (networking, the core of the engine, etc.) has been done, I can add features at a rate of about one per day.</p>
<p>These new features work seamlessly on networked multiplayer.</p>
<div style="text-align: center;"><iframe width="640" height="480" src="http://www.youtube.com/embed/Zi1_F4sEqA4" frameborder="0" allowfullscreen></iframe></div>
</p>
<h2>Loading screens</h2>
<p>Loading screens appear while the game is doing something in the background and the view is waiting on it &#8211; e.g. when reading save files, or retrieving a scene from the multiplayer server.</p>
<p style="text-align:center"><a href="/random/sss6/0.png"><img alt="screenshot" src="/random/sss6/0.png" width="256" height="192" /></a></p>
<h2>Player death</h2>
<p>I finally made it possible for the player to die! When this happens, the save menu shows up:</p>
<p style="text-align:center"><a href="/random/sss6/1.png"><img alt="screenshot" src="/random/sss6/1.png" width="256" height="192" /></a></p>
<p style="text-align:center"><a href="/random/sss6/2.png"><img alt="screenshot" src="/random/sss6/2.png" width="256" height="192" /></a></p>
<h2>Fall damage</h2>
<p>The holes in the ground work now. Most mobs that fall into them die, but in the case of the player, the mob is moved back to where it first appeared on the screen and takes some damage.</p>
<p style="text-align:center"><a href="/random/sss6/3.png"><img alt="screenshot" src="/random/sss6/3.png" width="256" height="192" /></a></p>
<p style="text-align:center"><a href="/random/sss6/4.png"><img alt="screenshot" src="/random/sss6/4.png" width="256" height="192" /></a></p>
<p style="text-align:center"><a href="/random/sss6/5.png"><img alt="screenshot" src="/random/sss6/5.png" width="256" height="192" /></a></p>
<p style="text-align:center"><a href="/random/sss6/6.png"><img alt="screenshot" src="/random/sss6/6.png" width="256" height="192" /></a></p>
<h2>Breakable tiles</h2>
<p>I added a new tile to the map that the sword can interact with. Bushes can be cut down, and stay cut down while there is a player in the scene.</p>
<p style="text-align:center"><a href="/random/sss6/7.png"><img alt="screenshot" src="/random/sss6/7.png" width="256" height="192" /></a></p>
<p style="text-align:center"><a href="/random/sss6/9.png"><img alt="screenshot" src="/random/sss6/9.png" width="256" height="192" /></a></p>
<p style="text-align:center"><a href="/random/sss6/10.png"><img alt="screenshot" src="/random/sss6/10.png" width="256" height="192" /></a></p>
<h2>Map-editing tools</h2>
<p>I implemented one of the map-editing tools I&#8217;m planning &#8212; the Diamond Pickaxe. This clears the data for the tile it is pointed at, destroying rocks, bushes and holes. Unlike the sword&#8217;s effect on bushes, the effect of the pickaxe is permanent.</p>
<p style="text-align:center"><a href="/random/sss6/12.png"><img alt="screenshot" src="/random/sss6/12.png" width="256" height="192" /></a></p>
<p style="text-align:center"><a href="/random/sss6/13.png"><img alt="screenshot" src="/random/sss6/13.png" width="256" height="192" /></a></p>
<h2>Performance</h2>
<p>I made some improvements to performance by caching colorized sprites and tiles.</p>
<p>All graphics are designed in grayscale PNG images, and these are colorized on the fly by the code. This seems to be quite common in NES and Gameboy Color games, and it allows you to use the same resources for different entities &#8211; e.g. dungeons can use the same tiles but be colored differently, and differently colored enemies can use the same sprites.</p>
<p>The problem with doing this in Java is that the best way to do it is to write a custom <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/image/BufferedImageOp.html">BufferedImageOp</a>, which is quite slow. Actually, I can still get hundreds of FPS with BufferedImageOp, but there seems to be some unpredictable lagginess at times when limiting the frame rate. Caching the results of the custom filter smooths this out completely.</p>
<p>I also experimented with Java&#8217;s BufferStrategy, but this seemed to be much slower than my own double-buffering (presumably due to the weird way my threads and locks are set up).</p>
]]></content:encoded>
			<wfw:commentRss>http://bytten.net/devlog/2012/02/25/screenshot-saturday-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

