# 3. Test your game locally

Now we can build the project and try out network replication locally. To do so, we need to launch and connect to a [Replication Server](/1.4/manual/replication-server.md).

## Run a local Replication Server

You can run a local Replication Server directly on your machine! You can either:

* Go to: *coherence > Local Replication Server > Run for Rooms* or *Run for Worlds*

<img src="/files/N7Kjy4qLFnKuMpXPASd0" alt="" width="375">

* In the **coherence Hub**, open the **Replication Servers** tab. From here, you can run a server for Rooms or Worlds:

<img src="/files/2BWBjVRvENWtSbqUpPke" alt="" width="375">

{% hint style="info" %}
Whether you run a Replication Server for Rooms or for Worlds depends on [which setup you plan to use](/1.4/manual/replication-server/rooms-and-worlds.md), which in turn requires the correct corresponding [Sample UI](/1.4/getting-started/samples-and-tutorials/samples-connection-uis.md).
{% endhint %}

Regardless of how you launch it, a new terminal window will open and display the running Replication Server:

<img src="/files/ewgMyNuSx6DrhBmw1f3a" alt="The Replication Server running in macOS Terminal" width="375">

If the console opens correctly and you don't see an error line (they show up <mark style="color:red;">in red</mark>), it means your Replication Server is running! Now you should be able to connect to it, in the game.

## Run multiple instances of the game

It is often useful to be able to run multiple instances of your game on the same device. This allows you to simulate multiple player connections.

There are multiple ways to do this:

* [Make a build](/1.4/getting-started/setup-a-project/local-development/local-testing-using-builds.md) of the game
* Use the [Multiplayer Play Mode](/1.4/getting-started/setup-a-project/local-development/multiplayer-play-mode.md) package (recommended, only available in Unity 6)
* Use a third-party plugin, such as[ ParrelSync](/1.4/getting-started/setup-a-project/local-development/local-testing-via-parrelsync.md)

Dive into the individual pages to see our recommendation for each option.

## Connect to the Replication Server

Connecting is done using our API. For now, use one of the Sample UIs we provide. You should already have one in the scene if you followed the steps in the [Scene Setup](https://docs.coherence.io/1.4/getting-started/setup-a-project/pages/-MWdIJ2Uv98RAAYyaS-2#id-3.-add-a-connect-dialog-ui) section.

With the game and the RS running, **you can now connect** and **play the game**.

{% hint style="warning" %}
**If you can't connect**

Did you change something in the configuration of your connected Prefabs? You have to bake again, and restart the Replication Server.

You will notice it because there will be a little chef's hat next to the coherence folder, or a warning sign on Bake buttons:\
\ <img src="/files/AAffTiDtI7enhQJqOXJ5" alt="" data-size="original">

<img src="/files/Jfuo23JOsEMLFnWo5EHG" alt="" data-size="original">

\
Time to bake!
{% endhint %}

***

{% hint style="success" %}
**In this section, we:**

* Ran a local Replication Server
* Saw how to run multiple instances of the game
* Connected to the Replication Server

Now that we know things work locally, it's time to [test the game in the coherence Cloud](/1.4/getting-started/setup-a-project/test-in-the-cloud.md)!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coherence.io/1.4/getting-started/setup-a-project/local-development.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
