Archive for the ‘Blog’ Category

One more Ultima Underworld story

Thursday, March 17th, 2011

I can’t believe I forgot this one.

One of the levels (5, I think?) was largely populated by ghouls, with standard flesh-eating names like Eyesnack and Kneenibble. Naturally you could talk to them instead of just fighting them. Jon Maiara (the same guy responsible for the Pac-Man homage) was writing the conversations for them, and included all sorts of things like the opportunity for you to make fun of Eyesnack’s name, to which he would respond by making fun of your name in return. You see the edge case, of course, right?

That’s right, part of our precious 640K was devoted to checking for whether the player’s name is also Eyesnack, in which case, in response to your mockery, the ghoul proclaims indignantly, “But your name same as mine!”

Maybe that will make you feel better about Judy falling into the lava.

Double pin

Saturday, March 5th, 2011

It’s not every day you get to make a move like this. From a 3-minute ICC game:

2r1kb1R/5p2/1Bnp2p1/pp4P1/4n1q1/1N6/PPPQ4/1K2R3

It was very pleasing to be able to play 25.Qxd6.

Ultima Underworld bugs

Monday, February 21st, 2011

While I’m reminiscing about the old days…

As we (Blue Sky Productions, later Looking Glass Technologies / Studios) were developing Ultima Underworld in 1991-1992, largely in a basement room in an office building in Somerville’s Davis Square, we received bug reports both from our own people and the QA team at Origin Systems, who published the game. “Our own people” largely meant MIT friends of the core programming team (me, Doug Church, and Jon Maiara) who we roped into helping out.

Our lead tester was Tim Stellmach (now at Vicarious Visions), a math major. You could tell he was a math major because his bug reports would start with “Consider a door.”

Our producer from Origin was Warren Spector, already a pretty important guy in the industry but someone who has since received yet more accolades for working on, well, Ultima Underworld, not to mention other games such as System Shock (with us), Deus Ex, and Epic Mickey. He is a super down-to-earth guy and we wasted no time in making fun of him, which he took with impressive grace. I guess it was a tradition at Origin to insert characters based on Warren into their games, so we figured we had to as well. Luckily we already had a “spectre” type of monster so it took no work to name one of them Warren. We made sure that Warren was in town the day that Tim was reading through the daily bug report list and said “Bug: There is no reference in the game to Warren Spector”, to which the rest of us immediately piped up, “Fixed!” without further explanation, much to Warren’s chagrin.

We were working with a lot of pretty raw graphics technology, as you can imagine, and it created some unintended graphical results fairly often. The upside was that whenever we ran into some heinous graphics bug that resulted in crazy psychedelic effects, once we figured out what was causing it, after fixing it we kept the code that would make it happen and enabled it when you ate too many mushrooms.

Speaking of graphics… well, probably most of you are far too young to remember the Apple ][, but it had a seriously weird graphics mode, which had not only a crazy palette (black, white, green, blue, orange, and purple) but also placed additional restrictions on how you could use the colors near each other (see here if you really need to know the gory details). Paul Neurath, our CEO, never tired of telling stories of what a pain it was to work with that system when he had written his earlier game Space Rogue. So naturally we added code that would specifically look for a certain file we had planted on Paul’s computer, and if it found it, would switch to a green-blue-orange-purple palette for one frame every half hour or so. Unfortunately I honestly can’t remember whether Paul ever actually noticed it.

One part of one of the levels, designed by Jon, was a Pac-Man homage. You had to run around a maze, which I believe faithfully duplicated the first level of Pac-Man picking up “ore” while avoiding ghosts. How Origin let this through I’ll never know, but they did have one complaint: Jon had named the ore “unobtanium” (yes, the same joke that Avatar used 20 years later), and they insisted that that name was too silly. So we changed it to “zanium” in protest… and apparently they were perfectly fine with that.

The worst bug that made it into the shipping game was probably mine. One of the quests involved talking to a woman named Judy, who could be found hanging out next to a river of lava. It turned out that, given our emergent-gameplay physics-driven simulation philosophy, we never actually prohibited characters from walking into the lava (although of course their AI tried to avoid it). So it was possible (although thankfully rare) for Judy to wander into the lava and die, making your game unwinnable. If you have been enraged at me for the last 20 years, I apologize.

But the best bug report I remember came from Origin. We rendered the world in true 3D but most of the objects (monsters, objects you could pick up) were 2D sprites. There were a few actual 3D polygonal objects, though, such as boulders. When we added the 3D object capability, we needed something to test it out, and we hadn’t created any ourselves yet, so we used a red sports car from some friends who were developing a game with the Car & Driver license, which we plopped down in the middle of a cavern. Sure enough, you could walk all around it and it looked just like a red sports car.

Then the bug report came in, of course. “On the fifth level, at this particular location, there is a red sports car sitting on the floor.” OK, I guess we could have expected that. What we did not expect was the next sentence: “I should be able to enter it and drive around.”

The dangers of self-modifying code

Sunday, February 20th, 2011

One of my coding stories recently showed up on reddit and spawned a giant thread. Having it brought up again reminded me of another fun bug from the early days, in this case 1991.

I had just graduated from college and joined Blue Sky Productions, soon to be renamed Looking Glass Technologies, where we were working on the PC game Ultima Underworld, a first-person 3D dungeon crawl. I needed a machine so I was given an 33 MHz 80486 PC. Everybody else was jealous because not only was it immediately the fastest PC in the office, it was also the only one with a floating point unit. The downside was that everybody wanted to run their tools requiring floating point on my machine.

Anyway, of course the first thing to do as soon as the machine showed up was to run the in-progress version of Underworld on it to see how zippy it would be—perhaps it could get all the way up to 15 frames a second! Unfortunately, the game completely failed on my machine. I can’t remember whether it just crashed, or everything on screen was just black, or what, but it just did not work at all.

After much hair-tearing, we figured out the problem. The texture mapper (in software, not hardware, of course), which had been written by an outside guy (Chris Green—I see he’s now at Valve) and handed to us, was using self-modifying code in an attempt to squeeze as much performance as possible out of the system. Where a normal program might have a loop that accesses a variable each time through the loop, our texture mapper’s loop would just refer to a constant value. Before entering the loop, it would do the variable lookup once, poke that value into its own code, replacing the constant, and then run the loop a bunch of times without having to waste time looking up the value again. Brilliant! Impossible to debug, but brilliant.

Unfortunately, the 486 had its own optimization—an instruction cache. So we were dutifully poking new values into program memory that had already been read and was never reread, which meant that all of the updates were completely ignored. Oops.

I see that the Wikipedia article on self-modifying code has a section on exactly this problem.

Carlos Ruiz Zafón: The Shadow of the Wind

Saturday, February 19th, 2011

I feel like too many of my book posts lately have been of the form “Eh, didn’t really float my boat.” Well, in this case my watercraft was 100% buoyant. The Shadow of the Wind not only should have been my thing, it actually was my thing.

I guess it was a big hit in Spain, where it was originally published, and I can see why. It’s full of books and (metaphorical) ghosts and romance and melodrama in a way that is slightly over-the-top but always enjoyable. It’s set in post-WWII Barcelona, and I really enjoyed the evocation of the time and place. It has a fairly standard metaplot of Young Man Digs Into The Mysteries Of The Past While Getting Dragged Into A Modern-Day Plot And Also Falling In Love With Someone Who May Or May Not Be Good For Him, but it implements it superbly. The characters are kind of two-dimensional (which is to say, they don’t really have three dimensions, but at least they don’t have only one), but who cares. I found myself tearing through it, both wanting to know What Happens Next And What Is The Real Identity Of That Mysterious Guy but also wanting to see how the personal relationships played out. I would call it a guilty pleasure but it was too well written for that.

Zafón has written a few other novels, and I have a feeling I’ll be reading one of them during my next summer vacation.

Cardiacs: “Odd Even”

Saturday, November 6th, 2010

Six months ago I made some general comments about the musical vocabulary of Tim Smith (of Cardiacs). Here are some notes on “Odd Even”, a song that illustrates a lot of his standard tricks. The song is on YouTube here and my transcription is here (PDF file).

The form could not be simpler: three repetitions of verse (a 7-bar phrase repeated twice) and chorus (8 or 12 bars; in the second and third choruses the last 4 bars are repeated). The third verse is instrumental.

The introduction (which foreshadows the end of the verse phrase) is a straight-out “Smith cadence” (♭III–v–I in the key of E), which already renders it unclear whether we’re in the key of G major (starting on the tonic and repeatedly raising the tension) or E major (starting on the flat mediant and repeatedly resolving the tension). This ambiguity will persist throughout the song.

The start of the verse seems to resolve the question by claiming that we’re in G major, and could not refer more explicitly to the Lydian mode, with a C♯ over the G chord. Already this is a hint that we might be moving back to the sharp side soon. There’s an interesting clash between that C♯ of the melody and the C♮ of the C chord that arrives on the second bar. The harmony then moves through A and E back to G, apparently establishing that E is subordinate to G—but then immediately repeats the introductory Smith cadence twice, reestablishing the ambiguity.

The phrase rhythm of the first verse phrase is also quite interesting. From the melody alone it looks like a pretty straightforward [4+4]+4 beats, but the harmonic rhythm, as well as the way that the instruments enter during its first statement, implies 6+6.

The chorus starts by moving fairly strongly to the flat side of G, going all the way to E♭ before slowly relaxing back to G, and right through G all the way to Bm and E again. The feeling of resolution provided by G is lessened this time by it happening for only two beats on the second half of a bar, rather than lasting a whole measure as it did before. The melody here is really nice; a drone-like D is continually returned to on the bottom (it’s a common tone of all the scales passed through, including the E Mixolydian implied by the final destination of E) while the upper implied voice of the line descends from B♭to A to G, then returns up to B♮ and G♯ to both chromatically fill that third and also strongly establish the “surprising” E (not so surprising in reality since the G–Bm–E sequence has been repeating the whole song).

The chorus ends by following yet another path from G to E, this time by repeating the triple plagal cadence G–D–A–E and sitting on the final E for an additional bar. That relaxation of the harmonic tension certainly makes it seem like E was the final destination after all—but when the next verse starts up again, back in G, it feels like a return to the tonic rather than a jump away from it.

The instrumental verse suddenly triples the melodic speed, and it’s interesting to see such a relatively hyper solo in the middle of what is otherwise a fairly sedate song. I wouldn’t have thought of it when I first heard the song, but after listening to a lot of jazz in the last month, the solo has sort of a bebop feel to it, at least when you look at it on the page and imagine it being played by a saxophone rather than by a keyboard.

It looks complicated but it is largely doing the same things found elsewhere in this song or Smith’s work in general—emphasis on that Lydian C♯, liberal use of whole-tone scales, and near the end a gleeful insistence on B♭, a note dissonant against both G major and E major.

The song ends with a final chorus, repeating that G–D–A–E progression four times in a long exhalation and landing with relative finality on E. So maybe it was in E major all along? But I think the fight between the two potential tonics the whole time was a charade; the whole point is that both G and E are equally important, and to proclaim one of them superior to the other is to force one point of view on a song that is all about presenting two.

Bud Powell: “Cleopatra’s Dream”

Monday, October 11th, 2010

I’ve always liked the sound of jazz but have never been as interested in it as rock or classical. Recently my interest has flared up a bit, and I’ve been trying to make up for lost time by listening to more of it with active ears. The standard approved way to work on your analytical technique seems to be to make transcriptions of classical recorded solos, so I picked up the first random jazz CD that was at hand, Bud Powell’s The Scene Changes, and sat down to transcribe the first number, Cleopatra’s Dream. Unfortunately 1) it’s a very fast tune (quarter note = 240), 2) it’s in A flat minor (that’s seven flats), and 3) Bud Powell, like I suppose any good pianist, uses both hands. So maybe it was not the best song to transcribe first. Nonetheless I ended up with something that is at least moderately accurate, especially in the right hand, and it can be found here (PDF file).

I did learn a bit from this exercise about how Powell improvises, and it was good practice for my ears, so it was certainly a success on those fronts. If anyone has suggestions or corrections, especially actual jazz musicians who can tell me, for example, “this line you sketched out in the left hand is not what anyone would ever actually play, he must be doing this instead”, I’d love to hear them.

(By the way, I noted on Twitter that I hear this as being in Ab minor (7 flats), and not G# minor (5 sharps), which you’d think would be more “simple”, and I think I realized why. The leading tone is an important part of the scale, and the major dominant chord that contains it is an important chord; and it’s much easier to think about a V chord that’s an Eb major (Eb, G, Bb) than a D# major (D#, F##, A#). So I think I chose the right key after all.)

Steven Erikson: Deadhouse Gates

Sunday, October 3rd, 2010

The second volume of the ten-book epic fantasy series The Malazan Book of the Fallen, which was begun with Gardens of the Moon, Deadhouse Gates is regarded by many fans (though not me) as the best of the bunch. It’s true for sure that you can see Erikson hit his stride here in a way that is new.

For one thing, the plot feels a lot better controlled. There are still a half-dozen independent threads going on, and in fact they don’t even all end up tying together in the way that they did in the first book, but perhaps it is that independence that lets Erikson take each one to a conclusion instead of trying to combine them all in the last chapter. This book also contains the famous Chain of Dogs sequence, which is pretty wrenching and gives the whole book an emotional weight that was less present before.

Once again, all the stuff going on can seem pretty random, most memorably when a ship of manages to go through a series of weird dimensions in quick succession, each crazier than the last. It is easy to regard this as Erikson just randomly chucking in every weird idea he can think of, but as I mentioned before, if something is introduced out of nowhere that seems to bear no relation to the plot, it is likely to be a call-forward to something in a future book. This can be a little frustrating but it certainly does contribute to the epic feel.

I would say that at this point the dimensions of the larger plot start to become clear, but that’s a lie—the most important plot thread in many ways doesn’t even really get hinted at until book 3. But you do start to get a sense of the scope of the thing. That scope will widen even more in the next book…

Steven Erikson: Gardens of the Moon

Monday, August 30th, 2010

Steven Erikson’s epic fantasy series The Malazan Book of the Fallen is about the most ambitious writing project I can think of short of Henry Darger. It’s not just the number of words in the thing, which is immense enough already (each of the ten books is a doorstop), but also the scale of the conception. There’s a giant amount of detail in there, with a backstory going back thousands of years, the uncovering of which is often just as much of a gasp-inducing plot element as any action sequence. Hints are often dropped which don’t pay off until literally thousands of pages later, and clearly Erikson had the entire thing largely planned out from the start.

Just a peek at the locations of the books is impressive. The second book drops almost all the characters and plot threads from the first and starts up a giant new collection of characters and threads on a different continent. The third book does jump back to the first book’s location, but then the entire first quarter of the fourth book is the backstory of what had originally appeared to be a minor character from the second book, and the fifth book starts all over again on a completely new continent. After that the threads start getting woven together a little more, which is almost a disappointment when you’re used to giant new vistas opening up every book.

As you might guess, this sort of thing is right up my alley. The sheer size of the worldbuilding, both in space and in time, is amazing, and the revelations that occur regularly are often jawdropping. Plus the guy can actually write, and the themes are largely about real human experience and emotions, and the characterization is pretty good; you can see why I’ve devoted an embarrassing number of hours to reading and rereading these books as they’ve been published. The tenth and final volume is coming out in early 2011, and I’ve started one more reread so I’ll be in place to read it at that time.

All that said, the books aren’t perfect. For one thing, although Erikson is a good writer, he’s not quite as good as he thinks he is, and sometimes passages can be overwritten or unclear. (And the excerpts of fictional poems that open the chapters are often just horrible.) Although there are occasional romantic relationships, he’s not that good at them—it’s generally hard to understand just why characters are falling in love (or, more usually, in lust). And although it’s hard for me to complain about the size when that is one of the things I love about the series, there’s just so much to keep track of, and so much to physically read, that it can be hard to remember it all and sustain my motivation all the way through.

The first book, Gardens of the Moon, also suffers somewhat from being written long before the other ones, before Erikson had really matured, and the violently in medias res nature of it is even harder to deal with as a reader than with the other books, since you’re starting from a blank slate. If you do read these books for the first time, I have one caution: don’t roll your eyes too much at the occasional seemingly completely random plot event or deus ex machina, especially in the first few books. In the context of a single book, they do appear to come from nowhere and have no good function except to tie up plot threads, but in the context of the entire series, they are usually used to introduce key elements that will become very important later in the series.

These books are not for everyone; they’re one of those things, like the band Cardiacs, that I love but am reluctant to actually recommend to anyone. But if this is the sort of thing you like, you may love it. And this is just about the best time to give it a try; it’s wrapping up soon so you can read the whole thing without waiting a year between each book, and tor.com is doing a pretty insightful reread through the whole series, which they just started a few weeks ago.

1960s Polish music videos

Sunday, June 27th, 2010

A few weeks ago I was browsing the web looking for fake Beatles songs, one of my favorite musical genres, and unexpectedly happened upon the awesome video for “Nie zadzieraj nosa” by the Polish group Czerwone Gitary. A quick glance at the sidebar made it clear that I would spend the next few days poring through a treasure trove of old Polish music videos. Here are the highlights of my findings, with the understanding that I know nothing about the Polish language or culture. If you don’t have all day to watch them all, my personal favorites are in bold.

“Nie zadzieraj nosa” itself really is a superbly crafted and performed fake-Beatles song. It’s perhaps just a touch too regular to be a real Lennon-McCartney, but all the idioms are spot on. Just watching their evident joy (especially the guy on the right) at performing music this awesome makes me smile.

Czerwone Gitary apparently still exists and is one of the most popular Polish bands of all time, but unfortunately for me they seemed to grow out of their faux-Beatles phase pretty quickly and transition into more of a folk-rock style. Another 60s band that seems to have followed a similar trajectory, with even more of a folk influence, is Trubadurzy. “Znamy sie tylko z widzenia” is worth watching just for the bass balalaika and (slightly) fancy footwork, but the video I’m obsessed with is “Kasia”. The song itself is a great earworm, a simple six-line verse sung over and over (with different words), and I can’t get over the charm of the video – the cinematography somehow making it seem like they’re all six inches tall, the fact that it takes five seconds for them to decide where the beat is despite the fact that they’re lip-syncing, the apparently terrified bass player, the barely-adequate dance steps. I must have already watched it thirty times. Trubadurzy seems to have then gone through a brief more rocky phase (“Usmiechajcie sie dziewczeta”) before descending into gloopy folkiness.

Another contemporary band worth checking out is Skaldowie, featuring a charmingly nerdy heartthrob. “Medytacje wiejskiego listonosza “ is rather Monkees-like both in its song and its video, while the video for “Śpiewam bo muszę” reminds me of the Monkees again, but in some sort of weird dystopia. The singer pulls a prank on everyone by dressing up in a polar bear suit… then removes its head while solemnly declaiming the rest of the song. Righto.

Perhaps the most reliably entertaining videos of the bunch for me belong to Alibabki, a group of six women singers with rotating membership. “Kiedyk pasła bydło” seems like a rocked-up version of a traditional tune or something, including those awesome piercing open Eastern European vocal harmonies, but its most arresting feature is the occasional banshee shriek, which I assume is meant to be laughter because it is always followed by a broad and very unconvincing smile. My favorite is “Niech wie jak jest”, with a very nice bittersweet chord progression and a gently burbling accompaniment that somehow reminds me of early R.E.M.

Most of the groups here seem to have lasted forever, or at least decades, constantly changing their musical style to fit with the times (which makes them less interesting to me once they hit the 1970s). I wonder if this is at all correlated with Poland being a Communist state then, or if it’s just sampling bias. The best example is Czesław Niemen, “arguably the most acclaimed Polish singer of all time”, whose career you can follow from a Twist and Shout-style raveup (“Ciuciubabka”, featuring Alibabki again — with the bonus that you can pretending they’re singing “Chewbacca”) to It’s A Man’s World-style wailing (“Io Senza Lei”) to electric gospel (“Jednego serca “) to early electronica (“Mleczna Droga”).

These are the videos that grabbed me the most, but this is just the tip of the iceberg — there are literally hundreds more. Go spend a day checking them out; I’m moving on to Yugoslavia.