This is the tale of how I wanted to create my own computer game, how I taught myself programming by doing it (not the other way around), and why I think you should do the same.
My Story
My first exposure to computer programming was back when I was about 10. Some of the cool boys at school (you know how it’s like) 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, religiously emerged in text worlds, rather than graphical games like Quake and Counter-Strike (both wildly popular back then, of course).
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. If you’re still not curious, there’s also the fact that about half of MUD players are female (*wink*).
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 a game was no longer a mere dream — I was doing it, even though I was quite a newbie. I was in the matrix.
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.
- MudMagic - Similar to MudConnector, has a repository of codebases too.
- 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.
Related Posts
Excellent post! Having a specific goal is the best motivation to learn the details of programming. Many of us have been there, especially with games.
February 3rd, 2007, at 11:29 pm #I concur :-)! I loved how personal it sounded.. and as a matter of fact I’m messing around with the nakedmud you suggested right now, looking cool! Amazing how it compiled in Cygwin with no problems at all. I’ve only looked at the source briefly, but I definitely agree that it’s very clear, very elegant… even the deeper C source. Love the “hooks” feature!
anywho, back to coding
February 4th, 2007, at 4:14 am #“If you’re still not curious, there’s also the fact that about half of MUD players are female (*wink*).”
“If you’re still not curious, there’s also the fact that about half of MUD players say they are female (*wink*).”
Fixed.
February 6th, 2007, at 12:14 am #@Asrea:
Cool. There’s a bunch of helpful people on the NakedMud mailing list if there’s anything you need.
@Mike:
February 6th, 2007, at 12:32 am #Haha. Yeah, that happens. Pretenders excluded, the ratio might not be quite what I said — it still is surprising how many there are when you consider the game’s… geekiness, though.