Posts from 2012.

CircleMUD Data in XML Format for Your Text Adventure Game

Long before World of Warcraft, people played text-based MMORPGs called MUDs (Multi-User Dungeon). These were basically multiplayer text adventure games where people could wander through a virtual world fighting monsters and exploring. They had several RPG elements to them.

CircleMUD was a popular piece of server software for running a MUD, and it came with a sizeable virtual world (which the admin could modify/append to customize their fantasy world.) It would be pretty handy to use parts of this data if you were creating your own virtual world for a text adventure game, but the format of CircleMUD's data files is kind of obtuse and not amenable to manipulation.

So I wrote a few scripts to convert these files into a single XML file which is 4MB when unzipped. You can parse this file and modify it to suit your needs. It contains 1979 rooms across 30 different areas (called zones in the file), with 46 shops and 569 different "mobs" (mobile objects, which are the monsters and NPCs). There are 678 different types of objects, including 116 weapons and 154 types of armor.

The scripts and original CircleMUD data (along with descriptions of the data formats) are included in the zip:

Download CircleMUD XML Data (1.3 MB zipped)
More... »

“How much math do I need to know to program?” Not That Much, Actually.

Here are some posts I’ve seen on the r/learnprogramming subreddit forum:

Math and programming have a somewhat misunderstood relationship. Many people think that you have to be good at math or made good grades in math class before you can even begin to learn programming. But how much math does a person need to know in order to program?

Not that much actually. This article will go into detail about the kinds of math you should know for programming. You probably know it already.

For general programming, you should know the following:
More... »

Nobody Wants to Learn How to Program

I frequently see a problem when people (especially techies) try to teach programming to someone (especially non-techies). Many programming tutorials begin with basic programming principles: variables, loops, data types. This is both an obvious way to teach programming and almost certainly a wrong way to teach programming. It’s wrong because nobody wants to learn how to program.

If you are teaching a class of adults who are paying with their own money for an education, then this is an appropriate and direct way to teach programming. It’s their money. They expect that they’ll have to focus and slug through concepts to come out the other end with programming knowledge. The start-with-variables-loops-data-types approach is fine for this. But most likely they still don’t want to learn how to program.

But for the casually interested or schoolchildren with several activities competing for their attention, programming concepts like variables and loops and data types aren’t interesting in themselves. They don’t want to learn how to program just for the sake of programming. They don’t want to learn about algorithm complexity or implicit casting. They want to make Super Mario or Twitter or Angry Birds. This idea is best summed up in one of Ryan North’s Dinosaur comics (click to enlarge):

Here are my five pieces of advice to people who want to teach programming or create programming tutorials:
More... »

“I Need Practice Programming”: 49 Ideas for Game Clones to Code

So you know a little bit about programming (perhaps you've read the free book, "Invent Your Own Computer Games with Python", a free programming book for beginners whose author shamelessly plugs at every chance) but you want to get better at coding. You can't seem to find any open source projects that are at your level or easy for new people to contribute to. You've gone through a few of the practice problems at Project Euler but you want to create something more substantial, or at least a cool thing you can show your friends. (Not that finding the 31337th prime number isn't cool.)

Here's a list of game clone ideas for you to implement. Each has a short description of the game, links to videos of the game, and descriptions of what kind of algorithms you'll need to know in order to implement them. These games have been selected for their simplicity, so you don't have to spend several weeks designing art, levels, scripted dialogue, or complicated AI. These are clones designed to be doable in roughly a weekend. A Mario or Zelda clone would be complicated to put together, but a Tetris or Asteroids clone would be doable in a weekend.

Orisinal Games:

The Orisinal website has a great collection of Flash games with very simple mechanics that can be copied. http://www.ferryhalim.com/orisinal/

I especially recommend Winter Bells, A Daily Cup of Tea, Bugs, and Hold the Rope!

The Wikipedia entry for video game clones also lists some ideas.

UPDATE: If you'd like to make some more advanced games, I highly recommend you watch the talk Juice it or lose it - a talk by Martin Jonasson & Petri Purho on some simple tweaks and tricks that turn a simple pong game into a really polished looking pong game.

Games from "Invent Your Own Computer Games with Python" and "Making Games with Python & Pygame" books:

These games are described in these free Python programming books and their source code is available. However, you can make your own variants.

1. Dodger

Description: Several bad guys fall from the top of the screen, and the user must avoid them. The player can be controlled with the arrow keys or more directly with the mouse. The longer the player lasts without being hit, the higher the score.

Variations: Have enemies fall at different rates and be different sizes. Have enemies fall from more than one side of the game. Have power up pickups that grant invulnerability for a while, slow down bad guys, give the player a temporary "reverse bad guys" power, etc.

This game is covered in Chapter 20 of "Invent with Python"

Download Source: dodger.zip

2. Memory Puzzle

Description: A board full of overturned cards. There is a pair for each card. The player flips over two cards. If they match, then they stay overturned. Otherwise they flip back. The player needs to overturn all the cards in the fewest moves to win.

Variations: Provide "hints" in the form of four possible matching cards after the player flips the first one. Or, quickly overturn groups of cards at the beginning of the game.

This game is covered in Chapter 1 of "Making Games with Python & Pygame"

Download Python Source: memorypuzzle.py

More... »

New Book: “Making Games with Python & Pygame”

I've completed my next book, which focuses on the Pygame library and making graphical games in Python. It assumes you have a little bit of Python programming knowledge. The book is free to read online from http://inventwithpython.com/pygame and can also be bought on Amazon.com for $25.

Thanks to everyone who helped me out with this book over the last year and a half.