You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 23, 2025. It is now read-only.
description: Welcome to the first release of the Unity Multiplayer Samples Co-op documentation content. Learn more about Unity MLAPI through the sample co-op Boss Room game and project.
7
+
hide_table_of_contents: false
8
+
---
9
+
10
+
You [saved the date](https://unity.com/demos/small-scale-coop-sample), and now Boss Room is public and live!
11
+
12
+
Boss Room leverages the new experimental netcode package to bring up to eight players together to defeat imps and a boss in this adorable vertical slice of a cooperative RPG dungeon. This small-scale cooperative game is built to teach you the underlying networking patterns and concepts behind a multiplayer game of its genre.
13
+
14
+
The Boss Room project equips you with all the project files and assets you need to explore the creation of a small-scale cooperative game packed with playable characters, enemies, and a boss. As Boss Room is being developed, tutorials on the different aspects of networking the sample will be written for developers right here on our live documentation site – so stay tuned!
15
+
16
+

17
+
18
+
To support this release, we provide getting started, tutorials, release notes, and more!
*[Getting started with Boss Room](/docs/learn/bossroom)
22
+
23
+
Visit and ⭐️ the Unity Multiplayer Samples Co-op [GitHub repository](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop) to watch for updates, provide feedback, and contribute to the project.
24
+
25
+
When downloading, always get the [latest from GitHub](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop/releases/latest).
26
+
27
+
If you have questions and want to connect, check out the Unity Multiplayer forum or join us on [Discord](https://discord.gg/buMxnnPvTb). We have channels for announcements, support, development, and co-op samples.
Copy file name to clipboardExpand all lines: docs/learn/faq.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,4 +56,27 @@ We recommend the following:
56
56
57
57
The Steam transport should be quite straightforward to use. Just add it to your project and set the `ConnectToSteamID` in the transport on the client to connect to the host that's all you need.
58
58
59
+
### Why do I get path too long errors with Boss Room on Windows?
60
+
61
+
Using Windows' built-in extracting tool may generate an "Error 0x80010135: Path too long" error window which can invalidate the extraction process.
62
+
63
+
As a workaround, shorten the zip file to a single character (for example "c.zip") and move it to the shortest path on your computer (such as in root C:\) and retry. If that solution fails, another workaround is to extract the downloaded zip file using an application like 7zip.
64
+
65
+
### Why do I get unidentified developer errors with Boss Room?
66
+
67
+
If you attempt to run a build on OSX and receive a warning dialog mentioning an "unidentified developer", you may need to override your security settings for this application:
68
+
69
+
1. In the Finder on your Mac, locate the application you want to open.
70
+
71
+
:::note
72
+
Do use Launchpad, it does not allow you to access the shortcut menu.
73
+
:::
74
+
75
+
1. Control-click the app icon, then choose **Open** from the shortcut menu.
76
+
1. Click **Open**.
77
+
1. The app is saved as an exception to your security settings. You can open it in the future by double-clicking it just as you can any registered app.
78
+
79
+
80
+
See [Apple Support](https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac) for details.
Copy file name to clipboardExpand all lines: docs/learn/getting-started-boss-room.md
+37-26Lines changed: 37 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,65 +13,62 @@ Boss Room is a fully functional Multiplayer Co-op Sample game made with Unity an
13
13
14
14
The intention is that you can use everything in this project as a starting point or as bits and pieces in your own Unity games.
15
15
16
-
## To get the project
16
+
## Get the project
17
17
18
18
### Install Git LFS
19
19
This project uses Git Large Files Support (LFS), which ensures all large assets required locally are handled for the project. See [Git LFS installation options for Windows and Mac instructions](https://github.com/git-lfs/git-lfs/wiki/Installation).
20
20
21
-
### Get the Project
21
+
### Get the project files
22
22
23
-
- A release version can be downloaded from the [Releases](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop/releases) page.
24
-
- Unzip the archive file.
23
+
- A release version can be downloaded from the [Latest Releases](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop/releases/latest) at GitHub.
24
+
- Unzip the archive file.
25
25
:::note Windows users
26
-
Using Windows' built-in extracting tool may generate a "Error 0x80010135: Path too long" error window which can invalidate the extraction process. A workaround for this is to shorten the zip file to a single character (eg. "c.zip") and move it to the shortest path on your computer (most often right at C:\) and retry. If that solution fails, another workaround is to extract the downloaded zip file using 7zip.
26
+
Using Windows' built-in extracting tool may generate an "Error 0x80010135: Path too long" error window which can invalidate the extraction process. As a workaround, shorten the zip file to a single character (for example "c.zip") and move it to the shortest path on your computer (such as in root C:\) and retry. If that solution fails, another workaround is to extract the downloaded zip file using an application like 7zip.
27
27
:::
28
-
- You are now ready to add the project to Unity Hub.
28
+
- You are now ready to add the project to Unity Hub.
29
29
30
30
:::important Compatibility
31
31
- Boss Room supports all major Unity platforms. To use the WebGL platform a custom WebGL transport based on web sockets is needed.
32
-
- Boss Room is compatible with Unity 2020.3 LTS and later.
32
+
- Boss Room is compatible with Unity 2020.3 and later.
33
33
- Make sure to include standalone support for Windows/Mac in your installation.
34
34
:::
35
35
36
-
## To add the project with Unity Hub
36
+
## Add the project with Unity Hub
37
+
37
38
1. Open Unity Hub.
38
39
1. Click **Add**.
39
40
1. Select the root folder of the downloaded project.
40
41
41
42

42
43
43
44
:::note
44
-
The first time you open the project Unity will import all assets, which will take longer than usual - it is normal.
45
-
The MLAPI v0.1.0 package will be installed with Boss Room.
45
+
The first time you open the project, Unity will import all assets, which will take longer than usual - this is normal. The Unity MLAPI v0.1.0 package will also be installed with Boss Room.
46
46
47
47
**Issues with importing due to parental control software**: If you have issues with importing you may want to check your DNS settings as some ISP parental controls may block GitHub access. For example, see this information on [WebSafe](https://community.virginmedia.com/t5/Networking-and-WiFi/Web-Safe-Breaks-GitHub/td-p/4279652).
In order to see the multiplayer functionality in action, you can either run multiple instances of the game locally on your computer or choose to connect through the internet.
71
68
72
69
### Local multiplayer setup
73
70
74
-
#### Build an Executable.
71
+
#### Build an Executable
75
72
76
73
1. Click File.
77
74
2. Click Build Settings.
@@ -82,11 +79,10 @@ In order to see the multiplayer functionality in action, you can either run mult
82
79
After the build has completed you can launch several instances of the built executable to be able to both host and join a game.
83
80
84
81
:::important Mac Users
85
-
To run multiple instances of the same app, you need to use the command line.
82
+
To run multiple instances of the same app, you need to use the command line:
@@ -96,22 +92,37 @@ To run multiple instances of the same app, you need to use the command line.
96
92
In contrast to running a local setup, when playing over internet we do not necessarily need a built executable. You can run the game in editor.
97
93
:::
98
94
99
-
100
-
Running the game over internet currently requires either setting up a [Photon Transport for MLAPI](https://github.com/Unity-Technologies/mlapi-community-contributions/tree/master/Transports/com.mlapi.contrib.transport.photon-realtime) or using Port Forwarding
95
+
Running the game over internet currently requires either setting up a [Photon Transport for MLAPI](#photon-transport) or using [Port Forwarding](#port-forwarding).
101
96
102
97
#### Photon Transport
103
98
104
-
Photon Transport uses Photon relay server to facilitate communication between clients and server living on different networks.
105
-
99
+
[Photon Transport for MLAPI](https://github.com/Unity-Technologies/mlapi-community-contributions/tree/master/Transports/com.mlapi.contrib.transport.photon-realtime) uses Photon relay server to facilitate communication between clients and server living on different networks.
106
100
107
101
:::unity Learn More
108
-
See the [Boss Room Photon Setup Guide](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop/blob/release/v0.1.0-experimental/Documentation/Photon-Realtime/Readme.md) for details.
102
+
See the [Boss Room Photon Setup Guide](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop/blob/master/Documentation/Photon-Realtime/Readme.md) for details.
109
103
:::
110
104
111
105
#### Port Forwarding
112
106
113
107
The [Portforward Site](https://portforward.com/) has guides on how to enable port forwarding on a huge number of routers. Boss Room uses UDP and needs a 9998 external port to be open.
114
108
109
+
import Iframe from 'react-iframe'
115
110
111
+
## Troubleshooting
116
112
117
-
import Iframe from 'react-iframe'
113
+
**Run builds on Mac OSX:**
114
+
115
+
If you attempt to run a build on OSX and receive a warning dialog mentioning an "unidentified developer", you may need to override your security settings for this application:
116
+
117
+
1. In the Finder on your Mac, locate the application you want to open.
118
+
119
+
:::note
120
+
Do use Launchpad, it does not allow you to access the shortcut menu.
121
+
:::
122
+
123
+
1. Control-click the app icon, then choose **Open** from the shortcut menu.
124
+
1. Click **Open**.
125
+
1. The app is saved as an exception to your security settings. You can open it in the future by double-clicking it just as you can any registered app.
126
+
127
+
128
+
See [Apple Support](https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac) for details.
We want the full history of inputs sent, not just the latest value. There is no need for `NetworkVariable`s, you just want to blast your inputs to the server. Since Boss Room is not a twitch shooter, we send inputs as reliable `RPC`s without worrying about the additional latency an input loss would add.
@@ -23,7 +22,7 @@ We want the full history of inputs sent, not just the latest value. There is no
23
22
Sending from server to client `RecvPerformHitReactionClient`
For example, the Boss Room project "ouch" action `RPC` mentioned for `NetworkCharacterState` is interesting for optimization purposes. You would normally want to have only one `RPC` for an action and let the client decide who should play the associated animation. Due to "ouch" being a long running action over multiple frames, you do not know yet when sending the initial `RPC` which characters will be affected by that action. You want this to be dynamic as the boss is hitting targets. As a result, multiple `RPC`s will be sent for each hit character.
@@ -33,30 +32,28 @@ For example, the Boss Room project "ouch" action `RPC` mentioned for `NetworkCha
33
32
The archer's arrows uses a standalone `GameObject` that is replicated over time. Since this object's movements are slow moving, we made the choice to use state to replicate this ability's status, in case a client connected while the arrow was flying.
We could have used an `RPC` instead, for example the Mage's projectile attack. Since it is expected for that projectile to be quick, we are not affected by the few milliseconds where a newly connected client could miss the projectile and we save on bandwidth having to manage a replicated object. Instead a single RPC is sent to trigger the FX client side.
We could have used a "kill" `RPC` to set a character as dead and play the appropriate animations. Applying our "should that information be replicated when a player joins the game mid-game" rule of thumb, we used `NetworkVariable`s instead. We used the `OnValueChanged` callback on those values to play our state changes animation.
It uses a `BoolNetworkVariable` to represent the "IsOpen" state. If I open the door and a player connects after this, the host will replicate all the world's information to that new player, including the door's state.
@@ -57,27 +57,26 @@ Actions in Boss Room are a great example for this. The area of effect action (`A
57
57
`AoeActionInput.cs` Shows the input being updated client side and not waiting for the server. It then calls an `RPC` when clicking on the area to affect.
`AOEAction.cs` Server side logic detecting enemies inside the area and applying damage. It then broadcasts an `RPC` to tell all clients to play the VFX at the appropriate position. Character's state will automatically update with their respective `NetworkVariable`s update (health and alive status for example).
If you want to make sure two variables are received at the same time, `RPC`s are great for that.
79
78
80
-
If you change `NetworkVariable` "a" and "b", there's no guarantee they'll both be received client side at the same time. Sending them as two parameters in the same `RPC` allows to make sure they'll be received at the same time client side.
79
+
If you change `NetworkVariable` "a" and "b", there is no guarantee they will both be received client side at the same time. Sending them as two parameters in the same `RPC` allows to make sure they will be received at the same time client side.
81
80
:::
82
81
83
82
`NetworkVariable`s are great when you only care about the latest value.
@@ -89,5 +88,3 @@ If you change `NetworkVariable` "a" and "b", there's no guarantee they'll both b
89
88
90
89
`RPC`s are great for sending transient events. Use them when transmiting short lived events.
0 commit comments