Tech Life Because I learned how to write it

Hacking on Mtrek

Mtrek is a real-time multiplayer space combat game loosely set in the Star Trek Universe. Sounds pretty sweet, right? Check out a screenshot.

mtrek

OoooOooh yeaaaaaaaah.

Designed and written by Tim Wisseman and Chuck L. Peterson in the late 80s at University of California, Santa Cruz, Mtrek is completely text-based. To understand where an enemy ship was, you had to visualize the direction via the onscreen data. If this wasn’t enough mental load, it was absolutely required to develop a set of macros on top of the game’s byzantine keyboard commands in order to master a particular ship. Furthermore, if you weren’t intimately familiar with the performance characteristics of your particular ship, you’d get quickly clobbered.

Mtrek was brutally unforgiving to new players. It was a pain in the ass to master, and constantly playing Mtrek was the primary reason I almost didn’t make it through my freshman year at UCSC, but that is not why it’s important to me.

The Mtrek Appeal

Mtrek’s painful learning curve was part of its appeal for me. It was a badge of honor to be able to sit at a Unix terminal, staring at a bunch of numbers, and crush your enemies. Mtrek was also a tantalizing preview of the connected nature of the Internet. Remember, this was the late 80s and we were years away from the arrival of the consumable Internet afforded us by web browsers. Most important to me, Mtrek arrived when I was early in my computer science career, so it wasn’t just a way to avoid studying; it was a machine I desperately wanted to understand.

After months of playing, I learned that one of the game’s creators, Chuck L. Peterson (“clp”) was a frequent player. After one particularly successful evening with my Romulan Bird of Prey, I mailed clp and asked if there was anything, however small, I could do to help with the game. Without as much a signal question to vet my qualifications, he gave me a project.

In Mtrek, there are a handful of bots that perform various utility and housekeeping tasks within the game. One of these bots the THX-1138 ran around the quadrants, and he wanted to alter its behavior. He sent me the source, gave me the barest of explanations of the code, and sent me on my way.

Let’s talk briefly about my programming qualifications at the time. My experience had recently peaked at an elegant snippet of Pascal that did an ok job of counting words from a file. The THX bot was written in C and it ran against a real-time game engine which was a programming construct far beyond my current understanding. I was terrified, so I hacked.

Hack Spectrum

MIT defines a hack thusly:

The word hack at MIT usually refers to a clever, benign, and “ethical” prank or practical joke, which is both challenging for the perpetrators and amusing to the MIT community (and sometimes even the rest of the world!) Note that this has nothing to do with computer (or phone) hacking, which we call “cracking”.

This was not the hacking I was doing late on a Thursday night while I avoided studying for my History of Consciousness final. My version of hacking at the time was, “Oh shit, how am I going to write this code in a language I don’t know against a codebase I don’t understand quickly enough that this guy who I respect doesn’t think I’m an idiot?”

The experience involved a set of tasks that I’ve become intimately familiar with over the years. To solve this particular problem, I had to figure out how to comprehend someone’s mostly undocumented code via a series of investigative experiments that started small (“Does it compile?”) and grew larger (“What happens when I change this function?) as I gained confidence.

It was a technical mystery and my job was to unpack and understand the mystery in whatever way I could in a pre-Google world. I searched newsgroups, I read man pages, and when I was stuck and felt I had a credibly hard question, I sent clp a well-researched email to which he’d quickly and briefly respond with delicious unblocking clarity.

Two weeks later, I still didn’t know C, and had only the barest understanding of how the Mtrek game worked, but the THX bot was acting how clp had expected. I shipped. It was a hack, it was an inelegant but effective solution to a computing problem and I had performed it.

An Unknown Someone

I’m not sure why I started thinking about Mtrek earlier this week. I think I was reflecting on the spartan interface. I searched for the game’s name and discovered the original game was no longer online, but a Java equivalent had been written and was alive and kicking. Sadly, I also discovered that clp had passed away in 2012.

I never met the guy, but as I wandered the Mtrek website reminiscing, I discovered he took the time to acknowledge my small, inept addition to the Mtrek universe. But far more importantly, he took a chance on an unknown someone he didn’t know nor would ever meet.

He doesn’t know the impact of a small decision he made many years ago, or that the result of that decision allowed me to not only produce the first piece code that I felt was mine not because I wrote it, but because I learned how to write it. The experience of writing this snippet of forgotten code was my first glimpse into the essential lessons of learning. The end result of clp’s small decision gave me timely and essential confidence to become a software engineer.

Thank you, clp.

Leave a Reply

Your email address will not be published. Required fields are marked *

12 Responses

  1. Thanks for the awesome trip down my own memory lane. I had a nearly identical experience when I first jumped into MUDs, eventually asking “How can I help?” and then learning (very, very quickly) how to program.

    18 years (and an awful lot of telnet-based debugging later), I’m working for a company you recently came and chatted with.

    I think there’s a bit of a myth that we’re all chaotic beautiful snowflakes ™…but even if we are, it’s nice to know that a lot of our origin stories have a lot in common. And it’s a lot easier to learn about yourself that way.

  2. Thanks for the article, rands! There’s still a mtrek newsgroup on alt.games. (I guess newsgroups are “forever”?) Some of your postings on there from about 20 years ago were abrasive.. but funny! I’m glad to see someone else still remembers this (nearly 30 years old) game.

  3. Mtrek @ Sore Eyes linked to this.
  4. Thanks for the post..and apologies, Mike. At first, I mistook you for Steve Scherf. (Another UCSC THX-programmer, turned successful software engineer)

    CLP, with his writing of mtrek, strongly influenced my early interests in life, (of the UNIX-terminal variety) which in turn, shaped my skillset that has carried me to where I am (professionally as well as geographically) today.

    It is always great to read that another mtrekker remembers the game. While any form of the “original source” is unlikely to ever be compiled again, mtrek and a small piece of clp, will live on as long as there is a single geek in the world, who remembers the significance of:
    14PPPPPPPPPPPPPPPPPPPPPp

  5. Alex Rosenberg 10 years ago

    TTTTTTTTt

    That game was a ton of fun.

  6. Its still online at http://www.mtrek.com
    And just as fun to play

    Mtrek is so great because it is real time- it doesn’t matter that its just text and numbers on the screen. Its just as fun as the best full immerse MMORG and was way ahead of its time in being an internet connected, multi-user, realtime, combat oriented game that was heaps of fun. And it still is heaps of fun.

    The new owners of it rewrote it from scratch so they say- and it looks like its here forever.

    I did get to meet CLP numerous times- he was a quiet guy but liked to laugh. Very sad to have lost him at such a young age.

    The best way to honor him and his work is to log on at http://www.mtrek.com, meet some nice new people, and blow up their ships.

  7. I hear what you are saying about “acknowledge my small, inept addition ” – many years ago I ran into a problem with mod_LDAP for Apache and dug into the C code (after not having touched the language for more than a dozen years and with Kernighan & Ritchie on my desk the entire time) and sent the author a fix that must have totalled about a dozen lines only to discover when the update hit the Apache site I was now “co-author” and thanked for “cleaning up some code and adding the Open LDAP functions”.

    I’ve never forgotten that largesse and when I ran a small open source project was always careful to give praise and acknowledgements to anyone that contributed, no matter how small.

  8. Squirel 9 years ago

    The game’s still up.

  9. MTrek in Repose | mtrek.com linked to this.