Skip to main content
s&box includes a mapping tool (based on Hammer) for building world geometry. Maps are .vmap files and can be loaded by games that support them, in addition to or instead of scene-based levels.

Opening the mapping tool

Open the mapping tool from the Tools menu in the editor. If you are working in an Addon Project, select the target game that the map is being created for before opening the tool.

Map files

Maps are saved as .vmap files inside your project’s maps/ folder. A compiled map (.vmap_c) is what the engine actually loads at runtime. The editor compiles the map for you automatically when needed.

Creating geometry

The mapping tool uses brushes — convex solid shapes — to build world geometry. Use the brush tools to place, resize, and carve geometry in the 3D viewport.
1

Select the brush tool

In the mapping tool toolbar, select the Block Tool to create new brush geometry. Use the 3D or 2D viewport to draw the brush shape.
2

Resize and position

After placing a brush, use the Select Tool to grab handles and resize it. Use the Inspector to set exact dimensions and position.
3

Apply materials

Select a face on a brush and use the Texture Tool to apply a material. You can browse materials in the Asset Browser and drag them onto faces.
4

Add entities

Entities are special objects in a map — lights, spawn points, triggers, and more. Right-click the viewport and choose to create an entity, then configure it in the Inspector.
5

Compile and test

Save your map and press F9 (or use the Build menu) to compile it. Launch the game from the editor to test it.

Addon maps

If you are creating a map as part of an Addon Project, your map will appear in the Asset Browser once compiled. Publish it from there to make it available on sbox.game.
Maps created in Addon Projects use the components and assets from the target game. Make sure the correct target game is set in your project settings before building map content.

Editor events for mapping

If you are writing editor tools that interact with the mapping tool, several editor events are available:
EventDescription
hammer.initializedFires when the mapping tool opens
hammer.selection.changedFires when the selection changes
hammer.rendermapviewFires for each MapView before rendering begins
hammer.mapview.contextmenuFires when the MapView is right-clicked
These events are available to editor tools that listen for them using the [EditorEvent] attribute.