Hack72.Design Games with ZZT

Hack 72. Design Games with ZZT

Use a retro game to quickly and easily make new retro games .

What do the names "Tim Sweeney" and "Epic Megagames" mean to you? For most people reading this book, they probably conjure up images of Unreal Tournament.

Not so for me.

When I hear those names, I instantly flash back to 1993. It's seventh grade, and I'm making my own video games using ZZT. Sweeney's creation, the very first game released under the Epic Megagames name , was an unassuming piece of software from the outside. You could play a top-down action/ adventure/puzzle game that used ASCII text for all of its graphics. Register the program by sending Tim a few bucks, and he'd send you a disk with three more adventures .

But underneath that faade, Sweeney's game had a feature that made ZZT much more than a simple adventure game. Instead of pressing P at the title screen (shown in Figure 8-1) to play the game, you could press E and make your own game using the simple and fun (if not always intuitive) game design tool.

Figure 8-1. The title screen of ZZT

Immediately, ZZT fans were making and sharing their own games, and the popularity of the software grew and grew even as Epic had completely moved on to bigger and better games. Intrepid hackers started devising their own tools that pushed the boundaries of the ZZT design tool, making it do things it was never intended to. Soon, Sweeney's own games looked old hat next to what some people were churning out. Eventually, Epic released the full version of the game as freeware.

What's amazing is that ZZT is still going strong today. In fact, there are many different web sites where you can learn more about how to use the program, download a wealth of different games (some amazing, some awful ), and find utilities that help you create better-looking and better-playing software. Some of the best are:



http://zzt.the-underdogs.org

A great starting place for all sorts of ZZT information, z2 offers nearly everything you could want. Download ZZT, read tutorials on the creation engine, and sift through a catalog of downloadable games. I especially like the "Featured Games" section that lists twenty of the best games available.



http://www.chocobo.org/~butz/zzt.htm

One of the oldest (if not the oldest) ZZT web sites, this is the home page of "Duky, Inc.," a ZZT "company" created by a fan named Luke Drelick. Yes, nearly everyone established their own "companies" back in the day with which to brand their games. The site contains about 287 ZZT games.



http://kevedit. sourceforge .net/

KevEdit is a ZZT world editor that was last updated in 2002, just in time to release a Windows XP version. I recommend that you start out using the standard ZZT editor, but if you do start getting into ZZT development you may want to check out this one's advanced and streamlined features.

8.1.1. Jumping Into ZZT Editing

The old adage proves (mostly) true with ZZT: the less complex a game editor is, the more limited its functions. Actually, I don't know if that's an old adage. I may have just made it up right now. But it seems to be true. You have to understand that when you create a ZZT game, you're creating a top-down action/adventure title in which the main form of interaction with objects is either shooting or touching.

Now, the reason I said ( mostly ) is because once you learn the ins and outs of ZZT, you can start to experiment and stretch the limits of the engine to create things that were never supposed to be. Dedicated fans have made shooters, falling-object puzzle games, and thoughtful role-playing games in which not a single shot is fired .

But for starters, we're going to make a game in which you kill some things, and then win.

8.1.1.1. Running ZZT.

You can get the full version of ZZT for free from just about any web site that deals with it, like z2. Unzip the archive to a new directory on your computer. If you download any games (the files will have the .zzt extension), just unzip them and put them into the same directory as you put the program.

After you install, run the zzt.exe file; you'll page through a screen of options asking you to select an input method (keyboard is best for editing) and color versus monochrome. (Hey, it was a valid question in 1991.) You'll see the title screen. You can press P to play Town of ZZT, but if you want to try out other games that you've downloaded, press W to select a world.

A list similar to Figure 8-2 will pop up. (If you've downloaded the Yoshi games that I made back in the day, it'll be very similar to the figure.) Notice that there's a demo of the ZZT world editor, called DEMO, in the list. Check this out later. You'll also want to play a bit of Town of ZZT to get an idea of what you can make very easily using the tools provided.

Figure 8-2. Selecting a world on the ZZT title screen

8.1.1.2. Your first board.

For now, just press E to enter the board editor. You'll see the screen in Figure 8-3.

Figure 8-3. The ZZT editor starting screen, and your first big decision

You'll need to enter a title for the room your player is starting in. For purposes of keeping our marketing department happy, name it Retro Gaming Hacks. The player will never see this designation, so use your room names for your own organizational purposes.

This would probably be a good time to mention that a ZZT game is, in effect, a series of interconnected boards. When your player is in one board, that is all the program is ever dealing with. You can cause events to happen across boards by turning flags on and off, but that is the only means of communication.

Apart from flags, the only information that is carried across boards are the player's statshealth, ammo, money (called gems ), etc. Apart from that, the player is only dealing with one board at a time. This is helpful because you're only editing one board at a time. So let's start with this one.

In general, creating your game board is like using a paint program. You move the cursor around the screen shown in Figure 8-4 and drop terrain (walls, bricks that you can shoot through, lines, water, etc.), enemies, and other objects exactly where you want them during the game. Let's add some enemies for our player to shoot. Press F2 to bring up the creatures menu, and add a Ruffian by pressing R. Next you'll set some variables that determine how the enemy acts.

Figure 8-4. Placing a few Ruffians on the board

If you save your game now by pressing S, then choosing a filename of up to eight characters , you can exit to the title screen and try playing your game. What will probably happen is that the Ruffians will immediately assault your player, disappearing as he touches them. He'll take 10 damage per hit. What a fun game! Let's add some ammo so our player can actually fight back. Press F1 and add some. (In the game, you shoot by holding the shift key, then tapping a directional arrow.) Also add some gems, which give the player back 1 HP each.

We don't really need all this space for our killing spree, so let's make the room smaller by adding walls. If you press P in the editor you'll see an arrow in the bottom left hand corner cycle through the different patterns you can draw with. If you press Tab, you'll be in draw mode. So press P once to switch to the wall pattern that makes up the border of the room, and draw some more walls for the player. Then move to the empty space outside those walls, and press X to fill it in (see Figure 8-5).

I'm actually breaking a cardinal rule of ZZT game development in the interest of expediency here. In general, it is considered extremely poor craftsmanship to leave the default yellow border on your ZZT boards. Usually you'll want to start off a board design by moving the cursor to the board, moving the pattern selector to the blank space, and pressing X to fill the area with empty space.


Figure 8-5. is for ammo; that's good enough for me

Not much of a game yet, is it? Notice the three-lined object in Figure 8-5. That's a passage, which transfers the player to a new board. Before we place it we'll have to actually make a new board, though. Press B and choose the last option. You'll have to name the new board. Now press B to switch back to the Retro Gaming Hacks board. Place a passage with F1 and point it towards the new board in the menu that pops up.

There are some interesting rules for passages. If there is an identically-colored passage in the destination room, the player will appear there. If not, the player will appear at the default starting location for the board, which is where the player is placed in the editor. By default, it's the center of the screen. You can change that by putting him in a new place with the F1 menu.


The first thing I'm going to do is create a Scroll (off the F1 menu). Scrolls are one-time-use items that display a text message to the player. Once you place it, you'll input the text you want it to display. You can edit it later by pressing Enter when the cursor is over the scroll, as shown in Figure 8-6. (This goes for just about everything else you place.)

Figure 8-6. Editing the text of the scroll

8.1.1.3. ZZT-OOP.

For most of the other things you can add to a ZZT gamedifferent types of walls, enemies, and other pre-programmed objectssimple experimentation will help you learn what they do. Just throw a bunch of them on a board, save the game, then play it to see what happens! But to make real ZZT games you have to learn ZZT-OOP, or Object Oriented Programming.

Now, I know I said this was easy. And it really, truly is. ZZT object programming uses real English words that mean what they say (for the most part). We're going to put a simple object into this next room, somewhere near the scroll. An Object is in the Creatures menu, which you access by pressing F2. Hit O to place it. You'll first be asked to pick which of the 255 ASCII characters you want to represent the object. If it's a person, choose one of the two smiley faces.

When you do, you'll see a text entry box much like the one you used on the Scroll. If you enter just text in here, the object will start talking as soon as you enter the room. But you don't want that, you want him to talk when you're touching him. So you enter the following code, as shown in Figure 8-7:

 @Pat #end :touch Buh, I am Pat. Touch me again to win. #zap touch #end  :touch #endgame 

Figure 8-7. Entering code in ZZT-OOP

Odds are, you can figure out exactly what each of these lines of code do just by reading through them. But let's go line-by-line for the slower kids in the back of the class.

When you preface a line with @, you're giving the object a name. This name will show up when the player interacts with the object (in the space where "Edit Program" appears in Figure 8-7). But it's also important because other objects on the same board will be able to interact with Pat only if he has a name. This can only appear on the first line of the program:

 @Pat 

When you enter a room, all objects immediately start executing their programs. If you want Pat to speak only when spoken to, you'll have to cause his program to end before he can stir up any trouble. When you preface a line with #, you're giving the program a command:

 #end 

A line with a : in front of it means that the following section of the program will only execute when a certain message is sent. In this case, if the player touches the object, the code below this line will run:

 :touch 

If you enter a line as plain text, with no symbol preceding it, it will appear as plain text. In the case of a human object, the player will assume that the character is talking to him:

 Buh, I am Pat. Touch me again to win. 

If you want Pat to say something different the next time you touch him, you'll have to get rid of that first :touch condition. This command will do that:

 #zap touch 

Note that if you don't put an #end command here, the program will continue to execute, skipping right past that : touch conditional and ending the game. Stop it before it does:

 #end 

This second touch message will never execute unless the first one is zapped:

 :touch 

The game will end, the player's high score will be saved, and he will have to press Escape to quit to the title screen:

 #endgame 

8.1.2. Further Reading

There is a tutorial for newbies on z2 (http://zzt.the-underdogs.org/index.php?p=newbie1) that goes into a lot more depth than I have here. It also assumes that you're going to download and use some of the utilities that allow you to have more colors and more options for your editing process. I think that's a little too complex for your first game, but otherwise the tutorial is excellent and explains many of the other functions of the ZZT-OOP programming language that you'll need to use.

In ZZT there is an internal Help file that you can access at any time by pressing H in the editor. The folks at z2 have transcribed it all into HTML for easier reading at http://zzt.the-underdogs.org/index.php?p=zoh.

And of course, as I mentioned earlier, a great way to learn about what you can do with ZZT is to play others' games. You can always check out the crappy Yoshi games I made when I was in middle school, as seen in the eye-catching Figure 8-8.

Yoshi and the Attack of the Mind-Warping Fingernails, with yellow borders, wasteful board design, and in-jokes only understood by about three people in my middle school! Amazing, isn't it? How about that "To Level 1 Map" label? That's some non-invasive level design right there, no?

Figure 8-8. The map screen for my first ZZT game

I'm half impressed and half mortified that you can still get these games all over the Internet today. In any case, it's probably best if you check out some titles on z2's featured games list, like Burglar (Figure 8-9).

Figure 8-9. Burglar! Note the exceptionally detailed art



Retro Gaming Hacks
Retro Gaming Hacks: Tips & Tools for Playing the Classics
ISBN: 0596009178
EAN: 2147483647
Year: 2003
Pages: 150
Authors: Chris Kohler

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net