Editing

Creating maps for KMQuake2 is easier than you would expect.  There are no special map editor settings required.  You need only use the included kmquake2_lazarus.def (for Radiant) or .fgd (for Worldcraft) entity lists to support the new or modifed entities.  The rest of the mapping-related changes are new tricks and capabilities that you can use in the map itself, at compile time, or at run time.

Increased Limits
First, most limits have been increased.  The limits of 256 each on models and sounds are no more.  There can be more than 1024 entities active at once, and SZ_Getspace: Overflow errors are now a thing of the past.  Maps can now extend beyond the +/-4096 coordinate when compiled with KMQBSP.

In addition, much larger outdoor areas are supported with a larger sky clipping distance, which defaults to 10000 and can be changed with the r_skydistance cvar.  To keep the r_speeds down in such huge expanses, maps compiled with QBSP -chop values of up to 1024 are supported.  This setting makes QBSP chop up surfaces every 1024 units, instead of every 240.  This setting is enabled by default in KMQBSP 1.13 and higher.  The reductions in r_speeds can be quite dramatic in some areas.


Solid Alphas
Solid alphas are supported, which means that you can have variable-alpha transparent effects using alpha channels.  This effect can be enabled on surfaces by setting both the TRANS33 and TRANS66 surface flags.

Alpha Test Textures
Textures with real holes are now supported, bypassing the rendering problems of solid alphas.    This effect can be enabled on surfaces by setting the 0x02000000 surface flag in Radiant's surface inspector. Use KMQBSP3 1.13 or higher to compile maps with these surfaces.  The screenshots below show how to set this surface flag in supporting versions of QERadiant and GTKRadiant.

QERadiant 1.47


GTKRadiant 1.50


QuArK users can download this file and unzip it to their QuArK/addons/Quake_2 folder to show the alphatest flag.  The translucent content flag will need to be set along with the alphatest flag if KMQBSP3 is not used to compile the map.

To make a texture have a cut-out, make a .wal texture with the areas to be invisible as color 255, or the last color in the palette that appears as a dark pink or peach in Wally.  You can find a tutorial on making these textures here.  Alternately, you can make a TGA texture with cut-outs by using an alpha channel that makes those parts invisible.

Moving and Animated Trans Surfaces
Transparent surfaces can now move and animate.  So if you've always wanted to make a glass door or a vehicle with windows, now you can.  Transparent surfaces that are part of brush models also no longer occlude trans surfaces behind them, but draw order problems will often occur (there's just no good way to sort trans surfaces that are outside of the BSP tree).

Prettier Trans Surfaces
Transparent surfaces are now lightmapped and environment mapped by default.  For surfaces on which this is not desirable (volumetric lights, etc.), this can be disabled by setting the 0x01000000 surface flag in Radiant's surface inspector.  The screenshots below show how to set this surface flag in supporting versions of QERadiant and GTKRadiant.

QERadiant 1.47


GTKRadiant 1.50


QuArK users can download this file and unzip it to their QuArK/addons/Quake_2 folder to show the flag for this, which is labeled "fullbright".

Transparent Entities
If you want to make a non-brush entity transparent, you now easily can by giving it an salpha key with a value between 0 and 1.  To change the transparency of an entity at run time, you can use the Lazarus target_set_effect entity and give it an alpha key with the new value for the target's salpha key.  Monsters made transparent by this method also spawn transparent chunks when gibbed.

Entity Sound Attenuation
Sounds attached to entities in Quake2 always had a very quick fall off.  This attenuation can now be changed as of 0.20 beta2.  For func_* entities as well as model_spawn, model_train, and target_speaker, the attenuation key can now be set to a value ranging from 0.02 to 3.98.

Hi-res Textures
JPG and TGA textures are supported, and will override similarly named .pcx or .wal images.  For example, if you have a TGA image named inventory.tga in the pics folder,  it will override pics/inventory.pcx.  A texture named basemap.jpg in textures/e1u1 will override textures/e1u1/basemap.wal.  In addition, higher-res texture and HUD pics will be scaled to fit in the same space as the .pcx or .wal images that they replace.

This autoscaling can be used to texture a map with TGA or JPG textures and make it look as if it had been done with a texture stretch of 0.5, 0.25, 0.125, or even smaller.  The size of any identically named .wal texture found at runtme is compared to the size of the TGA or JPG texture, and the resulting divedend is the texture scale used.  For instance, if the .wal version of a texture is 128x128, and the JPG version is 512x512, then the surface will look like it has a texture stretch of 0.25.  This technique avoids the problems caused by actually using such small stretch values, such as undersized dynamic light glows and MAX_MAP_LIGHTING compile errors.

Model_spawn Made Easier
Using the Lazarus model_spawn and model_train entities has also been made easier, thanks to the addition of entity alias scripting.  This allows you to create pre-defined mapobject entities that can be dropped into your map without having to fill in the fields for model_spawn or model_train in the map editor.  These aliases are defined in a text file called ext_data/entalias.def.  Alternately, aliases can be defined on a per-map basis in a map-specific file.  For mymap.bsp, it would be named ext_data/entalias/mymap.alias.  A sample alias file is included.
NOTE: This file can be loaded from inside a pak/pk3 file.

This script file contains alias definitions, which are virtual entity classnames that are changed to another classname when a map loads, each with a set of default key values.  These values can be any key value normally suppported in the game, and are subordinate to what the mapper specifies, except for classname.  For example, this alias definition:

scenery_tree1
{
     "classname" "model_spawn"
     "spawnflags" "4"
     "usermodel" "scenery/tree1/tris.md2"
     "solidstate" "3"
     "bleft" "-16 -16 -16"
     "tright" "16 16 168"
}

defines a virtual entity classname, scenery_tree1, which is converted to a model_spawn at runtime with the listed fields already filled in.  Scenery_tree1 can then be added to the entity list with the proper bounding box and model info, allowing the mapper to see the model and its bounding box in-editor to more easily position it.

Strogg Vorbis
Ogg Vorbis music is suppported, so you can now include custom music with your maps instead of using that on the game CD.  To use this feature, give the worldpsawn entity of your map a musictrack key with a string value that's the name of the Ogg Vorbis file to play, instead of sounds for the CD track number.  For example, a musictrack value of "foo" will cause the file music/foo.ogg to play. The musictrack key can also be used with the Lazarus target_cd entity to change music with triggered events in a map.
Note: the musictrack string must be at least 3 characters long to work properly.  Music tracks will even play from inside pak/pk3 files in 0.20!

RoQing Cinematics
Quake3 RoQ format cinematics are now supported, so if you'd like add pre-rendered cutscenes between maps, but gag at the 256-color, low-res .cin format, you now have a higher-res, greater color depth alternative.

Any Named Pak/Pk3 Suppport
Finally, when you''ve finished your project and are ready to package it up with its textures, sounds, etc. and distribute it, you no longer are restricted to putting it into a pak file in the name range of pak0.pak-pak9.pak.  You can name your pak file whatever you want and won't have to worry about the user accidentally unzipping it into baseq2 and overwriting Q2's main pak files.  Even better, you can use zip-compressed pk3 files instead to make your project have a smaller installed footprint.

Levelshots
Levelshots are supported.  A levelshot is just a screenshot of the level that is displayed when loading the map and in the start server menu.  Widescreen levelshots are also supported when running in widescreen video modes.

To make a levelshot:

  1. Enable JPEG screenshots in the advanced video menu and set the JPEG screenshot quality to its highest settings.
  2. Make sure the video resolution is at least 800x600, or better yet, a 16:10 widescreen mode like 1280x800 (run in windowed mode if you need to).
  3. Be sure to turn off the crosshair and hide the HUD (in the console: crosshair 0; hud_alpha 0 ).
  4. Then just take a screenshot of your map that highlights some of the scenery.
    If you end up taking lots of screenshots rapidly and have a problem with the output text in the upper left corner of the screen, bind a key to the command screenshot_silent for silent screenshots.
  5. If the screenshot is a widescreen image:
    1. Rename the resulting screenshot (scrnshot/kmquake2_xxx.jpg) to mapname_widescreen.jpg (for a level named mapname.bsp), and move it to a folder called levelshots parallel to the scnshot folder.
    2. Open the image in the editor of your choice and clip it horizontally so that it has a 4:3 aspect ratio, and save it as mapname.jpg.
    Otherwise:
    1. Rename the resulting screenshot (scrnshot/kmquake2_xxx.jpg) to mapname.jpg (for a level named mapname.bsp), and move it to a folder called levelshots parallel to the scnshot folder.
  6. Finally, include the levelshots folder in the pak or pk3 file for your map.

As the image is brightened up when displayed ingame, there should be no need to use gamma correction, provided that the in-game brighness is properly adjusted when the screenshots are taken.

.Arena Files
Quake3-style .arena files are supported to allow multiplayer maps to be automatically added to the maplist in the start server menu, instead of having to manually edit maps.lst.  The arena file is a simple script with basic information on the map.  Here are the contents of an example .arena file:

{
map        "marics81"
longname   "Topaz"
type       "dm teamdm"
}

The map field is the filename of the level's .bsp file (sans .bsp extension).  The longname field is the map's title, and the type field determines which game modes the map shows up in.  In KMQ2's start server menu, the maps from .arena files are added after the maps from maps.lst, and are filtered by the selected game type.  Here are the valid type tokens:

Deathmatch:    dm teamdm ffa team
Cooperative:   coop
CTF:           ctf
3Team CTF:     3tctf

The script should be named mapname.arena (for a level named mapname.bsp), and it should go in a folder called scripts, parallel to the maps folder.  The path for this file inside a pak or pk3 file should be scripts/mapname.arena.