When I was a computer science teacher, I put a lot of effort into making a text game with the intention of using it to teach. It was unsuccessful, though fun.

I’ve learned a lot since then about wasting effort and about simplifying things for audiences. I might even be able to teach if I gave it another swing. Here’s the post-mortem on a project called MUD.

Wasted Effort 1: Making it speak English

A MUD is a game played by typing and reading text while other users do the same. It looks like this:

You are standing in a grassy field. You see cow and empty bucket.

> milk cow

You milk the cow. Milk goes everywhere, so you stop.

> milk cow with bucket

You milk the cow. Now you see cow and bucket of milk.

For game purposes, it’s great that you can type commands in English. And I worked to make it possible in the MUD I designed for the class.

But I was trying to teach the Java programming language. I should have forgotten all about English commands.

It should have looked like this:

You are standing in a dark hallway. You see torch and bucket. Inside
bucket you see milk.

> pickup(torch)

You now have torch.

> put(torch, bucket.find('milk'))

You put torch in milk. The hallway is too dark now.

Those commands are written in Java.

This would have actually taught the students the subject matter, and it would have been a lot less effort on my part making the English-parsing code. (But just as much fun to code.)

In the example, the find part of the code may have been daunting, but it would have led directly to an explanation of how Java works. Instead I had to say “Well, so let me tell you about all the extra code needed to interpret English.”

Wasted Effort 2: Having No Goal

I wrote the game engine first and devised the lessons second. Except I didn’t really get to the part about devising lessons.

The only lesson I gave was about how to get started and look and move around.

But now I’m a test-driven development guy, and so I should have planned what I would do with the software before I planned what the software would do. Then I could have developed it incrementally.

  • Start with one room.
  • Leave out the code that saves the game.
  • Forget about fancy mechanisms to ensure people can still hear you if they have climbed into a box.

I could develop all that stuff later. All of that falls under the heading of YAGNI, an excellent computer programming concept: You Ain’t Gonna Need It.

If you don’t have a goal, you don’t know what you ain’t gonna need. There’s a life lesson for ya.

Wasted Effort 3: Not Trusting My Audience

I thought by making it respond to English and by letting it be a free-for-all type of system, I was making it simpler. This just goes to show that simple isn’t a well-defined word.

In fact, I didn’t trust my audience enough to understand what I wanted to tell them. This probably affected all of my teaching.

I expected them to learn Java by creating objects inside the MUD game, which is a whole different process from playing the game.

I should have trusted that they would grasp Java as they played the game by typing in Java. That would have turned many of them on to the deeper opportunities to use code to be creative in the ways I had intended.

Bonus: Bad Story-Telling

A game is a story. I wanted to create a sandbox game, and even that has characters and settings and atmosphere.

So here was my big mistake:

I didn’t provide a list of what commands would work.

When telling a story, never keep what’s going on a secret. Game players must know what they can do or they aren’t interested.

I thought – completely backwards – that the fun of the game was trying things and seeing what could work.

But this is just frustrating:

You are in a broken down shack. You see: door.

> open door

The door is already open.

> use door

I don't understand.

> walk through door

I don't understand.

> go through door

You go through the door.
You are in a broken down front yard. You see: door and path.

I should have just told them what commands they could issue. Here’s what they needed, Java-style:

You are in the belly of a ship. You see: stairs.
Try `look(stairs)` or `options()`

> look(stairs)

The stairs are old, but they should hold you.
You can: stairs.climbUp(), stairs.climbDown()

> stairs.climbUp()

You are on the deck of a ship. You feel like you could go anywhere.
You see: stairs, bow, stern, saltyJim.
Try `bow.go()` or `options()`