> For the complete documentation index, see [llms.txt](https://studio-docs.sandbox.game/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://studio-docs.sandbox.game/multiplayer/create-a-multiplayer-game.md).

# Create a multiplayer game

Ask your agent for the match in one prompt, then check that the server owns shared results and that each player gets their own character. The rules behind that request are on [How multiplayer works](/multiplayer/how-multiplayer-works.md).

## Step 1: Describe your match

Say how many players there are, whether they compete or cooperate, how a match starts, and which results the server decides. Health, score, inventory, and a win condition are that kind of result.

Published players enter through a platform queue. Choosing that queue is on [Add matchmaking](/multiplayer/add-matchmaking.md).

## Step 2: Ask your agent to build it

In your agent, ask:

```
Make this game multiplayer using the multiplayer systems.

Each player spawns as a character they control. The server decides shared results. Clients only show those results.

Include the multiplayer scene, one PlayerSpawner, a GameMode, and networked movement through the movement skill.

Make it playable by multiple clients in the editor, and ready to publish through the platform's multiplayer upload.
```

Wait until the agent finishes.

{% hint style="info" %}
*TIP: If the agent builds a single-player character first, send the same request again and say the match is multiplayer from the start.*
{% endhint %}

## Step 3: Check the scene and the spawner

Ask your agent:

```
Show me the multiplayer scene, the GameMode, and where each player spawns.
```

You are looking for a gameplay scene, a `GameMode`, and one `PlayerSpawner`.

Every multiplayer level needs that one `PlayerSpawner`. `GameMode.getPlayerSpawner()` throws if it is missing. The server and clients share its path. `PlayerController`, the Pawn, `PlayerInfo`, and `GameSessionInfo` spawn through it.

Each joining player gets their own Pawn. That client owns it. Other players can see it.

Objects created while the match is running, such as projectiles or pickups, need a scene-placed `MultiplayerSpawner`. `world.add` on the server does not create that object on clients. An object already placed in the level does not need one.

Spawn and despawn only on the server. A client can ask through `@ENGINE.ServerRPC()`. The server then calls `destroy()` or `MultiplayerSpawner.despawn()`.

Join order, display names, and who receives a spawn are on [Multiplayer reference](/multiplayer/multiplayer-reference.md).

## Step 4: Check shared results stay on the server

Ask your agent:

```
Show me where a shared result is decided, and confirm a client cannot change that result on its own.
```

The server decides the result, then updates the shared value. Connected clients, including someone who joins later, show that value.

## Step 5: Set the server scene

In **Project Settings**, set **Server Default Scene** to the scene the dedicated server loads. Set it even when that scene is the same map the game already loads. A menu and the gameplay scene can still be different scenes. The project stores the choice as `defaultServerScene`. Save with `Ctrl+S` / `Cmd+S`.

A multiplayer upload is blocked until that scene is set. The Upload dialog names the problem and opens Project Settings.

## What You've Done

The game has a spawn path for each player, shared results the server owns, and a server scene for upload. How those results and player actions cross the network is on [Share state and actions](/multiplayer/share-state-and-actions.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://studio-docs.sandbox.game/multiplayer/create-a-multiplayer-game.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
