<?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>Codezen</title>
	<atom:link href="http://blog.codezen.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codezen.org</link>
	<description>Hacker Friendly Ranting</description>
	<lastBuildDate>Wed, 17 Apr 2013 21:53:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>On e-books</title>
		<link>http://blog.codezen.org/2013/04/17/on-e-books/</link>
		<comments>http://blog.codezen.org/2013/04/17/on-e-books/#comments</comments>
		<pubDate>Wed, 17 Apr 2013 21:45:37 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=879</guid>
		<description><![CDATA[I&#8217;ll admit, at least when it comes to books, I&#8217;m an extreme Luddite. There&#8217;s just something that I find comforting about the feel of a book in my hands, the sweet smell emanating from the aging pages of a paperback, or the excitement of getting a crisp new book. For the past five or six [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ll admit, at least when it comes to books, I&#8217;m an extreme Luddite. There&#8217;s just something that I find comforting about the feel of a book in my hands, the sweet smell emanating from the aging pages of a paperback, or the excitement of getting a crisp new book.</p>
<p>For the past five or six years, I&#8217;ve kept an eye on the ebook industry but I failed to find a compelling reason to switch. Even now, the domain of the ebook reader is a weird back alley of tech. The technology looks and feels antiquated. E-ink readers are nice, power efficient, easily read in broad daylight, but for $140 (current Kindle Paperwhite) you get a device whose major selling point is the fact that it has a backlight. Others, like the Nook Glowlight advertise things like &#8220;fast page turn&#8221; for $120. All of them uniformly espouse power savings with a 6&#8243; screen that reminded me of an old Palm Pilot and a refresh rate reminiscent of scraping a clay tablet.</p>
<p>Also, ebooks are bullshit from a consumer freedom point of view. Look, I know that publishers are out to make money and I don&#8217;t expect them to receive, filter, edit, and publish books for nothing but at the same time I see my public library with a wait list and a two week time limit on what amounts to a floppy disk (yeah, those 3.5 inch suckers in the days of yore) worth of data. Maybe a couple of floppies if there are lots of pretty pictures or the author has a problem with going on long irrelevant tangents (Stephenson, damn you). It doesn&#8217;t make sense to me, the consumer, that there would be people waiting in line for copies of something that can be copied instantly, perfectly and at no cost.</p>
<p>There has to be a better way that combines the strength of the library (free public service with loads of media) with the strengths of the ebook (ease of duplication and transmission) that still gets the publishers a fair share. Publishers have only traditionally allowed libraries to operate because they posed no threat to sales. If a library buys three copies of a hit new book, then only three of its members can read that book at a time and everyone else either has to be patient or buy a copy and we all know how great the human race is at being patient. Now that actual physical scarcity no longer exists in the world of media, I&#8217;m not sure if there <em>is</em> a solution that doesn&#8217;t screw at least one of the interested parties (publisher, library, member). Either the publisher takes a loss because the library eliminates scarcity, the library takes the hit because publishers switch to some model where they feel like they get compensated for lost sales, or &#8211; as it is now &#8211; the member gets screwed because an archaic system is being used to create artificial scarcity.</p>
<p>The library conundrum aside, the fact is that once you &#8220;own&#8221; an ebook you have fewer rights than owning a physical book. You can&#8217;t lend books, for example, or if you can you can only lend them for short periods of time to other registered users. You can&#8217;t resell ebooks, or exchange them. You can&#8217;t do anything with them but read them (which is admittedly the primary purpose of a book, but nonetheless).</p>
<p>That said, I recently became a somewhat reluctant convert to the ebook.</p>
<p>There are a few salient points that have come into focus over the past year or so.</p>
<p>First, tablets make great ereaders. They don&#8217;t go for 28 hours of reading on a single charge, but they also have sharp color screens and are capable of doing a thousand other things. For $60 more than the aforementioned ad-free Kindle Paperwhite you can get a Nexus 7 that will blow it away on all fronts other than power usage and the mythical &#8220;I&#8217;m using my electronic device on the beach because I&#8217;m not afraid of sand or water&#8221; usecase. Oh yeah, and the screen is lit and the pages turn fast too. This observation hasn&#8217;t been lost on Amazon or Barnes and Noble either since they followed the release of the iPad with the Kindle Fire and Nook HD which are both full fledged tablets rather than ereaders.</p>
<p>Second, I started reading Terry Pratchett&#8217;s Discworld series and immediately fell in love. The series is <strong>40 books long</strong>. At a brick and mortar book store, new paperbacks of Discworld are $10 apiece. That&#8217;s roughly on par with Amazon (+ shipping). Doing the easy math, that&#8217;s $400 to assemble a collection of all the Discworld books, assuming that they&#8217;re all roughly the same price. Austin is a great town for used books too, but none of the various used book stores have a great number of Discworld books and none of them had any of the first four. In the end, to do used I&#8217;d have to go online where used copies range from $3 to $5 a pop so I&#8217;d have to spend let&#8217;s say $160 (+ shipping) and wait weeks to get the books from a variety of sellers that probably have no issues calling a coffee stained paperback &#8220;like new&#8221;. Alternatively, I could spend $5 a pop, get untarnished ebooks <em>instantly</em> and spend about half as much. For the $400 I&#8217;d spend on a complete collection I could get every ebook <em>and</em> buy a tablet to read them on. Economically both in time and money there&#8217;s no contest.</p>
<p>What about the library I was ranting about earlier? Well, the Austin Public Library only had the second Discworld novel (the one I was looking for at the time I made this decision) in <em>ebook form</em>. Some of the other Discworld novels are around, mostly the later ones, but not consistently and it seems like they&#8217;re almost all out of copies. For someone that can finish the comparatively short Discworld novels in two or three delicious sittings, the weeks of waiting in between books just isn&#8217;t going to work. There&#8217;s that artificial scarcity I mentioned working for the publisher.</p>
<p>Lastly, despite the fact that I value my rights as a consumer, it&#8217;s impossible to argue that the ebooks don&#8217;t have a lot of advantages. I bought <em>Mort</em>, the fourth Discworld novel, after I finished the third, <em>Equal Rites</em>. It was simple, instantaneous, and the ebook looks great. I can read the ebook anywhere (laptop, phone, tablet, random computers), there&#8217;s an in-reader dictionary lookup, I can change the font sizes and spacing. In short, there&#8217;s a lot more freedom in the acquisition of the books and the act of reading them which, considering I think I&#8217;ve lent out two or three books to friends in my entire life and virtually never resell recreational books, vastly outweighs the loss of rights to lend or resell them.</p>
<p>Now&#8230; if only I could get my tablet to smell like old paper&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2013/04/17/on-e-books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creativity In, Creativity Out</title>
		<link>http://blog.codezen.org/2013/02/11/creativity-in-creativity-out/</link>
		<comments>http://blog.codezen.org/2013/02/11/creativity-in-creativity-out/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 18:15:17 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=859</guid>
		<description><![CDATA[I have never wanted to write a novel as bad as when I was reading a good one. I have never wanted to code as much as when I&#8217;ve just discovered a brilliant piece of engineering. I have never wanted to throw down on canvas or clay than when I&#8217;ve watched an artist in fugue [...]]]></description>
				<content:encoded><![CDATA[<p>I have never wanted to write a novel as bad as when I was reading a good one. I have never wanted to code as much as when I&#8217;ve just discovered a brilliant piece of engineering. I have never wanted to throw down on canvas or clay than when I&#8217;ve watched an artist in fugue make masterpieces out of brute ingredients. Architecture, design, poetry, it&#8217;s all the same. I cannot help but relay admiration for craftsmanship into abstract effort.</p>
<p>This is the core difference between mastery and competence. A master can use art to inspire.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2013/02/11/creativity-in-creativity-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android App: Memoires</title>
		<link>http://blog.codezen.org/2013/01/30/android-app-memoires/</link>
		<comments>http://blog.codezen.org/2013/01/30/android-app-memoires/#comments</comments>
		<pubDate>Wed, 30 Jan 2013 20:45:27 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=845</guid>
		<description><![CDATA[I&#8217;ve journaled off an on for my entire life. It seems natural to me, but I never seem to get around to it as often as I should. I almost always think about journaling when there&#8217;s some great weight on my mind (like moving, switching jobs, Scarlett growing up, parents growing old &#8211; you know, [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve journaled off an on for my entire life. It seems natural to me, but I never seem to get around to it as often as I should. I almost always think about journaling when there&#8217;s some great weight on my mind (like moving, switching jobs, Scarlett growing up, parents growing old &#8211; you know, the classics) and these topics always require a lot of context, a lot of back and forth and I can never seem to hand write more than two pages before my hand begins to cramp. I guess it&#8217;s been too long since I&#8217;ve had to do written essays in school =).</p>
<p>So, in a flash of inspiration, I decided that I should look into <emph>audio</emph> journals. It&#8217;s so much easier to capture the spirit of what you&#8217;re conveying in words. You get all sorts of extra clues about the state of mind of the speaker. Most importantly, it&#8217;s easier to talk for half an hour and hash out your thoughts than it is to write pages and pages.</p>
<p>I wish I could say that I did an exhaustive audit of Android audio recording apps and made a conscious decision but this flash of inspiration I had came at 1:30 in the morning on a night when I had a lot on my mind so I found a well-reviewed app and &#8211; so far &#8211; it&#8217;s been awesome.</p>
<p><a href="https://play.google.com/store/apps/details?id=net.nakvic.dromoris&#038;feature=nav_result#?t=W251bGwsMSwyLDNd"><img src="http://blog.codezen.org/wp-content/uploads/2013/01/memoires.png" alt="Memoires Logo" width="124" height="124" class="aligncenter size-full wp-image-847" /></a></p>
<h3 id='Memoires'>Memoires</h3>
<p>The app in question is &#8220;Memoires: The Diary&#8221; written by Victor Nakonechny. The title seems a little pompous, is misspelled, and more than a little redundant, but it&#8217;s a really nice all purpose journal app. It&#8217;s free and it&#8217;s on the <a href="https://play.google.com/store/apps/details?id=net.nakvic.dromoris&#038;feature=nav_result#?t=W251bGwsMSwyLDNd">market</a>.</p>
<p>This is one solid app. You can keep audio snippets, pictures, and text in reverse chronological order. It amends each entry with the GPS location you made it in (which would be especially cool if you were traveling), the weather at the time, any tags you want, and of course the time and date. I can&#8217;t personally imagine writing a standard text journal with it, but that&#8217;s more because a phone&#8217;s keyboard is tedious for long entries &#8211; a tablet might make that a lot more feasible.</p>
<p>The best part is the app will occasionally prompt you to backup which is extremely important if you don&#8217;t want your journal to be reset by something stupid like phone failure, wipe, or thievery. I only tested the &#8220;backup to SD card&#8221; option because the other options seem less appropriate for a private, mostly audio journal but there are a lot of other options, like exporting to HTML, RTF, and various Google services. I decided to examine the .zip backup it created to make sure that it wasn&#8217;t in some stupid format that might disappear if Memoires ever becomes unmaintained or broken, etc. and I found that it was pretty straightforward: a SQLite 3 database, and a directory including the raw recordings I had made. In short, nothing that couldn&#8217;t be reconstructed if need be.</p>
<p>In addition to the backup settings, there are a number of other basic settings like a password &#8211; which immediately made me think of those flimsy diary locks I used to see as a kid. There are also themes and other appearance things (font size, etc.) that are just the icing on the cake.</p>
<p>All in all, I&#8217;ve been happy with it the few times I&#8217;ve had a reason to record in the last couple of weeks and I believe it deserves the high rating it gets on Google Play. If audio journaling is something that interests you, I&#8217;d highly recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2013/01/30/android-app-memoires/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Roguelike Generators</title>
		<link>http://blog.codezen.org/2013/01/23/fun-with-roguelike-generators/</link>
		<comments>http://blog.codezen.org/2013/01/23/fun-with-roguelike-generators/#comments</comments>
		<pubDate>Wed, 23 Jan 2013 23:02:36 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[gaming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=796</guid>
		<description><![CDATA[I may or may not be tooling around with a roguelike. Not because I think the genre is dead (it most certainly isn&#8217;t) but because some programming tasks are made fun just by their subject matter. I haven&#8217;t quite gotten to the point where I&#8217;m using &#8220;mana&#8221; and &#8220;damage&#8221; and etc. as variable names, but [...]]]></description>
				<content:encoded><![CDATA[<p>I may or may not be tooling around with a roguelike. Not because I think the genre is dead (it most certainly isn&#8217;t) but because some programming tasks are made fun just by their subject matter. I haven&#8217;t quite gotten to the point where I&#8217;m using &#8220;mana&#8221; and &#8220;damage&#8221; and etc. as variable names, but that&#8217;s not the first fun part. The first fun part is generating a rogue dungeon level.</p>
<p>Now, anybody that&#8217;s ever even thought about developing a roguelike should know about <a href="http://roguelikedeveloper.blogspot.com/">ASCII Dreams</a> written by the developer of Unangband, Andrew Doull. I especially found his series on <a href="http://roguelikedeveloper.blogspot.com/2007/11/unangband-dungeon-generation-part-one.html">Unangband Dungeon Generation</a> to provide a lot of insight into generating dungeons that are interesting a long with a lot of interesting history and philosophizing.</p>
<p>In the end, though, I wanted to try my own, naive, hand at the dungeon generation problem. I did take a few major things away from Andrew&#8217;s discussion however. Mostly that there are a lot of nice rooms that can be generating procedurally with simple tricks and, failing that, having a system for &#8220;vaults&#8221; (which are various, hand-designed rooms with interesting features) can be interspersed for extra flavor. Also, various features added to rooms, like water, lava, ice, minerals, rubble, etc. compel players to explore.</p>
<p>Most of this I&#8217;ll get to later, if ever, with my toy generator. The first problem is generating the topology of the dungeon itself.</p>
<h3 id='My-Approach'>My Approach</h3>
<p>Now, one thing that I&#8217;ve found annoying about classic generation algorithms is that they tend to have a lot of really long tunnels. This is because rooms are generated at random across the static map and then, if they haven&#8217;t merged together, are connected by tunnels. This has never felt right to me. I understand that &#8211; in universe &#8211; a dungeon might not have the most sensible design, but having long winding tunnels are boring. Doing connectivity checks on the rooms is boring as well. While we&#8217;re at it, I don&#8217;t want to have a predefined playing field (array) to work with. I&#8217;ll put a limit on the area of the dungeon level, but if it&#8217;s a whole bunch of tiny rooms in a very long line, so be it. Unfortunately, I also want the level to be consistent (i.e. no physics violating overlapping inconsistent geometry) so it seems inevitable that the level will eventually be represented on a global grid, but at least that grid will be bounded and reasonably shaped to the level. If necessary, after the level is fully generated the excess grid could be eliminated just by noting where one room enters into another.</p>
<p>So, what I wanted to do was generate a dungeon level that is both tunnel free (for the most part), consistent and connected a priori. Interesting stuff like themed-features, rivers, lava flows, etc. could then be painted over the level geometry in broad strokes.</p>
<h3 id='Problems-vs-Classical'>Problems vs. Classical</h3>
<p>There are some troubles with this approach. The first of which is that it makes multiple level consistency really hard with multiple staircases. For a classical generator, you can randomly place down staircases on one level, and then replicate that pattern with up staircases on the next level and ensure that you have rooms to encompass them. This works when you&#8217;re going to manually connect all the rooms in the end, but it doesn&#8217;t work so well when you&#8217;re building a pre-connected level. As such, either there has to be only a single up and down staircase per level (not a bad idea, really) or you have to throw that level of consistency out the window and just match arbitrary up and down staircases. This means that you could have two down staircases right next to each other that would teleport you to different ends of the next level, but in a gametype that traditionally promotes save scumming (i.e. if you go down the same staircase twice, the level is different each time you descend) I think that&#8217;s acceptable.</p>
<p>Another problem is that, without tunnels, the dungeons are more likely to be dense. That&#8217;s a good thing in the fact that it gives a lot more interesting rooms close by and the player spends a lot of time in an environment. It&#8217;s also a dangerous thing because it means there&#8217;s a lot fewer twisty places to get out of sight of pursuing monsters. I think that&#8217;s acceptable as well, although it&#8217;ll be something to account for if I ever get around to generating monsters.</p>
<h3 id='Implementation'>Implementation</h3>
<p>I decided to bang out a proof of concept in an evening. Breaking down the logic, the easiest way to generate in this fashion is to generate one room, which will be the root. Then, generate another room. Connect these two rooms with a doorway, then that whole complex becomes the root &#8220;room&#8221;. Rinse and repeat until the dungeon is of a certain size.</p>
<p>In order to encompass this, I came up with a class for <code>Space</code>. A Space is any arbitrary portion of the dungeon level. It includes a 2-dimensional array <code>geometry</code> that describes what&#8217;s in that space. One Space&#8217;s geometry can be added to another Space&#8217;s geometry with a set overlapping point. A <code>Room</code> is just a space with a name and whose geometry is likely a single room, but is arbitrary. Then, special types of rooms, like one mentioned in Unangband as the core type, two overlapping rectangles (which results in single rooms, crosses, T-shapes, L-shapes, etc.) are just Rooms with special geometry generation.</p>
<span class="collapseomatic " id="id7922"  title="Expand Code">Expand Code</span><div id="target-id7922" class="collapseomatic_content "></p>
<pre>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/python

import random
import sys

def chance(c):
    if random.randint(1, 100) &lt;= c:
        return True
    return False

def rand_element(l):
    return l[random.randint(0, len(l) - 1)]

def rand_block(max_x, max_y):
    return (random.randint(0, max_x), random.randint(0, max_y))

class Space(object):
    def __init__(self, geom = []):
        self.global_x = 0
        self.global_y = 0
        self.geometry = geom

    def point(self, x, y):
        return (self.global_x + x, self.global_y + y)

    def adjust_x(self, x):
        self.global_x = x

    def adjust_y(self, y):
        self.global_y = y

    def area(self):
        area = 0
        for row in self.geometry:
            for x in row:
                if x:
                    area += 1
        return area

    # Create an initialized array for a space with dimensions.  we can't just do
    # [[0] * x] * y because then the sublists are all just instances of the same
    # list.

    def space(self, x, y, val = 0):
        geom = []
        for y in range(0, y):
            geom.append([val] * x)
        return Space(geom)

    # Add space takes two arbitrary spaces and merges together, using points
    # s1p and s2p as the same points in the resulting form.

    # If kwargs[&quot;chicken&quot;] is True, it will return False (i.e. fail), if any of s1's
    # points are overwritten by s2 except for the intersection point.

    def add_space(self, sq, s1p, s2p, **kwargs):

        chicken = False
        if &quot;chicken&quot; in kwargs and kwargs[&quot;chicken&quot;]:
            chicken = True

        s1 = self.geometry
        s2 = sq.geometry

        s1_dim_y = len(s1)
        s1_dim_x = len(s1[0])

        s1_o_x, s1_o_y = s1p

        s2_dim_y = len(s2)
        s2_dim_x = len(s2[0])

        s2_o_x, s2_o_y = s2p

        g_max_x = s1_dim_x

        # Account for s2's width going farther to left
        if (s1_o_x &lt; s2_o_x):
            s1_start_x = (s2_o_x - s1_o_x)
            s2_start_x = 0
            g_max_x += s1_start_x
        else:
            s1_start_x = 0
            s2_start_x = (s1_o_x - s2_o_x)

        # Account for s2's width going farther to right
        if ((s1_dim_x - s1_o_x) &lt; (s2_dim_x - s2_o_x)):
            g_max_x += (s2_dim_x - s2_o_x) - (s1_dim_x - s1_o_x)

        g_max_y = s1_dim_y

        # Account for s2's height going higher
        if (s1_o_y &lt; s2_o_y):
            s1_start_y = (s2_o_y - s1_o_y)
            g_max_y += s1_start_y
            s2_start_y = 0
        else:
            s1_start_y = 0
            s2_start_y = (s1_o_y - s2_o_y)

        # Account for s2's depth going lower
        if ((s1_dim_y - s1_o_y) &lt; (s2_dim_y - s2_o_y)):
            g_max_y += (s2_dim_y - s2_o_y) - (s1_dim_y - s1_o_y)

        geom = self.space(g_max_x, g_max_y)

        # Draw both into geometry:

        for y in range(0, s1_dim_y):
            for x in range(0, s1_dim_x):
                geom.geometry[y + s1_start_y][x + s1_start_x] = s1[y][x]

        for y in range(0, s2_dim_y):
            for x in range(0, s2_dim_x):
                if s2[y][x]:
                    if chicken and (x, y) != s2p and\
                            geom.geometry[y + s2_start_y][x + s2_start_x]:
                        return False
                    geom.geometry[y + s2_start_y][x + s2_start_x] = s2[y][x]

        self.adjust_x(s1_start_x)
        sq.adjust_x(s2_start_x)

        self.adjust_y(s1_start_y)
        sq.adjust_y(s2_start_y)

        self.geometry = geom.geometry
        return True

    # Sort out surrounding used and unused coordinates.

    def _cardinal_sort(self, x, y):
        unused = []
        used = []
        pairs = [(-1, 0, 0),(0, -1, 3),(0, 1, 1),(1, 0, 2)]

        for off_y, off_x, direction in pairs:
            b = (x + off_x, y + off_y, direction)
            # Count out of bounds as unused.
            if (y + off_y) &lt; 0 or\
               (y + off_y) &gt;= len(self.geometry) or\
               (x + off_x) &lt; 0 or\
               (x + off_x) &gt;= len(self.geometry[y + off_y]) or\
               self.geometry[y + off_y][x + off_x] == 0:
                unused.append(b)
            else:
                used.append(b)

        return (used, unused)

    # Return a list of coordinates of used squares that have at least one
    # unused square (four-way) adjacent that, if used, would have no other used
    # neighbors but the first one. So, in summary

    # 1|
    # 2| &lt;- all perimeter blocks
    # 3|
    #
    # 1|_  &lt;-- neither are perimeter blocks
    #   2

    # The intent here is to find blocks where it's appropriate to attach a
    # doorway. For now, this only list blocks that are pressing against the
    # outside boundary of the geometry. There are some neat cases that could be
    # generated with finer granularity, but I'm not sure if that's better done
    # with specific generators.

    def connectable_coords(self):
        r = []
        for i, y in enumerate(self.geometry):
            for j, x in enumerate(y):

                # Skip unused blocks
                if not x:
                    continue

                used, unused = self._cardinal_sort(j, i)
                for s_x, s_y, s_d in unused:
                    sub_used, sub_unused = self._cardinal_sort(s_x, s_y)
                    if len(sub_used) == 1:
                        r.append((j, i, s_d))
        return r

    def print_geom(self):
        for row in self.geometry:
            p = &quot;&quot;
            for x in row:
                if x:
                    p += (&quot;%s&quot; % (chr(x),))
                else:
                    p += &quot; &quot;
            print(p)

    def gen(self):
        pass


class Room(Space):
    def __init__(self):
        Space.__init__(self)
        self.name = &quot;&quot;

        self.name_prefixes = [ &quot;Beautiful&quot;, &quot;Evil&quot;, &quot;Corrupted&quot;, &quot;Pristine&quot; ]
        self.name_suffixes = [ &quot;of Doom&quot;, &quot;of Dancing&quot;, &quot;of Flowers&quot;, &quot;of Blood&quot; ]
        self.name_bases = [ &quot;Room&quot; ]

        self.name_prefix_chance = 25
        self.name_suffix_chance = 25
        
    def give_name(self):
        n = &quot;&quot;
        if chance(self.name_prefix_chance):
            n += rand_element(self.name_prefixes) + &quot; &quot;
        n += rand_element(self.name_bases)
        if chance(self.name_suffix_chance):
            n += &quot; &quot; + rand_element(self.name_suffixes)
        self.name = n

    def gen(self):
        self.give_name()

class SimpleRoom(Room):
    def gen(self, x, y, val):
        Room.gen(self)
        self.geometry = self.space(x, y, val).geometry

class SimpleAdditiveRoom(Room):
    def gen(self, min_x, max_x, min_y, max_y, val):
        Room.gen(self)

        # Get section 1 dimensions
        r1_dim_x = random.randint(min_x, max_x)
        r1_dim_y = random.randint(min_y, max_y)

        # Section 2 dimensions
        r2_dim_x = random.randint(min_x, max_x)
        r2_dim_y = random.randint(min_y, max_y)

        # Random overlapping points
        r1p = rand_block(r1_dim_x, r1_dim_y)
        r2p = rand_block(r2_dim_x, r2_dim_y)

        r1 = self.space(r1_dim_x, r1_dim_y, val)
        r2 = self.space(r2_dim_x, r2_dim_y, val)

        self.geometry = r1.geometry
        self.add_space(r2, r1p, r2p)

class Hallway(Space):
    def gen(self, x, y, val):
        Space.gen(self)
        self.geometry = self.space(x, y, val).geometry

if __name__ == &quot;__main__&quot;:
    root = SimpleAdditiveRoom()
    root.gen(3, 10, 3, 10, ord('A'))

    val = ord('B')

    while root.area() &lt; 2000:
        sr2 = SimpleAdditiveRoom()
        sr2.gen(3, 10, 3, 10, val)

        c1 = rand_element(root.connectable_coords())

        m = [ 2, 3, 0, 1 ]  
        c2 = rand_element([ x for x in sr2.connectable_coords() if x[2] == m[c1[2]]])

        hall = Hallway()

        if c1[2] == 0:
            hall.gen(1, 3, ord('+'))
            hall.add_space(root, hall.point(0,2), c1[:2])
            r = hall.add_space(sr2, hall.point(0,0), c2[:2], chicken = True)
        elif c1[2] == 2:
            hall.gen(1, 3, ord('+'))
            hall.add_space(root, hall.point(0,0), c1[:2])
            r = hall.add_space(sr2, hall.point(0,2), c2[:2], chicken = True)
        elif c1[2] == 1:
            hall.gen(3, 1, ord('+'))
            hall.add_space(root, hall.point(0,0), c1[:2])
            r = hall.add_space(sr2, hall.point(2,0), c2[:2], chicken = True)
        elif c1[2] == 3:
            hall.gen(3, 1, ord('+'))
            hall.add_space(root, hall.point(2,0), c1[:2])
            r = hall.add_space(sr2, hall.point(0,0), c2[:2], chicken = True)

        if r:
            root = hall
            val += 1

    root.print_geom()
</pre>
<p></div>
<p>I got a little lazy with the execution of <code>__main__</code>. There&#8217;s a cleaner way to deal with matching up the direction end-points (hell, just take a random one and rotate the entire room to match, really) but for an evening&#8217;s playing around I think the results are actually pretty nice.</p>
<span class="collapseomatic " id="id6391"  title="Expand Example">Expand Example</span><div id="target-id6391" class="collapseomatic_content "></p>
<pre>

        ]]]]]]                                                           
        ]]]]]]                                                           
        ]]]]]]]]]]]                                                      
        ]]]]]]]]]]]                                                      
        ]]]]]]]]]]]                                                      
        ]]]]]]]]]]]                                                      
        ]]]]]]]]]]]                                                      
        ]]]]]]]]]]]          UUUUUUUU                                    
        ]]]]]]               UUUUUUUU                                    
          +                UUUUUUUUUU                                    
         ZZZZ              UUUUUUUUUU                                    
         ZZZZ              UUUUUUUUUU                                    
         ZZZZ              UUUUUUUUUU                                    
         ZZZZ                UUUUUUUU MMMMMMMMM                          
         ZZZZZZZZ            UUUUUUUU+MMMMMMMMM                          
         ZZZZZZZZ            UUUUUUUU MMMMMMMMM                          
         ZZZZZZZZ            UUUUUUUU MMMMMMMMM                          
         ZZZZZZZZ                        MMMMMM                          
         ZZZZZZZZ                        MMMMMM                          
         ZZZZZZZZ                JJJJJJJ MMMMMM                          
         ZZZZZZZZ                JJJJJJJ MMMMMM                          
            +                    JJJJJJJ  +                              
          WWWWWWW                JJJJJJJJJJJJJJ                          
          WWWWWWWWWW NNNNNN      JJJJJJJJJJJJJJ                          
          WWWWWWWWWW NNNNNN      JJJJJJJJJJJJJJ                          
          WWWWWWWWWW+NNNNNN      JJJJJJJJJJJJJJ                          
          WWWWWWWWWW NNNNNN       +                                      
          WWWWWWWWWW NNNNNNBBBBBBBB                                      
          WWWWWWWWWW NNNNNNBBBBBBBBBB                                    
          WWWWWWWWWW NNNNNNBBBBBBBBBB                                    
             WWWWWWW  NNNN BBBBBBBBBB                                    
             WWWWWWW  NNNN BBBBBBBBBB                                    
            OOOOOOOOOONNNN       BBBB                                    
            OOOOOOOOOO   +       BBBB                                    
            OOOOOOOOOO FFFFFFF   BBBB                                    
            OOOOOOOOOO FFFFFFF   BBBB                                    
            OOOOOOOOOO FFFFFFF    +                                      
            OOOOOOOOOO FFFFFFF AAAAAAAAAAA                               
            OOOOOOOOOO FFFFFFF+AAAAAAAAAAA                               
            OOOOOOOOOO FFFFFFF AAAAAAAAAAA                               
            OOOOOOOOOO FFFFFFF AAAAA                                     
            OOOOOOOOOO+FFFFFFF AAAAA          PPPPPPPPP                  
             OOOOO     FFFFFFF AAAAA          PPPPPPPPP                  
             OOOOO LLL FFFFFFF AAAAA          PPPPPPPPP TTTT             
                   LLL +         +            PPPPPPPPP TTTT             
                  LLLLLLL        CCCCC        PPPPPPPPP+TTTT             
                  LLLLLLL        CCCCC        PPPP   +  TTTTT            
                  LLLLLLL        CCCCC      HHHHHHHHHH  TTTTT            
     [[[[[[[[[                   CCCCCCCCCC HHHHHHHHHH  TTTTT  XXXXXXXXXX
     [[[[[[[[[                   CCCCCCCCCC HHHHHHHHHHHHTTTTT XXXXXXXXXXX
     [[[[[[[[[ GGGGGGGGGG        CCCCCCCCCC HHHHHHHHHHHHTTTTT+XXXXXXXXXXX
     [[[[[[[[[ GGGGGGGGGG  EEEEE+CCCCCCCCCC HHHHHHHHHHHH      XXXXXXXXXX 
     [[[[[[[[[ GGGGGGGGGG  EEEEE CCCCCCCCCC+HHHHHHHHHH        XXXXXXXXXX 
     [[[[[[[[[ GGGGGGGGGG EEEEEE CCCCCCCCCC                   XXXXXXXXXX 
     [[[[[[[[[+GGGGGGGGGG EEEEEE CCCCCCCCCC                   XXXXXXXXXX 
   [[[[[[[[[[[ GGGGGGGGGG EEEEEE     +                        XXXXXXXXXX 
   [[[[[[[[[[[ GGGGGGGGGG EEE       DDD                                  
   [[[[[[[[[[[ GGGGGGGGGG+EEE       DDD                                  
   [[[[[[[[    GGGGGGGGGG EEE   III DDD                                  
   [[[[[[[[    GGGGGGGGGG EEE  IIII DDD                                  
   [[[[[[[[         +     EEE  IIII DDD                                  
   [[[[[[[[         KKK   EEE  IIII DDD                                  
                    KKK        IIII DDD                                  
                    KKK        IIII+DDDQQQQ                              
                    KKK        IIII QQQQQQQQQQ                           
                 KKKKKKK       IIII+QQQQQQQQQQ                           
                 KKKKKKK       IIII QQQQQQQQQQ                           
                 KKKKKKK       IIII QQQQQQQQQQ                           
                 KKKKKKK                    +                            
                 KKKKKKK                    SSS                          
\\\\\\\\\        KKKKKKK                SSSSSSSS                         
\\\\\\\\\        KKKKKKK                SSSSSSSS                         
\\\\\\\\\        KKKKKKK                SSSSSSSS                         
\\\\\\\\\        KKKKKKK                SSSSSSSS                         
\\\\\\\\\\\\\\   KKKKKKK                SSSSSSSS                         
\\\\\\\\\\\\\\     +                    SSSSSSSS                         
\\\\\\\\\\\\\\RRRRRRRRR                 SSSSSSSS                         
      \\\\\\\\RRRRRRRRR                     SSS                          
      \\\\\\\\RRRRRRRRR                                                  
      \\\\\\\\RRRRRRRRR                                                  
         +    RRRRRRRRR                                                  
        VVVVV RRRRRRRRR                                                  
      VVVVVVV RRRRRRRRR                                                  
      VVVVVVV+RRRRRRRRR                                                  
      VVVVVVV RRRRRRRRR                                                  
            + RRRRRRRRR                                                  
          YYYYY                                                          
          YYYYY                                                          
          YYYYY                                                          
          YYYYY                                                          
     YYYYYYYYYY                                                          
     YYYYYYYYYY                                                          
     YYYYYYYYYY                                                          
     YYYYYYYYYY                                               
</pre>
<p></div>
<p>Not many long tunnels, and a large number of rooms (which are indicated by different letters. Doorways are +s. There are still, of course, some places the geometry doesn't make sense. Usually when two joined rooms have a doorway and also have adjacent open blocks (like P and H in the above). However, all in all, not bad for an evening's screwing around.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2013/01/23/fun-with-roguelike-generators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the Steam Box</title>
		<link>http://blog.codezen.org/2012/12/11/on-the-steam-box/</link>
		<comments>http://blog.codezen.org/2012/12/11/on-the-steam-box/#comments</comments>
		<pubDate>Tue, 11 Dec 2012 08:52:13 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[gaming]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=774</guid>
		<description><![CDATA[The Steam Box has been making the news lately, most recently with a confirmation from the venerable Gabe that it&#8217;s a thing that may exist in our plane of reality. There&#8217;s also been a lot of talk lately about the Steam Linux beta (that I got in to, hooray!) and the release of Steam&#8217;s Big [...]]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://www.cnet.com.au/gabe-newell-says-steam-box-is-a-go-339342744.htm">Steam Box</a> has been making the news lately, most recently with a confirmation from the venerable Gabe that it&#8217;s a thing that may exist in our plane of reality. There&#8217;s also been a lot of talk lately about the Steam Linux beta (that I got in to, hooray!) and the release of Steam&#8217;s Big Picture which is a console like controller interface intended for big screens (i.e. TVs).</p>
<p>Because of the timing, a lot of these Steam Box announcements, and a lot of the buzz around it has been that this box will run Linux. As such, in the gaming community there&#8217;s a lot of &#8220;whoa, Linux&#8230; what does that mean for us?&#8221; and in the Linux community there&#8217;s a lot of &#8220;finally Linux games!&#8221; I love Steam, I own a handful of titles in it, and I&#8217;m extremely pleased that they&#8217;ve put out a native Linux client (even in beta form). However, I am totally unconvinced that this is going to be a Linux based Steam machine, despite the timing. Here&#8217;s my logic.</p>
<div id='toc'>
<ul><li><a href="#Why-Not-Linux">Why Not Linux?</a></li>
<li><a href="#Why-I-Could-Be-And-Hope-I-Am-Wrong">Why I Could Be (And Hope I Am) Wrong</a></li>
<li><a href="#tldr">tl;dr</a></li>
</ul></li></ul>
</div>
<h3 id='Why-Not-Linux'>Why Not Linux?</h3>
<p>I think that it&#8217;s likely that a Valve console would take advantage of the huge Steam library. They&#8217;ve put almost a decade of effort into turning Steam into a slick, painless, even fun experience and they&#8217;ve sold millions of games. Steam is now a big release platform for a lot of AAA publishers (Bethesda, id, Eidos, Firaxis, Gearbox, etc.) as well as a load of indie publishers that wouldn&#8217;t have found nearly the following if it wasn&#8217;t as painless to find out about them and pay them.</p>
<p>It seems to me that Valve would be making a huge mistake if they&#8217;re not parlaying that massive, successful library directly into their prospective console. Bringing a handful of AAA launch titles into your living room on day one makes the Steam Box just another console that differentiates itself with maybe a handful of Valve exclusives (Half-life 3, anybody?). Bringing 2000 mature, well-loved and <em>already purchased</em> games into your living room with a cheap box and promising all the future PC releases would be <em>killer</em>. In addition, a Steam Box that was just a Windows machine with a slick interface would suddenly become the defacto PC spec &#8211; solving an issue that game devs have struggled with since the very beginning of PC gaming, namely how to deal with the thousands of different hardware and resource configurations. Finally, it would have the added benefit that literally any game that runs on Windows would effectively work out of the box (perhaps with a little tweaking for the spec, or any novel input devices, but without the pain of a full port).</p>
<p>There is a whole lot of greatness in bringing a cheap, well configured and standardized PC into the living room with a giant library of already working and popular games.</p>
<p>Unfortunately, with a Linux based OS on it, this is impossible. Valve titles would be ported, of course (and in fact that seems like it will happen regardless thanks to the Steam Linux beta) and a fair number of indie games already have ports, but what about the library titles that would strengthen a console release? How many developers can Valve convince into doing a free port of an older game? I believe the answer is very few because for most of these old games there&#8217;s no profit in it. Technology like Wine could be used, but if your focus is on solid gaming experience that&#8217;s a whole new set of problems. As such, using a Linux based OS would almost completely obviate the advantage of the Steam library.</p>
<h3 id='Why-I-Could-Be-And-Hope-I-Am-Wrong'>Why I Could Be (And Hope I Am) Wrong</h3>
<p>First of all, perhaps I&#8217;m overstating the likelihood of the Steam library coming to the living room. A lot of the older, unportable games would not be controller friendly and if they&#8217;re aiming for a more traditional controller oriented approach (instead of controller, mouse, and keyboard) they&#8217;d be worthless and hard to play even if they ran perfectly. Not to mention the fact that, by definition, the entire existing library already runs elsewhere which doesn&#8217;t really give the Steam Box any draw over a gaming PC except perhaps to those without the cash for an expensive pre-built or the know-how to build their own.</p>
<p>In essence, maybe losing compatibility wouldn&#8217;t be the worst thing in the world and if that&#8217;s the case Linux starts making a whole lot more sense. You get a very mature stack from kernel through display and because you&#8217;re targeting a single hardware configuration you can create a stable, well-tested release on top of open source components fairly easily. Compared to the amount of time it would take to custom develop the entire stack, the bugfixing would take a trivial amount of time and effort.</p>
<p>Second, Linux is free as in freedom. What other console developer would be able to glean fixes and features from unpaid volunteers?</p>
<p>Third, Linux is free as in beer. A Steam library compatible approach would have to come packaged with a Windows license which easily adds $100 to the unsubsidized price tag of the device. Ideally, if they chose to go this route, they could get a deal from Microsoft. The Dreamcast, for example, ran a version of WinCE developed by Microsoft that was seamless. That was before the Xbox hit the scene however and I highly doubt Microsoft would be so amenable these days. On the other hand, if the alternative is to have a Linux box running AAA games, they might be better served by giving Valve a deal to maintain their edge in the desktop space. Either way, though the box becomes more expensive and they lose the advantage of the open source stack.</p>
<p>The final, and best fact for the possibility of Linux on the console is that, if they chose to ignore compatibility, and went the more traditional console route with a release in 2014 / 2015, they&#8217;d have plenty of time to rally support for Linux titles, get the already existing Linux ports lined up and polished, and &#8211; in the end &#8211; come to the table with a more extensive library than any of the competitors.</p>
<h3 id='tldr'>tl;dr</h3>
<table>
<tr>
<td>Base</td>
<td>PROS</td>
<td>CONS</td>
</tr>
<tr>
<td>Windows</td>
<td>
<ul>
<li>Massive Steam library already polished and working</li>
<li>Easy to productize fast</li>
<li>Already mature</li>
<p>.
</ul>
</td>
<td>
<ul>
<li>Take a price hit on licensing / packaging Windows</li>
<li>Less fine grain control of software stack</li>
</ul>
</tr>
<tr>
<td>Linux</td>
<td>
<ul>
<li>Free (as in beer) &#8211; lower end price</li>
<li>Open source &#8211; get fixes from volunteers</li>
<li>Already mature</li>
</ul>
</td>
<td>
<ul>
<li>Not many existing ports in the catalog</li>
<li>Brand new platform without much industry expertise</li>
</ul>
</td>
</tr>
</table>
<p>I&#8217;m still not convinced that this isn&#8217;t going to end up being Valve&#8217;s effort to further monetize their work on the existing Steam library, but if they are willing to start a serious console from scratch then Linux is cleary the way to go. None of the information we already know about the device seems to indicate which approach Valve is favoring and as such I think it&#8217;s premature to make assumptions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2012/12/11/on-the-steam-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Intermediate Dwarf Fortress</title>
		<link>http://blog.codezen.org/2012/11/25/on-intermediate-dwarf-fortress/</link>
		<comments>http://blog.codezen.org/2012/11/25/on-intermediate-dwarf-fortress/#comments</comments>
		<pubDate>Sun, 25 Nov 2012 19:59:24 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[gaming]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=765</guid>
		<description><![CDATA[I&#8217;ve been playing Dwarf Fortress a lot these days, after a hiatus and I finally managed to get my first Barony (i.e. a stable fortress that&#8217;s got enough imports, exports, and population to get a noble &#8211; the first step to a monarchy). This fortress is about five years old, which is a feat in [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been playing Dwarf Fortress a lot these days, after a hiatus and I finally managed to get my first Barony (i.e. a stable fortress that&#8217;s got enough imports, exports, and population to get a noble &#8211; the first step to a monarchy). This fortress is about five years old, which is a feat in and of itself, but it&#8217;s survived four good sieges, a minotaur attack and initially I thought it was cursed and doomed to be a failure (I had a failed strange mood dwarf turn out to be a vampire that went berserk and lost 5 dwarves and damn near tantrum spiralling the remaining 10 and then had some migrants show up pissed off and some dwarven babies die mysteriously and a vampire fishery worker that got elected mayor&#8230; I could go on).</p>
<p>I thought I&#8217;d take advantage of this milestone to write a few things that I&#8217;ve realized in my last year or two of Dwarf Fortress that may not be obvious to even players that have been at it for while and had their share of FUN. As such I won&#8217;t be covering basics like food production or embark, but leaning more toward intermediate strategy and surprises.</p>
<p>The first tidbit I have is that <strong>Dwarf Fortress is all about supply</strong>. Half of your game is spent supplying masons with stone, smelters with ore, forges with bars, food, fuel, water, furniture. You have to look at optimizing the speed at which your supply chains work in order to avoid getting bogged down.</p>
<p>This starts with specialization. First, of the stockpile. General stockpiles have their uses (like keeping all of your workshops uncluttered), but general stone stockpiles will get choked quickly. Even general metal ore stockpiles will get bogged down in tetrahedrite and galena. You need to specialize them even more. For example, getting steel production started. You&#8217;re going to need to smelt quite a bit, first iron, then pig iron, then steel. The stockpile around your smelters then should allow just your most common iron ore (i.e. magnetite), and bars of pig iron and iron. Nothing else. If you are going to switch from steel to copper (say to bash out a bunch of copper bolts or bins) then either start a new smelter/stockpile, or change the stockpile settings and mark everything currently in it for dumping.</p>
<p>Why does this make such a difference? Because &#8211; especially with the 0.34 hauling changes &#8211; you want your haulers to do the hauling and your artisans to do the crafting. If the stockpiles around your workshops are inefficiently loaded, you&#8217;ve got your legendary armorer walking up ten flights of stairs and hauling materials back to his shop to get his task done when any idle Urist getting drunk in the hall can do it. Higher skilled workers craft way faster than novices, but if they&#8217;re wasting their time hauling it doesn&#8217;t matter at all.</p>
<p>Which brings me to the other specialization: of workers. The higher skill a worker the better their output and the faster they produce it. A legendary artisan, mason, smith, carpenter can blink through a full order of items in no time and they&#8217;ll be great quality. Once you&#8217;ve reached that level, you&#8217;re pretty much no longer bound by how fast you can produce the items, but how fast you can supply the craftsman with materials. By ensuring that you&#8217;re always focusing on leveling a single dwarf, you&#8217;ll reach that point faster than if you throw 10 novice dwarves at it. You take a hit initially (if you&#8217;re unlucky and don&#8217;t get a decent migrant for the job) but after that single dwarf you drafted gains a few levels, he&#8217;ll be moving much faster than the handful of dwarves with less experience would be.</p>
<p>Unfortunately, the basic UI makes this a huge pain in the ass. There&#8217;s no good way to get a decent overview of the skills of your fortress and as such it&#8217;s too easy to have high level crafters languishing as novices in other fields. As such, I recommend Dwarf Therapist for anyone that wants to have any level of control over their dwarves (and yes, it works on Linux). With Dwarf Therapist when I get a migrant wave, I group by squad (so I can use the &#8220;no squad&#8221; group) and then sort by skill in each labor ensuring that I have the highest dwarf in each skill assigned and only one or two related skills enabled at a time. For example, I usually only have one or two masons and now, five years in, both of them are &#8220;accomplished&#8221; (level 10) and they can build walls, bridges, coffins, etc. as fast as I can get them stone. My single legendary + 3 carpenter can make a new brace of 30 beds in no time. My single weaponsmith is also &#8220;accomplished&#8221; and I started him from nothing &#8211; he&#8217;s just made literally every weapon and bolt ever produced at the fortress (arming military, hunters, weapon traps, some trade orders). In short <strong>throwing dwarves at the problem is almost never the answer</strong>.</p>
<p>That said, some labors &#8211; like stone smoothing or woodcutting &#8211; respond well to having dwarves thrown at them because they are no supply (or one-time supply) and have no workshop. This is why I have 4 wood cutters and 8 detailers (5 of which are legendary).</p>
<p>With this knowledge in hand, I&#8217;ve gone from having a massive list of managed jobs that seemed to take forever, to having short bursts of jobs that disappear quickly and it&#8217;s made all of the difference not only to my fortress but to my frustration level. I lost many a fortress to not being able to get weapons or ammo out fast enough, or produce coffins, beds, etc.</p>
<p>The next bit of knowledge is that <strong>the manager isn&#8217;t perfect</strong>. Playing DF would really suck without the ability to manage jobs on a higher level than the workshop and the manager does a good job of providing that interface. I almost always have a standing meal and brew order and it&#8217;s great for handling bedrooms (queuing beds, rock cabinets, rock doors) and smelting wouldn&#8217;t be nearly as painless without it.</p>
<p>However, the longer than chain of actions, the worse the manager performs. I used to draft a half-squad, then queue up a huge amount of jobs for iron then steel, then crafting weapons, armor, and leather clothing. The problem is that the forge jobs get queued at the same time as smelter jobs so that even though you list the squad&#8217;s weapons as top priority, those jobs are getting cancelled constantly until you&#8217;ve got the supplies to complete them. The result is the first random job that&#8217;s queued and has materials gets done so that even though you clearly gave the weapons top billing, you could get a squad that has two weapons, four breastplates, one gauntlet and a mail shirt when you could&#8217;ve had them all at least armed and training with the same amount of metal and time.</p>
<p>There are two ways to deal with this. The first is that you queue up chunks of tasks. For example, queueing the fuel creation jobs and waiting, then the smelting jobs, and waiting, then the actual jobs you want done. This works, and because it takes advantage of the manager&#8217;s ability to track the items and notify you on completion, it&#8217;s the best for large tasks (like outfitting a squad).</p>
<p>The second way is to take manual control of part of the process. The manager blindly queues jobs up in a sort of round-robin manner between workshops, but it will never cancel jobs unless the overall task has been cancelled. That means, if you need something made quickly it&#8217;s often better to just go to the workshop, cancel the inactive manager tasks, and insert your own. The manager won&#8217;t override you, you don&#8217;t have to wait for them to validate the job, and you don&#8217;t have to wait for the already queued jobs at the workshop to be completed. This is best for on the fly jobs, like creating more bolts in the middle of a siege, or anything else you want to rush to the front of the line.</p>
<p>Another tidbit is that <strong>the military is never enough</strong>. Military dwarves are great because they can become mobile killing machines capable of putting down sieges like no other. That takes a long time though, and a lot of hard experience. Even getting decent marksdwarves takes quite awhile even though you can get pretty experienced hunters. In the meantime, it&#8217;s perfectly possible to bottle up your fortress &#8211; but being forbidden from the surface means your pastures are destroyed, you have no access to huge amounts of trees, or fish (unless you had enough time to get them underground), or hunted meat. Traders will get slaughtered, diplomats leave unhappy. No, you need to be able to capture or kill an onslaught outright.</p>
<p>Personally, I like a two story entry way, with a trap hallway and entrance on the first level, and open space on the second level with fortifications bordering one side. The entrances and fortifications are all behind bridges that can be raised and the whole entry way can then be flooded. This way I can bite off a certain number of invaders by toggling the entrance bridges, deal with them (cage and pit, eviscerate, headshot from above or &#8211; worst case &#8211; seal off and drown). After they&#8217;re dealt with, pit the captured invaders, reset the cage traps, and take another bite.</p>
<p>This automated system works pretty but it&#8217;s very rigid as well. A military is still necessary for handling the unexpected forgotten beast that flies up by accident into your lower levels and suddenly appears in your dining room breathing fire. Or for clearing out goblin stragglers, thieves, snatchers etc. In addition to berserk dwarves of which there will be many.</p>
<p>Another brief tidbit is <strong>read the magmawiki page on <a href="http://dwarffortresswiki.org/index.php/DF2012:Armor">Armor</a></strong>. For a long time I thought that military dwarves only needed one piece of chest, leg, foot, arm, head armor but in the end they need way more than that to be decked out. The difference is staggering.</p>
<p>Last military one is be aware that <strong>you can have standing active and inactive orders</strong>. I was ignorant of the fact that you can actually have &#8220;inactive&#8221; squads training and guarding and &#8220;active&#8221; squads be in position for a siege. This makes calling everyone to battle stations as easy as setting everyone to active on the military alert screen. You switch between active and inactive orders with /. Before, I had my training and guarding on the &#8220;active&#8221; schedule, and then when a siege came I&#8217;d manually position my squads but that&#8217;s not nearly as useful because you can&#8217;t easily burrow them and you can&#8217;t easily control their numbers.</p>
<p>Last bit of knowledge: <strong>quality easily trumps quantity</strong>. Setting up a great hall with tables, chairs, food, and booze is a necessity that all DFers are familiar with. Maybe you&#8217;ve even seen dwarves griping about the lack of chairs if you haven&#8217;t gotten to it yet. If you have to choose between 30 rock tables and thrones versus a couple of nice metal (gold, silver, platinum &#8211; even lead) go for the nicest ones you can provide. The lack of chairs thought will be easily outweighed by just being in the presence of these nice objects. My current fortress (whose inhabitants are mostly ecstatic) had literally four gold tables and chairs in the hall with 150 dwarves for awhile and not once did I catch a sad dwarf complaining about lack of chairs, but a lot of my others always had &#8220;admired a fine seat&#8221; in their thoughts.</p>
<p>The same thing is true with other furniture, meals, booze, and virtually all trade goods. Try to put out the best product rather than the most product. This dovetails with the worker specialization I mention above.</p>
<p>Anyway, these are my notes after receiving my first Barony. Hope they help you with your FUN.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2012/11/25/on-intermediate-dwarf-fortress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Election 2012</title>
		<link>http://blog.codezen.org/2012/11/07/on-election-2012/</link>
		<comments>http://blog.codezen.org/2012/11/07/on-election-2012/#comments</comments>
		<pubDate>Wed, 07 Nov 2012 21:28:24 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=758</guid>
		<description><![CDATA[I, like many of my colleagues, took a breath of relief last night when Obama won his second term. In addition, a lot of the other interesting races went Democrat as well, Elizabeth Warren most notably, but also Donnelly and McCaskill (seems like the Republicans got bit pretty hard over their rape insanity). The only [...]]]></description>
				<content:encoded><![CDATA[<p>I, like many of my colleagues, took a breath of relief last night when Obama won his second term. In addition, a lot of the other interesting races went Democrat as well, Elizabeth Warren most notably, but also Donnelly and McCaskill (seems like the Republicans got bit pretty hard over their rape insanity). The only thing that would&#8217;ve made me happier (aside from the entirely unlikely possibility of the Democrats taking the House) is if Jim Graves put Bachmann out to pasture once and for all.</p>
<p>Not all of my colleagues are relieved today, however. Since I started coming in to the office more (new team) in August, and as the pressures of the race started to make it daily conversation, I heard a lot of crazy things coming from engineers that I would otherwise respect. I can&#8217;t be sure, but I don&#8217;t think that they make 250k a year either. I guess Texas is Texas even in Austin.</p>
<p>We had a lot of nice propositions on the ballot for Austin too and most of them passed which hopefully translates into a lot of new funding for great projects like libraries, museums and &#8211; most controversially if you judge by yard signs &#8211; a new medical school for UT.</p>
<p>However, returning to the national level, the picture is almost resoundingly positive for we progressives.</p>
<h3 id='The-Supreme-Court'>The Supreme Court</h3>
<p>At least one, if not more of the justices will be replaced in the next 4 years due to death or retirement. Ginsburg is likely who would&#8217;ve been replaced by a conservative judge in a Romney universe. Instead a younger liberal judge will be put in place. Other&#8217;s like Kennedy or Scalia would be wins for the Democrats, and for sanity, as things like Citizens United, Roe v. Wade, and hopefully new reforms are challenged in our highest court.</p>
<p>The life term limit for the judges makes their influence long reaching and for Obama to get another one or two appointments to the bench would go a long way to avoiding future conflict for major progressive reforms (if we get that far). For the record I don&#8217;t advocate violating the Constitution for these reforms, but I do believe that the Constitution was written 200 years ago and must be interpreted to be relevant today.</p>
<h3 id='The-Punishment-of-Liars'>The Punishment of Liars</h3>
<p>The GOP is full of lies and misinformation. There&#8217;s no way that you can deny that they&#8217;ve been involved in some of the most vapid and factless campaigns in history. From Romney&#8217;s 2010 <a href="http://www.politifact.com/truth-o-meter/article/2010/dec/16/lie-year-government-takeover-health-care/">Lie of the Year</a> coming up in a debate two years after it had been thoroughly debunked, to the fact that the Romney campaign <a href="http://www.huffingtonpost.com/2012/08/23/mitt-romney-_n_1836139.html">&#8220;won&#8217;t be dictated to by fact checkers&#8221;</a> to the bold-faced, consistent and totally idiotic lies from day one of the Obama presidency (i.e. Obama is a muslim/socialist/fascist/anti-christ/gay/communist/Kenyan).</p>
<p>On top of it, Mitt Romney&#8217;s campaign promises were many and details were few. While I can&#8217;t say he <em>didn&#8217;t</em> have a brilliant set of tax deduction eliminations and plugged loopholes to offset his tax cut agenda, I can say that if he <em>did</em>  he&#8217;s an idiot for not being specific and that lack of details likely means he was bullshitting us all in an attempt to get elected on a mound of empty promises.</p>
<p>If the GOP had been rewarded this cycle with the Presidency or a new majority in the Senate, it would cause them to view lying and empty promises as a valid tactic. Thankfully, that didn&#8217;t happen, and in fact the Democrats made gains at every level nationally. I&#8217;d be surprised if the GOP does some soul searching and realizes that they need to come up with concrete solutions instead of promises next time around, and I fully expect the next round of utter bullshit is already being cooked up, but if we can establish a pattern over a few more cycles of &#8220;crazy and/or liars = unelectable&#8221; maybe the Democrats can take the House in 2014 and the Presidency again in 2016 and <em>then</em> after so many cycles of failure, they&#8217;ll get the point. Maybe they&#8217;ll realize that pandering to the extreme right for the primary and then tacking hard back to center for the general election is a losing strategy. Then perhaps we&#8217;ll get a real alternative party or, even better, a party that is willing to cross the aisle and compromise when the American people universally realize that we need progression instead of regression.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2012/11/07/on-election-2012/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On the DS9 / Babylon 5 Controversy</title>
		<link>http://blog.codezen.org/2012/10/19/on-the-ds9-babylon-5-controversy/</link>
		<comments>http://blog.codezen.org/2012/10/19/on-the-ds9-babylon-5-controversy/#comments</comments>
		<pubDate>Fri, 19 Oct 2012 18:49:21 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[b5]]></category>
		<category><![CDATA[scifi]]></category>
		<category><![CDATA[trek]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=712</guid>
		<description><![CDATA[Note: It&#8217;s been a long time since I&#8217;ve watched B5, and I&#8217;m keeping an open mind. If you want to nitpick or bring up new evidence, please do so in the comments, I&#8217;d be happy to edit and expand the discussion. On Reddit recently, I was defending my favorite of the Treks, DS9, against a [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Note: It&#8217;s been a long time since I&#8217;ve watched B5, and I&#8217;m keeping an open mind. If you want to nitpick or bring up new evidence, please do so in the comments, I&#8217;d be happy to edit and expand the discussion.</strong></p>
<p>On Reddit recently, I was defending my favorite of the Treks, DS9, against a horde of Babylon 5 fans that argued that Paramount ripped the entire premise of DS9 from material that J. Michael Straczynski (JMS) tried to sell to them long before DS9 was ever announced.</p>
<p>Do I believe that Paramount would be that unscrupulous? Absolutely. They&#8217;re a studio, and in the history of movies and TV I&#8217;m sure you can find plenty of other examples of assholish behavior. Personally, that seems like legal grounds to sue the shit out of Paramount, but JMS apparently didn&#8217;t want to taint either show with legal action. That doesn&#8217;t seem very businesslike, but hey. I can&#8217;t fault the guy for wanting to have more sci-fi on TV rather than less.</p>
<p>I&#8217;ve watched Babylon 5. I enjoyed it. I am not a conspiracy theorist however so I decided to look at the supposed mirror-like similarities between the shows and determine what I thought myself.</p>
<div id='toc'>
<ul><li><a href="#Summary">Summary</a></li>
<li><a href="#The-premise">The premise</a></li>
<li><a href="#The-religious-undertone">The religious undertone</a></li>
<li><a href="#Working-with-former-enemies">Working with former enemies</a></li>
<li><a href="#New-armaments">New armaments</a></li>
<li><a href="#Female-First-Officer">Female First Officer</a></li>
<li><a href="#Dr-daddy-issues">Dr. daddy issues</a></li>
<li><a href="#The-primary-foes">The primary foes</a></li>
<li><a href="#Names">Names</a></li>
<li><a href="#Conclusion">Conclusion</a></li>
</ul>
</div>
<h2 id='Summary'>Summary</h2>
<p>The first thing I wanted was a concise list of the similarities. It&#8217;s been quite awhile since I&#8217;ve watched B5 so while I remember the grand sweep of things, the details are little hazy. The best summation is a list I found in the IMDB FAQ for B5 and it goes a little something like this.</p>
<ul>
<li>Babylon 5 involves a space station beside an artificial hyperspace jumpgate. Deep Space Nine involves a space station beside an artificial wormhole.</li>
<li>Both shows had human captains who would end up becoming figures of religious significance to a local race. Benjamin Sisko would become the Bajoran Emissary while Sinclair was Valen.</li>
<li>Both shows involved humans working alongside a recent enemy race: the Minbari in Babylon 5 and the Klingons in Deep Space Nine (although the friendly nature of the Klingons was established in Star Trek: The Next Generation)</li>
<li>Both shows would introduce a small, powerful, first of its kind warship at similar points in their third season: The Defiant on Deep Space Nine and the White Star on Babylon 5</li>
<li>Both shows featured female seconds in command who were hot tempered: Kira Nerys on Deep Space Nine and Susan Ivanova on Babylon 5</li>
<li>Both shows featured doctors who had strained relations with their fathers and who were hiding secrets: Julian Bashir&#8217;s genetic modification on Deep Space Nine and Stephen Franklin&#8217;s involvement with the underground and his stim addiction on Babylon 5</li>
<li>Both shows involved combat against mysterious foes who seemed much more powerful than the protagonists: The Dominion on Deep Space Nine and the Shadows on Babylon 5</li>
<li>In addition there are several names which appear in both shows such as Lyta/Leeta and Dukhat/Dukat..</li>
</ul>
<p>Let&#8217;s get cracking.</p>
<h2 id='The-premise'>The premise</h2>
<p><strong>Babylon 5 involves a space station beside an artificial hyperspace jumpgate. Deep Space Nine involves a space station beside an artificial wormhole.</strong></p>
<p>This seems to be the most damning evidence that the premise of DS9 was ripped off. On the face of it, these are very similar. However, if you break it down, I&#8217;d argue that these are genre pieces.</p>
<p><strong>Set on a space station.</strong> It seems suspicious that JMS would pitch B5 to Paramount and then, 4 years later, when B5 got the greenlight elsewhere, suddenly there would be a new Trek set on a space station. However, this ignores one fact and that&#8217;s that not only are space stations totally average in sci-fi and in fact are mentioned endlessly in TOS and TNG, but also that the human race has actually (in <em>reality</em>) put a number of space stations in orbit around earth. The Russian Mir space station was put up in 1986, three years before JMS&#8217;s pitch, and 7 years before DS9 started to air. It&#8217;s unsurprising then that TV sci-fi, especially in two franchises set in our future rather than in some alternate reality like Star Wars, would choose a space station. JMS chose it for B5 because it acts as a semi-neutral diplomatic area, DS9 chose it because it was a different take on a universe that had already had two shows about cruising the galaxy.</p>
<p><strong>Set by a [transportation device]</strong>. This seems like a stronger argument than it&#8217;s base setting. Jump gates and worm holes? Basically the same thing, right? No&#8230; not really. In B5 jump gates are the mechanism for ships to enter hyperspace. They&#8217;re like highway on and off ramps and standard ships have to use the jump gate <em>network</em> to cross vast distances. Trek already had something like this, warp speed. The wormhole is different, it&#8217;s a one-of-a-kind link between two points in space that are vast distances apart.</p>
<p>This doesn&#8217;t address the core issues though. Regardless of technology, there&#8217;s still some transit feature next to the space station. But really, isn&#8217;t that an obvious device for both shows? B5 <em>requires</em> a jumpgate because otherwise it wouldn&#8217;t be very useful as a space station in a world where ships have to use them to cross large distances. In the same way, DS9&#8242;s <strong>story</strong> <em>requires</em> the wormhole because without it, it&#8217;s just one of a hundred different Federation space stations and not a very integral or interesting one at that. It&#8217;s one of the oldest literary devices in the book to have a trade point, a port, a bridge, a mountain pass in the setting because it gives a reason for exotic people and items to show up. In military stories, it gives a tactical weight to the setting. In short, nobody should be surprised that this is part of the base setting for either show.</p>
<p><strong>What&#8217;s being left out</strong>. There are a lot of omissions in the setting that are left out of this argument as well. Like the fact that B5 was constructed by and for Earth, where DS9 was taken after the occupation of Bajor. Or that B5 is a node on an already known (locally, at least) network, where the wormhole basically puts DS9 on the frontier of an entire new and unexplored quadrant.</p>
<p>Most importantly though, the premise of DS9 from episode one is still exploration, albeit in a different way than previous Trek. It explores philosophy (Distant Voices, Life Support et. al) religion (Bajoran episodes, of which there are many) in addition to planets (ala Meridian, Paradise, Children of Time, etc. as well as introducing Trill, Ferenginar and New Sydney on screen). It takes two full seasons before the main antagonist, the Dominion, is even seen and almost another three seasons before the main conflict begins. At it&#8217;s core DS9 is still solidly in the one-off paradigm of TNG for its first 5 seasons, and even the longest Dominion War arc is only a handful of episodes long.</p>
<p>To B5&#8242;s credit, it&#8217;s the origin of the highly serialized sci-fi that would fit right in today, in the age of the DVR when all modern drama is serial as well. The story, as such, is also serial and has much more to do with the continuing machinations between the races on B5, Earth, Mars, Earthforce, Psi Corps and eventually the Shadows than it does with any sort of exploration. That&#8217;s not a criticism, it&#8217;s a fact. Where DS9 is more like a collection of short stories with the same characters but vastly different topics and tones, B5 is closer to a coherent novel with complex factions and subterfuge.</p>
<p>It&#8217;s here in the <em>story</em>, not the setting, is where the premise of shows must differentiate themselves. If you don&#8217;t believe that, then every modern hospital drama is a rip-off of ER, every cop show is a rip off of Hill Street Blues, etc. etc.</p>
<h2 id='The-religious-undertone'>The religious undertone</h2>
<p><strong>Both shows had human captains who would end up becoming figures of religious significance to a local race. Benjamin Sisko would become the Bajoran Emissary while Sinclair was Valen.</strong></p>
<p><strike><br />
First of all, the Minbari are not a &#8220;local race&#8221; except in the fact that they have residents on B5 &#8211; a human station -, but I&#8217;ll ignore that part.</p>
<p>Second, while Sisko as The Emissary is definitely religious, I don&#8217;t remember Valen ever being established as anything but a badass historical figure. I suppose the &#8220;Minbari not of Minbari&#8221; metamorphosis thing can be interpreted as miraculous, and there is the time travel but that could be equally attributed to science fiction as divinity. I won&#8217;t hinge my argument on that though, especially since I might just not remember.</p>
<p>The real crux here is that, while B5 does make use of religion occasionally, it&#8217;s not a consistent component of the overall story. The example that&#8217;s given here (Sinclair being Valen) isn&#8217;t even <em>hinted</em> at until the third season of B5 (episode 3&#215;16, War Without End pt 1.) at which point Sinclair is not the (or even a) main character. It also didn&#8217;t air until May 13th, 1996. DS9 established Sisko as the Emissary in <em>the first episode</em>, which aired almost 3.5 years before then on January 3rd, 1993.</p>
<p>B5 fans might argue that JMS is just a genius and that this was his plan all along and part of his foolish disclosure to evil Paramount but I find that highly unlikely.</p>
<p>Even if the above doesn&#8217;t sway your opinion<br />
</strike></p>
<p>It&#8217;s clear that each series has a vastly different approach to religion and again, that&#8217;s what matters more than a silly bullet point. DS9 is constantly expounding on Bajoran religion, Sisko being the Emissary is an <em>integral</em> part of the show. What with the orbs, the festivals, the vedics, the kais, virtually all of Kira&#8217;s back story, the Prophets and their role in the Dominion War, the Pah Wraiths and their cult. Even Dax&#8217;s death at the hands of a Wraith. DS9 spends a lot of on-screen time getting into the minutiae of Bajoran religion. In B5, religion takes a pivotal role by weaving it through the plot through Sinclair/Valen and prophecy as motivation instead of persistent set dressing, as exodist points out in the comments.</p>
<h2 id='Working-with-former-enemies'>Working with former enemies</h2>
<p><strong>Both shows involved humans working alongside a recent enemy race: the Minbari in Babylon 5 and the Klingons in Deep Space Nine (although the friendly nature of the Klingons was established in Star Trek: The Next Generation)</strong></p>
<p>Personally I don&#8217;t think this holds water for the same reason the bullet states. When DS9 started, the Klingons had been established as an ally for 5 years of TNG (and closer to 25 in-universe). If we take into account that the Klingons don&#8217;t start playing a major role until Season 4, then it&#8217;s even longer. The previous state of enmity isn&#8217;t even referenced in DS9 because it&#8217;s unnecessary.</p>
<p>Later, there&#8217;s a time when the Klingons and the Federation are at war again (thanks to the Founders), but that&#8217;s the nature of politics in drama and a separate case than working with a long-established enemy.</p>
<h2 id='New-armaments'>New armaments</h2>
<p><strong>Both shows would introduce a small, powerful, first of its kind warship at similar points in their third season: The Defiant on Deep Space Nine and the White Star on Babylon 5</strong></p>
<p>First, the &#8220;third season&#8221; is misleading. DS9&#8242;s Defiant showed up in the third season premiere, on September 26th, 1994. The White Star class showed up (as far as I can tell from the wiki and the bullet) in the B5 third season premiere a year later on November 6th, 1995 although I guess the B5 fans can argue once again about JMS&#8217;s possible omniscience and subsequent foolhardiness in the Paramount office.</p>
<p>Anyway, a <em>year</em> after the Defiant, the White Star comes out with the ability to create a jumpgate at any point to get to hyperspace&#8230; sounds a bit like warp speed to me. Who&#8217;s copying who again? =P</p>
<p>In all seriousness this argument doesn&#8217;t hold weight for one reason: it&#8217;s an obvious necessity. Both shows are set on (relatively) stationary space stations, both shows have a looming threat (we&#8217;ll discuss farther down) so is it really a surprise that both shows introduce a new badass heavy fighter-type ship? Absolutely not. The main characters have to leave the station and do some ass kicking. It&#8217;s as simple as that.</p>
<p>But why a new ship, in either case? Because there&#8217;s a new threat that has to be answered with better, more agile hardware. In B5 human ships were a joke compared to the massive Minbari ships which in turn were a joke compared to the massive Shadows. In DS9, sure they could&#8217;ve used a Galaxy class ship but those were exploration, science and defense ships with massive crews. The Defiant, as Sisko says, is a ship with one purpose: war. It&#8217;s fast and it packs a punch.</p>
<h2 id='Female-First-Officer'>Female First Officer</h2>
<p><strong>Both shows featured female seconds in command who were hot tempered: Kira Nerys on Deep Space Nine and Susan Ivanova on Babylon 5</strong></p>
<p>No way! A 90s show with a strong female that doesn&#8217;t take any shit? And she&#8217;s close to the top of the hierarchy? Amazing. Forget the fact that Kira was essentially a guerilla terrorist shortly before the show began, and Ivanova was a figher pilot because, you know, that might actually differentiate them. This is more a result of out-of-universe culture shifting than anything in-universe in my opinion.</p>
<h2 id='Dr-daddy-issues'>Dr. daddy issues</h2>
<p><strong>Both shows featured doctors who had strained relations with their fathers and who were hiding secrets: Julian Bashir&#8217;s genetic modification on Deep Space Nine and Stephen Franklin&#8217;s involvement with the underground and his stim addiction on Babylon 5</strong></p>
<p>Seriously? Let&#8217;s break it down.</p>
<p>Both stations have doctors. That should have obvious reasoning on both sides.</p>
<p>Both characters have issues with their fathers&#8230; okay, but not only is that tangential to their overall story, it&#8217;s not uncommon in reality and it&#8217;s quite common in TV. Franklin&#8217;s father was a strict general, Bashir&#8217;s parents illegally genetically modified him as a child, Ivanova has an issue with her telepathic mother that committed suicide, Kira has an issue with her mom who was a traitorous comfort girl to the Cardassians, Quark has an issue with his mother because she&#8217;s so progressive, it goes on and on. The reason that people on TV have a lot of family issues is that it&#8217;s a familiar dynamic to every person in the human race. As such, I&#8217;m ignoring the father issues as too common.</p>
<p>Both characters have secrets. That is so vague as to be meaningless. Especially since on B5 practically everyone has secrets, that&#8217;s the sort of show it is. Again, not a criticism, in fact having flawed characters instead of Trek-ish ideologues is to it&#8217;s credit. However, if Bashir didn&#8217;t have a secret, then Kira would and the previous bullet would&#8217;ve been &#8220;tough female second in command <em>with secrets</em>&#8221; because Ivanova&#8217;s mom&#8217;s telepathy secret. If not Kira, then Worf would have secret and then it would be a parallel to Garibaldi&#8217;s secret Italian food addiction (or his dark period). The point is that two analogous characters having secrets isn&#8217;t a big deal. You know what other doctor has daddy issues and secrets? Dr. House. If I watched a lot of the other medical shows I could probably come up with other characters too but I basically despise them.</p>
<p>Now, if the secrets were in any way similar perhaps there&#8217;d be more to this argument but they&#8217;re totally different. Bashir&#8217;s secret is his genetic status, given to him against his will, that nonetheless allows him to perform superhuman feats of intellect. Franklin&#8217;s secret is his underground dealings and stim addiction. They&#8217;re completely unrelated and, on top of it, form episodes in the series that are vastly different. Bashir gets discovered and it brings up classic Trek philosophy of how we&#8217;d deal with genetic engineered humans, whether he deserves to retain his commission, who gets punished. Later, his genetically modified state is used when Section 31 shows interest in him, and also in a couple of (rather tiresome) episodes where he attempts to communicate with some genetically engineered misfits. Franklin&#8217;s secret stim usage causes him to resign the medlab, go on &#8220;walkabout&#8221; and return with new insight, a clear disgrace and redemption arc, a self-discovery.</p>
<h2 id='The-primary-foes'>The primary foes</h2>
<p><strong>Both shows involved combat against mysterious foes who seemed much more powerful than the protagonists: The Dominion on Deep Space Nine and the Shadows on Babylon 5</strong></p>
<p>Once again, this is such a common trope throughout all literature that it&#8217;s almost not worth discussing. An existential threat to you and your way of life is the <em>essence</em> of drama. That&#8217;s why you watch 300, or Battlestar Galactica, or disaster movies like Armageddon, or Aliens, or Independence Day, or a slew of other shows and movies. You want to see the underdog defeat the big bad guy, especially when the underdog is your planet or species. This same sort of conflict shows up in each of the previous Trek series (the Borg, the Q, the Armageddon Machine). More generically, this sort of story shows up everywhere from Animal House (misfits band together to save their frat house from being destroyed) to Rocky.</p>
<p>As I&#8217;ve tried to point out in many of the previous blocks, it&#8217;s the execution that matters, not the surface trope level similarities and the Dominion and the Shadows are not similar at all except in their relative power to the protagonists.</p>
<p>The Dominion is much more straightforward foe. They have a massive standing force of ships and soldiers. They have an empire on the other side of the wormhole with a strict and known hierarchy. They encompass hundreds of worlds and races. In many ways the Dominion is a despotic version of the Federation, a parallel that I don&#8217;t think was used enough in DS9. Their great power comes from sheer resources rather than ultra-advanced technology beyond that of their enemy. Their motivation to attack the protagonists comes from the desire for conquest.</p>
<p>The Shadows, on the other hand, are an ancient race of beings that emerge every 1000 years to cull the weak races through bloodshed and thus form a sort of natural selection pressure. They have bizarre organic advanced technology but are somehow vulnerable to telepathy. They are the flip side to the Vorlon, a race with the goal of nurturing races to survive the shadow wars.</p>
<p>There are some similarities in their execution. Like their unsurprising use of cunning to undermine their foes, or their intense desire to exterminate the protagonists and&#8230; I guess their ability to cloak themselves? But none of these are specific enough to call one a copy of the other.</p>
<h2 id='Names'>Names</h2>
<p><strong>In addition there are several names which appear in both shows such as Lyta/Leeta and Dukhat/Dukat..</strong></p>
<p>Give me a break. Ask yourself this. If DS9 was really going to rip off B5, don&#8217;t you think they&#8217;d have the smarts to change the names?</p>
<p>Ugh. Leeta (DS9) and Dukhat (B5) are minor characters, in vastly different roles from their counterparts. In a context in which we&#8217;re not trying to paint DS9 as a rip-off, these might even be considered homage but as evidence of plagiarism they&#8217;re about as weak as it gets.</p>
<h2 id='Conclusion'>Conclusion</h2>
<p>Look, I&#8217;m a fan of both series. None of the above should seem like a criticism of B5 itself. It&#8217;s a solid show and it was well written for the most part. It&#8217;s also got a totally different dynamic, arc, and execution than DS9.</p>
<p>I&#8217;ll admit that DS9 is my favorite Trek and thus it might seem like I have a dog in this fight, and I do, but I&#8217;m not trying to make the argument that DS9 is better, just that it&#8217;s not a rip-off. There are too many good writers that worked on the show and wrote too many good episodes (without analogues in the whole of B5) to dismiss them as plagiarists.</p>
<p>I&#8217;m all for fan theories, but this one just seems petty. Perhaps it&#8217;s the ultimate expression of the disappointment that B5 fans (myself included) feel about the fact that it got jerked around during production. I could see some people creating this theory because there is a seed of truth (JMS presenting B5 to Paramount before DS9 was in the works) and, if it were true, it would mean that Babylon 5 would&#8217;ve been just as successful as DS9 if it had the same level of backing.</p>
<p>In the end, I&#8217;ve found no argument that this theory is true except for some <a href="http://tvtropes.org">TVTropes</a> level generic similarities. Even if I admit that it&#8217;s <em>possible</em> that Paramount guided the creation of DS9 with JMS&#8217; manuscript in its back pocket, there&#8217;s no evidence (even JMS can&#8217;t tell for sure), and that&#8217;s still no reason each show can&#8217;t be original where it really matters: the story. The actual execution.</p>
<p>That said, maybe I&#8217;m missing some key point or piece of evidence. Maybe I&#8217;ve ignored parts of the show that are relevant. If that&#8217;s true, put it in the comments and we can continue discussion! I am open minded and convinceable if given the proof.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2012/10/19/on-the-ds9-babylon-5-controversy/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>On Qtile</title>
		<link>http://blog.codezen.org/2012/10/18/on-qtile/</link>
		<comments>http://blog.codezen.org/2012/10/18/on-qtile/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 20:31:36 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=704</guid>
		<description><![CDATA[Anyone that knows my open source predilection also knows that I have a lot of obscure and elitist taste in software. The only thing that could make me more tech hipster is if my kernel/OS of choice was a BSD instead of mainstream Linux. Case in point, my primary environment is a tiling WM written [...]]]></description>
				<content:encoded><![CDATA[<p>Anyone that knows my open source predilection also knows that I have a lot of obscure and elitist taste in software. The only thing that could make me more tech hipster is if my kernel/OS of choice was a BSD instead of <em>mainstream</em> Linux.</p>
<p>Case in point, my primary environment is a tiling WM written in Haskell, <a href="http://xmonad.org">Xmonad</a>. However, lately, I&#8217;ve been wishing for a bit more ease of use and a bit more flexibility in my whole base setup. With FOSS, whenever I have an itch, I try to scratch it one way or another.</p>
<p>Lately I&#8217;ve tried popular tiling WMs, like awesome and dwm. A couple of serious in-development ones as well, like subtle, i3, and musca. I still have a few to try, like spectrwm. However, for the past few days I&#8217;ve been really enjoying one called <a href="http://qtile.org">Qtile</a>.</p>
<p>It&#8217;s written in Python, which is a major plus for me because it&#8217;s my dynamic language of choice. In the 21st century, window management isn&#8217;t even close to &#8220;intensive&#8221; and as such I think trading speed (from C) for flexibility (from Python) is clearly the way to go.</p>
<p>The configuration for Qtile is done in it&#8217;s native language. Xmonad is configured in its native language too, it just happens to be Haskell and my days of pure functional programming are long gone so I appreciate the ability to mess with code, configuration and plugins without having to re-learn a set of enigmatic operators. Tangentially, I also experimented with native config in the last major version of my own software (<a href="http://codezen.org/canto-ng">Canto</a>) and it&#8217;s an extremely powerful configuration strategy. In part because the interpreter for your dynamic language is very powerful and (hopefully) well-designed and also because obviously the structures created in the configuration are simple to then manipulate in the code itself. In the end I started to migrate away from it because it&#8217;s hard to programmatically alter a configuration whether to convert to another version, or to save configuration done via a software interface. Qtile, and other tiling window managers, generally have no need to do either of these things if their initial interface is complete enough so I&#8217;m glad to see that I can execute arbitrary Python in the config and look forward to being able to construct my own layout capabilities.</p>
<p>Another advantage of Qtile is that it takes a more circumspect view of window management. Each piece of software doing one thing and doing it well is a great facet of the Unix philosophy but the lines drawn between functionality are arbitrary. Xmonad, for example, does literally nothing except manage windows (as you would expect). It does it very well, but it only has a bit of functionality to play nice with the other tools that most modern users would consider necessary (it&#8217;s capable of reserving space for bars / trays and it has capability to output text based on internal status). Qtile includes window management, but it also includes a configurable bar with status output, focused window titles, a clock and a tray. With Xmonad, achieving a similar setup to this requires setting up a loghook (interfacing with Haskell), and using two or three different programs in tandem (i.e. stalonetray for the tray, dzen2 for the bar, and that&#8217;s not counting any other status info like battery, memory, or cpu &#8211; all of which come with Qtile out of the box &#8211; which would inevitably require an app like conky to do in one place). Subtle, and to some extent i3 take this approach as well, but Qtile&#8217;s implementation is nicer, in my opinion. In effect you get more than the bare minimum of functionality which means you have less effort to integrate secondary components for the basic. Also, the Qtile widgets actually include a lot of the same default options which are passed through Python kwargs to each widget so it&#8217;s easy to keep your widgets&#8217; behavior consistent and tweaked to your liking.</p>
<p>One really cool thing about Qtile is <code>qsh</code>, which provides a shell+filesystem like interface to your WM. It allows you to query what windows are on what screens, information about your configured bar, switch layouts, close windows etc. This sort of thing is very handy if you ever want to interact or squeeze some functionality out of your WM with a simple script instead of Python.</p>
<p>At this stage I have no criticisms of Qtile, which is saying something. I will however state that I haven&#8217;t been using it long and I&#8217;m still trying to learn the default keybinds (instead of porting my Xmonad configuration keys over &#8212; for the most part). One aspect I&#8217;m curious about is the multiple monitor support, but from the documentation it seems like even that usually neglected area, has good support even for things such as separate bars. We&#8217;ll see. My dual monitor usecase has faded in recent times.</p>
<p>All in all, it&#8217;s definitely worth a try. Especially if you&#8217;re looking a tiling WM that doesn&#8217;t force you to find other programs to get basic information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2012/10/18/on-qtile/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On Why Tekkit isn&#8217;t as good as vanilla Minecraft</title>
		<link>http://blog.codezen.org/2012/10/08/on-why-tekkit-isnt-as-good-as-vanilla-minecraft/</link>
		<comments>http://blog.codezen.org/2012/10/08/on-why-tekkit-isnt-as-good-as-vanilla-minecraft/#comments</comments>
		<pubDate>Mon, 08 Oct 2012 21:50:48 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[gaming]]></category>

		<guid isPermaLink="false">http://blog.codezen.org/?p=693</guid>
		<description><![CDATA[I was, admittedly, late to the game on picking up Minecraft, and only started with 1.2.5, but it doesn&#8217;t take very long for you to &#8220;get&#8221; it and see that it&#8217;s a very persuasive game. It&#8217;s simple in mechanics, yet deep in possibility. You harvest various things to make tools, to make buildings, to defend [...]]]></description>
				<content:encoded><![CDATA[<p>I was, admittedly, late to the game on picking up Minecraft, and only started with 1.2.5, but it doesn&#8217;t take very long for you to &#8220;get&#8221; it and see that it&#8217;s a very persuasive game. It&#8217;s simple in mechanics, yet deep in possibility. You harvest various things to make tools, to make buildings, to defend yourself from the native mobs and other players (if that&#8217;s how you play). As this very well known <a href="http://www.penny-arcade.com/comic/2010/9/17/">Penny Arcade</a> comic (and it&#8217;s follow up) suggests, it&#8217;s a concept that will immediately click with a large subsection of gamers. It&#8217;s a game that takes a very minimal amount of training to pick up and play, but will reward those that learn a bit more. It&#8217;s even something I can play with (or just around) my six year old daughter and not have to worry about it showing up negatively in her subconscious years later too &#8211; a major bonus for a gamer dad used to the fare of killing demons with increasingly powerful weaponry or headshotting virtual human beings.</p>
<p>However, being an engineer, when I see some sort of technical complexity &#8211; like Minecraft&#8217;s brilliant crafting system &#8211; I can&#8217;t help but wonder what it would be like to take it to the next level.</p>
<p>Enter <a href="http://technicpack.net/Tekkit">Tekkit</a>, a collection of mods designed around adding a huge amount of technical complexity to Minecraft by integrating a huge number of machines and components, new concepts and recipes. From simple electric circuits, improved redstone, to computer blocks and nuclear reactors.</p>
<h3 id='Where-tekkit-succeeds'>Where tekkit succeeds</h3>
<p>When I first got going with Tekkit, I thought I was in nirvana. There are so many conveniences. The macerator to grind up ore and get double the ingots from a block. The electric appliances powered by wind or solar or geothermal devices connected with wires. The lovely amount of complexity of the electrical systems. The improved redstone. The automation potentials. This basic improvement in minecraft life is great and addicting. New ore and gems to tantalize you when you&#8217;re deep in the earth. New plants, new crops. New gadgets like automatic miners and jetpacks. New weapons and armor. There isn&#8217;t a single area of vanilla that <em>isn&#8217;t</em> expanded on.</p>
<h3 id='Where-tekkit-fails'>Where tekkit fails</h3>
<p>Unfortunately, it doesn&#8217;t take long for you to reach a point where the resources you&#8217;re going to need for your planned projects are going to be insanely vast. For example, my first goal was going to be to setup a force field to defend my little area. The recipe to create a force field doesn&#8217;t look too bad but its energy requirements are steep (as you would expect) when you&#8217;re protecting a large area. So, instead of tackling the complexity, or following a blueprint for a nuclear plant, I decided I&#8217;d just craft a HV (high voltage) solar array which would power my force field and charge a battery to keep the power up at night. Simple enough, this was all based on theorycrafting.</p>
<p>However, to create a single HV array would require 512 (8x8x8) solar panels. Each solar panel requires a generator, two circuits and some other easier to get components. Each circuit require copper wire, iron, and redstone. Copper wires require rubber. Generators require batteries, furnaces, and machine blocks (8 iron). The recipes aren&#8217;t hard, but for a single HV solar array I&#8217;d need something like 5000 iron and 3000 copper, 1500 rubber. These are rough, the tekkit wiki probably has real numbers, but the point is that it was clear from the get-go I wasn&#8217;t going to be harvesting these myself. To get 5000 iron I&#8217;d probably spend days of play time in mines.</p>
<p>And so I discovered the Equivalent Exchange (EE) part of Tekkit. It&#8217;s mod that, at its core, lets you echange many lesser valued items for one higher valued item. It&#8217;s a great concept because it means that all of that extra garbage you get from mining you can convert, losslessly, into another type of item. I can&#8217;t tell you how many stacks of cobblestone I&#8217;ve had from mining that just sit in a large chest waiting for me to use them because I can&#8217;t bare to let them go. With EE I&#8217;d be able to convert them into something I actually need. Sounds fair. After all, it&#8217;s in the title: equivalent exchange.</p>
<p>But EE also comes with energy collectors that are able to absorb EMC (the &#8220;currency&#8221; of items) from sunlight. It becomes clear that when you can absorb enough EMC to basically replicate an iron ingot in a couple of seconds that this is probably the best way to get 5000 iron ingots without strip mining the planet.</p>
<p>So it seems all right then. Sure you&#8217;ve got uber expensive items, but you&#8217;ve also got a way to convert time spent doing anything into items. Just be patient and you&#8217;ll have enough EMC to pay for your ingredients. Problem solved, right? Sure, but at what cost? What reason do you now have to play the game if resources are meaningless with a little effort?</p>
<p>Why explore? Why face danger? Why delve into the caverns and discover underground strongholds and dungeons if you will never return with anything that you couldn&#8217;t have replicated? Why spend more than two minutes in the nether if you only have to get one glowstone dust forever?</p>
<p>You know what the most efficient strategy for playing Tekkit is, after you&#8217;ve got an energy collector and a condenser up to a certain efficiency? Go do something else and leave your character to idle nearby. Zero effort, guaranteed reward. I generated more diamonds in my sleep this way than I would&#8217;ve ever mined in days of gameplay otherwise.</p>
<p>I&#8217;m sure that I can afford the reagents to make that HV solar array now, but what&#8217;s the point? There&#8217;s no achievement left in creating it except for building a machine to crank out solar panels so I don&#8217;t have to put up with the tedium of thousands of steps I&#8217;d have to take by hand to create one myself. And I understand that designing such a machine is pleasurable, but if creating the components of the machine is just a waiting game for ingredients, why not go to creative mode and design it there?  Similarly, if having 1000 diamond blocks is your goal for building your mansion of unparalleled wealth, why not just skip the few days of waiting (or less, likely, if you have a better collector/relay/condenser setup) and just do it in creative mode? Because you want to be &#8220;challenged&#8221; by sitting around waiting doing anything else for long enough? Because it&#8217;s an achievement to have replicated a mansion?</p>
<p>In short, by forcing us to get around resource gathering by making end-game level items insanely expensive, Tekkit has obviated the whole point of playing the game in survival mode.</p>
<p>Perhaps I&#8217;m unfortunate in being too obsessed with efficiency. Tekkit has a lot of great additions to vanilla, but I can&#8217;t bring myself to ignore the gamebreaking ones. If I can have access to unlimited resources, I can&#8217;t help but take advantage of them and, eventually, it makes more sense to keep upgrading your replicator setup than it does doing pretty much anything else. Perhaps I can just remove the EE mod (I am running a personal server after all), but then I don&#8217;t know how I&#8217;d deal with the insane amounts of material I need to pursue my grand plans. Maybe I could just force myself to ignore collectors, and only convert &#8220;honest&#8221; items into more useful ones? I don&#8217;t know. All I know is that, right now, the simplicity of vanilla looks a lot more challenging, rewarding and, thus, appealing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codezen.org/2012/10/08/on-why-tekkit-isnt-as-good-as-vanilla-minecraft/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
