Changing the World / Editing Keen with TED

From KeenWiki
Jump to navigation Jump to search

This is an article and tutorial about the level editor TED5 by Andrew Durdin written in 2002.

Changing the World / Editing Keen with TED

From the early days of Commander Keen, avid fans have been excited by the idea of creating their own custom levels for the games. Over the course of time, various level editors were created for Invasion of the Vorticons, but no-one had made one that worked for Goodbye, Galaxy! or Aliens Ate My Baby-Sitter.

Then for the first time, on the Rise of the Triad Special Edition CD-ROM, Apogee/3DRealms released TED 5, the last incarnation of John Romero's tile editor which had been used for many games since the birth of Id software, including Commander Keen. Suddenly the prospect of editing Keen levels came a lot closer.

But all was not yet perfect: TED organised its data files in one way, but the released version of Keen did it in another. Even worse, some of the data required by TED was stored in the Keen executables, and would need to be patched back in for any new levels to work. This problem for a long time seemed practically insurmountable.

In April 2001, progress was being made. A keen fan who goes by the name ChargingMoose released an all-new Keen 4 level which he had painstakingly made by hand with a hexeditor. This achievement got many people excited about the possibilities it adumbrated. The same month, theoddone33 and relnev wrote some utilities to extract data from the Keen executables for TED to use, though they had yet to work out a reliable method of patching homemade levels back in so they could be used.

It was not until that December that this problem was solved. Admiral_Bob came up with the idea of using a little-known DOS function to patch the Keen executable in memory prior to running it, so that the hassle of modifying the program file was removed. Unlike theoddone33's quick-and-dirty utility, Admiral_Bob's was robust and well-documented, and worked with different versions of Keen. Its only drawback was that it could not patch the data that TED output without the user manually editing one file, a task which many non-technical fans shrank from doing.

Now, this final snag has been removed. Now, a little more than ten years since the release of Goodbye, Galaxy!, we have put together a package so that for the first time anyone can easily create their own levels for Secret of the Oracle, The Armageddon Machine, and Aliens Ate My Baby-Sitter. Now you can find out how to use TED to its full potential, and realise the levels you've had in your mind for so long. Now there are no more excuses.

Getting a TED in Life

The first thing to do is to download our package. It contains everything you need to start making your own custom levels right away. Installing the utilities is a simple process:

1. Unzip into a new folder; C:\TED is a good choice.

2. Copy the Goodbye, Galaxy! or Aliens Ate My Baby-Sitter files into the same directory. You will need all the ck4, ck5, and ck6 files, and the exes.

3. Decompress the exe files. You can either do this from a command line, or double-click the Unlzexe shortcut and enter the names of the Keen exes.

4. Run tedsetup. This will process all the Keen exes, and set up TED to edit all of them.

And that's it: TED is now ready for use. If you have any problems, check the end of the article to find a solution.

To start TED, just run ted5. If you installed more than one Keen episode, you will be asked to choose which episode you wish to edit. TED will take a few seconds to load the graphics, then will present you with an introductory dialog.

TED, being an in-house development tool, is not the most user-friendly program; its interface is trimmed to provide flexibility and efficiency, but does not take much effort to learn.

A menu bar, containing commands for controlling TED, runs along the top of the screen. Along the bottom runs the status bar. From left to right are the currently selected background and foreground tiles and the currently selected icon, and their numbers. To the right of this is the layer indicator, showing which layers are visible and which are active (more on layers in a bit). Finally we have the cursor position in both decimal and hexadecimal.

Levels and Playing Fields

The step in editing is to open an existing level or create a new one. By default, TED will load the world map from Keen. You can choose a different level to edit by choosing File, Edit New Map, or pressing Alt+O. To create a new map, you should first delete an existing map (File, Delete Map), then create a new map in its slot (File, Create Map). You will be prompted for a name and the level size. Note that there are two rows of tiles on each edge of the level that are not seen when playing Keen; also that the name you give here will not be used in the game, but is for reference only. You can now look around the map by using the arrow keys to scroll.

Keen 4, 5, and 6 levels consist of three layers of tiles: the background, foreground, and info layers. The background is just there to add colour to the scene. The foreground layer contains tiles that Keen interacts with: platforms, point items, doors, secret passages, and so on (note that many tiles in the foreground layer actually appear behind Keen). Finally, the info layer contains information about sprites and special features such as switches, doors, bridges and so on. Any or all of the layers can be visible and/or active for editing—the 1, 2, and 3 keys make the layers active or inactive; the 4, 5, and 6 keys make the layers visible or invisible. You can check the layer indicator at any time to see which layers are visible or active.

Editing a map primarily involves selecting the layers you want, choosing tiles, then clicking to place the tiles. To choose a tile, click on the left-hand side of the status bar or press space. The tile-selection window will appear. The three buttons, "Tiles", "Masked", and "Icons" will display tiles for the background, foreground, and info planes respectively. The icons are primarily used for placing sprites in the level; note that most sprites have different icons with a 1, 2, or 3, indicating that they are present in Easy, Medium, or Hard modes. Use the up and down arrows to scroll through all the tiles, and click them to select. You can also "pick up" a tile from the map by clicking the right mouse button on it. Go ahead and spend a few minutes making some modifications to a level., but keep it simple for now.

To save your changes, just hit Alt+S or choose File, Save Map. But before you can test the level, you have to export the maps to the format that Keen will understand: choose File, Carmacize Maps. This may take a minute or two. When it asks to print a report, choose no, or TED may hang. At this point, you can either exit TED, or if you're running it under Windows, start a new DOS prompt to test the level in—this latter choice makes testing much quicker. If you were editing a Secret of the Oracle level, run GO4; if not, run GO5 or GO6 as appropriate. As soon as you're in the game, you can press F10+W to jump to your level. After testing your changes, you can make a quit exit by pressing Ctrl+Q.

Platforms and Bridges and Doors (Oh My!)

Once you have a basic level made, you'll want to add more advanced features like moving platforms, switches, bridges, doors, and so on. These are all done with links in the info layer. I'll start with the simplest: moving platforms.

A simple moving platform in Secret of the Oracle can be placed by putting a moving platform icon with a red arrow in the desired spot. To stop the platform moving off the edge of the screen however, you'll need to put some blocking tiles in its path: these icons look like a "B" in a square. Put one blocking tile to each side (for a horizontally-moving platform) or above and below (for a vertically-moving platform). A collapsing platform (the one with a yellow triangle below) only needs a single blocking tile beneath it. In Keen 5 and Keen 6, the platforms with green arrows (known as Goplats) need a path made of the yellow arrow icons to follow.

Often you want the player to have to turn a platform on with a switch. To do this, you need to place another blocking tile in the way of the platform between the other two. Make a note of the hexadecimal values of the location of the tile (the X and Y values beginning with $ at the right-hand side of the status bar). Now place a switch in an appropriate place, and link it to the blocking tile: Choose Misc, New INFOPLANE Value or press Enter, and type in a $ followed by the last two digits of the X and Y values you wrote down (see the picture for an example). Then click on the switch; this will place the link in the info plane, which will be shown as four digits. The switch will now turn the blocking tile off, to activate the platform.

In the same way, you can link a switch to a bridge (link to the left-hand edge of the bridge), a gem-holder to a closed door (link to the top of the door), and a walk-in doorway to the place you walk out (link to where you want Keen's feet to end up after he enters the doorway). Note that if you create a link from a switch to a square with nothing in the info plane, that switch will turn a blocking tile on; also that you need to use a particular tile to make a walk-in door (find out by looking at an existing level).

Another feature which makes Keen levels exciting is secret passages. Some foreground tiles allow Keen to walk behind them—these are suitable for secret passages. However, identifying which ones are like this and which ones are solid is difficult: I suggest examining some of the original levels and noting down the tile numbers of the "secret passage" tiles to keep track of them. When putting point items in a secret passage, you must use icons for them, rather than their foreground tiles. I suggest that you only place the "walk-behind" tiles in secret passages once the level is completed, so that while editing you can keep track of them more easily.

Finally, some Keen levels have separate areas that act like independent mini-levels (the Pyramid of the Forbidden is a good example of this). You can place scroll blocks in the info layer to mark horizontal and vertical edges between these areas. The scroll blocks look like horizontal and vertical blue lines with small white stripes; I suggest examining existing levels to see how they are used before placing them in your own levels.

Robo TED

TED contains several features which can ease some of the tedium and speed up the process of making complex levels. I'll cover some of them quickly here.

  • Grid Mode toggles the showing of a grid on the current level. This can help with placing tiles in the right positions. Turn this on or off from the Mode menu or by pressing G.
  • Block Fill mode quickly fills a rectangular area with the currently selected tiles. Choose it from the Mode menu or press B, and click the left mouse button on the desired top-left corner, and the right button on the bottom-right corner, then press Enter to fill the area.
  • Flood Fill mode will fill an area of one tile with the currently selected tiles. Choose it from the Mode menu or press F, then click in the desired location to fill.
  • Copy Mode (also on the Mode menu, or press C) lets you select a rectangular set of tiles to copy so that you can duplicate them in another region easily. Select the area as for Block Fill mode, then press Enter.
  • Paste Mode (you know where to find it) allows you to paste one or more copies of the tiles chosen with Copy Mode. Click with the left mouse button to place a copy. You can use the Paste Overlay option (on the Mode menu, or press F3) to toggle pasting of empty tiles. The Snap-Paste option (press S) toggles pasting copies just anywhere, or in a tessellated pattern. This is especially useful for filling in the background of a level.
  • The View Map & Goto option on the Misc menu shows you a small overview of the whole level; click an area to jump to it.
  • You can change the size of a level with the "Change MAP Edges" option on the Edit menu. Select the edge you want to change, and enter a positive or negative number to add or remove rows from that edge.
  • If the default screen size is too small, you can switch to a high-resolution mode by choosing ?, Video Mode Switch or by pressing F9.

The Road to Fame

Now that you've made some really great levels, you'll want to send them to your friends or upload them for others to try. The files you will need to distribute are as follows (an X stands for the episode number that you are editing; either 4, 5, or 6):

  • goX.bat (batch file to play the custom levels)
  • custmaps.ckX (contains the custom levels)
  • maphead.ckX (stores some more level data)
  • ckXpatch.exe (the patching program)
  • patchX.pat (the patching information)
  • unlzexe.exe (to uncompress Keen executables ready for patching)

I recommend zipping these files up with WinZip or another utility, and distributing the zip file; this will make it simpler for users to download and set up your levels.

Help! I'm Going Mad!

Nothing on a computer ever works for everyone. Here are some solutions to the most common problems you might encounter while creating your own levels.

I get an error message: "Couldn't identify KEEN*.EXE" or "Unrecognised version of KEEN*.EXE" If you get one of these errors, either you forgot to use UNLZEXE to decompress your Keen executables, or your version of Keen is incompatible with the utilities. TEDSETUP and CK*PATCH.EXE will only work with the different versions of Keen that we had, as these were the only ones we could get information on. The following versions should be compatible: Secret of the Oracle version 1.4; The Armageddon Machine version 1.4; Aliens Ate My Baby-Sitter versions 1.0, 1.4. Note also that TEDSETUP currently will not work with CGA editions of Keen.

I get an error message running GO*.BAT: "Error: cannot open CK*HEAD.OBJ"

This error message will appear if you forgot to Carmacize your maps before trying to test them.

I cannot see any icons in the tile selector in TED

For some reason, only version 1.4 of Keen includes the icon graphics; if you have an earlier version, you should get hold of version 1.4.

Keen gives me an error: "Map too tall!"

Most likely your level is too large. You should use the Change Map Edges option to make it smaller.

Keen gives me an error: "No free spots in spritearray!"

Your level contains too many sprites or point items. You should remove some and try again.

Keen gives me an error: "Too many scroll blocks"

Your level contains too many scroll blocks; you need to redesign your level to contain fewer separate areas.

I have a problem not listed here

If you have any other problems, feel free to email me: While I cannot guarantee a solution, I will do my best to help you out. Please be aware that the utilities may not perform correctly under Windows 2000 or Windows XP. I am working on this problem, but do not know whether a solution is possible or not.

That's all! Now go and make some great levels!

See also