[ Content | Sidebar ]

groovelily; regret

May 7th, 2007

I learned about the band GrooveLily from an episode of Next Big Hit. I wasn’t paying too much attention when the song, “No Room In Your Bag”, started: a patter song over a drum backing. But then some chords on the piano came in, the instrumentation started getting richer (electric violin, yay), and I started realizing that I rather liked the lyrics. (Not to mention the singer’s sliding into falsetto.)

Quite a song; it’s stuck in my head since. I hesitate to link to a myspace page, but it seems to be the best place to listen to the song. (There’s also a live version available on the band’s web site, but the instrumentation is worse, so I won’t link to it here.) About marriage, gender structures, jobs, academia (in part), art, kids: all things that are dear to my heart.

And about making choices, choices with serious consequences, yet not being paralyzed by the consequences of those choices. The title of the song comes from the chorus:

You make a choice, you make a call.
You may rise, you may fall.
You will pay for what you get.
You’ve got no room in your bag for regret.

So: you make choices. They have consequences, potentially serious ones, and won’t always turn out the way you expect. But, if they don’t, wishing you’d chosen differently isn’t going to do squat for you.

I’m not sure why this is rattling around in my head so much right now. I don’t want to give my readers the impression that my life was full of bad choices, choices with unpleasant consequences, because that simply isn’t true: I’m quite happy with the way that basically all of my major life choices have turned out. (And I don’t spend time worrying about the minor ones, either!) But the meme does seem to be showing up in my environment a fair amount; one bit I may post about later, but I’m also thinking of a discussion on the XP mailing list about the prime directive for retrospectives.

Some people like the directive, some people don’t, and I’m not sure myself which side I come down on, but we can all agree that certain aspects are positive. It’s not that you don’t look at the effects of your past choices – if you’re not going to do that, then you’re not holding a retrospective! But that doesn’t mean that you should spend your time beating yourself up over bad consequences. (Or beating other people up, which seems to be more the thrust of the prime directive: don’t waste your energy on blame.) Make a good effort to learn what you can from the past, see if you can come up with a strategy to do better in some way next time, and leave it at that.

Anyways, enough on regret. I got GrooveLily’s album Are We There Yet? on the strength of that song. The album doesn’t live up to its promise, but there are several nice moments. One of my favorites, on the first track: the lyric “I’m feeling paranoid” coming up in a context where you think we’re going to get a Freud rhyme, but no: “Hanging like Harold Lloyd”. They seem to be turning to the stage more these days (or maybe they have a long stage history – I should look into their back catalog); I just finished listening to Striking 12, a charming musical based on “The Little Match Girl”. (I was amused by this Anime Music Video based on the song “Screwed-up People Make Great Art” from the album.)

Good stuff; I plan to listen to more of their music.

warriors-mavs, games 5 and 6

May 5th, 2007

Game 5 was in Dallas; the Mavs went up twenty, I decided that it just wasn’t the Warriors’ night. I wasn’t worried about them not winning the series or anything, but the Mavs were a good team on their home court, and the Warriors were obviously having an off night.

And then the Warriors started coming back. And came all the way back, and were up by (I believe) 9 points, and I was lamenting my faithlessness. (This happens to newly converted fans.) But they let it slip away at the end; oops.

Still, game 6 was in Oakland; I had high hopes for a victory there. Which were quickly dashed when Baron Davis strained his hamstring. The Warriors hung in while he was out, but when he came back, he could barely move, and you could just tell that the Mavs would take advantage of him.

Which they tried to do, but the Warriors kept it close, and were even up by 2 at the half. And then, all of a sudden, it was the third quarter, Stephen Jackson rained down threes like manna from the heavens, and in the blink of an eye, the Warriors were up by 23 points.

Which lead, unlike the Mavs’, they managed to hold on to. I still am having a hard time understanding what happened: winning the series at all was a huge upset, but winning the final game 111-86? I have no context for that.

So what’s going to happen next? We’ll find out soon if they’re going to face Utah or Houston in the next round. Am I supposed to expect the same thing to happen in the next round? I have to think that, somehow, the Mavs were a particularly good matchup for the Warriors, that the Warriors aren’t really as good as they’ve looked, and that they’ll be lucky to make it through the next round. But given what I’ve seen of them, given the way they closed out the season, I can’t say that with conviction.

warriors-mavs, game 4, fourth quarter

April 29th, 2007

In the fourth quarter, the Warriors went on a run a bit earlier, and it paid off. Dallas tried to come back with threes at the end, but the Warriors sealed the game by stealing an inbounds pass with 3.3 seconds left.

I guess I’ll be watching a fair amount of basketball over the next few weeks; this is fun! The Warriors didn’t dominate game 4 the way they dominated game 3, but the Mavs merely looked like a decent team instead of an .817 team, the Warriors were really energetic on defense, and it all worked out in the end.

probability

April 29th, 2007

A puzzle from This Week’s Finds, Week 250:

You and your friend each flip a fair coin and then look at it. You can’t look at your friend’s coin; they can’t look at yours. You can’t exchange any information. Each of you must guess whether the other person’s coin lands heads up or tails up. Your goal, as a team, is to maximize the chance that you’re both correct.

What’s the best you can do? If you pick an answer at random, you’ll get it right 1/4 of the time; can you prove that that’s the best you can do? If not, can you find something better?

streamstar launch

April 29th, 2007

I had the pleasure of going to the StreamStar launch in New York. In a private jet, no less; Sun execs occasionally take them, Fowler was using one to get to the launch, and the rest of us got to tag along.

Which was fun. Not a transcendent experience or anything: the food was so-so, there wasn’t any place to put my backpack. And I was surprised that there wasn’t any internet access: I thought the technology for that sort of thing was available, and it seems like exactly the sort of thing executives would appreciate to make more effective use of the hours in the air. Dunno. But it was very nice to be able to show up just a few minutes before the plane was scheduled to leave, and to not have to go through security: it eliminates all sorts of waste and uncertainty. If I’d been taking a commercial flight, I probably would have had to go a day earlier, and otherwise I would have had to get up at an ungodly hour; as it was, the timing was quite civilized.

What was not so great was waking up that morning with a sore throat, and having it turn into a quite nasty cold by the end of the day. I ended up lasting through about 45 minutes of the launch party; nice to see a StreamStar system set up and working in a hotel (never thought I’d see that), but I wish I’d been able to enjoy more of it. We had something interesting planned the next day which I had to bow out of, too.

Fortunately, the cold went away about as fast as it arrived: I was feeling much better by the end of the flight home. Which was my favorite part of the whole experience, as it turned out: I got to hear Fowler talk about several really amazing products we have in development. I’d been feeling a little out of touch for a while; there’s obviously been a lot going on that I’ve been missing. To the extent that I’m now starting to think that I want to hang out at Sun for the indefinite future just to see how this comeback plays out. We have a stream of products (not least of which is StreamStar itself) coming out that nobody has seen before; they won’t all stick, but I bet some of them will, and I bet some of them will create markets that nobody has envisioned.

I need to start figuring out what’s happening on the software side, too…

warriors-mavs, game 4, third quarter

April 29th, 2007

The steal and dunk at the end of the third quarter to tie the game perhaps wasn’t quite as impressive as the midcourt shot at the end of the half, but it was pretty close.

Or maybe it was more impressive: hustle rather than luck.

warriors-mavs, game 4, first half

April 29th, 2007

Not sure yet how this game will go, but it’s looking up all of a sudden. For much of the half, the Warriors couldn’t really get anything going; the Mavs weren’t doing anything too special either, though, so the Warriors stayed within 8 or so. But then Pietrus came in, and had several excellent blocks and a really stunning dunk out of nowhere on an offensive rebound, and the energy went way up and the score got closer. At the end of the half, it’s tied, in the most improbable fashion imaginable: the Warriors were down three, got the ball back with 1.1 seconds left and made a half-court shot to tie it. (Their three-point shooting sucked through most of the half, but it picked up towards the end.)

So it’s tied now, with the energy in the Warriors’ fashion. They need to keep up the energy and cut down a bit on the bone-headedness (the worst of which was hotdogging on a three-on-one that turned a guaranteed score into an attempt at an alley-oop foiled by a non-shooting foul); I’m looking forward to the second half.

warriors

April 27th, 2007

I don’t watch basketball much. I don’t have anything against the sport – it seems reasonably entertaining to watch – but the baseball season alone already provides more sports than I really feel like watching over the course of the year. And it doesn’t help that my local team for the last eight years has been bad, slow, boring, with boneheaded management.

Until recently. One trade last year gave a glimmer of hope, a managerial hire this year gave another. And then they unloaded several mediocre, slow players and got a bunch of rather good ones in return. (I have no idea what Indiana was thinking when they made the trade.) Still, I saw that as a sign of hope (doubtless soon to be dashed) for the future rather than a move that would pay off this season. And they went into a slump which seemed to confirm that.

But then they won nine out of their last ten ending the season, and now they’re in the playoffs for the first time in more than a decade. Of course, their opponent, Dallas, has by far the best record in the league, so they don’t any realistic chance, do they?

Apparently they do. The A’s game wasn’t on this evening (stupid Comcast), so I watched most of game 3 of the Warriors’ playoff series; and they just beat the crap out of Dallas. You’d never believe that the Warriors’ record this season was .512; you’d never believe that the Mavericks’ record was .817. I saw several amazing plays, and the Warriors were clearly far from intimidated.

Right now, they’re leading the (best of seven) series 2-1. Dallas is a very good team, it could obviously go either way. But I am impressed with what I’ve seen.

streamstar details

April 26th, 2007

As promised, here’s some more information about StreamStar. (Which is officially known as the “Sun Streaming System”.) It’s an extremely high performance video server, targeted at cable companies and telcos trying to move into the video space; its distinguishing features are that it can pump out an extremely high number of video streams at a much lower cost per stream and a much lower footprint (in terms of rack space) than its competitors, backed by a much larger amount of storage than its competitors. It’s a distributed system; some of the nodes (handling video ingest, control traffic, etc.) run on general purpose Opteron servers, but there are also storage nodes (Thumpers, each of which contains 24TB of disk storage plus a couple of Opterons), and one specialized box.

The specialized box, StreamSwitch (whose official name is “Sun Fire x4950”; blech) is quite a beast. Fully loaded, it has 32 10Gb ethernet ports for streaming video out, 32 10Gb ports for getting video off of the Thumpers, and up to 2TB of memory for caching video, so we don’t have to hit the disks every time we want to stream.

This is an obscene amount of streaming and video capacity. On the streaming side, we can send out 320Gb of traffic every second. Modern encoders can generate pretty good-looking standard definition video at 2Mbps using H.264; we can support 160,000 individual streams at that bitrate. (I’m not sure what the best numbers are for high definition H.264 video – maybe 6-8Mbps? Double those numbers if you’re using MPEG-2, but at this point H.264 is mature enough and has enough momentum that there’s a clear shift in its direction.) And that number isn’t marketing hype: while we do lose a little bit of overhead from bandwidth allocation issues (rounding, fragmentation, etc.), the hardware and software really is capable of saturating those ports. We’ve observed performance of above 310Gbps, which is a huge amount of streaming capacity. (Fun fact: 40,000 StreamStar systems provides enough video capacity to send a high-definition stream to every single television on the planet! So this will never be the highest volume of products – no matter how well it takes off, there’s a cap on how many we can sell…)

And this can be hooked up to 32 Thumpers, providing 320Gbps of video data coming into the switch. Again, using the same 2Mbps number, each Thumper can store around 9400 hours of video. So a fully loaded system could conceivably store around 300,000 hours of video. There are a few bits of marketing hype here – for one thing, you’d probably want to store each video twice for redundancy purposes. (Even with RAID providing data security guarantees, you’ll still occasionally want to bring a Thumper down for maintenance or something.) Even if you divide by two for redundancy purposes, though, you can still store 75,000 two-hour movies, or you can store a month’s worth of TV from 200 different channels. (The system is designed to ingest large numbers of video streams in real time, for live TV; it can ingest movies much faster than real time.) Also, we can’t currently saturate the 10Gbe ports coming out of the Thumpers; we’ll work on improving that, but I’m not sure how much it matters. Many people will be watching the same content simultaneously, so we don’t actually need the bandwidth coming into the switch to equal the bandwidth going out of the switch; and having a couple terabytes of cache (almost a minute per stream) gives us a lot of wiggle room to play with there.

So what can you do with all of this? It opens up new usage models in two different ways. For one thing, that’s a lot of storage. (768 TB; I imagine that it won’t be too long before we’re up to a petabyte!) If it’s used for movies, then you can go very far indeed down the long tail. I haven’t checked – how many DVDs have ever been released? I assume that Netflix will still have us beat towards the end of the long tail, but we can put up a good fight. Alternatively, you can use some of that storage for live TV. It lets cable companies store weeks worth of TV channels, so if you miss a TV show, no problem: it can all be sitting there on the server. (At least if the content providers will let them: as the Cablevision case shows, content providers apparently have a horror of letting people actually, say, watch TV shows when they want to.)

For another thing, the streaming bandwidth means that everybody watching TV can get their own unicast video stream. Right now, TV signals are being broadcast out: a TV station sends out a signal once, and everybody watches that same signal. So everybody is watching the same thing at the same time. Cable companies can refine that model somewhat, so different zip codes might, say, get slightly different ads, but it’s pretty far from being personalized.

If everybody gets their own video stream to play with, though, then there are a few new games you can play. For one thing, it can act as a Tivo (except with a lot more disk storage, and with the disks at the head end instead of at each TV): you can pause, rewind, fast-forward at will. (Networked Personal Video Recorder, or NPVR, is the buzzword here.) Which is great for TV watchers. For another thing, it opens up new ad models: each person can get their own customized set of ads. Which is great for TV providers and advertisers; with luck, it will even mean that the ads that TV watchers get will be a little more interesting to us, too.

All of a sudden, we’re a lot closer to the holy grail of video service: we’re not quite at a situation where anybody can watch any movie ever made any time they want, or any television show any time they want, but we’re much much closer to that than we’ve ever been before. And we can do this all at a reasonable price, one which is more than low enough to fit the cable companies’ business models. (And which is significantly lower than the price of existing low-capacity video servers.) In fact, at this stage the barriers to that holy grail seem to be legal rather than technical: we just have to convince the people who make the movies and TV shows to let people watch them!

This has been a fascinating product to work on; it’s hard to believe that I’ve been working on it for almost four years. I have a great bunch of coworkers, I’m still learning something new every day, and we have some interesting things coming up in our road map. It’s wonderful that the product is finally launching; I expect great things going forward.

we’ve launched!

April 26th, 2007

The product that I’ve been working on for the last four years has launched! I am very excited. I will blog more later; nice to be able to finally talk about this.

lego star wars ii

April 22nd, 2007

Lego Star Wars II is a very lightweight adventure game based on the original trilogy of movies, with everything made out of Lego. Mostly fluff, but a fair amount of humor, and the whole package is really quite fun.

The best part, for me: it’s very easy, and has a cooperative multiplayer mode. This meant that Miranda and I could play through it all together. I’ve never done much cooperative video game playing; I highly recommend it, especially with one’s daughter. It worked great in this game; we could both happily wander our way through the levels, puzzles weren’t too tough (and there were a few that she solved before me), and, on the rare occasions when she got too frustrated, she could drop out for a minute without penalty.

Gameplay: you wander through areas from the movies. At any given time, there are at least two playable characters in your party; most of the time, there are more than two, and you can switch between them (almost) at will. Different characters have different abilities: force-wielding characters can manipulate certain objects; certain doors can only be opened by, say, one of the robots; R2D2 can hover across chasms; the robots can’t jump up platforms, etc. There are your standard switches and the like to manipulate the environment; you can often destroy parts of the environment, as well, and you periodically encounter piles of lego blocks which you can assemble into something. You can imagine the puzzles that result: human A gets to location B, assembles something or flips a switch to let C3PO go somewhere, C3PO flips another switch, or R2D2 flies somewhere and flips a switch, eventually the whole party has crossed a chasm.

You accumulate money as you go along (used to unlock extras); if you die, you lose some of the money but reappear in the same place, and if you’re out of money, there’s no cost to dying. So an amazingly forgiving game in that regard. I wouldn’t propose this as a general model, but there’s something here that other games can learn from, I think. Why don’t all games do this? As far as I can think of, there are two good reasons to penalize characters for dying:

  1. You want to make the game harder, so you require people to carefully navigate a series of challenges without making a mistake.
  2. It’s hard to figure out what state to put people in when bringing them back to life.

The former is pretty obvious; let me explain the latter. In a typical game, you have various bits of state: location, health, ammo, items, money, etc. So, when you die, the game has to decide what state to restore you in. Sometimes, games give up and restore you to the last time you saved the game. Another common choice is to bring you back to a recent checkpoint: Halo, for example, takes this route.

But Lego Star Wars has a remarkably small amount of state. There’s no ammo, there are almost no items. (The only exceptions are hats (usually stormtrooper helmets) that you occasionally wear, looking quite silly; those get knocked off the first time you get hit, so it’s reasonable to not restore them when you die.) You do have health, but your health bar is so short (four hearts) that it might as well just restore you to full health when you die. So the only choices the game has to make are what to do with your location and money when you die. And it simply preserves the former and docks the latter a bit (an entirely acceptable choice, given how unimportant money is, and how easy it is to acquire).

I was, of course, aware of the virtues of the lack of state when doing certain types of programming, but this was the first time I’d thought of that when designing video games. I certainly wouldn’t recommend that all games go this route, but it’s a valid choice that I wasn’t aware of.

And other games impose penalties on dying for reasons other than the two listed above, for no good reason that I can see. While playing this game, for example, I was also working my way through parts of GTA III. When you die in that game, it plunks you near a hospital; you’ve lost all your guns, ammo, and armor. Assuming you’ve saved before starting the mission, there’s absolutely no reason to not reload your save game at this point, if for no other reason than to get your guns back. Which leads to the following problems:

  • The default action on death is useless.
  • It forces you to explicitly go to your hideout in the game to save before starting each mission, even if you’re near the start point for the next mission, in case you die during the next mission.
  • When you die, you have to drive back to where you were given the last mission, and then drive from there to where the action in the mission actually happens. (And sometimes watch lengthy cut scenes for the n‘th time.)

Which is pointless. Making you replay stuff in order to make the game harder is fine in general, though it can certainly be overdone, but there’s a difference between that and forcing you to repeat busywork. Why not just put in a simple checkpoint right before the start of the real action of each mission, and leave it at that? The sad thing is that this flaw is still present in later games in that series.

Enough about death; back to the regular gameplay. Once you’ve played through each level, you can play it again using a wider range of characters. (Including ones you assemble yourself by mixing and matching lego pieces, should you so choose.) Which is a nice way to extend replay value: they hide lots of stuff in each level that you can only access by using special powers or by being certain characters; so you have lots of stuff to look for the second time through the level, while also at times rethinking your basic approach (since your new characters may move in different ways than the original characters you used for the level). I didn’t play through too many levels a second time, but that was because I had other games I wanted to try; I’m sure I would have happily replayed the whole thing had I been in a bit more of a game drought. (Or had been only able to acquire video games at restricted intervals, instead of being able to buy them whenever I felt like it.)

I don’t want to claim that the game is a vast advance in the genre, or anything. But it’s quite well done, made several smart choices, and the cooperative multiplayer is great. I certainly recommend it to anybody who wants to play video games with a child, and I imagine lots of people in other circumstances would enjoy it as well.

random links: april 21, 2007

April 21st, 2007

wii sports

April 21st, 2007

Wii Sports is supposed to be key to the system’s mass appeal. Rather than targeting gamers, it’s designed to appeal to everybody; rather than forcing you to control the game by manipulating two joysticks, a D-pad, six face buttons, and four shoulder buttons, it lets you just swing the controller back and forth. (Side note: one thing that wasn’t clear to me in the early coverage of the system was that the controller contains two unusual motion detection devices: there’s something that can tell where on the screen you’re pointing it (if you’re pointing it at the screen, at least), and there’s an accelerometer, to tell whether/how you’re swinging it around. This game only uses the latter (except for interacting with menus and the like). The nunchuck attachment also has an accelerometer; this game uses that for boxing, so it can tell whether or not each hand is punching.) Designed for easy accessibility, designed for multiplayer, designed to convince people who wouldn’t think of buying an Xbox to buy a Wii, after some friend or relative has forced a controller into their hand and they’ve achieved enlightenment.

Or something like that. I don’t know if I believe all the hype, but the console is continuing to sell, and Wii Sports doubtless has a lot to do with it. While my parents were here over Christmas, I did play it a few times with my dad and with Miranda; my dad wasn’t planning to buy a Wii when he got home or anything, but he did seem to be enjoying himself. Then again, I’m sure he would have enjoyed doing a lot of things with the two of us.

Tennis was our favorite game of the lot. Let me be very clear: this is not at all a sim. It’s doubles tennis (with one player in charge of two miis if you’re playing with less than four people), with the computer controlling movement: your sole responsibility is to swing at a not-too-inappropriate time. And if you swing too early, well, swing again: your mii will franticly double-take, flail, dive for the ball, leap, whatever as is required. Which looks very silly indeed on the screen, especially the dives. I smiled and laughed basically the whole time while playing the game; it really was a lot of fun.

Bowling is much more of a sim. To the extent that, at first, it was a little uncomfortable: I was trying to make natural bowling movements, but without a 15-pound ball at the end of my arm, my elbow started feeling a bit odd. I’m used to that now, though. I think this is Miranda’s favorite of the games; right now, actually, she’s better than I am, though I hope to close the gap now that I’ve given up on trying to put just the right spin on the ball. (I don’t do that in real life; why try in the game?)

She finds golf frustrating, but I think it’s pretty good. It certainly requires the most finesse of any of the games; sometimes, alas, it requires more finesse than the controller is capable of. Putting, in particular, can be a bit much: the controller seems unable to detect very small swings, so tap-ins, rather than being completely routine, turn into an annoying task of making very small swings to try to get the minimum strength that the controller registers, lest you end up several feet away on the other side. There are similar problems with chip shots near the green. Still, I enjoyed it; if I were to play the game more, golf might end up being the mode where I’d spend the most time.

Baseball and boxing, however, seemed more or less pointless. Baseball in particular seemed like a quite bad translation of the game.

Fun stuff; I’m not planning to play any more of it by myself, but I’ll happily pull it out whenever guests come over. After, of course, forcing them to make miis of themselves; I continue to think that miis are a great idea, exactly for games like this.

And no, we didn’t launch any wii remotes into our television screen, or indeed launch them at all. We did whack them a few times on furniture that was nearby, but they turned out to be sturdy enough to survive that. Good thing, too, considering how expensive they are and how hard they were to find…

at rest with attributes

April 14th, 2007

[ I apologize for all the acronyms in the first paragraph of the post. I will explain what one of them means over the course of this entry, but if you’re here for, say, video game thoughts instead of technical geekery, then you would be correct in interpreting that as a sign that you should hit the ‘next’ button in your blog reader. ]

One of my team’s current projects at work is replacing a CORBA interface for managing video files with an interface involving sending XML over HTTP. We’ve looked at a few examples of XML/HTTP interfaces recently – we considered integrating a few areas of our software with a very simple hand-rolled RPC mechanism last year, and we’re also integrating a different part of our software with a SOAP interface right now. But one of my coworkers said “shouldn’t we look at REST?” in our team meeting on Thursday. And since all the cool bloggers are now spending their time talking about how REST is good and SOAP is bad, I thought that was a great idea: if nothing else, I was already rather embarrassed that I had no idea what REST meant, and it would give me an excuse to learn! So I spent a quite pleasant afternoon yesterday learning about it, and coming up with a RESTful version of the interface in question.

But before I explain what REST means, some Kealia history. The software-side founder of Kealia insisted that we follow a programming discipline he (I believe) invented called “attribute-oriented programming”. The idea here is that your object interfaces shouldn’t have any verbs: the interface should consist entirely of attribute getters and setters. So whenever you have a verb that you want to add to your interface, you have to think of a way to express this as changing the value of an attribute. Frequently, this isn’t too hard (though it’s still often distasteful): you might replace a schedule() function with a nextTime() setter. Other times, it’s much more of a stretch: sort() is an example.

There are a few special exceptions allowed. The one that’s relevant to this discussion is that, if you want to add or remove something to/from a collection, then you should call a function named newXXX() or deleteXXX(). (And there are also some extra restrictions layered on top of this, but I won’t go into them here.)

Attribute-oriented programming turns out not to work very well. We still follow the rules, despite the departure of their proponent from active work on the project, because of a general feeling that we’d rather consistently follow a bad standard than mostly follow a bad standard but occasionally do whatever we feel like. (Though I personally would support a thoughtful effort to relax the rules in appropriate circumstances; it’s hard to make a good case for spending time on that, but every new hire is a reason to ask that question again.)

Despite my dislike for the attribute-oriented philosophy, there are some good things that go with it. We have a custom network layer for internal use: it’s specialized for sending out high-performance attribute updates. (Basically, Observer across the network; there are some other things grafted onto it, but I won’t go there.) Not great for a general purpose RPC system, but most of the time in this project, we don’t need a general purpose RPC system: instead, there are several crucial places in our code where we want to spit out lots of little state changes very quickly over the network, where this works quite well. It still takes a while for new hires to come up to speed, but this is one area where I think we made a good choice. (It’s not perfect – some of the details are pretty weird – but, well, if you’re waiting for perfection, you’ll have to wait a while.)

Which brings us to REST. REST (short for REpresentational State Transfer) is a philosophy that says that, if you’re trying to do RPCs over HTTP, you should work with the idioms of HTTP, instead of using it to tunnel general RPC ideas. To begin with, HTTP says that objects should be identified by URIs. (As opposed to, say, sticking an object identifier in the body of the message somewhere, or in some CGI parameter.) And HTTP provides you with four verbs: GET is the most common (your browser uses it every time it fetches a web page), POST is not infrequent (you use it when filling out forms), but there are also PUT and DELETE.

This turns out to map extremely well with attribute-oriented programming: GET and PUT are attribute readers and writers, POST and DELETE are the newXXX and deleteXXX on collections. (It seems that REST proponents are willing to use POST in a somewhat more flexible fashion than that, actually, but I won’t go into that now; certainly the sweet spot for POST seems to be the same.) It also maps extremely well to concepts in other areas: those of you who aren’t my coworkers have, I assume, never heard of attribute-oriented programming, but you’ve all heard of databases. And database people talk about Create, Read, Update, Delete (CRUD), which are POST, GET, PUT, and DELETE.

I don’t want to go into the details of the arguments, but the REST proponents sound reasonable to me: if you want to provide a programmatic interface for a service over the internet, you’ll have an easier time doing it if you can learn from the single most phenomenally successful example of such a beast. (Especially if you’re using that example’s underlying protocol to do your communication!) Network programming is different from and harder than writing a standalone program; learn from the lessons of the past, work with successful idioms, and you’ll avoid many mistakes and find it easier to grow an ecosystem around your service.

And certainly the interface that I’m thinking about at work fits fine within this framework. Let’s say that we have a URL http://foo.com/video/ that represents all the video stored on the server. Then, to upload some new video, do a POST to http://foo.com/video/. This will return a URL representing the new file, say, http://foo.com/video/my-movie. If someone else wants to learn something about the movie, that person (or program!) can do a GET to that URL or to some URL lying off of it: if you want to find its duration, for example, maybe GET from http://foo.com/video/my-movie/duration, or maybe just GET from http://foo.com/video/my-movie itself (which could return an XML object containing the duration as an attribute or an element).

(Incidentally, the details of that last example are what is currently giving me the most trouble. Which URL is the right one to use? If we go with the shorter one, is an attribute or an element more appropriate? For now, I’m leaning to initially using the shorter URL, and using an attribute, but I don’t see much different either way. I’m not immersed enough in XML to know when attributes are idiomatic and when elements are idiomatic in cases like this, alas…)

So that’s two of the verbs. If you then want to remove a video, just send a DELETE request to its URL. And if you want to change some attribute, do a PUT: if you made a typo in the director’s name in your initial POST, for example, you could PUT the new value to http://foo.com/video/my-movie/director.

Fun stuff, this. I didn’t have to think much at all when designing the RESTful version of this interface: many of the decisions were already made for me, and I never had to fight REST, so I can be reasonably confident that other people will find the interface useable. Certainly the result is very simple; much more so than the SOAP example I was looking at. (Even at the surface level, though admittedly we’re solving a simpler problem; the actual underlying XML in that example made me rather nauseous.) The other model we’d been looking at (hand-rolled XML over HTTP, always using POST) was nice and simple, but the REST example is a little more coherent, and required us to make fewer decisions. (And I expect other people will find it a little easier to work with, at least if they’re not too RPC-immersed.)

The upshot is that I can follow certain discussions more intelligently than I could before, I have a good candidate for our new interface, and I have some new insights into the strengths and weaknesses of the way I’ve had to program for the last four years. (Speaking of which, yesterday was the three year anniversity of Kealia’s acquisition by Sun; I am amazed at how quickly the time has gone by.)

I leave you with a quote by Roy Fielding, the originator of REST, on SOAP (and other related protocols):

SOAP … deliberately attempts to suck.

elebits

April 12th, 2007

I was pretty nonplussed when I first started playing Elebits. It’s sort of a weird mix of Katamari with a first-person shooter: on the one hand, you have a gun that you use to “capture” these elebit creatures that are hiding and running around, but on the other hand you can also use the gun to pick up various pieces of your environment and in general cause mayhem and wreak havoc.

The problem is, I don’t particularly like first-person shooters. And, at first, it really did feel like an FPS to me: maybe you’re capturing the elebits instead of killing them, but I sure can’t tell the difference. Playing around with the environment was sort of fun, but not all that great: it’s nice to be able to wander around a few rooms in a house grabbing items off of cupboards, and then, as you power up, throw the cupboard itself around, but I wasn’t really getting into it.

After a few levels, though, I realized that I was being unfair as labelling it as an FPS. After all, one key feature of an FPS is that the people you are shooting are shooting you back; that’s not the case in this game. Ironically, though, as I was realizing this, I came across a level where there were a few toy tanks that really were shooting at you; to make things worse, I couldn’t kill (sorry, “capture”) them! I may not always be thrilled with shooting people who are shooting back, but I like being shot at and not being able to shoot back even less. A few levels later, I figured out that, if you turned them on their side, they would stop shooting me, but it took me a while.

Admittedly, there weren’t enough guns for that to be a serious annoyance, and the guns didn’t show up on every level. Unfortunately, that annoyance was followed by levels with different annoyances: in some levels, you can only break so many objects, in others you can only make so much noise. Given that (the good aspect of) this game is about wreaking havoc on your environment, that was just frustrating: I’m all for judicious imposition of limitations in games, but those impositions shouldn’t be directly at odds with what makes the game fun!

At this point, my gentle readers may wonder why I continued playing the game. (And my less gentle readers are writing me off as a wuss, I suppose.) Around level 7 or 8, a few things happened to change my opinion of the game. The most important thing was that I managed to get out of the house, to the back yard. Inside the house, there was only so much scope to wreak havoc: you could work your way up to cabinets, but that was about it. Outside the house, though, you got to where you could toss around shrubbery with abandon fairly quickly, and start to see the possibility of throwing around cars and the like. And soon after that, you got to wander around the neighborhood; cars, light posts, you name it were fair game, and you started to look at houses in a new light.

The second thing is that I upped the sensitivity in the controls to the max. You use the wiimote to both aim and turn, but you only turn if the cursor is near the edge of the screen. (And you use the joystick on the nunchuck to move; it’s a Wii translation of mouse and keyboard FPS controls.) This worked okay, but it wasn’t as fluid as I would have liked. When you up the sensitity, however, the area where you aim but don’t turn got a lot smaller, and the controls started to feel very nice. I may be ambivalent about FPSes, but I appreciate good controls when I see them: I suspect that, as developers get used to the Wii, it will have the best FPS control scheme of any console.

After that, I was happy to play through the rest of the game. And, even setting aside the pleasant environmental mayhem, the game is based on a single, solid mechanism. You use your capture gun to manipulate the environment and to capture elebits; as you capture elebits, you turn on interactive aspects of your environments (usually meaning no more than buttons you can press to turn on machinery). When you activate that machinery, special elebits come out that let you power up your capture gun, allowing you to lift heavier things. And that, in turn, lets you find more elebits, leading to another cycle of turning on machines, etc. A nice, simple reinforcing cycle, and they did a good job of balancing the need to search through the environment carefully to find elebits without requiring you to be insanely thorough about that.

All in all, a pleasant game, with some good aspects, some interesting aspects. So I’m happy to have played it, but also happy that it didn’t last longer than it did. There were some dubious design choices, but ultimately nothing that was really bad; there was a touch of the Katamari genius, but not quite enough to grab me. (One aspect of the Katamari genius was completely lacking, though: the music sucked.) And it was a welcome sign that the Wii controls may end up working very well for some traditional game genres, not just for new ones.

random links: april 8, 2007

April 8th, 2007

objection!

April 8th, 2007

Phoenix Wright: Ace Attorney is an old-style courtroom-based adventure game for the DS. It’s set in the near future, and apparently legal norms have changed somewhat: as far as I can tell, rather than people being innocent until proven guilty, they’re guilty unless you can prove during the (at most three-day trial) that some specific other person committed the crime.

This would seem to be a bit of a tall order. Fortunately, it also turns out that the real guilty parties love to appear as witnesses in court cases, so you have a chance at catching them in some sort of contradiction, after which everything starts to unravel. At least if you don’t try the judge’s patience too much.

The mechanics of the game alternate between evidence gathering and courtroom scenes. In the former, you wander around various areas (the scene of the crime, related locations, police offices, etc.) gathering evidence (i.e. touching various parts of the environment) and talking to people; in the latter, you cross-examine witnesses, pressing them on various points, whipping out evidence that contradicts them, and the like.

And it’s fabulous. It’s witty: the characters are funny, the situations are pleasantly outlandish, but with enough internal consistency to have it cohere nicely. I inadvertently laughed out loud once during the game (at the end of the third case, for those of you who have played it), and was quietly amused many more times. There’s a plot connecting the various cases, with enough surprises to keep me interested. I liked how they (completely inappropriately) reused character sprites from the evidence gathering phase in the courtroom phase (e.g. the hotel bellboy carrying a tray with a tea set on it); I liked the over-the-top reactions to courtroom triumphs and setbacks, coupled with animations that would be in place in a 2D fighter.

The gameplay mechanics were also solid. Liesl and I managed to finish it without having to resort to gamefaqs, which is quite an accomplishment for a traditional adventure game. There were, admittedly, situations where we mostly had to guess at which piece of evidence to present – various pieces seemed relevant, and we couldn’t quite figure out which one the game was expecting at a given juncture – but there weren’t so many of those as to be really oppresive, and, in retrospect, I often felt that I could have figured it out on my own. (Fortunately, you can basically save at any time, so if you get really stuck, you can just do an exhaustive search without worrying about the judge punishing you.) There were a couple of times when cases went a bit far outside the game’s internal logic – in particular, I was a bit nonplussed by the time when the judge went as far as declaring your client guilty before a deus ex machina dropped in – but it didn’t abuse that sort of thing too often.

I don’t quite understand why it didn’t have multiple save slots – save data must take up all of 100 bytes or so. As it was, one person had to finish a given episode before the next person could try it. Fortunately, in our case, the first person trying each episode managed to finish it without needing outside help, so that wasn’t a huge barrier.

It’s now my favorite DS game. (Though I’m not sure I’d feel that way if the DS Animal Crossing had been my introduction to that series.) Which, admittedly, says as much about the DS as it does about this game: while I’m glad I got the console (I need a portable console, and the DS is clearly a better choice for me than the PSP), there just haven’t been that many traditional great games on it. Of course, games on portable consoles are by nature less ambitious than their tv console brethren, but that’s not entirely an inherit limitation: in particular, the two Golden Sun games are some of my favorite games ever.

Having said that, this game is exactly what is so wonderful about the DS, and what more publishers should take as a lesson. It’s a traditional adventure game, with a simple engine, simple artwork, and a fair number of words. A very small team should be able to pull this out: I could imagine a single programmer, a single artist, a single writer (plus help with music, playtesting, etc. as needed) pulling this off in half a year. You’d want that artist and writer to be quite talented, because they make or break a game like this, but the overall development costs for this game must have been a hundredth the costs of a top-flight Xbox 360 game, say. At that price, you don’t need to appeal to everybody: if you have a vision that’s well-executed that will appeal to a niche market, that’s enough to make a successful product. Which is apparently the case here – the series is on its fourth iteration in Japan, I believe, two of which have come out so far in the US, and other publishers have noticed and started to put out their own entries in the genre.

Those of you who think the industry is forgetting its past, or those of you who like to read, take heart. And, as I have said before: go Capcom.

go, akismet!

April 7th, 2007

I turned on Akismet a little more than a month ago; since then, it’s caught just shy of 20,000 spam comments for me, or just under 600 a day, allowing less than five a day to make it through. I haven’t noticed any false positives yet (though admittedly I get a low enough rate of comments that that doesn’t mean as much as it might); all in all, I’m extremely pleased.

The volume of spam is high enough that I frequently am unable to thoroughly examine the spam queue before clearing it out. So if you submit a comment and it hasn’t been approved by the next time I post, please let me know. As is, though, I’m almost inclined to stop examining the spam queue at all and just trust Akismet to not screw up. I would definitely be willing to pay money for this.

xbox elite

April 7th, 2007

I was kind of looking forward to the Xbox 360 Elite announcement. I’m almost positive I’ll buy a 360 at some point this year: I doubt the Wii and DS will be enough to keep me happy this year, and it even seems likely that the 360 willl have more games I’m really interested in this year than any other console. In fact, it looks like the first must-have 360 game for me will show up next month (Mass Effect, by the makers of the excellent Jade Empire), and while the first half of this year is looking abnormally strong game-wise, so I might not need to rush out immediately to buy it, I’ll probably be bored if I don’t buy it at some point over the summer.

But I’d rather not pay $400 for a console, and by all accounts a shockingly high proportion of the consoles break. Surely a redesign is a sign that they’ll drop prices, and maybe give us a signal that their manufacturing has improved somehow?

No, it turns out: they’re keeping the prices of existing models the same, just adding a new model on top. With a strange price point and set of features: I for one don’t care in the slightest about HDMI outputs, and while there are people out there who do, it seems like those people would look at an 360 for $480 and a PS3 for $500/600, and shell out the extra money to get a Blu-ray player. The business logic behind making your console look more like your surprisingly unsuccessful competitor, and doing so in a way as to maximize the likelihood of negative comparisons, escapes me. But what do I know?

No matter the price, I clearly wasn’t getting the Elite, but I could have done with a price drop. As far as quality goes, the initial comment from Microsoft along the lines of “our other models have crap quality but the new one will be better” didn’t impress me too much. A day or two ago, though, they announced that they were improving the warranty terms: now, if it breaks within the first year, they’ll repair it at no cost (including free shipping) and have it back within 5 days.

I suppose I’ll grudgingly shell out 400 bucks for one at some point this summer. Which would seem to be evidence that their strategy of not lowering the price is paying off, at least in this case. I would say that I’m not sure I’m representative, but maybe I am: if other people agree that the 360 is coming into its own this year, then Microsoft probably should hold off on price drops. I guess their feeling is that they aren’t likely to win over many Wii buyers, that they still have compelling advantages over Sony, and that they like actually not losing money on consoles, so no sense dropping their price until Sony does. Not sure they’re making the right choice, but in the grand scheme of things it’s really not my problem.

go emi!

April 7th, 2007

There had been rumors at the end of last year that, some time this year, EMI would allow non-DRM versions of its music to be sold online, so I wasn’t completely shocked by the recent announcement. But I was still surprised, and surprised it happened so early. Nice to see one record company behaving sanely. (Or at least behaving in the way I’d like them to; the jury is certainly still out on whether or not it will help their business goals.)

The details are a little interesting: bundling no DRM with a higher quality and a higher price point. The higher price point is obvious enough, and I’m glad it’s only for singles instead of albums; I’m curious how the higher quality came to be, though. Was Apple arguing for a single price point, EMI wanted a higher one, and Apple relented if they’d raise the quality? Does somebody have an interest in muddying the experiment, to make it harder to tell the effects of no DRM alone? Had Apple been wanting to raise prices all along, and this was a way they could do it without losing face? Could it be some strange way to make it easier to track illegal copies of the non-DRM music purchased in this manner? (That would really be stretching it.) Did somebody just decide that higher bit rates are good, and this is where they’d introduce it? I’m betting that this linkage is a face-saving gesture somehow, I just can’t figure out the details.

I would say that this makes me want to go out and buy more EMI music, but it really doesn’t. For one thing, I buy music based on what I want to listen to rather than the publisher, and for another thing, my preferred medium of purchase remains CDs. This will have an effect on my purchasing habits if/when indy publishers are allowed to sell non-DRM music through iTunes, however: it occasionally happens that I learn about a band through Next Big Hit and am unable to purchase their music on a CD. Until now, that’s meant that I won’t purchase their music at all (though I might give in and sign up for one of these MP3 subscription services at some point), but I would be willing to purchase their music on iTunes under the new rules. Who knows, maybe at some point I’ll give up on my “only buy albums” philosophy, and start buying individual tracks as well.