Saving and Compiling

From Valve Developer Community
Jump to: navigation, search
Français Русский 简体中文

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 calculating visibility, so that the computer can quickly work out which parts of the map need to be drawn at any given time, and calculating static lighting such as that from our light entity.

Saving

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

    Choose Save As... to save the map.

    Tip: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: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: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: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!

Bug:
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.



Your First Map
Adding Prop Models