Saving and Compiling: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (added {{key|}} template and {{otherlang}} is replaced on {{otherlang2}})
(cleaned)
Line 7: Line 7:
{{first room menu}}
{{first room menu}}


The final stage of making a level is saving and compiling it. A map must be compiled to run it in the [[Source|Source Engine]].
The final stage of making a level is '''saving and compiling''' it.
{{clr}}


== Saving the map ==
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.
[[Image:hammer_saveas.jpg |thumb|right|200px| Choose ''Save As...'' to save the map.]]
<!--[[Image:hammer_setname.jpg |thumb|right|200px| Type in a name for the map, then Click the Save button.]]-->


First, let’s save this map:
== Saving  ==


# Click the '''File''' menu.
# Click the "File" menu and choose either "Save" or "Save As...":<p>[[File:Hammer saveas.jpg|border|200px| Choose ''Save As...'' to save the map.]]</p> {{tip|You can press {{key|Ctrl+S}} to save the map with its existing name without having to open the menu.}}
# As this is your first time saving this map, we will need to give it a name, so choose '''Save As...'''.
# 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.}}
# A '''Save As...''' dialog will open. Type the name of your map into the '''File Name''' field:
# Click the "Save" button to save the map to disk.
#:{{warning|You cannot include any spaces in the filename.}}
#* [[Half-Life 2: Deathmatch]] maps should have the <code>dm_</code> prefix before their map names so that they can easily be recognized.
# Click the '''Save''' button to save the map to disk.


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


{{note|You can also press {{key|Ctrl+S}} to save the map without having to open the menu.}}{{clr}}
== Compiling  ==


== Compiling the map ==
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.
[[Image:hammer_pickrunmap.jpg |thumb|right|200px|Click the '''Run Map''' icon to compile your map.]]


You have saved your map, but you will also need to compile it before it can be played in the game engine.
# Open the File menu, and choose "Run Map...". {{tip|You can also press {{key|F9}}.}}
# The dialog that appears is used to set up a compile:<p>[[File:Hammer setmapparam.png|border|200px|Change the "Run Map" parameters to match these settings, then click "OK".]]
## 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!}}
## Under "Additional game parameters:", type <code>-toconsole -dev -console +sv_lan 1</code>
## Now click the "OK" button to start the map compile process.


When a map is compiled, it is converted from the raw .VMF file that you just saved, into the .BSP format used by the game engine. The geometry is processed and the proper lighting and shadows are pre-calculated with several compile programs.
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.


Open the '''File''' menu, and choose '''Run Map...'''.
Congratulations, you've made your first map!


The '''Run Map''' dialog will open.
{{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 <code>map <your map, without file extension></code> to load the map manually.}}
{{note|You can also press the {{key|F9}} key to display this dialog}}
{{clr}}


[[Image:hammer_setmapparam.gif|thumb|right|200px|Change the '''Run Map''' parameters to match these settings, then click '''OK'''.]]
== The result ==


This dialog is used to set some basic compile parameters.
[[File:Hammer engine.jpg|border|300px|The final room, compiled and running in the game.]]


# Make sure that '''Normal''' is set under the '''Run BSP''', '''Run VIS''', and '''Run RAD''' settings.
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.
# Under '''Additional game parameters:''', type:
#: <code>-dev -console +sv_lan 1</code>
#: See [[Additional game parameters]] if you wish to learn more about these settings.
# Now click the '''OK''' button to start the map compile process.


The '''Compile Process Window''' will show the progress of the compile. When the compilation is done, the game you are mapping for will automatically launch, and load your map in the engine.
To continue learning abut mapping, visit [[:Category:Level Design]]. If you have problems, check [[:Category:Level Design FAQ]].


{{note|If you wish to compile under [[HDR]] lighting, simply check the box that says HDR. The time to compile the map will be twice as long, but that is completely normal.}}{{clr}}
{{navbar|Adding Prop Models|Your First Map|:Category:Level Design}}
 
[[Image:hammer_engine.jpg|thumb|300px|right|The final room, compiled and running in the game.]]
 
Here's a shot of the compiled map in-game. It isn’t much to look at yet, but it has the basic pieces you need to get started making your own maps.
 
Congratulations, you’ve made your first map!
 
== Where do I go from here? ==
Now that you know the basics, look at the [[:Category:Level Design|Level Design Category]] page for a list of articles and tutorials on different level design topics.
 
If you're having problems, you may wish to consult the [[:Category:Level Design FAQ|Level Design FAQ]].{{clr}}
 
{{Navbar|Adding Prop Models|Your First Map|:Category:Level Design}}


[[Category:Level Design Tutorials]]
[[Category:Level Design Tutorials]]

Revision as of 10:57, 30 August 2009

Template:Otherlang2

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.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.  [todo tested in ?]

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 abut mapping, visit Category:Level Design. If you have problems, check Category:Level Design FAQ.


[[::Category:Level Design|:Category:Level Design]] →