[ Content | Sidebar ]

hudson; ipod

December 17th, 2004

I hope that Atlanta fans are happy right now; I’m certainly not. Was that really the best we could get for Tim Hudson? Was that really better than keeping him around for another year, or for that matter signing him long-term? Sigh. (And the Yankees seem to have wriggled out from under the Jaret Wright signing.)

When importing stuff on the iPod yesterday, it imported the first song at high speed, then slowed to a crawl for the rest. At about the time that it slowed to a crawl, the fan turned on. (Well, one of them – I was afraid that one was busted, but both seem to be working today, so maybe the machine doesn’t always turn both on.) So my theory is that some power management stuff kicked in to lower the processor speed. And, actually, I’d been thinking the computer was slow ever since I upgraded to Fedora Core 2; I’d been blaming that on the upgrade (maybe the new version of Galeon is slower, or something), but maybe something weird is going on with power management. Anyways, when I rebooted the computer I told it to always leave the CPU at full speed when the machine is plugged in; maybe that will help. I haven’t imported anything since then, but my web browsing today does seem speedier.

Though there is a new iPod down side – I listened to it while jogging yesterday, which was great, except that the last song on the album (Beatles for Sale, which like their other early albums isn’t too impressive) didn’t play: it showed up in the track listing, but when I tried to play it, the iPod just ended the album. When I looked at it under iTunes, it seemed fine, and would play, but obviously something went wrong. Anyways, I deleted it on the iPod and told iTunes to resync, and now it seems to play fine. I’ll have to keep my eyes open for this sort of thing in the future; maybe I somehow wasn’t careful when disconnecting the iPod once?

i pod people

December 15th, 2004

About a year ago, I started toying with the idea of getting an MP3 player: I’d recently taken up jogging (and I’m still doing it, a year later), and jogging is really boring. But after toying with the idea for a while, I gave it up, because none of the available players seemed to have a convincing set of features for the price I wanted. Fortunately, however, I won an iPod yesterday at a holiday party at work, and a free iPod definitely scores well on both features and price.

To be honest, my experience so far has been a bit mixed. For now, I’m putting off getting it to work under Linux: I’m controlling it via Apple’s iTunes software on Windows. Installing the software was reasonably straightforward, but there were a few glitches, like the time when the iPod installer wanted me to reboot my computer while the iTunes installer (which had been started by the iPod installer) was merrily chugging away. And once I had all that installed, I then downloaded a software upgrade for the iPod itself; after I’d done that, I wondered if that upgrade was solely for the purpose of preventing me from buying songs from Real Networks. Which I certainly have philosophical obejctions to, though it won’t make a practical difference since I don’t plan to buy songs in non-CD formats from anybody…

The software itself mostly works well, but there are some strange glitches. When I first put in a CD, it happily (and fairly quickly) converted the contents into MP3s. But then I ejected the CD and put in another one, and it refused to acknowledge that I’d changed CDs. I went through all the menus, and I can’t figure out what I should have done: there doesn’t seem to be a “look at the damn CD drive” option anywhere. So, for now, I’m exiting iTunes and reentering it every time I change CDs.

Also, I initially told iTunes not to automatically sync my hard drive with the iPod: my hard drive actually has less space than the iPod (it’s only a 20GB iPod, but it’s a two-year-old laptop with most of the disk space devoted to Linux), and I certainly want to be able to delete music from the laptop without deleting them from the iPod. The software has an option to let you manage the synchronization manually, but I couldn’t figure out how to get it to work; so I gave up and turned on automatic synchronization. (Which still seems not to be completely automatic: it turns on when I either start iTunes or plug in the iPod, but not after I’ve just ripped a CD.) Very strange.

And then today it was only managing to rip CDs at about 1-1.5x, instead of the 4-5x that I got yesterday! I have no idea what’s up with that, but it’s really annoying – it’s bad enough to have to ever boot Windows on this machine, but to be stuck in Windows when I’d much rather be using Linux just sucks.

My iPod isn’t just a normal iPod, either, it’s a U2 Special Edition one. Woo-hoo. So it’s a less attractive black and red, has signatures on the back, and comes with a $50 coupon (valid only for 120 days) on a $150 music purchase that I have no desire to make. I’m not actively against U2 – if it, say, came preloaded with U2 music, then I wouldn’t actually delete it, and I still have a few of their CDs that I bought in high school – but I can’t say that I appreciate being turned into an ad for the band.

All grumbling aside, I do think I’ll like it a lot. It’s nice and small; it’s denser than I expected, but is still quite light enough that I should be able to jog with it fine. The user interface for the machine itself looks pretty good. I’ll have to go out and buy a carrying case, and maybe a remote for it. And maybe a 4-pin to 6-pin firewire connector – my laptop only has USB1 and 4-pin firewire, while the iPod prefers USB2 or 6-pin firewire, though the speed of the USB1 connection hasn’t been a problem for now, given that ripping the CDs is by far the limiting stage involved in getting music into the machine.

paper mario 2

December 13th, 2004

As mentioned before, we’ve finished Paper Mario 2. Which is a bit of an event: it is, by my count, the fifth video game that Liesl has ever finished. Though it’s not as surprising as that statistic makes it seem: two of the previous games that she finished were the original Paper Mario and the not-entirely-unrelated Mario and Luigi: Superstar Saga. The other two games, for the curious, are the two Golden Sun games, which I heartily recommend. What the Paper Mario and Golden Sun games have in common, as far as I can tell, is that they’re RPGs where you can use your special abilities (magic and equivalents) on non-battle screens as well as in battles, giving rise to Zelda-style dungeons. (The Zelda games fall into the category of games that Liesl starts but doesn’t finish; I’m not sure she’s even started any RPGs other than the ones discussed here, though admittedly we don’t have a lot of them around the house.)

So what’s the verdict? It’s obviously a pretty good game, or we wouldn’t have finished it. It does a lot of things in somewhat non-traditional RPG fashion, often with superior results. Aside from being able to use magic anywhere, I particularly appreciate the fact that monsters are visible. The fact that they don’t respawn in dungeons doesn’t hurt, either.

And lots of the RPG mainstays are given enough of a spin to be somewhat fresh: one of the dungeons isn’t a dungeon at all, another one is nicely mxed up with the associated overworld/city areas. I like the inter-chapter scenes featuring Peach and Bowser. It’s nicely balanced – as my ability to buy video games increases, I no longer have much tolerance for games whose play time is extended by mindless difficulty. (Or even, at times, mindful difficulty…) The Luigi appearences are pretty funny.

Having said that, while I quite enjoyed the game, I wasn’t blown away by it. Not much has changed since the first game; there are many worse things in the world than a video game sequel repeating the virtues of a well-done original, but it’s not the ideal that I hope for. I liked the relative lack of annoying overworlds, but the cities aren’t as strong as I’d hoped. The main city has some amount of territory to explore; the other cities are tiny. There are side quests, but they’re frequently tedious and don’t advance the plot at all.

And speaking of plots, that’s one advance in modern RPGs that Paper Mario has completely missed out on: the increased focus on plots. Princess Peach has gotten kidnapped; surprise, surprise. Yes, it’s not Bowser doing the capturing, but we’ve seen that slight twist before. There’s some nonsense about saving the world, but it’s hardly convincing, certainly not enough to make up for the lack of imagination in the “find the seven crystal stars” idea.

Also, while I’m complaining, it (admittedly, like most other RPGs) hits on one of my pet peeves – what’s the deal with having a large party but not letting you use all of them in battle? What are the other characters doing while you and your chosen primary companion(s) are fighting – eating popcorn and betting on the outcome? At least Paper Mario doesn’t have the character balancing issues that this can lead to in other games, since experience points only affect the main character, but I don’t get the idea behind giving you lots of characters without letting you actually use them. Of course, the answer is that it would be tedious to manage tons of characters in every battle, and it would be hard to balance regular battles with boss battles that way, but wouldn’t a better answer be to limit the number of sidekicks? (Maybe that would lead to a more concentrated and more effective plot, too…)

Better presentation would have helped, too. They’ve gone about as far as they can with this 2D-in-3D shtick; while voice acting might be out of place in this game, it might not, and I can’t help but wonder if the 2D thing is used as an excuse to skimp on production values elsewhere instead of as a strong design choice of its own.

All kvetching aside, I had a lot of fun with it, and it was one of the better games that I’ve played this year. I just wish Nintendo would get out of some of the ruts they’re in.

random access, top hat

December 8th, 2004

When talking about the new DVD/DVR, I forgot to mention one advance: improvements in random access. DVDs aren’t better than video tapes just because they look better: they’re better because you don’t have to rewind them, you can jump to any scene (once you get past the annoying ads at the beginning), because they look good when paused. Similarly, this DVR is better than a VCR because you can delete shows in any order, and because it has buttons to let you jump forward or backwards by 30 seconds, making it easy to skip commercials. We pretty much never use the fast forward / rewind buttons on it.

Having said that, improvements are possible. For example, when browsing through the saved programs, it gives you 5 different options for sorting them, but none of them are what we want, namely reverse chronological order. (I have a hard time believing that wanting to watch the oldest shows first makes us some sort of freaks.) Also, they divided the saved shows up into screens, but there’s no way to scroll a page at a time instead of a screen at a time.

We went to Top Hat last week. Very good: quite similar to The Gay Divorcee, but everything about it is a little better. More songs, better songs, better dance sequences, the plot makes a bit more sense, and I really like the wife of Edward Everett Horton’s character. (Played by Helen Broderick, apparently; never heard of her.)

I’m very glad the Yankees signed Jaret Wright for too much money (not that money matters to the Yankees). Last year was obviously a combination of fluke / Leo Mazzone; that deal’s going to look pretty stupid six months from now, never mind three years from now.

adventure games and rpgs

December 6th, 2004

We’re done with Paper Mario 2 now (and I’m starting Metroid Prime 2 – what an amazingly bad menu system!), so I should probably continue talking about it. It’s such a quietly unusual game, though, that I think I have a couple of entries’ worth of material about it.

Maybe it’s not that unusual; it is quite unconventional for an RPG, but now that I think about it, several of its non-RPG elements are actually fairly normal in adventure games (such as the Zelda games).

So: a comparison of the genres.

  • Both typically have you exploring in cities, overworlds, and dungeons.
  • Both can have fairly strong plots.
  • RPGs have a leveling-up system, controlled by experience points; adventure games have you gaining new abilities via items.
  • Both have a sort of HP system, but it’s finer-grained in RPGs; in RPGs, it’s tied to leveling up, while in adventure games it’s typically tied to finding a special item, like the Zelda heart containers.
  • RPGs have a party, adventure games don’t.
  • RPGs usually have a magic system or something like it (though not all characters can use it equally); adventure games typically don’t.
  • In RPGs, enemies are invisible until the battle starts; in adventure games, they’re out there for everybody to see.
  • In RPGs, battles are on a special screen, with most of the action happening by commands selected from menus; in adventure games, battles are on the main screen, and you control the character’s actions directly with the same controls as you use to move around.
  • I think inventories are probably normally handled in a more anal manner in RPGs.

Now, obviously not all of these are aspects tightly linked. Though, I suppose, they must reinforce each other for them to have remained coupled like this. It would be interesting to see a game design pattern language that explained these relationships; can we come up with some reasons? I suppose that multiple party members and magic go together, because magic gives a way for the party members to be differentiated from each other. And multiple party members also go with having a special battle screen with commands on it: otherwise, it would be too hard to control all the characters.

But that doesn’t explain why, in RPGs, the wandering monsters are traditionally invisible. And, indeed, in Paper Mario these aspects are severed: there’s still a special battle screen with special commands, but you see the enemies in front of you while wandering around, and can avoid them if you choose. Which is, I think, a good thing: for example, when revisiting areas later in the game, the monsters are too trivial for fighting them to be very rewarding (either intellectually or in game-play terms), so it’s nice if you can avoid them. Or if you’re in a mood for exploring instead of fighting, it’s good to be able to avoid monsters instead of having them distract you. (I’m still scarred from the ridiculously frequent random battles in Skies of Arcadia: sometimes I wouldn’t even be able to remind myself of what I was looking for when last attacked before another battle would start.)

I suspose the visible monsters are the only item in the other list where Paper Mario picks the adventure game choice instead of the RPG choice, but it makes untraditional choices (that don’t fit into either convention) in several other areas. For one thing, normally when levelling up, the experience point gap grows as you advance between levels. In Paper Mario, however, there are always 100 experience points between levels, and the same monster gives you fewer experience points as you get stronger. This works because the party members aren’t symmetric: you only level up Mario via experience points, while the other characters advance via a separate mechanism. (Which involves looking for certain items, like the way you “level up” in an adventure game.)

The character differentiation also happens differently than in normal RPGs: each companion has one special thing that it can do (give information, send a shell out, blow, hide you, etc.), and while these affect battles (in fact, each special thing turns into multiple special moves in battles), they can also be used in the overworld, to let you get items, get to previously inaccessible areas. This is actually one of my pet peeves in RPGs: you have this magic system, but while it has a big effect on battles, it really is only used outside of battles to heal you. Wouldn’t it be more interesting if you could use, say, a fire spell to burn your surroundings, instead of just burn your enemies? The only other RPGs that I know of that let you use your magic in the overworld are the excellent Golden Sun and its sequel. This makes Zelda-style puzzles possible in an RPG, and can be a lot of fun. In fact, now that I think about it, the connections between characters in Paper Mario and special items in Zelda are obvious: Koops is similar to the hookshot, Bobbery is a lot like the bomb bag.

The way you gain abilities via leveling up is also much more open. When you gain a level, you can chose what to increase: your hit points, your magic points, or your “badge points”. These latter allow you to equip more badges, which give you new attacks, or change your abilities (e.g. decrease the damage you take, increase the damage you do, etc.). So you can personalize your character to suit your playing style, both by what you chose to power up and which badges you equip. (Liesl and I took very different tacks here – for more than half the game, I think I upgraded badge points exclusively, and I chose badge points that changed my characteristics while Liesl chose badges that gave her more different attacks.) Also, the numbers involved are much smaller: in traditional RPGs, you’ll have hundreds of hit points and attacks will do tens of points of damage, while in Paper Mario you’ll have tens of hit points, and a badge that will decrease your damage taken by one point makes a big difference.

I certainly won’t propose this badge system as the ultimate in RPG leveling up systems, but it is a nice change of place, and I hope that future RPGs will continue to play around with flexible leveling up systems. (I had hoped that Final Fantasy X would have a similarly flexible system, but you really didn’t have a lot of choices when traveling along its sphere grid (or whatever it’s called) to level up.)

Enough for today; I’ll finish the discussion later this week.

truffles

December 4th, 2004

Have I extolled the virtues of Bittersweet, by Alice Medrich, here yet? I guess not. It’s a wonderful chocolate cookbook that I’ve been working through off and on; very good recipes, and many of them aren’t very difficult. Today, for example, I decided to make her “Truffles Au Cocolat” again, for the third time; since I’ve gotten recipe requests for it before, I figured I might as well put it in the blog. So here it is!


Truffles Au Cocolat

1 lb. bittersweet or semisweet chocolate (50-62 percent), coarsely chopped
10 Tbsp (1 1/4 sticks) unsalted butter, cut into small pieces
2 large egg yolks, at room temperature
1/2 cup boiling water or freshly brewed espresso
1/2 cup unsweetened cocoa powder

Line the bottom and sides of an 8-inch square pan with tinfoil.

Melt the chocolate and butter together. Combine the egg yolks and water/espresso; mix with a spatula, scraping the bowl to prevent the eggs from scrambling. Then mix that into the chocolate, stirring gently until completely blended and smooth. Pour the mixture through a fine-mesh strainer into the pan, and spread evenly. Cover and refrigerate until firm (at least 2 hours).

Remove pan from fridge; use liner to transfer the sheet of chocolate to a cutting board. Allow it to soften until you can cut it without cracking, about 30 minutes if it is very hard. Invert the sheet and peel off the liner. Put the cocoa powder in a bowl. Cut the chocolate sheet into 1-inch or smaller squares; toss them in the cocoal powder.

Store tightly covered in fridge (up to 2 weeks; up to 3 months in freezer). Let warm up for about 20 minutes before serving.


I’ve simplified the recipe a bit; in particular, she wants you to heat the egg mixture in a double-boiler (she actually recommends an improvised double-boiler, but never mind that) until they reach 160 degrees on an instant-read thermometer. (This is presumably to kill bacteria.) The thing is, just adding the boiling water already brings the mixture up to that temperature, so that step seems not very useful to me. Also, she tells you how to modify the recipe if you’re using higher-percentage chocolate (she tells you how to do that for all the recipes in the book – it’s one of the things I like about it, since it gives the recipes a more experimental feel). When you press the mixture through the strainer, make sure you scrape off the bottom of the strainer. (It’s not clear to me whether the strainer has any role other than to strain out scrambled eggs, for what that’s worth.)

If you’re looking for good chocolate, by the way, Scharffen Berger does a good job. I recommend their factory tour the next time you’re in Berkeley, too.

morality

November 30th, 2004

George Lakoff had an interesting article in The Nation recently, called “Our Moral Values”, where he analyses progressives versus conservatives in terms of the morality expressed by a nurturing family versus the morality expressed by a family with a strict father, and gives some tactical suggestions based on that. Pretty sensible; I should really read more of his stuff, and I know some of my friends have been into his linguistics books. I wonder how Lakoff’s split compares with Jane Jacobs’ division of morality in Systems of Survival? I should reread that book. (Looks like she has a new book out, too.)

It also reminded me of another Nation article from last year, “A Nation of Victims”, by Renata Brooks. She talks about how Bush uses dependency-creating language, charactistic of the linguistic tricks abusers use to get their ways. The strict father/husband gone horribly wrong, basically.

dvd/hdd player

November 28th, 2004

We bought a new DVD player (and recorder, not that I really care) last month, with a built-in hard drive. Noteworthy aspects:

  • In Spanish, it’s called a “Grabador de DVD con disco duro”. This amuses me, for no particular reason.
  • It is nice having a DVR, though we watch little enough TV that we’re not getting so much benefit yet out of the “pause live TV” aspects. We’ll probably get more use out of it next baseball season.
  • It doesn’t have all the fancy Tivo stuff, but it also doesn’t require a monthly subscription. Which is definitely a good tradeoff, as far as I’m concerned – I’m morally opposed to having to pay a subscription fee to use my electronics. It does grab a program guide off the cable signal; it doesn’t do as much with it as I think it should, but it’s still pretty useful.
  • One of the reasons why the program guide is particularly useful for us is that the only stuff we normally record is Food Network programs (Iron Chef, Good Eats; speaking of which, Gear for Your Kitchen is pretty good); we can’t tell it to record all episodes of those shows, but we can tell it to record at certain times if those shows are being broadcast but not otherwise, and it’s easy to browse all food-related programs.
  • Having a large hard drive (ours is 120GB) is surprisingly useful.
  • It’s kind of ironic that it can’t record digital TV, given that it has an MPEG decoder (and encoder) built in. You’d think that somebody would make a DVR that can also decode HD broadcast signals, given the plethora of HD monitors.
  • It crashes occasionally. Which isn’t something that I want in my consumer electronics. But it hasn’t caused any real problems yet.
  • The DVD player remembers where we were last watching basically every DVD that we’ve ever put into it. Which was a little freaky at first, but is pretty useful once we’re used to it – e.g. we can switch between Miranda’s and our DVD’s.
  • It has a slow response time to button presses, and a really slow response time to being turned on or off.

the singing detective

November 27th, 2004

Now that Miranda’s bed time has moved up (since she no longer takes naps at daycare), we’ve finally been able to watch movies not suitable for 5-year-olds. We usually can’t finish a whole movie in a single night, and most evenings we watch various Food Network programs that we’ve recorded instead of movies, but at least we finally get to watch movies some of the time.

The most striking one we’ve seen recently is The Singing Detective. Which isn’t actually a movie: it’s a BBC TV series, and is quite unlike anything else I’ve seen. Skin disease, alternation between fantasy and reality, hallucinations, music (frequently at inappropriate times, though not so inappropriate as in some movies). For the first two or three (out of six) episodes, I didn’t really know what to think, but it all comes together quite nicely at the end.

So why do DVD’s feel compelled to include extras after extras? Books never include extras; CD’s include a little booklet, but it’s hardly the same thing. Personally, I basically never look at the extras of DVDs – why would I want to do that instead of, say, watching the movie? (Or watching a different movie.) I guess it matters to people who are big fans of the movie in question, though, and it’s a relatively low-cost addition (at least compared to the cost of making the movie itself…)

kent beck

November 20th, 2004

I just finished reading Kent Beck’s Smalltalk Best Practice Patterns. Not because I’m about to start programming in Smalltalk – it would be an interesting language to experiment with, but I’m way too busy for that right now – but because I really wish I could program like Kent Beck.

This book had a couple of striking examples along those lines. One way that he suggests using the book (not the only way, just one way) is this: every time you are about to do something, you should look in the book for a relevant pattern (unless you know it already), and use it. Which might sound ridiculous if your only exposure to patterns is the Gang of Four book, but Beck presents many many more patterns, going down to a much lower level: he has patterns (or “patterns”, since I’m not sure everybody would agree that’s an appropriate label for them) covering such matters as variable naming and indentation. (He doesn’t insist that everybody agree with him on how to indent; he does think, and I agree, that it’s useful for a team to be consistent on such trivial issues.)

The point here is that he’s very successfully weaved his patterns into a pattern language covering a large amount of ground: if you have a basic idea of what to do in the large, then there’s a pattern that’s applicable, and that pattern in turn calls on smaller patterns for its implementation, which call on still smaller patterns. The theory (which I believe) is that, one you have a pattern language internalized, you can produce quite good code without having to think about it too much most of the time, allowing you to devote your brain cells to decisions where more thinking is necessary. You can see an example of this with larger scale patterns in his and Ralph Johnson’s article “Patterns Generate Architecture” in Kent Beck’s Guide to Better Smalltalk.

The other part in the book that made me say “man, I wish I could program like this” was the following bit from Method Comment:

Someone recently asked me point blank, “What percentage of your methods have comments?” I answered, “Between 0 and 1 percent.” Oh the uproar! As a sanity check, I asked a developer at one of my clients (where I had taught Smalltalk based on an earlier version of these patterns) what percentage of the methods of their 200 class system had comments. His answer, “between 0 and 1 percent.” “Has that ever been a problem?” “No, never.”

I just wish my methods were so transparent… I remember reading the refactoring book and coming across the place where Fowler says that comments are a sign of bad code. My first reaction was “that’s ridiculous!”. And, of course, if code is unclear, comments are a good thing; but what’s even better is to take the comments as a sign that the code needs to be refactored to make it clear, at which point the comments are probably no longer necessary.

One other predictor of bad code in Beck’s book that I hadn’t seen before was to check rates of change: don’t have a method or a class or whatever with some stuff that changes all the time and other stuff that never changes. A few days after reading that, I had a chance to apply it: I’m trying to refactor a ridiculously large class (something like 25 member variables, a constructor with about 10 arguments, etc.), and I noticed that some variables (corresponding to MPEG headers, basically) were basically set once and never changed. So I pulled some of them out into a class (a coworker wisely suggested that I not pull out all of them at once: pull out the elementary stream headers into once class, and pull out the transport stream headers into another class later), and sure enough, once I’d done that, I noticed that several methods in the original class only used those member variables and could easily be moved to the new class, and those were the only methods that accessed most of the member variables. By the time I was done I’d removed five or six member variables and two constructor parameters from the original class, had a delightfully small, self-contained, and testable new class, and was much happier with life. Of course, I could have been led to this refactoring through other routes (e.g. noticing that the variables in question were used together in certain methods), but the “rates of change” heuristic worked just fine.

cities and overworlds

November 19th, 2004

I’m (well, we’re, but more about that some other time) in the middle of Paper Mario 2 right now, and it’s setting off such a cascade of reactions, I figured I’d better start posting about it now instead of waiting until I’m done with the game. It’s not that the game is so stunningly excellent – I quite like it, but no more so than several other games – but rather that it’s interestingly and productively different from other RPG’s out there.

I had been lumping this game together with its N64 predecessor Paper Mario (for obvious reasons) and with a GBA game from a year or so ago, Mario and Luigi: Superstar Saga. And while its gameplay has only minor differences from the original Paper Mario, it’s actually quite different from Superstar Saga, and, frankly, a good deal better. (Don’t get me wrong, I enjoyed Superstar Saga.) The difference that is relevant to this entry is one that I’ve also noticed when comparing handheld Zelda games with their N64/Gamecube compatriots.

Superstar Saga and the 2D Zelda games divide the non-dungeon parts of the world into a rectangular grid. Some of the grid contains the various cities and towns; the rest of the grid is the overworld. This overworld typically has walls of trees, waters and other barriers limiting your navigation through the world, and making it somewhat tricky to avoid wandering monsters. Sometimes, the overworld can have interesting enough puzzles; most of the time, it’s just boring.

In the 3D Zelda games and in the Paper Mario games (which have flat sprites but are more 3D in other ways), the overworld has quite a different effect. The 3D Zelda games may have just as much, or even more (I really have no idea) overworld as their 2D counterparts, but it’s much less oppressive. (Well, at least on the N64: Wind Waker, the Gamecube Zelda game, had way too much overworld to slog through.) You don’t run into artificial barriers every couple of seconds, there aren’t grid transitions constantly popping up, it’s much easier to avoid wandering monsters if you’re in a peaceful mood, and you have a nice, fast mode of transportation to let you go through the game. The Paper Mario 2 overworld behaves much more like a 2D overworld in terms of dividing the world up into a grid and having artificial barriers everywhere, but there’s an incredibly small amount of overworld, so it turns into a pleasant diversion instead of a chore.

Also, while I in general prefer cities to overworlds, it’s also the case that, for reasons that aren’t entirely clear to me, I much prefer the cities in the 3D games to the cities in the 2D games. There just seem to be more interesting people to talk to, more nooks and crannies to explore, more favors to do for people. This last factor should not be minimized: in particular, one reason why Majora’s Mask was so wonderful was the little notebook of things to do other than make progress the main plot. It gave you things to do while wandering around, it recognized (and bounded) those things (the presence of the notebook makes a difference, too), and some of those tasks fit into story arcs of their own (I probably got as much satisfaction out of setting up the wedding in that game as in actually beating the main boss).

Which made me wonder: wouldn’t I prefer an adventure or RPG without any overworld at all, where the whole game was one big city? And, of course, I have played such a game: Shenmue. Which rocked. Ever since its sequel came out for the Xbox, I’ve wanted to get the console; but buying a whole console just for one game seemed a bit much. So I kept on waiting for another must-have game to appear on it. I think, however, that the time is fast approaching when I will give in and admit that yes, I do want to play Shenmue II enough to justify buying a console just for it. Don’t get me wrong – I’m sure I’ll buy other games for it once I have the console – there just aren’t any other games that will leave a void in my soul if I never play them.

I also wonder if the Grand Theft Auto series has the all-city feel that I’m looking for. I’ve stayed away from the series largely because I’m not sure I’d want to explain them to Miranda, but I do feel uncultured for not having played them. Of course, they’re not adventure / RPGs to begin with, but they might have an appropriate mix of exploration, task completion (like a modern platformer but more coherent), plot, and what not to make me feel happy.

In this discussion, I have of course ignored the fact that RPGs have not only cities and towns but also dungeons. To that, I will say that, while I do enjoy a well-constructed dungeon, the 4 dungeons that recent Zelda games have had instead of the traditional 8 (or whatever the number is) is, I think, about the right number from my point of view. Though the dungeons in The Ocarina of Time really were a lot of fun…

virtual functions and access control

November 15th, 2004

I was just reading Exceptional C++ Style, by Herb Sutter, and one of the recommendations (Item 18) threw me for a bit of a loop. That item talks about access control for virtual functions. (We’ll ignore destructors, since that’s a special case.)

My habit is to provide public virtual functions if I want all of the corresponding public functionality to be polymorphic; if I want to provide polymorphic behavior on a finer grain, I provide protected virtual functions. I never provide private virtual functions: I’m aware that, in many of the situations where I use protected virtual functions, I could use private ones instead, but I’ve never particularly seen fit to do so.

Sutter disagrees with me on two counts. The first is the point that I just brought up: “protected” means that subclasses can call the function, so if you have a virtual function on a class A that you only want to be called by A, you should really make it private instead of protected. The fact that it’s virtual is enough of a hint that subclasses of A can/should override it; there’s no need to mark it protected in addition. This makes sense to me.

The second point of disagreement is that Sutter doesn’t believe in public virtual functions at all: according to him, your public functions should all be non-virtual, though they can invoke non-public (probably private, by the above) virtual functions to carry out the actual work. In the simplest case, the public function can be a one-liner to forward to a virtual function that carries out the actual work.

The philosophical point here is that public functions provide the interface that the class provides to its users, while virtual functions provide the “customization interface” that the class provides to its inheritors. These are two different things; they should be separated accordingly.

That’s somewhat plausible, but I’m not sure I completely buy it. In particular, if the class in question is solely an abstract interface, I’m not sure that it makes any sense much of the time to distinguish between these two aspects: the public interface exists only to provide customizable behavior, so why not acknowledge that?

There are, of course, some situations where you want to do this sort of trick. In particular, it can be the case that all implementations of the public functionality will normally want to carry out more or less the same tasks in the same order, with only the details varying. In that case, providing a public non-virtual function that calls a sequence of non-public virtual functions is very useful. (This is the “Template Method” design pattern.)

The book also gives further examples where this might be useful – for example, if you decide that you always want to perform some action before and/or after calling the core of the implementation (e.g. instrumenting it, checking pre-/postconditions), then it would be useful to have your function already broken up into a public non-virtual part and a non-public virtual part: you would only have to change the non-virtual part.

There’s some truth to that. On the other hand, in my limited experience, that’s not something I want to do all that frequently; and, in situations where I want to do such a change, it’s not too tricky a refactoring to turn a public virtual function into a public non-virtual function plus a non-public virtual function. (It’s not completely trivial, but it’s not that hard, either.) Furthermore, it’s not like starting with a public non-virtual interface is a panacea: in particular, if you want to change from an implementation with a single virtual function into an implementation with multiple virtual functions (creating a Template Method), then the fact that you started from a non-virtual public interface won’t help you at all.

The place where I’d seen this before is the IOStreams library. I suppose it makes sense there – the authors of the standard want to impose as few constraints as possible on implementors, so this fits into that vein: e.g. it makes it possible for people to ship versions of the library that instrument various calls. And, in general, the less control you have of your subclasses, the better job you have to do of guessing where to put your virtual functions, because it may not be possible to carry out arbitrary refactorings; this is a technique that can help. (Though, as I said above, I’m not sure how much it helps, given the non-Template Method to Template Method conversion example that I mentioned.) But, in general, I’m not convinced.

Still, as Sutter says, it’s so easy to do things the way he recommends that you might as well always do it, given that there can be benefits at times. There’s certainly something to that – I would never dream of having non-private member variables, after all, so even in situations where I really am keeping around data that I allow the user to read and write, I will do that via public member functions. (But I don’t want to stretch that analogy too far – I’m rarely in a situation where a class provides simple functions to read/write a member. Or rather, I’m in that situation more often than I’d like at work, but that’s because we do things wrong at work, not because it’s a good idea.)

For the time being, I’m keeping an open mind on the issue. Even if I were convinced by Sutter’s arguments, I doubt I’d adopt his recommendation immediately, because that would require changing our coding conventions at work, and I don’t think this is an important enough issue to require a change of existing conventions.

On completely different topics:

  • I was playing Paper Mario 2 (about which I will write multiple posts later) over the weekend, when Miranda started humming the main Katamari Damashii theme, for no particular reason. So I spent the rest of the weekend and much of today singing/whistling/humming it myself.
  • I don’t know what triggered it, but I’ve suddenly started getting a new piece of blog spam about every 5 minutes. Sigh. Fortunately, they’re getting intercepted and dumped into the moderation queue, but it’s still a pain.

followups

November 11th, 2004

We bought one of the tables today – a lovely dark purple rosewood one from a Chinese furniture store. So now we’ll actually be able to have more than two people over for a meal.

And the piano was looked after today. It really does look like the piano guy from the store was incompetent – the keys were sticking for two reasons, one of which was a normal occurrence during the breaking-in period but one of which was due to shoddy prep work. And it looks like he screwed up fixing the way one of the notes clicks, too. (Though I won’t count that one as fixed until a couple of days go by, since I’ve seen it “fixed” twice so for only to come back the next day.) Hopefully the guy today really did know what he was talking about; I’m optimistic.

prisons

November 11th, 2004

I just finished Are Prisons Obsolete?, by Angela Davis, and it reminded me how screwed up we are about prisons. I read an article (in The Progressive?) a few years ago which said that the US locked up between 5 and 15 times as many people per capita as countries in Western Europe (admittedly, for most countries, the ratio was closer to 5x than 15x); the book says that the US has 5% of the world’s population but 20% of the world’s prisoners, which pretty much agrees with that figure. Locking up somebody is a really awful thing to do to them, and we’re supposed to go by the principle of innocent until proven guilty beyond a reasonable doubt, yet by the standards of civilized countries, only 20% of the people in our prisons actually deserve to be there.

And California is, of course, a leader in this. Apparently two thirds of our prisons were built in the 80’s and 90’s; we passed an incredibly draconian three strikes law a few years ago; and Gray Davis was not only bending over to do whatever the prison industry wanted, he did whatever he could to lock up people and throw away the key, universally overturning parole board recommendations to let prisoners out. At least Arnold is sometimes letting people out of prison when the parole board recommends it.

And it’s not just the numbers of people we lock up: we do everything we can to dehumanize prisoners once they’re in jail. (And then act shocked, shocked when something like Abu Ghraib comes up.) Huge overuse of isolation, guards treating prisoners like dirt, guards allowing prisoners to abuse other prisoners, setting up the worst sort of Lord of the Flies scenario.

And there’s no reason for any of this. It doesn’t make any sense at all morally: you should never treat people badly just because you have the power, or just for revenge. It doesn’t make any sense pragmatically: the only possible moral justification for prisons is to reduce crime, but if you want to reduce recidivism, doesn’t it make a lot more sense to model good behavior, to improve socialization, to improve education levels?

And then there’s prison labor. I really believe that most people in this country don’t want to be gratuitously mean; but there are so many ways that people can make a lot of money off of prisons, whether in constructing them, running them, or getting slave labor out of them, which skews the debate horribly. Not to mention second-order sources of profit: we want to control the governments of third-world nations and sell lots of weapons, so we invent a war on drugs, which we have to justify by locking up drug users and drug dealers in huge numbers.

Sigh. I’m sure, though, that the Christian fundamentalists in power will improve the situation soon – they so clearly take turning the other cheek as words to live by.

gay divorced tables

November 6th, 2004

We went to see The Gay Divorcee on Wednesday. (The Stanford Theatre is showing a bunch of Fred Astaire / Ginger Rogers movies over the next couple of months.) I’d forgotten that old movies are in a 4:3 aspect ratio, or something close to that – not nearly as horizontal as modern movies. A couple of nice songs and some nice dancing, but I was hoping for more. And the Continental sequence really was over the top – not as bad as, say, a dream sequence from a Gene Kelly movie, but still…

We’re going table-shopping this weekend – now that there are three of us and we have friends with kids, our little round table just isn’t quite up to the chore. We looked at various options today, and found four reasonable options, but all had their flaws – not having a leaf, being more expensive than we wanted, needing a bit more care than is ideal, or in a style that didn’t thrill one of us. I’m sure we’ll buy one of them, but I’m still not sure which. I am glad that we finally got around to going to my namesake store, Carlton Arts and Design in downtown Mountain View – I’ve walked past it dozens of times without going in, not being very interested in the stuff in front (large porcelain vases), but there’s some pretty neat stuff in there. Miranda loved all the chests with their little drawers, there was a very simple vase that I liked a lot, if I were a sake drinker at home I would certainly buy one of their sake sets, and there were some quite nice tables. On the expensive side, but they were better constructed than the others we were considering, so we may well end up getting one of them.

election night

November 2nd, 2004

It’s election night. And what a depressing campaign it has been. I voted for the Green candidate for president (David Cobb), but if California had been close, I would have voted for Kerry: I don’t like him at all, but Bush’s team is evil.

No matter what happens, I’m going to feel guilty: I’ve been almost completely politically inactive since moving to California. Even if Kerry wins, political discourse continues to move to the right. Democrats keep on positioning themselves as slightly better than Republicans; I can’t stand that, but I also haven’t been doing anything to change that.

Which raises the question: what should I be doing? I’m completely out of touch with the local political scene, so figuring out what’s going on here is the obvious first step. Maybe there are local issues that I’ll get motivated out; it would be nice if the local work were to fit into larger strategic themes, though.

I’m not sure exactly what strategic themes I think will be most effective, though. One thing that intrigued me about the election this year was California’s Proposition 62, which was trying to recast our primary systems: all candidates from all parties would be on the primary ballot together, and the top two vote-getters would go on to the main election, even if they were both from the same party. It sounds like a good idea to me: I can’t say I like political parties to begin with, at least with the winner-take-all system we have in this country, and I’m sure that, in a lot of races in California, we’d end up with a more liberal Democrat running against a more conservative Democrat, which I’d much rather see than a Democrat against a Republican. Having said that, I don’t think the proposition has much of a chance – it’s not in the news much, and propositions like this don’t seem to win without making a bit of a splash in the process.

What happened to the full public financing movement? It looked like it was going strong 6 years ago, but I haven’t heard much from it recently. Sounded like a good idea. (Don’t get me wrong, I’m happy to support other things than changing election machinery, but it does seem a good way to get bang for your buck.)

Of course, politics isn’t the only thing that I wish I were finding time for…

refactoring milky video games

October 31st, 2004

My house has been struck by plague. On Tuesday, Liesl stayed home; on Wednesday, Liesl and Miranda stayed home; on Thursday, Liesl, Miranda and I all stayed home; on Friday, there wasn’t anybody else to pass the cold to (the dogs don’t get colds from us, fortunately, and they stay home all the time anyways), but we weren’t getting any better, either. Fortunately, Miranda was more or less on the mend by Saturday, and I think Liesl and I will be able to go to work on Monday. We’ll see.

Does having a cold make you more sensitive to the smell and taste of milk? Because either I’m having incredibly bad luck, or every store in Mountain View is full of spoiled milk, or something. At first I thought something was wrong with the temperature control in our fridge, and that may actually be the case, but milk is now smelling strange to me as soon as I bring it home. And it’s not just me – Miranda has been complaining about the taste, too. Maybe it’s a recent switch from 2% to 1% milk – does milk with a lower fat content go bad faster?

One of the benefits of staying home is that I’ve had lots of time to play games. In my last entry, I talked about how wonderful Katamari Damashii is. And I just want to emphasize that further; I’ve been playing through the game again, and it (and its music) really is fabulous. In fact, I was going to say that it’s the second best video game I’ve played this generation, after Metroid Prime, but looking at my shelves, that’s an exaggeration. It probably is the best video game I’ve played in the last two years, but all that says is how front-loaded this generation is. Hmm: Are generations always front-loaded? I guess I would believe that as a general rule: in the first two years, you see new gameplay ideas that wouldn’t have been possible in previous generations of hardware, while the three years after that give you games that are largely refinements of ideas that you’ve seen before. So early in this generation we got Metroid Prime, Animal Crossing, the Resident Evil remake, ICO, Golden Sun, Advance Wars, and the beautiful short life of the Dreamcast (Shenmue, Jet Grind Radio, Space Channel 5, Soul Calibur). While now the best games, while often quite good (Prince of Persia, SSX 3), usually don’t excite me as much.

I’m finally getting to the end of my first big refactoring project at work. Two or three months ago, I inherited some badly written, completely untested code, so my top priority was to clean it up, so I’d be able to fix bugs in it and adapt it for new situations. It’s been quite an educational experience. One thing that I learned from my last refactoring project is that, if you start your refactoring at the top, then it will probably be very helpful in understanding the structure of the code, but it won’t make it any easier to test – you’ll still be left with big classes, albeit better-structured ones, and writing unit tests for big classes sucks. So I was happy a month and a half ago when I found a couple of nice little classes that I could split off from this code and write unit tests for. And, while doing that, I noticed some bugs in the code, bugs I never would have found without cleaning it up like that. This week I finally got to a situation where the main class involved in this program is small enough for me to test.

Except that the tests were too simple. Which points at a way in which I was misunderstanding the program. This program doesn’t actually do anything itself – it just takes user requests and passes them off to other programs to carry out the actual work. And there are only a couple of important user requests, so it turns out that there are two unit tests at the core of this program. But, while it’s a small program, it’s not that small. And, when I look at the code, I see that the real story is the error cases. If you’re dealing with a program that just talks to lots of other programs, then the question isn’t what happens if everything goes right: the question is what happens if you get queries or responses in an unexpected order, what happens if one of the other programs goes down, what happens if this program goes down and has to try to recover its state.

So I’ll be spending the next two weeks refactoring code with that aspect of it in mind (I’ve already done most of the relevant refactoring, of course) and bringing it under test. And then I’ll move on to something else – there’s another program that I’m in charge of that is starting to cause problems and need refactoring, or maybe I’ll have to refit this program with different external interfaces. (Which will be a lot easier now: that’s the whole point of refactoring, after all, and developments in our business plan make me think that I’m getting this done just in time.)

I really love the way that code development via refactoring works. I didn’t try to understand the whole program at once and come up with a better way to do things. Instead, I started by looking for places in the code that I knew I didn’t like the look of (or the smell of, as the refactoring book puts it), and improving them. Every few days, I’d get sick of fixing some particular thing over and over (or, worse yet, not fixing it), and at that point I’d have enough of an understanding of the problem that I could usually come up with a general solution. Usually the solutions (whether specific or general) weren’t perfect; I’d add a FIXME comment, and a couple of weeks later the surrounding code would have changed enough that the FIXME comment could be dealt with much more easily. For a long time, I had a hard time telling how much progress I was making (and, in particular, when I’d be done), but all of a sudden this week I looked up and realized that the bad smells had greatly receded: they were still there in the fringes of the program, but a strong core had appeared, one which will serve us well going forward.

katamari damashii

October 24th, 2004

I take back everything good I said about Manny’s fielding. Anyways:

Today’s game is Katamari Damashii. (Or Katamari Damacy, as the US version is spelled, though they pronounce it the same way.) It has one, very simple, idea: you roll a ball around, and items that are small enough stick to the ball. As more and more items stick to the ball, it gets bigger, enabling you to pick up more items.

It’s impressive how much mileage it gets out of this idea. Early levels are pretty straightforward: you start as a 5cm ball, say, that can pick up thumbtacks but still gets chased by mice; over the course of the few minutes that the level gives you, you get to where you can pick up those mice and other larger items (books, fruit). And the level is divided up into areas, some of which have no barrier between them, but some of which have a sign that you can only pick up if you’re as large as the height marked on the sign, so the level effectively expands as you get larger and larger.

In later levels, you’re given more time and usually start somewhat larger; instead of picking up thumbtacks and worrying about mice, you start, say, by picking up bananas and worrying about people. And then picking up people, and eventually picking up trees, cars, … By the end, the scope of the game is truly remarkable: the last level starts you off at one meter, and when I finished I was more than half a kilometer in size. You interact with a portion of a level in a completely different way when you’re 1 meter tall versus 3 meters tall (hmm, can I pick up cars now?) versus 10 meters tall (hey, those elephants look promising, and I can get small buildings now) versus 30 meters tall (skyscrapters, giant squid) versus 100 meters tall (oh, they hid some even more giant squid over here; and I can pick up small islands now) versus 300 meters tall (clouds beware). I’m curious how they implemented this, actually – I tend to assume that, when you’re 300 meters tall, they no longer bother modeling bananas, while when you’re 1 meter tall, they don’t bother modeling far-off areas that you won’t be able to get to until you’re lots larger. But such transitions, if they’re there, are completely seamless.

The music is fabulous, too. For a while, I wondered “do I just like any sort of pop music as long as it’s in Japanese?”, but the truth is that the music is great, and I loved the song in English as much as the ones in Japanese. The control scheme works pretty well – they used a two-joystick scheme instead of a single joystick + buttons scheme, and while either way would probably be equally expressive, it is nice to see a game that uses dual joysticks effectively.

It is, of course, a short game – even the best one-trick ponies can only be dragged out so long, after all. (Though I am actually planning to go back and replay some of the stages; they’re fun, and a look at gamefaqs.com suggests that eventually I’ll be able to unlock time-limit-free versions of stages.) But it is priced accordingly: it’s the best 20 bucks I’ve spent on a video game in quite some time.

infinite justice

October 22nd, 2004

I just read Arundhati Roy’s article “The algebra of infinite justice” in her very good and very depressing Power Politics. It was written on September 29, 2001; I’d forgotten that “Operation Infinite Justice” was once the code name for our war on Afghanistan. Anyways, I was struck by the following quote in the article:

The trouble is that once America goes off to war, it can’t very well return without having fought one. If it doesn’t find its enemy, for the sake of the enraged folks back home, it will have to manufacture one. Once war begins, it will develop a momentum, a logic and a justification of its own, and we’ll lose sight of why it’s being fought in the first place.

My first reaction was: right on, look at the mess we’ve gotten into in Iraq. The thing is, though, the truth is even worse than this quote envisions. Yes, the war in Afghanistan didn’t end up finding our enemy; yes, the war in Iraq was manufactured. But the war in Iraq wasn’t manufactured in order to appease “folks back home” demanding a war: instead, Bush had his sights set on Iraq before September 11. There was never was a connection between the two: September 11 simply gave Bush an excuse to fight the war he really wanted.

Sigh.

blog spam

October 21st, 2004

I learned about blog spam today: a spammer tried to add comments to most of the posts here. The bodies of the comments were random quotes; the goal is to get people to click on the spammer’s name, which linked to a web site. Actually, that may not be the main goal: apparently blog spammers mainly use this as a way to try to increase their rank in search engines.

Fortunately, it turns out that WordPress has a way to say “flag a comment as needing approval if it contains one of these words”. So I just entered the web site in that list, and now the spam gets blocked. Yay. But it will be a pain if this sort of thing keeps on happening.