User Tools

Site Tools


Compiling Maps for Cafu

When you have finished editing a map in CaWE, you’ll want to run it with Cafu. The engine however requires that the map is in a precomputed form, and this section describes how you turn your map into a fully precomputed world file. The process of turning your cmap map file into a for the engine usable cw world file is called compiling.

As to not force you to run the compile procedure for all your cmap files by hand, the CaWE mapping editor provides a “Compile” menu with which you can easily and very conveniently accomplish this task. In this section, you'll learn how to use it.

tut_compile1s.jpg You will find the “Compile” menu in the top menu bar of CaWE. It's items can roughly be separated into three distinct groups: The upper group tells CaWE what to do, the middle group says how to do it and the lower group is for stopping the compile process early. The function of all items is explained in greater detail below:

Step 1: The compile steps

The upper group of menu items tells CaWE which steps of the compile process should be run. You can turn the individual parts on or off by checking or unchecking the mark in the appropriate line.

  1. Save Map: Saves the map. Checking this does exactly the same as a click on the “File → Save” menu item before compiling the map. Having this checked is practical and recommended when you work on a map and want to test it “live” in the Cafu engine every now and then, because it makes sure that the compilers pick up the latest version of your map with the most recent changes.
  2. Run CaBSP: This is the crucial step that runs the CaBSP compiler on your map. CaBSP takes your map file and creates a world file for use by the Cafu engine from it (the map file is not modified). As all other compilation steps build on this one and the generated cw file, you cannot turn it off to omit CaBSP.
  3. Run CaPVS: Runs the CaPVS compiler on the intermediate result obtained from CaBSP. CaPVS precomputes the PVS (Potentially Visibility Set) for the world file. This can be a lengthy process on its own, and you may wish to skip it when you're just testing your map. However, it also has a potential for improving the rendering performance of your map significantly, so you should never leave this out for release maps.
  4. Run CaLight: Runs the CaLight compiler on your map, which precomputes the static lighting of your maps by using physically accurate Radiosity methods. CaLight too can take very much time to complete, and should therefore never be run without a preceding CaPVS pass. However, for testing you may want to skip CaLight as well as CaPVS, because your map will be full-bright when CaLight is not run, which may be sufficient for checking e.g. the geometry or entity placement during map development.
  5. Start Engine: If this entry is checked, Cafu will automatically be launched with your map when the compiling process is finished.

Step 2: Starting the compile process

After you have selected which steps should be included in the compile process, you can start it with varying quality settings by clicking on one of the three items of the middle group (“Quick”, “Normal”, or “High Quality”). These settings mostly affect the quality of the lighting generated by CaLight, and therefore have a direct impact on its run-time.

After you started the compile process, a console window opens, showing compile details and progress information. Note that you can simply close the console window at any time and continue to work on your map while the compilation process keeps running in the background. Just use the “View → Screen Elements → Console” menu to toggle the console window on and off. The three menu items to start a compile will be grayed-out while another compilation is running, so that starting two compile processes simultaneously is not possible.

However, you can stop the entire currently running compilation process prematurely by clicking on the “Compile → Abort” menu item.

If you activated the “Start Engine” item, Cafu will be started when the compile process is complete and you'll just have to click on “OK” in the Cafu dialog to start and play your map!

Tips, Tricks and Trouble-shooting

Using the “Compile” menu requires that you have setup the “Configuration” dialog of CaWE completely and properly. If a compiler cannot be run correctly, please check if you got all the executable file names right in this dialog. Please refer to Installation, Initial Configuration and De-Installation for more details.

If your map turns out to be pitch-black when run in the engine after the last compilation step, a likely cause is that you kept the CaLight compiler enabled, but did not place any radiosity light source (i.e. no light or sky material). For checking this quickly, just disable CaLight in the “Compile” menu, then start the compilation again and review the result in the Cafu engine. Thereafter, you may want to place some light sources into your map by applying materials that cast radiosity light, and re-enable CaLight again in order to compute a proper, realistic radiosity solution.

For quick tests during map development, you can save a lot of compile time by turning off the CaPVS and CaLight compile steps. You may get very low frame-rates and only full-bright lighting, but that's usually fine for checking the map geometry. When you're done, or about to release your map for others, you definitively should compile it once with CaPVS and CaLight enabled, in order to obtain the maximum speed and quality.

Very advanced users can also compile their maps manually at the command-line. This offers the possibility for further customisations of the compile process. Compiling maps at the command-line is explained here.

mapping/compiling_new.txt · Last modified: 2013-01-07 12:07 (external edit)