> For the complete documentation index, see [llms.txt](https://2yeet.gitbook.io/anvilcsg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://2yeet.gitbook.io/anvilcsg/validation-and-build/build-map.md).

# Building a map

Build Map turns the editable Anvil scene into a portable **Anvil Baked Map**. The source brushes remain editable, while the built asset stores generated meshes, collision, decals, probes, mapper data, and optional baked lighting.

Open the window with **Build Map** in the top toolbar or **File > Build Map**.

## Output

Choose a Map Name and Save Folder. The default folder is:

`Assets/AnvilMaps`

A normal map uses this layout:

```
Assets/AnvilMaps/MapName.asset
Assets/AnvilMaps/MapName/Generated/
Assets/AnvilMaps/MapName/Lighting/
```

Anvil removes empty generated subfolders. When updating an existing map asset, its name and folder stay locked so the build updates the correct asset.

## Build scope

The window builds either:

* **Full Map**
* **Active Local Build Area**

A Local Build Area writes isolated preview output and does not replace the last full map.

## Build organization

### Automatic (Recommended)

Automatic creates real combined meshes where objects are compatible. Its normal priority is:

1. **Build Section** as the highest room or culling boundary
2. **Detail Geometry** kept separate from ordinary world merging
3. **Group** as a lower-level merge boundary outside a named section
4. Loose static geometry merged spatially
5. Safety splits for scripts, non-static objects, No Shadows, and other incompatible behavior

Decals remain separate renderers but follow the section and group of their target. Collision is organized separately from render merging.

### Merge by Material (Debug)

Broadly merges by material and ignores much of the room and Group ownership. Use it to diagnose output, not for a map that depends on room-based culling.

### One Chunk per Brush (Debug)

Produces heavier output, but makes it easier to trace a bad generated mesh or lightmap result back to one source brush.

## Face culling

Available modes:

* Off
* NoDraw Only
* Normal
* Aggressive

Start with **Normal**. Use the debug modes only when investigating missing faces or unwanted internal geometry.

## Smooth normals

Available modes:

* Off
* Auto
* Ignore

Per-brush smoothing flags can request weighted smoothing or prevent Anvil automatic smoothing.

## Collision

The scene builder provides:

* **Smart Merged (Recommended)**
* **Per Brush (Debug)**
* **Off**

Smart Merged skips brushes marked **No Collision**, includes **Collision Only**, isolates scripted and non-static collision, and otherwise merges compatible collider data by section, detail state, and spatial area. Generated MeshCollider data is welded and cleaned.

You can also choose a Physics Material and Collider Layer.

Current limitation: **Per Brush** is visible as a debug choice, but current generated output still uses baked collider chunks. Do not rely on it to create one collider for every original source brush.

## Advanced controls

* **Ignore UV2 Validation** allows a build to continue after UV2 validation fails.
* **Tangents** includes tangent data where required.

Ignore UV2 Validation is a debugging escape hatch. It can allow lighting artifacts into the result.

## Starting the build

The final button depends on scope and lighting quality:

* Build Map
* Build + Bake
* Build Local Area
* Local Area + Bake

Use **Build Only** lighting quality when you need generated geometry without running Unity lighting.

## If the build is blocked

Anvil checks the source scene and request before replacing the existing map. Fix blocking issues through Check Map where possible.

For some failures, the window can offer **Build Isolated Incomplete Preview**. This preview may omit broken content, does not start a light bake, and does not replace the last valid full map.

## Reading the result

After a successful build, inspect the report for source brush, chunk, and triangle counts. Use its selection and ping actions to find the map asset or generated meshes.

The number of generated chunks depends on Build Sections, Groups, Detail Geometry, materials, behavior flags, and safety splits. A low chunk count is useful, but it should not come at the cost of the culling or gameplay boundaries your project needs.
