> For the complete documentation index, see [llms.txt](https://bizachi-dev.gitbook.io/bullethell-elemental-template/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bizachi-dev.gitbook.io/bullethell-elemental-template/user-interface-menus/creating-a-new-scene.md).

# Creating a new scene

Step by step to create a new map (scene) for PvE or PvP.

The easiest way is to **duplicate a shipped map** and change it. `MapArena1` is a good start for a PvE map and `PVPArena2` for a PvP arena. You can also build one from an empty scene with the objects below.

A map scene holds no UI, no player and no network object. The HUD, the player character and the multiplayer objects are created when the match starts.

<figure><img src="https://215355839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc8AVbPtcUOjcVrQx9Eyu%2Fuploads%2Fgit-blob-eb48322320cd076a314d32457b25f20f6e12daf2%2Fv16-maparena1-hierarchy.png?alt=media" alt="MapArena1 hierarchy"><figcaption><p>MapArena1, a complete PvE map.</p></figcaption></figure>

***

### 1. Objects every PvE map needs

| Object                                                            | Why                                                                                                                                                           |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **GameplayManager**                                               | Runs the match: timer, waves, boss, XP table and perks. See [Create New Monster wave](/bullethell-elemental-template/scriptables/create-new-monster-wave.md). |
| **Spawn points** (one or more objects with **SpawnPoints**)       | Areas where monsters appear. Add them to **Spawn Points List** on the GameplayManager.                                                                        |
| **Player spawn** (an empty object)                                | Where the players start. Add it to **Team Spawn Slots** on the GameplayManager (element 0).                                                                   |
| **Floor and walls** with colliders                                | The player walks on colliders. Walls must be on the **Wall** layer with the **Wall** tag: shots that ricochet, pushes, charges and leaps stop at them.        |
| **NavMeshSurface**, baked                                         | Monsters, minions and summons walk on the NavMesh.                                                                                                            |
| **Main Camera** (tag MainCamera) with **TopDownCameraController** | Follows the local player by itself.                                                                                                                           |
| **EventSystem** with **InputSystemUIInputModule**                 | The HUD needs it for touches and clicks.                                                                                                                      |
| **MonsterPoolManager** (MonsterPool)                              | Spawns and reuses the monsters.                                                                                                                               |
| **DropPoolManager** (DropPool)                                    | Spawns and reuses the XP and gold drops.                                                                                                                      |

Optional: **Ambience** (Scene Ambient Audio, the music of the map), **Global Volume** (post-processing), **DamagePopupPoolManager** (the prefab `Res/UIElements/DamagePopup/DamagePopupManager.prefab`, for styled damage numbers), **EffectPoolManager** (created automatically when missing), health pickups placed by hand, and [boxes](/bullethell-elemental-template/gameplay-systems/boxes-and-drops.md).

***

### 2. Floor, walls and NavMesh

The shipped maps use invisible colliders for the gameplay area and a separate model for the art:

* **FloorCollider**: a BoxCollider with its MeshRenderer turned off, layer Default.
* **WallCollider** objects: BoxColliders with the MeshRenderer turned off, layer **Wall**, tag **Wall**.
* The art (floor, walls, props) is only visual.

Put the **NavMeshSurface** component on the floor object with **Use Geometry** set to **Physics Colliders**, then click **Bake**. The invisible colliders define where monsters can walk.

<figure><img src="https://215355839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc8AVbPtcUOjcVrQx9Eyu%2Fuploads%2Fgit-blob-d3ee00e011a27c833f7c6c3decf827838c0964c7%2Fv16-navmesh-surface.png?alt=media" alt="NavMeshSurface settings"><figcaption><p>NavMeshSurface on FloorCollider (MapArena1).</p></figcaption></figure>

{% hint style="warning" %}
Bake again every time you move a floor or wall collider. A duplicated scene keeps using the NavMesh and the lighting data of the original scene until you bake it again and generate its lighting.
{% endhint %}

***

### 3. Spawn Points

<figure><img src="https://215355839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc8AVbPtcUOjcVrQx9Eyu%2Fuploads%2Fgit-blob-594950cac716c0f87fc2ea6f5f037696ba572d61%2Fv16-spawn-points.png?alt=media" alt="SpawnPoints component"><figcaption></figcaption></figure>

**Radius**: monsters appear at a random point inside this radius, snapped to the NavMesh. The area is drawn as a green sphere in the Scene view.

Put spawn areas inside the NavMesh and away from the player spawn. Each monster picks one of the areas of the Spawn Points List at random.

***

### 4. Camera

<figure><img src="https://215355839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc8AVbPtcUOjcVrQx9Eyu%2Fuploads%2Fgit-blob-04b006441d45676abf47fb38fd82e667a54882bd%2Fv16-topdown-camera.png?alt=media" alt="TopDownCameraController"><figcaption></figcaption></figure>

| Field                                    | Default        | What it does                                                                                                                                            |
| ---------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Target Camera**                        |                | Camera to move. Empty uses the Camera on the same object.                                                                                               |
| **Target Offset**                        | (0, 7.5, -7.5) | Camera position relative to the player.                                                                                                                 |
| **Framing Ahead**                        | 1.5            | Meters the camera looks ahead of the character, so the player sits a bit below the center and sees more of the arena ahead. `0` centers the character.  |
| **Smooth Follow** / **Follow Smoothing** | On / 10        | Smooth movement and its speed.                                                                                                                          |
| **Lateral View Angle**                   | 0              | Sideways offset.                                                                                                                                        |
| **X Rotation** / **Y Rotation**          | 45 / 0         | Camera angle.                                                                                                                                           |
| **Shake Intensity** / **Shake Duration** | 0.11 / 1.5     | Shake used when the final boss appears. The hit shakes are set in [Juice Settings](/bullethell-elemental-template/gameplay-systems/game-feel-juice.md). |

You do not need to assign the player: the camera finds the local player when the match starts.

***

### 5. Linking the scene to the game

1. Add the scene to **Build Settings** (File > Build Profiles > Scene List). A scene that is not in the build cannot be loaded, offline or online.
2. **PvE map**: create a [Map Info Data](/bullethell-elemental-template/scriptables/create-new-map-info-data.md), write the scene name in **Scene** and add the asset to **Game Instance > Map Info Data**. The order of that list is the unlock order.
3. **PvP arena**: write the scene name in **Scene Name** of a [PvP mode asset](/bullethell-elemental-template/gameplay-systems/pvp-modes.md) and add the asset to **Game Instance > Pvp Modes**.

Several Map Info Data can use the same scene (the Halloween event map uses MapArena4, for example).

***

### 6. PvP arenas

A PvP scene needs the GameplayManager, floor, walls, NavMesh, camera and EventSystem, but no spawn points, waves or boss (the mode asset runs the match).

* **Team Spawn Slots**: one slot per team. Team 1 starts at slot 0, team 2 at slot 1, and so on. Battle Royale needs one slot per player (10 in the demo).
* **Team Spawn Spread Radius**: random offset around each slot so players of the same team do not overlap.
* Mode objects: Battle Royale uses boxes and must be built around the world origin (the safe zone is centered at 0, 0, 0). MOBA needs lanes, towers and the two nexus. Goal Rush needs the ball and two goals. See [PvP Modes](/bullethell-elemental-template/gameplay-systems/pvp-modes.md).

You never place the multiplayer sync objects in a scene; they are spawned when the match starts.

***

### 7. XP table of the match

Each map has its own level-up table in **GameplayManager > Xp To Next Level**. To generate it:

1. Open the map scene.
2. Open **Tools > XP Progression Generator**.
3. Set **XP for Level 1**, **XP for Max Level** and **Max Level**, and click **Generate XP Progression**.

The tool writes the table in the first GameplayManager of the open scene with a curve that grows by the same percentage each level. The shipped maps use 200, 20000 and 40.

{% hint style="info" %}
Characters start the match at level 1, so the first value of the table is not used: going from level 1 to level 2 costs the second value. Also set the GameplayManager **Max Level** to the same number, the tool does not change it.
{% endhint %}

***

### Checklist

* The scene is in Build Settings and linked to a Map Info Data (or a PvP mode).
* The NavMesh is baked and covers every spawn point.
* Walls use the Wall layer and tag.
* The GameplayManager has spawn points, a player spawn slot, waves and, if the win condition needs one, a **Boss Prefab** with **Is Final Boss** on.
* There is a MonsterPoolManager and a DropPoolManager.
* Play from the **Login** scene and start the map from the map menu.
