Saving and Compiling

From Valve Developer Community
(Redirected from Compiling)
Jump to: navigation, search
English (en)français (fr)日本語 (ja)русский (ru)中文 (zh)
Edit

The final stage of making a level is saving and compiling it.

A map must be compiled into the format read by the engine before it can be played. This process involves VBSP creating the map, VVIS calculating visibility, so that the computer can quickly work out which parts of the map need to be drawn at any given time, and VRAD calculating static lighting such as that from our light entity.

Tip.pngTip:A common pitfall for mappers is wasting time by compiling with VVIS and VRAD on, when they're still in the design stage of a map. You should worry about the main features of a map (walls, buildings, logic, NPCs, etc) before you start visibility optimizations. After you have visibility sorted out, then begin lighting.

Saving

  1. Click the “File” menu and choose either “Save” or “Save As...”:

    Choose Save As... to save the map.

    Tip.pngTip:You can press Ctrl+S to save the map with its existing name without having to open the menu.
  2. Since this is the first time you’ve saved the map, a “Save As...” dialog will open no matter which option you chose. Type a name for your map into the “File Name” field.
    Warning.pngWarning:You should not include any spaces in the name.
  3. Click the “Save” button to save the map to disk.

The map is saved in the uncompiled .VMF file format.

Compiling

You have saved your map to VMF, which is a text format. You will need to compile it before it can be played in a game. Compiling means converting a raw VMF file into the binary BSP format. The map’s geometry is processed and the proper lighting and shadows are pre-calculated by a series of compile programs: BSP, VIS and RAD.

  1. Open the File menu, and choose “Run Map...”.
    Tip.pngTip:You can also press F9.
  2. The dialog that appears is used to set up a compile:

    Change the “Run Map” parameters to match these settings, then click “OK”.

    1. Make sure that “Normal” is set under “Run BSP”, “Run VIS”, and “Run RAD” settings.
      Tip.pngTip:If you want to compile with High Dynamic Range, tick the checkbox. This will make your compile take twice as long, but with such a small map that hardly matters!
    2. Under “Additional game parameters:”, type “-toconsole -dev -console +sv_lan 1”.
    3. Now click the “OK” button to start the map compile process.

The Compile Process Window will show the progress of the compile (though it may stop updating if it takes a very long time). When the compile is complete, the game you are mapping for will automatically launch and load your map in the engine.

Congratulations, you’ve made your first map!

Icon-Bug.pngBug:If you are using either of the Source SDK Base games, currently you will get a “filesystem in use” error when the game tries to load. Just launch from Steam instead. Open the developer console and type map <your map, without file extension> to load the map manually.

The result

The final room, compiled and running in the game.

Here’s a shot of the compiled map running in Half-Life 2: Deathmatch. It isn’t much to look at yet, but it has the basic pieces you need to get started making your own maps.

To continue learning about mapping, visit Category:Level Design. If you have problems, check Category:Level Design FAQ.