< Mapping
Revision as of 08:15, 14 April 2012 by MCR (talk | contribs) (Linux: formatting)


In order to see a map in game it must be compiled. Compiling can be very time consuming. If you don't want to compile yourself, you can use the contrib/map-get/ script to download the latest version of the compiled maps. You need python 2.x to do so. Grab it from Windows users should right click the file and select 'Open with' and choose the python binary (e.g. in c:\python23).

The rest of this page is designed for mappers who are compiling their own maps, and for information on ufo2map's settings.

Compiling your own map

To compile your own map it must be saved in the /base/maps/ folder. You should use ufo2map.exe, which is located in the folder where you installed the game, alongside the game's executable (ufo2map.exe). Running it is different for different platforms


To run ufo2map.exe, go to the Start Menu. For Windows XP, click Run and then type cmd. It should open a small black window with an old dos-like prompt. Browse to your game's installation folder. If you game is in c:\Program Files\ufoai, you would type cd "c:\Program Files\ufoai" and hit enter.

Once you're in the directory, type ufo2map maps/


Under Linux we use ufo2map - which is a binary including the bsping and the radiosity part.

Just type make maps from master/.

Once you're in the directory, type ./ufo2map maps/

Loading the map in game

To play the map in game, you will need to add the map to a .ufo file in the /base/ufos/ directory. You can either add the entry to your existing maps.ufo file or make a new file for your map. If you're just testing, making a new file can be easier to work with. The file should look something like this for a test map, though you can look at other maps in maps.ufo to see other options:

mapdef yourmap
	map			"yourmap"
	description	"_Your map description"
	teams		2
	multiplayer	false
	maxaliens	8





Once you have this file in the /base/ufos/ folder, you can load your map in Skirmish mode.

Errors you may get

  • mixed face contents
Example: Entity 0, Brush 12: mixed face contents
All brushsides should have the same content and surfaceflags set - but there may be exceptions like nodraw faces
this happens if more than the allowed number of brushes touches one brush - e.g. a long stair
this means that there are "too many lightmap pages". Concretely, this may happen if there are too many surfaces in the map, or textures scaled too small.

Advanced Parameters for ufo2map

If you type ufo2map --help, you will get a long list of supported parameters. Here are a few:

Extra light samples for better lighting
-quant NUMBER
The default is currently 4, but you can reduce this for much better lighting (cleaner lines). But this will dramatically increase compile times.
This will bypass the lighting stage if you just want a quick test. You can add day or night parameters behind it to bypass just that lighting stage.
This will check the map file, but it will not make any changes. Instead, it will print out a list of found problems. It will report about mixed levelflags, z-fighting and more.
This will check the map file and try to fix a number of problems. So it fixes surfaces that ought to be nodraw and more.

Batch File

There is a batch file with some useful options, e.g. you can compile all the maps in one directory (when dealing with a random map assembly). Look for contrib/scripts/compile_maps.bat and run

compile_maps.bat /help

for information.