How I Taught Myself Programming by Making a Game
My first exposure to computer programming was back when I was about 10. Some of the cool boys at school were playing a fantasy game with each other, all in text. They called it a “MUD“, one of the oldest genres of computer games. I grew curious and it didn’t take long before I was sat at home, emerged in textual worlds rather than the typical graphical games like Quake and Counter-Strike, both of which were wildly popular back then.
Briefly about MUDs: If you’ve never heard of or played MUDs, I strongly encourage you to give them a try. They may not have graphics, but that is exactly what gives them power. They’re like books — if you have a decent imagination, you don’t need graphics. In fact, I’d play a MUD over a game with crappy graphics any day. MUDs are also incredibly educational — if I hadn’t played MUDs, I wouldn’t be speaking nor writing English nearly as well as I do today (I’m not a native speaker), and I probably wouldn’t know much about programming either.
Anyway, after a while I decided I wanted to create my own game. I downloaded a C codebase and started hacking away at the source, experimenting and learning the basics of programming (I was completely clueless before MUDs). Creating something out of nothing was no longer a fantasy, I was actually doing it.
Eventually, my little project evolved into more than just a spare-time thing and was serving a couple thousand players, admittedly not simultaneously but I was still quite impressed, and I had learned many a valuable lesson about everything from love to programming.
I took the plunge into the world of programming without reading any books on the subject. I am a person who learns best from practice, so it wasn’t all that bad. I bent, I broke and I played with the code and eventually I learned all about functions, pointers, memory management, and all the other fun feats of C. The only downside to this was that I was not learning contemporary programming languages and methods. Until recently, that has been the single biggest reason why I haven’t recommended that anyone interested in programming start out by trying to create their own MUD. MUD codebases are old… Well, most of them, anyway.
NakedMud
NakedMud is a modern MUD codebase whose core is still in the good old C, but everything else is accomplished using Python as an embedded scripting language. Don’t let C discourage you — if you want, you can leave the core alone, do everything in Python and only make the small, necessary changes in C. Python is incredibly easy to learn, and games are much more fun to work with than traditional learning tools, right? Could it be any better? Besides, as soon as you’re comfortable with Python, modifying C will be painless, too.
Geoff Hollis, the creator of NakedMud, describes the codebase as a clean and easy way to create your own MUD, without all the usual hassle that other codebases bring — and that’s exactly what it is. NakedMud’s source is beautifully clear and concise in comparison to other codebases, making it a perfect tool for those who want to create their own game for the first time, and have no clue how to do it from scratch. If you want to create your own game, really, use it.
What now?
I won’t go into details about NakedMud as Geoff has literally written books about it. If any of this has even remotely tickled your curiosity, I will, however, end this off by strongly recommending that you learn more on your own. Here’s a few links to get you started:
- MUD - The Wikipedia entry.
- The Mud Connector - The Technorati of MUDs. Helps you find MUDs you want to play.
- NakedMud official website
- NakedMud official mailing list
- NakedMud unofficial website
- Programming with NakedMud (PDF) - An introduction to the NakedMud codebase, by Geoff Hollis.
- Extending NakedMud (PDF) - A comprehensive tutorial on extending NakedMud, by Geoff Hollis.
- Python in NakedMud (PDF) - An introduction to the Python aspect of NakedMud, by Geoff Hollis
- Dive Into Python - A massive book on Python. It’s free and it’s awesome.
- Python - The official website.
The source of the MUD I created, Shattered Dreams MUD (SDMUD), can be found here. As you can probably imagine from what I said about it being my first, it isn’t a masterpiece. If anything, studying the source of it will make you realize what makes NakedMud better than the other, old, mainstream codebases.
November 1st, 2008 at 22:09
[...] How I Taught Myself Programming by Making a Game [...]