Table of contents


  1. Getting started.
  2. Making your own tilemap.
  3. The QMP.
  4. Reference.

1. Getting started.


So you want to make a map for Qake? That's great. Here's what you'll need:

To use mappy for Qake, you'll need to modify the mapwin.ini file, at the bottom of the file, change the map format information to the following

maptype="LW2H2A10"
mapdefw=100
mapdefh=100
mapdefbw=16
mapdefbh=16
mapdefBMP="ts01.bmp"
mapstaggerx=0
mapstaggery=0
mapclickmask=1

Now the first thing I recommend opening one of my maps to get the feel of how a Qake map is structured. Start mapwin.exe and choose open, then select e1m1.map in the Qake data folder.

If everything is set up properly, you should see the layout of the map minus any kind of background details such as buttons. What you're seeing is the main layer of e1m1. Maps in Qake typically have three layers:

Additional layers can be added, if the mapper so desires. Details as to how and why will come later.

The properties of each layer can be changed in the script, which I will document below. On the right you should see the ts01.bmp chopped into tiles. You can Click on a tile and place it anywhere on the map. Remember magic pink means transparent to background.

To switch layers, select Layer from the menu then Layer 1. Layer 1 is the background layer in e1m1. Go back to Layer 0 after you've had a look around.

If you want to see the background layer whilst working on the main layer, you can hit Control-K to bring up Onion Skin, set it to layer 1 and enable it. Note, to edit the background you'll need to actually switch to the appropriate layer.

2. Making your own tilemap


Now that you've seen how the map looks, you can create your own. Hit File->New. Mappy will prompt you with a dialogue. The standard size for tiles are 16x16 in Qake, so change the values in the dialogue if they aren't currently set to that.

Choose a desired width/heigh in tiles for the map below this. It's best to guess a bit big then use the Resize map command in Mappy later if you have a lot of extra space.

Select Paletted (8-bit) for color.

Once the map is created, Choose File->Import to load your tileset. Qake ships with one tileset presently, although it's very likely new ones will be created in the future. Select ts01.bmp located in the Qake data folder. The right hand palette of tile should then fill up with all the tiles in the tileset. To place them in the map, click on the tile you want and then click where you want to place it.

Remember the layer rules. Any tile placed on the "main" layer will be solid based on it's solid type defined in the ts01.txt. If placed on any other layer, it will be a non-interactive decoration.

You may have unexpected results with some tiles, they may look solid, but are actually not defined that way in the tileset. This is because some of them are only used for backgrounds in the maps.

The player (and most monsters) is about two tiles tall and 1 tile wide at 16x16. He can jump up approximately 1.5 tiles.

3. The QMP


When done building your map, use Mappy's Save as .MAP command to save the map file to the data folder. Right, now you can create a solid map, to populate it or play it, it will need an associated script.

In the data folder, create a text file called MAPNAME.qmp where mapname is the name of your .map file. The qmp extension will allow Qake to find this map in the custom maps/mods menu.

The first line of this new script should be:

label " Name of your map"

Note the space at the start. This command declares the map's name, this is currently used in the custom maps/mods menu and will be used in other places.

Next line should be:

clear

This command causes Qake to wipe all entities and data left over from the last map. It's very important. Next line should be:

set_restart "MAPNAME.qmp"

Where mapname is the name of this file. This indicates to Qake which script to run if the player dies and it needs to restart the level. This previously was automatically the last script it ran, but because of complications with the menu scripts, this command was added so you can set it up properly.

Next you should add a line like this:

tilemap mapname.map

This tells Qake to load binary map data from a file called mapname.map. This should obviously be the file your map you made in mappy is called.

music "heresy.mid"

Optional, this command sets which music file to play.

set bgcolor 40

Sets the background color to 40, which is brown. You can use any color index in the Qake palette. To find out what colors are available, you can load the palette up in Paintshop Pro, it's included as qake.pal in the data folder.

run ts01.txt

This will run the script ts01.txt, which contains a bunch of commands for the ts01.bmp tileset. How to make a tileset will be discussed later.

The next thing you need is a playerspawn:

playerspawn X Y

This will define where the player starts The X and Y are tile coordinates. If you have your mappy program open, hover 1 square above the floor where the player should start. In the title bar for the map you'll see X: 4/200 y: 2/200 or something like that. The first number for each X and Y are what you enter here.

Remember to get one square above ground level And by that I mean find the square where upon which the player will stand. Move up one square to the first open space. Move up one from that to find out where to put the player's head. This is the start location.

Your map is now playable, but unpopulated. If you made doors or platforms, they won't yet work. You could save and try it out now if you wish. Load Qake, choose customize, custom maps and select your map.

To populate your map you'll need to add commands that create entities. Items are slightly different. I'll start with items. To add an item, simply add one of these commands to the script:

item_shells X Y
item_nails X Y
item_rockets X Y
item_cells X Y
item_health X Y
item_megahealth X Y
item_biosuit X Y
item_quad X Y

For X and Y use the same method you used to get the playerspawn location, however, since items are shorter, you need not place it an extra square above ground level.

item_armor TYPE X Y
item_weapon TYPE X Y

These two are slightly different items in that they take a TYPE parameter. For armor this is:

0Green Armor
1Yellow Armor
2Red Armor

For item_weapon this is:

3double barreled shotgun
4nailgun
5super nailgun
6grenade launcher
7rocket launcher
8lightning gun

To add monsters you'll need to add one of these commands

monster_army X Y FLIP
monster_dog X Y FLIP
monster_ogre X Y FLIP
monster_scrag X Y FLIP
monster_knight X Y FLIP
monster_demon X Y FLIP
monster_zombie X Y FLIP

Most of these entities are tall like a player, so you'll need to move them up 1 above the normal spawn location. Again X and Y are as above. FLIP indicates their facing direction. If 1, they'll face left, if 0, face right.

Variables

Qake use variables in it's scripts. Variables can be defines with the set command. Qake has a number of predefined variables:
NameConstantDefault ValueComment
gravityNo10Units per second for gravity, variable.
pauseNo0Boolean, is game paused?
fullscreenNo1Boolean, fullscreen mode?
tilesizeNo16Width and height of a tile. Should always be 16, strange stuff might happen otherwise
screenwidthNo320Resolution width of the screen or window, if windowed. After changing, call vid_restart
screenheightNo240Resolution height of the screen or window, if windowed. After changing, call vid_restart
joystickNo1Boolean, is joystick enabled.
upYes1Command bit for the up key
downYes2Command bit for the down key
leftYes4Command bit for the left key
rightYes8Command bit for the right key
jumpYes16Command bit for the jump key
fireYes32Command bit for the fire key
wepswitchYes64Command bit for the weapon cycle key
menuYes128Command bit for the menu key
useYes256Command bit for the use key
solid_yesYes1Used for .solid or tilesolid command. Indicates object is solid, note there is [currently] no solid_no with the value of 0, indicating something is not solid, as that is the default value
solid_sloperYes2Used for .solid or tilesolid command. Indicates object is a solid triangle sloping up and to the right = /
solid_slopelYes3Used for .solid or tilesolid command. Indicates object is a solid triangle sloping up and to the left = \
solid_hopdownYes4Used for .solid or tilesolid command. Indicates object is a solid bar along it's top few vertical pixels unless the player is performing the hopdown manuever or is already below it.
solid_hopdown_sloperYes5Used for .solid or tilesolid command. Indicates object is a solid slope along it's top few vertical pixels unless the player is performing the hopdown manuever, the slope is up and to the right /
solid_hopdown_sloperYes6Used for .solid or tilesolid command. Indicates object is a solid slope along it's top few vertical pixels unless the player is performing the hopdown manuever, the slope is up and to the left \
solid_slimeYes8Used for .solid or tilesolid command. Indicates object is made of slime. This solid type damages the player somewhat whenever he is inside it, unless he has the biosuit powerup, it otherwise behaves as water
solid_lavaYes9Used for .solid or tilesolid command. Indicates object is made of lava. This solid type damages the player a lot whenever he is inside it, it otherwise behaves as water.
solid_waterYes10Used for .solid or tilesolid command. Indicates object is made of water. Inside this object, the player can move in all 2 dimensions freely, until he runs out of oxygen, where upon he begins taking damage.
solid_barsYes11Used for .solid or tilesolid command. Indicates object is made of bars. Projectiles may pass through the object, but larger creatures may not.
mf_draw_mainYes2Map layer flag, indicates the layer should be drawn as the primary layer.
mf_draw_bgYes1Map layer flag, indicates the layer should be drawn as the background layer.
mf_draw_fgYes4Map layer flag, indicates the layer should be drawn as the foreground layer.
mf_collisionYes4Map layer flag, indicates the layer should be considered in collision detection routines.
mf_collisionYes8Map layer flag, indicates the layer should be considered in collision detection routines.
mf_animateYes16Map layer flag, indicates the layer should be animated (see animate command).
silverkeyYes32768Item flag value of the silver key, can be used for triggers, etc.
goldkeyYes65536Item flag value of the gold key. can be used for triggers, etc.
music_volumeNoCurrent music volume. Set with "music" command, it is provided as a variable for read only purposes.
fps_displayNo0Boolean, display Frames per second?
bg_colorNo0Palette index of the map clearing color.
hardwareNo0Boolean. Should use 2D hardware acceleration?
stretchNo0Boolean. Should stretch screen to specified resolution?
smoothNo0Boolean. Should use smooth stretch when stretching graphics (see stretch)?
global_healthNo0Health of the player (for level changing purposes).
global_cellsNo0Amount of cells carried by the player (for level changing purposes).
global_shellsNo0Amount of shells carried by the player (for level changing purposes).
global_nailsNo0Amount of nails carried by the player (for level changing purposes).
global_rocketsNo0Amount of rockets carried by the player (for level changing purposes).
global_itemsNo0Item flags of items carried by the player (for level changing purposes).
global_weaponNo0Currently selected weapon of the player (for level changing purposes).
global_armorNo0Amount of armor the player has (for level changing purposes).

Command Reference


bind [keyname] [action]

Binds a key to an action. Available actions are the predefined variables: $up $down $left $right $jump $fire $wepswitch and $menu. Keynames originate from SDL or refer to joystick buttons if they begin with the word "button" and are followed by a number.

changelevel [script filename]

Nearly identical to run, below, but copies off both the scriptname and the player's stats for the restart command.

music [filename or command]

If the parameter is a filename, this command loads and plays that music file. The parameter may also be one of the following commands "play" "stop" "volume" or "pause". Play, stop, and pause behave as you'd expect (but ironically, not for MIDI files). Volume requires an additional parameter that adjusts the playing volume of the music. The addition parameter should be an integer value between 0 and 128.

move [target] [new position x] [new position y]

Moves a movemap to a new position, the movemap moves at the object's speed.

movemap [name] [origin x] [origin y] [tile x] [tile y] [width] [height]

Defines a movemap in so doing it spawns a new entity. The new movemap appears at origin x, y. The source for the image is tile x, y for the width and height specified.

playerspawn [origin x] [origin y]

Defines the tile location the player spawns at.

print [string]

Outputs a debugging/log string.

restart

Restarts the current level (reruns the last changelevel'd script)

run [script filename]

Executes a script.The script runs, then returns to were the calling script left off.

set [var] [value]

Sets a variable's value. Variables can be used in place of parameters for most functions.

slide [filename]

Displays an image slide.

tilefont [filename]

Loads a tilefont image. A tile font image should be 16 tiles x 16 tiles.

tilemap [filename]

Loads a tilemap with the specified filename. The map can contain multiple layers.