03 January 2010

Pokemon Simulation and Me (and You)

A long time ago, the Laquidara family broke away from the shackles of pay by the minute America Online and got broadband. This marked the beginning of me being truly being on the internet (I'm a little embarrassed to admit that in the dialup days, I would basically spend my limited internet time on the Apple website, lusting over computers I couldn't afford).

What was I doing at the time? Playing Pokemon of course. Who wasn't in the glory days of early 2000. At least I think that's true, but my timeframe could be seriously messed up. Anyway I think one day in the summer of 2000 I was looking for Nintendo 64 ROMS, (a fruitless task, emulating the N64 on the hardware of that day was pretty dicey), and somehow I stumbled on the online Pokemon community.

"The what?", you may be thinking (alternatively "You're fucking yanking my chain!").

Well it turns out, largely unbeknownst to me, people were using the internet to do something as crazy as to congregate with peers with similar interests. I know, right? There was more to this internet thing than reading about the G4 Cube or the iMac DV Special Edition. And these Pokemoners were fucking smart. Through collaboration on Usenet and message boards, they'd made incredible observations about the game: they had many of the formulas nearly figured out, they had strategies that seemed so extremely clever when you saw them, but I wouldn't have thought of in a millions years, but the coup de grace was that they had an online simulator of Pokemon battles. Pokemon was released in the US in September of 98 and, in under two years, through largely clean room reverse engineering, the mechanics of the game were well-enough understood to write a simulator and someone actually did it. This is really impressive to me!

So now I'm going to qualify this a little. The simulator that was written, known then and until the end of time as the Pokemon Battle Simulator or PBS, was buggy and incomplete. I don't want to take anything away from the guy that wrote it (I'm, quite frankly, in no position to, as you'll later find out), but the coding was, legend has it, fairly horrendous. These legends indicate that no functions were used whatsoever. (Or perhaps functions were used, but there was no argument passing. There's some dispute regarding this, and while I did have the source code for a brief period of time, I didn't really feel the need to examine this at the time.) But in spite of this qualification, I still think it's an impressive thing.

Coincidently, another thing I was into at the time was programming. What this means is I had the Kernighan and Ritchie C Book, had started reading it and stalled out at functions (my 13 year old mind did not see the utility and found parameter passing extremely confusing), and was going to a computer-oriented summer camp. In my mind this made me the ideal person to write a successor to the PBS. And I actually started work on it. Boring, tedious, awful work on formatting information on every Pokemon and move in the game. Once that was done, I started writing some code to handle real basic stuff, like creating Pokemon from the command line. Remember that I had no idea how to use functions. I got about five layers of conditional statements deep and found it unmaintainable. (A little sidebar, primarily for anyone who's a bit familiar with Pokemon, part of this work was decomposing each move into a primary damage value, a secondary effect, a move usage parameter, and an accuracy value, which essentially allows the creation of arbitrary moves based on the recombinations of these components. It sort of baffles me that I had the foresight to design a system were I did not need to create discrete code for each move but could not understand functions!)

So with that initial push out of the way, we return to the Pokemon community, namely a message board called Azure Heights, which was among the first sites I stumbled upon in my encounter with the Pokemon community. Remember those smart people reverse engineered so much about the game? Well if you were looking for them, you probably would find them at Azure Heights. That was awfully intimidating to me. So as I'm wont to do in real social situations, I spend a lot of time observing (on the internet this is known as lurking, in real life it's known as being the weird kid sitting in the corner a the sophomore ring dance). It took me nearly a year to have the cojones to register an account and start making posts on their message board.

And when I did it was anticlimactic, because I was just another face in a the crowd. I was neither butt-stupid nor particularly insightful. But Azure Heights was hardly the only gig in town. Remember this is the roaring pre-tech-bubble-burst days. You wanted free web space with no ads and the ability to run basically any type of CGI you wanted? You went to f2s.net and you fucking had it. So I shopped around and, some time in late 2001, joined a message board called Pokemon Daily, which was sort of in a decline. In a smaller pond, I got noticed a little bit more.

And soon something really significant happened. PokeDaily's decline really accelerated. The database for the message board got corrupted and f2s announced that their free service was ending. The subset of the site staff who still seemed concerned about the message board, in an act of protest towards the seemingly absentee staff who appeared to have left future site in jeopardy set up a new Pokemon Daily and started a grassroots effort to recruit new site staff. Then, back came the old guard to the new PokeDaily, stripping the young blood of their new positions. Long story short, factions formed, a new site called Marble Palace was started, I offered to host it on a 486 I was using as NAT router, got fucked over by port 80 blocking, had no idea what was going on, declared defeat, and ended up site staff at Marble Palace anyway. I was a part of something, however small or trivial or even embarrassing, and honestly, that felt pretty good. So my interest in my aborted simulator was very much reignited.

In truth and retrospect, the fall of PokeDaily and the rise of Marble Palace was not of extremely great significance (even on the minuscule scale of online Pokemon!), because things had shifted. In the olden days, one typically felt an allegiance with at least one major message board. Now, IRC was the place to be. Pokemon Gold and Silver were the state of the art, and the simulator to play them was an IRC bot (the original gsbot and its various progeny). So if you battled on IRC, why not just chat on IRC? The archetype of Pokemon message board as a notion of "nationality" was very much deemphasized.

Marble Palace wanted to buck that trend and no one wanted to help more than I did. In my mind IRC was a scary place where millions of conversations were occurring at once and you had to rush what you wanted to say, and say if in the process of keeping up you fucked up: you'd never live that down. Marble Palace had a couple of good years, as I fruitlessly worked to build the simulator that would now had the dual aims of saving the Pokemon playing world from the bugginess of the PBS and the "terrifying" gsbot. (Some IRC notes: being involved with Marble Palace did eventually break my fear of IRC, but I remained terrified of both gsbot and the large channel that it was run from. Thus I never played beyond the original generation games competitively. So basically it's fairly accurate to say my fear of IRC turned me into the future-hating Pokemon curmudgeon I am today.)

But honestly, High School me was a lousy programmer. Yeah I figured out functions. Yeah I eventually coerced my mind to understand pointers. But along the way I made so many bad decisions. Writing massive amounts of the system in shell scripts. Eventually rewriting them in C, but not having the good sense to do such basic things as put line breaks in reasonable places or not create massive conditional statements whose clauses stretched over four unbroken lines full screen at a fairly high resolutions. Adding to the issue was the fact that I worked my ass off in high school. I feel like a lot of people realize that they can do ok slacking off in high school. I never got that memo, or I was just wasn't smart or ballsy enough to pull it off. So working on my simulator was largely limited to Christmas and summer breaks.


1 comment:

  1. Nice job posting this at exactly midnight. I didn't know part of openpkmn's original aim was to keep the online Pokemon community on message boards rather than IRC rooms; pretty funny.