Workshop docsBuilding maps
Building and compiling a map
The Black Mesa-specific parts of getting a map from Hammer into the game, including the compile settings the official maps use, cubemaps and nodegraphs.
This page assumes you can already build a basic room in Hammer. If you can't, work through the Valve Developer Community's Your First Map series first. It's written for Half-Life 2, but nearly everything carries over. Then come back here for the parts that are different in Black Mesa.
Before you start
Pick a name now. Map names are hard to change later, because campaign files, loading screens, level transitions and nodegraphs all refer to them.
- Use lowercase, no spaces, and a prefix that's yours:
ap_storage_01, notStorage Map. - Black Mesa itself uses
bm_for singleplayer anddm_for multiplayer maps. You can follow that convention, but don't start a singleplayer map name withbm_c. The official campaign uses that prefix, and the menu groups maps by their first four letters when it picks a loading screen image. - If your campaign has several maps, number them in play order (
ap_01_lobby,ap_02_vault) so they also sort alphabetically in that order.
Keep your VMFs outside the game folder, e.g. in C:\bms-mapsrc\. Game updates and file verification can delete things you leave in the install folder.
Spawning the player
| Map type | Entity |
|---|---|
| Singleplayer | info_player_start (one per map). |
| Deathmatch | info_player_deathmatch. See Multiplayer maps. |
| Team Deathmatch | info_player_marine and info_player_scientist. |
A singleplayer player spawns with nothing. Give them the HEV suit (item_suit) and any weapons as entities in the map, or with a game_player_equip, if you want them armed from the start.
Compiling
Press F9 (File → Run Map) to compile.
- Normal mode is fine while you're building. Set VIS and RAD to Fast for quick iteration.
- Expert mode lets you pass extra parameters to the compilers. Use it for your final builds, because Black Mesa's lighting looks noticeably better with the right VRAD settings.
Final compile settings
These are the VRAD (lighting) parameters the official Black Mesa maps were compiled with. Choose the line that matches your map:
| Map type | VRAD parameters |
|---|---|
| Indoor (Earth) | -staticproppolys -textureshadows -staticproplighting3 -extrasky 32 -smooth 35 -ambientocclusion -choptexlights |
| Outdoor (Earth), any visible sky | the indoor line plus -cascadeshadows |
| Xen, no real sky | the indoor line plus -cascadeshadows |
| Xen, with a real sky | the indoor line plus -cascadeshadows -realskylight |
In Hammer's expert compile, add -game $gamedir $path\$file at the end of the line, as the default commands do. If you'd rather not set up expert compiles by hand, HTCT has a Black Mesa preset that does it for you.
Lighting
Black Mesa has two kinds of light:
- Baked lights (
light,light_spot,light_environment) are computed by VRAD when you compile, exactly as in other Source games. - New lights (
newLight_Point,newLight_Spot,newLight_Dir) are real-time deferred lights with dynamic shadows and light cookies. They were added in the Xen update and are used throughout the official maps.
Most official maps use baked lighting for the overall light and new lights for the parts that move, flicker or need sharp shadows. The VDC page on Black Mesa's new lights explains every setting. The in-game New Lights Editor lets you tune them live.
Cubemaps
Cubemaps give shiny surfaces (floors, metal, glass, water) their reflections. Without them, reflective materials show a generic image that looks wrong in almost any room.
Place
env_cubemapentities in each distinct area, about head height, away from walls.Compile the map.
Launch the game with these launch options:
-oldgameui -dev -console +r_4way_use_fast_normals 0Load your map from the console:
map yourmapnameRun these console commands:
mat_specular 0 buildcubemaps mat_specular 1Quit, and remove the extra launch options.
The cubemaps are saved into the .bsp itself.
Nodegraphs (maps with NPCs)
NPCs find their way around using info_node entities you place in Hammer. The first time the map loads, the game turns them into a nodegraph and saves it as maps/.
- After your final compile, load the map once so the nodegraph is rebuilt, then include
maps/in what you ship. Otherwise every player's game has to rebuild it, which makes their first load slower.graphs/ <mapname>.ain - If NPCs stand still or walk into walls after you've changed the layout, the nodegraph is out of date. Delete the
.ainand load the map again.
Testing
Hammer copies the compiled map into bms/. In the game console:
map yourmapnameUseful while testing (some need sv_cheats 1):
| Command | What it does |
|---|---|
noclip | Fly through walls. |
impulse 101 | Give yourself all weapons and ammo. |
god | Take no damage. |
ent_text | Show info on the entity you're looking at. |
developer 1 | Show developer messages on screen. |
mat_wireframe 3 | See through walls to check where geometry is rendered. |
Once the map plays well, read Loading screens and Creating a campaign before you pack it. They're the two steps people most often miss.
