Step Five: Mapping II

MAPPING II

Here I'll explain how to get an updated version of q3map2, use q3map2GUI to compile a map, and how to pack your map nicely up into a .pk3 for release.

TOOLS NEEDED

  • Terminal
  • TextEdit or other text editor
  • Preview or a more advanced image editor (for resizing images)
  • XQuartz
  • MacRadiant
  • q3map2GUI (included with MacRadiant)
  • NetRadiant

If you haven't already installed MacRadiant, you should look at Mapping I.

UPDATING Q3MAP2


q3map2 is used to compile maps from the .map format used by Radiant into the .bsp format used by the game. Unfortunately, the copy included in MacRadiant is slightly out of date, and so does not support some more advanced features such as proper terrain texture blending.

You can still use this old version of q3map2 if you wish, but it's not recommended.

A considerably more up-to-date version can be found inside NetRadiant, an alternative version of Radiant. Download the 'MacOS 10.6 (intel, compiled on MacOS 10.6.6)' version from Ingar's NetRadiant site. Put the NetRadiant application somewhere - I put it alongside the MacRadiant 1.4 application, and will assume that you have done the same. If you're not sure what you're doing with the Terminal I recommend you do.



If you want, you can map with NetRadiant instead of MacRadiant. The interface is slightly different since it is based on GtkRadiant 1.5 rather than 1.4. If you want to do this, you should get The One and Only's NetRadiant JKA Fix from JKHub and follow the instructions inside the download.



Create a new file in TextEdit. Make sure that it is a plain text file. If it has the formatting bar at the top, do Format->Make Plain Text.

Plain Text File

Copy and paste into the file:

#!/bin/sh

MY_DIRECTORY="${0%/*}" # cut off the script name
MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off radiant14
MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off sw
MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off Resources
MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off Contents
MY_DIRECTORY="${MY_DIRECTORY%/*}" # cut off MacRadiant1.4

DYLD_LIBRARY_PATH="${MY_DIRECTORY}/NetRadiant.app/Contents/MacOS/install/"

export DYLD_LIBRARY_PATH

${MY_DIRECTORY}/NetRadiant.app/Contents/MacOS/install/q3map2.bin "$@"

Script File

Note that you shouldn't edit any of the paths unless you know what you're doing.

Save the file as q3map2.ppc in the same folder as NetRadiant and MacRadiant 1.4. Make sure that there isn't a hidden .txt extension!

Save Box

GtkRadiant folder



Now for some more Terminal fun. Open up Terminal in /Applications/Utilities/.

Type cd and then a space, and drag the folder containing NetRadiant and MacRadiant 1.4 into the terminal. It should be something like:

cd /Some/Path/GtkRadiant/

Hit enter. Now type

chmod +x q3map2.ppc

and hit enter again. Next up,

mv "MacRadiant 1.4.app/Contents/Resources/sw/radiant14/q3map2.ppc" "MacRadiant 1.4.app/Contents/Resources/sw/radiant14/q3map2.ppc.old"

(enter of course), and finally:

mv q3map2.ppc "MacRadiant 1.4.app/Contents/Resources/sw/radiant14/q3map2.ppc"

Now you have a more up-to-date version of q3map2!

If anything goes wrong with this step, you can either delete your new q3map2.ppc inside the application and move q3map2.ppc.old back to q3map2.ppc, or just overwrite MacRadiant 1.4 with a clean copy if you don't feel comfortable doing that.

USING q3map2GUI


q3map2GUI can be found inside the Goodies folder that comes with MacRadiant. You can use it even if you haven't updated your copy of q3map2. Open it up. It should look something like this:

q3map2GUI shot

Hopefully you've still got your .map file from Mapping I, or have made something more complicated. Do Select File… and locate the .map file. Let's do a fancy final compile. Go to Presets… and select (final) : BSP -meta, -vis, -light -fast -filter -super 2 -bounce 8. You can do more customisation of the compile line by choosing flags. Click on the LIGHT button. Tick the -dirty box to turn on dirtmapping/ambient occlusion.

Now hit Start q3map2… to compile your map. q3map2GUI will bring up a pane to show the compile progressing.

q3map2 pane

As in Mapping I, you can test your map again by putting the .bsp in the maps folder inside your base folder.

PACKING UP YOUR MAP


You'll have noticed that your map is missing a levelshot when it's loading up, and that your map doesn't show up in the menus. To deal with this, you'll need to add an image to the levelshots folder and write an .arena file for your map.

Open up your map in-game. Try to turn the settings up as high as possible, and turn anti-aliasing on if possible.

Go into first person mode. Turn 2D drawing off and hide the gun using

/cg_draw2D 0
/cg_drawgun 0

in the game console.

Use the game console to bind a key to taking a screenshot:

/bind <key> screenshot

or

/bind <key> screenshot_tga

Hit the key to take the screenshot that will show up as the map is loading.

Make a maps folder somewhere. Also make a levelshots and scripts folder alongside maps.

pre-pk3 folder

Put your .bsp file into the maps folder. Now find the screenshot you took of your map. It will be in the screenshots folder inside your secondary base folder, so for example at /Users/yourusername/Library/Application Support/Jedi Academy/base/screenshots/ for the Steam version. Open it up in Preview or another image editor.

Resizing image Do Tools->Adjust Size… or the equivalent command in your editor. Resize it to a power-of two size - usually this will be 512x512 or 1024x1024 depending on how high you want the quality to be. Save the resized image in the levelshots folder. If your map is called mymap.bsp, the image should be named mymap.jpg or mymap.tga

Finally, you can make the .arena file. Make a new file in TextEdit or your text editor of choice. Ensure that it is a plain text file. If it has the formatting bar at the top, do Format->Make Plain Text.

Plain Text Again

Enter into the text file:

{
map         "mymap"
longname        "My Map"
fraglimit       10
type            "duel powerduel"
}

Note that the value corresponding to map should be the same as for your .bsp - my .bsp is called mymap.bsp. longname is the name that shows up in the menu. The map will show up in the menus for the Duel and Power Duel gamemodes.

Save the text file as mymap.arena in the scripts folder. Make sure that you don't have a hidden .txt extension. You should now have something along the lines of this:

One more pre-pk3 folder

Select the scripts, maps and levelshots folders. Right- or control- click and select Compress 3 Items. Rename the produced Archive.zip to mymap.pk3, being careful that there isn't a hidden .zip extension, and put the mymap.pk3 into your base folder.

Load the game up, and your map should show up in the menus. Enter the map and your levelshot will show as the level loads.

In Menus

Now you've successfully packed your map up. You can send it to people or submit it to be hosted somewhere, though you should practice a bit first!

This article is my 9th oldest. It is 1154 words long, and it’s got 0 comments for now.