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.
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.
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:
| 0 | Green Armor |
| 1 | Yellow Armor |
| 2 | Red Armor |
For item_weapon this is:
| 3 | double barreled shotgun |
| 4 | nailgun |
| 5 | super nailgun |
| 6 | grenade launcher |
| 7 | rocket launcher |
| 8 | lightning 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.
| Name | Constant | Default Value | Comment |
|---|---|---|---|
| gravity | No | 10 | Units per second for gravity, variable. |
| pause | No | 0 | Boolean, is game paused? |
| fullscreen | No | 1 | Boolean, fullscreen mode? |
| tilesize | No | 16 | Width and height of a tile. Should always be 16, strange stuff might happen otherwise |
| screenwidth | No | 320 | Resolution width of the screen or window, if windowed. After changing, call vid_restart |
| screenheight | No | 240 | Resolution height of the screen or window, if windowed. After changing, call vid_restart |
| joystick | No | 1 | Boolean, is joystick enabled. |
| up | Yes | 1 | Command bit for the up key |
| down | Yes | 2 | Command bit for the down key |
| left | Yes | 4 | Command bit for the left key |
| right | Yes | 8 | Command bit for the right key |
| jump | Yes | 16 | Command bit for the jump key |
| fire | Yes | 32 | Command bit for the fire key |
| wepswitch | Yes | 64 | Command bit for the weapon cycle key |
| menu | Yes | 128 | Command bit for the menu key |
| use | Yes | 256 | Command bit for the use key |
| solid_yes | Yes | 1 | Used 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_sloper | Yes | 2 | Used for .solid or tilesolid command. Indicates object is a solid triangle sloping up and to the right = / |
| solid_slopel | Yes | 3 | Used for .solid or tilesolid command. Indicates object is a solid triangle sloping up and to the left = \ |
| solid_hopdown | Yes | 4 | Used 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_sloper | Yes | 5 | Used 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_sloper | Yes | 6 | Used 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_slime | Yes | 8 | Used 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_lava | Yes | 9 | Used 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_water | Yes | 10 | Used 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_bars | Yes | 11 | Used for .solid or tilesolid command. Indicates object is made of bars. Projectiles may pass through the object, but larger creatures may not. |
| mf_draw_main | Yes | 2 | Map layer flag, indicates the layer should be drawn as the primary layer. |
| mf_draw_bg | Yes | 1 | Map layer flag, indicates the layer should be drawn as the background layer. |
| mf_draw_fg | Yes | 4 | Map layer flag, indicates the layer should be drawn as the foreground layer. |
| mf_collision | Yes | 4 | Map layer flag, indicates the layer should be considered in collision detection routines. |
| mf_collision | Yes | 8 | Map layer flag, indicates the layer should be considered in collision detection routines. |
| mf_animate | Yes | 16 | Map layer flag, indicates the layer should be animated (see animate command). |
| silverkey | Yes | 32768 | Item flag value of the silver key, can be used for triggers, etc. |
| goldkey | Yes | 65536 | Item flag value of the gold key. can be used for triggers, etc. |
| music_volume | No | Current music volume. Set with "music" command, it is provided as a variable for read only purposes. | |
| fps_display | No | 0 | Boolean, display Frames per second? |
| bg_color | No | 0 | Palette index of the map clearing color. |
| hardware | No | 0 | Boolean. Should use 2D hardware acceleration? |
| stretch | No | 0 | Boolean. Should stretch screen to specified resolution? |
| smooth | No | 0 | Boolean. Should use smooth stretch when stretching graphics (see stretch)? |
| global_health | No | 0 | Health of the player (for level changing purposes). |
| global_cells | No | 0 | Amount of cells carried by the player (for level changing purposes). |
| global_shells | No | 0 | Amount of shells carried by the player (for level changing purposes). |
| global_nails | No | 0 | Amount of nails carried by the player (for level changing purposes). |
| global_rockets | No | 0 | Amount of rockets carried by the player (for level changing purposes). |
| global_items | No | 0 | Item flags of items carried by the player (for level changing purposes). |
| global_weapon | No | 0 | Currently selected weapon of the player (for level changing purposes). |
| global_armor | No | 0 | Amount of armor the player has (for level changing purposes). |