Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit d563c54

Browse files
committed
2 parents 836bf07 + 4410621 commit d563c54

File tree

133 files changed

+14375
-819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+14375
-819
lines changed

docs/learn/bitesize/bitesize-introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: About Bitesize samples
55

66
The Bitesize Samples repository provides a series of sample code as modules to use in your games and better understand Netcode for GameObjects (Netcode).
77

8+
* [Multiplayer Use Cases](bitesize-usecases.md) - Learn more about core Netcode For GameObjects (Netcode) features through practical examples and In-Editor tutorials.
89
* [2D Space Shooter Sample](bitesize-spaceshooter.md) - Learn more about physics movement and status effects using Netcode `NetworkVariables` and `ObjectPooling`.
910
* [Invaders Sample](bitesize-invaders.md) - Learn more about game flow, modes, unconventional movement networked, and a shared timer.
1011
* [Client Driven Sample](bitesize-clientdriven.md) - Learn more about Client driven movements, networked physics, spawning vs statically placed objects, object reparenting.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
id: bitesize-usecases
3+
title: Multiplayer Use Cases sample
4+
description: Learn about the scenes in the Multiplayer Use Cases sample.
5+
---
6+
7+
The [Multiplayer Use Cases Sample](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/tree/main/Basic/MultiplayerUseCases) provides multiple scenes that explain some APIs, systems, and concepts that you can use with Netcode for GameObjects:
8+
9+
- Server-side manipulation of data sent by Clients.
10+
- State synchronization through NetworkVariables.
11+
- Proximity interactions that are only visible only to the local player.
12+
- Client-server communication through Remote Procedure Calls (RPCs).
13+
14+
### Tutorials
15+
16+
Each scene includes a tutorial to help you locate the scripts and GameObjects it uses. Follow the tutorial included in each sample scene to learn how to use it.
17+
18+
The tutorials that open with each scene use the [Tutorial Framework package](https://docs.unity3d.com/Packages/com.unity.learn.iet-framework@4.0/manual/index.html). You can open each tutorial at any time from the **Tutorials** menu.
19+
20+
## The NetvarVsRpc scene
21+
22+
The NetvarVsRpc scene explains why to use NetworkVariables instead of Remote Procedure Calls (RPCs) to perform state synchronization.
23+
24+
## The NetworkVariables scene
25+
26+
The NetworkVariables scene shows you how to use NetworkVariables to perform state synchronization in a way that also sends the most recent information to late joining or reconnecting clients.
27+
28+
## The ProximityChecks scene
29+
30+
The ProximityChecks scene shows you how to detect the local user and enable or disable in-game actions based on the player character's distance from a GameObject.
31+
32+
## The RPCs scene
33+
34+
The RPCs scene semonstrates the following Remote Procedure Call (RPC) processes:
35+
* Use RPCs to send information from clients to the server.
36+
* Perform server-side manipulation of the data sent.
37+
* Use connection approval to determine the spawn position of the player.
38+
39+
## Additional resources
40+
41+
- Get help and ask questions on [Multiplayer Discussions](https://discussions.unity.com/lists/multiplayer).
42+
- Join the community of Multiplayer creators on the [Multiplayer Networking Discord](https://discord.gg/unity-multiplayer-network).
43+
- [Request a feature or report a bug](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/issues/new/choose).

docs/learn/distributed-authority-quick-start.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ public class ConnectionManager : MonoBehaviour
150150
}
151151
```
152152

153+
:::note
154+
155+
It's important to wait until `OnClientConnectedCallback` has been triggered before spawning objects. Spawning objects early will result in errors and unexpected behaviour.
156+
157+
:::
158+
153159
2. Add the `ConnectionManager` component script you created to the *NetworkManager* object.
154160
![add connection manager](/img/learn/distributed-authority-quick-start/create-connection-manager.png)
155161

docs/release-notes/ngo-changelog.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ The following content tracks features, updates, bug fixes, and refactoring for t
88

99
| Release | Date | Changelog |
1010
|---|---|---|
11-
| 2.0.0-pre | 2024-06-17 | [2.0.0-pre](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@2.0/changelog/CHANGELOG.html) |
12-
| 2.0.0-exp | 2024-04-02 | [2.0.0-exp](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@2.0/changelog/CHANGELOG.html#200-exp2---2024-04-02) |
13-
| 1.10.0 | 2024-07-22 | [1.10.0](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/release/1.10.0/com.unity.netcode.gameobjects/CHANGELOG.md) |
11+
| 2.0.0-pre.4 | 2024-08-21 | [2.0.0-pre.4](https://docs.unity3d.com/Packages/com.unity.netcode.gameobjects@2.0/changelog/CHANGELOG.html) |
12+
| 2.0.0-exp | 2024-06-03 | [2.0.0-exp](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/blob/develop-2.0.0/com.unity.netcode.gameobjects/CHANGELOG.md#200-exp5---2024-06-03) |
13+
| 1.11.0 | 2024-08-20 | [1.11.0](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/releases/tag/ngo%2F1.11.0) |
14+
| 1.10.0 | 2024-07-22 | [1.10.0](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/releases/tag/ngo%2F1.10.0) |
1415
| 1.9.1 | 2024-04-18 | [1.9.1](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/releases/tag/ngo%2F1.9.1) |
1516
| 1.8.0 | 2023-12-12 | [1.8.0](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/releases/tag/ngo%2F1.8.0) |
1617
| 1.7.1 | 2023-11-15 | [1.7.1](https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/releases/tag/ngo%2F1.7.1) |

docusaurus.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ module.exports = {
240240
label: "2.0.0-pre",
241241
path: "current",
242242
},
243+
"1.11.0": {
244+
label: "1.11.0",
245+
path: "1.11.0",
246+
},
243247
"1.10.0": {
244248
label: "1.10.0",
245249
path: "1.10.0",

sidebars.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,19 @@ module.exports = {
124124
"label": "Networking components",
125125
"items": [
126126
{
127-
"type": "doc",
128-
"id": "basics/networkobject"
129-
},
130-
{
131-
"type": "doc",
132-
"id": "advanced-topics/networkobject-parenting"
127+
"collapsed": true,
128+
"type": "category",
129+
"label": "NetworkObject",
130+
"items": [
131+
{
132+
"type": "doc",
133+
"id": "basics/networkobject"
134+
},
135+
{
136+
"type": "doc",
137+
"id": "advanced-topics/networkobject-parenting"
138+
},
139+
]
133140
},
134141
{
135142
"collapsed": true,
@@ -146,10 +153,6 @@ module.exports = {
146153
},
147154
]
148155
},
149-
{
150-
"type": "doc",
151-
"id": "advanced-topics/physics"
152-
},
153156
{
154157
"type": "doc",
155158
"id": "components/networkmanager"
@@ -163,6 +166,10 @@ module.exports = {
163166
"label": "NetworkAnimator",
164167
"id": "components/networkanimator"
165168
},
169+
{
170+
"type": "doc",
171+
"id": "advanced-topics/physics"
172+
}
166173
]
167174
},
168175
{
@@ -536,6 +543,10 @@ module.exports = {
536543
"type": "category",
537544
"label": "Bitesize samples",
538545
"items": [
546+
{
547+
"type": "doc",
548+
"id": "learn/bitesize/bitesize-usecases"
549+
},
539550
{
540551
"type": "doc",
541552
"id": "learn/bitesize/bitesize-introduction"

tools/porting-to-dgs/client-vs-dgs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ The following table lists some pros and cons of using a client-hosted hosting ap
4141
| Client-hosted games are simpler to debug and profile compared to dedicated server-hosted games (your development PC can also run the host, a DGS might run on specialized hardware). | Players can more easily cheat because they have physical access to the server. |
4242
| The above makes it great for LAN (local area network) parties. | Client-hosted games don’t scale well. Player hardware usually isn’t capable of hosting game sessions with hundreds of connections. |
4343

44-
✝ However, some games might generate more traffic (compared to compute resources), which might make a client-hosted game more expensive than using a service like Game Server Hosting (Multiplay) if relying too much on Relay.
44+
✝ However, some games might generate more traffic (compared to compute resources), which might make a client-hosted game more expensive than using a service like Unity Multiplay Hosting if relying too much on Relay.
4545

4646
## Dedicated server-hosted games
4747

48-
A dedicated server-hosted game is a game that runs server builds on hardware that’s dedicated to hosting the game. The dedicated server might be in an [on-premise data center](./hosting-considerations.md#developer-hosted-cloud), in the [cloud](./hosting-considerations#developer-hosted-cloud), or made available through a [managed service provider](#managed-service-provider), such as Unity’s [Game Server Hosting](https://docs.unity.com/game-server-hosting). In any case, players don’t usually have access to the server build.
48+
A dedicated server-hosted game is a game that runs server builds on hardware that’s dedicated to hosting the game. The dedicated server might be in an [on-premise data center](./hosting-considerations.md#developer-hosted-cloud), in the [cloud](./hosting-considerations#developer-hosted-cloud), or made available through a [managed service provider](#managed-service-provider), such as Unity’s [Multiplay Hosting](https://docs.unity.com/game-server-hosting). In any case, players don’t usually have access to the server build.
4949

5050
Games that benefit most from a dedicated server-hosted hosting approach include those that:
5151

@@ -61,9 +61,9 @@ The following table lists some pros and cons of using a dedicated server hosting
6161
| There’s no extra lag due to relay based connections. | You must consider scalability because the number of players connected to your server fleet can change drastically in a short time. |
6262
| You have more control over performance and quality of service since you as a developer control the hardware the server runs on. | It can quickly get expensive, depending on how you host the server build. |
6363
| It’s easier to think about the server part of your code and the client part of your code when there’s no overlap like a client-hosted game. | It’s more complicated to debug because you usually need to run the production build in a virtual machine for testing. |
64-
| Clients don’t require as much performance because they'ren’t responsible for the processing and bandwidth overhead involved with hosting. | You have to keep a server build and a client build. |
64+
| Clients don’t require as much performance because they aren't responsible for the processing and bandwidth overhead involved with hosting. | You have to keep a server build and a client build. |
6565
| You don’t have to worry about host migrations or what to do when the host player disconnects. ✝ | |
6666
| You don’t have to worry about the unfairness of the host having zero latency or lag. | |
67-
| You have the option of using a managed service provider like Game Server Hosting, which allows you to focus on other aspects of your game. | |
67+
| You have the option of using a managed service provider like Unity Multiplay Hosting, which allows you to focus on other aspects of your game. | |
6868

6969
✝ However, you still need to accommodate for unexpected server failures. These failures are less likely to happen, but you still need to handle them with appropriate error messaging.

tools/porting-to-dgs/game-changes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Games using a DGS hosting approach rely on automation to handle startup events a
7474
Instead of using in-game menus on start-up, you’ll need to implement an automated startup flow that will `StartServer()` automatically, then wait for your clients to connect. This is also when you might want to set up a lobby in your lobby service or advertise yourself as “ready” to your hosting provider and matchmaking service. After your service knows you’re ready, it can redirect clients to your server.
7575

7676
:::note
77-
If you’re interested in using other Unity services for your multiplayer game, see [Lobby](https://docs.unity.com/lobby), [Game Server Hosting](https://docs.unity.com/game-server-hosting), and [Matchmaker](https://docs.unity.com/matchmaker).
77+
If you’re interested in using other Unity services for your multiplayer game, see [Lobby](https://docs.unity.com/lobby), [Multiplay Hosting](https://docs.unity.com/game-server-hosting), and [Matchmaker](https://docs.unity.com/matchmaker).
7878
:::
7979

8080
### Automate closing the lobby
@@ -126,7 +126,7 @@ Starting a new game with connected players and keeping the same game session is
126126

127127
### Automate exit codes
128128

129-
Many hosting providers, such as [Unity’s Game Server Hosting service](https://docs.unity.com/multiplay/), watch your server and react to exit codes. For example, if you have a bug resulting in `StartServer` failing, you can call `Application.Quit(1)` with exit code `1`. Exit codes greater than `0` let the hosting provider know something went wrong and the provider can automatically react to this appropriately by trying to reboot your server or just destroying it.
129+
Many hosting providers, such as [Unity’s Multiplay Hosting service](https://docs.unity.com/multiplay/), watch your server and react to exit codes. For example, if you have a bug resulting in `StartServer` failing, you can call `Application.Quit(1)` with exit code `1`. Exit codes greater than `0` let the hosting provider know something went wrong and the provider can automatically react to this appropriately by trying to reboot your server or just destroying it.
130130

131131
## General game changes
132132

@@ -296,9 +296,9 @@ I've also seen self-signed certificates used for "offline" purposes, such as enc
296296
The content in this section might only apply to some hosting providers. Other hosting providers might have zero bandwidth costs for in-datacenter and ingress transfers.
297297
:::
298298

299-
Some hosting providers manage build updates for you and charge for in-datacenter and ingress transfers. One such hosting provider is [Unity’s Game Server Hosting (GSH)](https://docs.unity.com/multiplay/) solution (Multiplay).
299+
Some hosting providers manage build updates for you and charge for in-datacenter and ingress transfers. One such hosting provider is [Unity’s Multiplay Hosting](https://docs.unity.com/multiplay/) solution.
300300

301-
If you use GSH, you can make sure there’s no downtime between updates. GSH performs [build updates and rollouts](https://docs.unity.com/game-server-hosting/legacy/how-do-differential-updates-work.html) in the background. However, you can still [optimize your builds to reduce your bandwidth costs](https://docs.unity.com/game-server-hosting/legacy/cost-optimization.html). For example, you can speed up the update process (and incur fewer charges) by ensuring you have as few changes as possible between build versions.
301+
If you use Multiplay Hosting, you can make sure there’s no downtime between updates. Multiplay Hosting performs [build updates and rollouts](https://docs.unity.com/game-server-hosting/legacy/how-do-differential-updates-work.html) in the background. However, you can still [optimize your builds to reduce your bandwidth costs](https://docs.unity.com/game-server-hosting/legacy/cost-optimization.html). For example, you can speed up the update process (and incur fewer charges) by ensuring you have as few changes as possible between build versions.
302302

303303
There are several ways you can mitigate the differences between build versions. For example, you can use:
304304

@@ -331,5 +331,5 @@ You can use DGS asset stripping to optimize many aspects of your server-hosted g
331331
If you’re a small game studio with a small player base, you might not consider the bandwidth costs involved with updating your game. However, these costs can grow quickly without optimizations like incremental builds. A server build of 30 GB and a fleet of 15,000 servers equates to hundreds of terabytes of bandwidth costs for each update.
332332

333333
:::tip
334-
The recommended best practice is to review the bandwidth and related costs of your hosting provider so you can calculate the true cost of rolling out an update. You can view the pricing information for Unity’s Game Server Hosting [here](https://docs.unity.com/game-server-hosting/concepts/pricing.html).
334+
The recommended best practice is to review the bandwidth and related costs of your hosting provider so you can calculate the true cost of rolling out an update. You can view the pricing information for Unity’s Multiplay Hosting [here](https://docs.unity.com/game-server-hosting/concepts/pricing.html).
335335
:::

0 commit comments

Comments
 (0)