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

Commit c609a3d

Browse files
jabbacakesVic-CooperNoelStephensUnity
authored
Develop into main to publish WebGL quickstart (#1377)
Co-authored-by: Vic Cooper <vic.cooper@unity3d.com> Co-authored-by: Vic Cooper <63712500+Vic-Cooper@users.noreply.github.com> Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
1 parent 3e400cc commit c609a3d

File tree

5 files changed

+59
-10
lines changed

5 files changed

+59
-10
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: distributed-authority-quick-start
3-
title: Distributed authority quickstart for Netcode for GameObjects
3+
title: Distributed authority general quickstart
44
---
55

66
Use this guide to learn how to create your first [distributed authority](../terms-concepts/distributed-authority.md) Netcode for GameObjects project. It walks you through the connection setup, including connecting to the distributed authority service, and adding basic gameplay.
@@ -15,8 +15,7 @@ Before you begin, you need the following:
1515

1616
- An active Unity account with a valid license.
1717
- The [Unity Hub](https://unity.com/download).
18-
- A supported version of the Unity 6 Editor.
19-
- Additional requirements information can be found here: [Netcode for GameObjects requirements](https://docs-multiplayer.unity3d.com/netcode/current/installation).
18+
- A supported version of the Unity 6 Editor. Refer to the [Netcode for GameObjects requirements](https://docs-multiplayer.unity3d.com/netcode/current/installation).
2019

2120
## Project setup
2221

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: distributed-authority-webgl
3+
title: Distributed authority and WebGL quickstart
4+
---
5+
6+
Use this guide to learn how to create your first [distributed authority](../terms-concepts/distributed-authority.md) Netcode for GameObjects WebGL project.
7+
8+
This guide is intended as an addition to the [distributed authority general quickstart](distributed-authority-quick-start.md) page, which provides more details about setting up Netcode for GameObjects to use distributed authority.
9+
10+
:::note Beta feature
11+
Distributed authority is still in beta. During the beta phase, using the distributed authority service provided by the [Multiplayer Services package](https://docs.unity.com/ugs/en-us/manual/mps-sdk/manual) is free. When distributed authority is fully released, [using the service will incur a cost](https://unity.com/products/gaming-services/pricing).
12+
:::
13+
14+
## Prerequisites
15+
16+
Before you begin, you need the following general requirements to use the distributed authority network topology:
17+
18+
- An active Unity account with a valid license.
19+
- The [Unity Hub](https://unity.com/download).
20+
- A supported version of the Unity 6 Editor. Refer to the [Netcode for GameObjects requirements](https://docs-multiplayer.unity3d.com/netcode/current/installation).
21+
- When installing the Editor, make sure to include the __WebGL Build Support_ module.
22+
23+
You also need the following packages and minimum versions for a WebGL distributed authority session:
24+
25+
- Netcode for GameObjects version 2.1.1+
26+
- Unity Transport version 2.3.0+
27+
- Note that you don't need to create a self-signed certificate to connect to a distributed authority session.
28+
- Multiplayer Services version 1.0.2+
29+
30+
## Create and set up your project
31+
32+
Follow the instructions on the [distributed authority general quickstart](distributed-authority-quick-start.md) page.
33+
34+
## Build and run with WebGL
35+
36+
1. Navigate to __File__ > __Build Profiles__ to open the __Build Profiles__ window. Select WebGL as your target platform.
37+
1. From the __Build Profiles__ window, click __Build and Run__.
38+
- Unity launches a small web hosting app to provide the HTTP services required to launch the WebGL application in your browser.
39+
1. Once you have one instance of your WebGL project running, you can copy the URI from your browser and paste it into another window or tab, which creates and connects another player to the same session.

docs/terms-concepts/distributed-authority.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For game designs that don't require a precise physics simulation or client predi
3232

3333
The traditional [client-server](client-server.md) model typically includes a service relay to solve connectivity issues, notably Network Address Translation (NAT), between players across different regions and networks. This topology works well for projects that require competitive client prediction, rollback, and a centralized authority – however, it comes at the cost of added latencies when communicating state changes from one client to another.
3434

35-
With a distributed authority topology, a client's state change takes a single client-relative [round trip period of time (RTT)](../lagandpacketloss.md#round-trip-time-and-pings) (½ per client) to be updated on all connected clients. The distributed authority service is more efficient: messages are routed and then processed, whereas client-server topologies require messages to be processed and then, at a later time, conveyed via new messages to all connected clients.
35+
With a distributed authority topology, a client's state change takes a single client-relative [round trip period of time (RTT)](../learn/lagandpacketloss.md#round-trip-time-and-pings) (½ per client) to be updated on all connected clients. The distributed authority service is more efficient: messages are routed and then processed, whereas client-server topologies require messages to be processed and then, at a later time, conveyed via new messages to all connected clients.
3636

3737
<p align="middle">
3838
<img src="/img/cloud-relay-service.jpg" width="50%" />

docs/tutorials/get-started-with-ngo.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: get-started-ngo
3-
title: Client-server quickstart for Netcode for GameObjects
3+
title: Client-server quickstart
44
---
55

66
Use this guide to learn how to create your first [client-server](../terms-concepts/client-server.md) Netcode for GameObjects project. It walks you through creating a simple Hello World project that implements the basic features of Netcode for GameObjects.
@@ -116,7 +116,7 @@ Netcode for GameObjects comes with an integrated scene management solution that
116116

117117
Now that you have a **NetworkManager**, assigned a **PlayerPrefab**, and added your current scene to the scenes in build test, you can quickly verify everything is functioning/configured correctly via entering play mode in the Unity Editor. By starting a host, you are starting `NetworkManager` as both a server and a client at the same time.
118118

119-
You can test your Hello World project using the Unity Editor or a command-line helper. If you choose the latter, refer to [Create a command line helper](../tutorials/command-line-helper/). Otherwise, refer to the following instructions to test using the Unity Editor. Only the Plane appears on the server until the first client connects. Then, Netcode for GameObjects spawns a new Player prefab for each connected client; however, they overlap in the Game view.
119+
You can test your Hello World project using the Unity Editor or a command-line helper. If you choose the latter, refer to [Create a command line helper](command-line-helper.md). Otherwise, refer to the following instructions to test using the Unity Editor. Only the Plane appears on the server until the first client connects. Then, Netcode for GameObjects spawns a new Player prefab for each connected client; however, they overlap in the Game view.
120120

121121
1. Select **Play** from the top of the Unity Editor to start the scene.
122122

@@ -403,7 +403,7 @@ namespace HelloWorld
403403
}
404404
```
405405

406-
#### A Review of the `HelloWorldPlayer.cs` script
406+
#### A Review of the `HelloWorldPlayer.cs` script
407407

408408
The `HelloWorldPlayer.cs` script adds some basic movement to the Hello World project player. Both the server player and the client player can start player movement. However, the movement occurs through the server's position NetworkVariable, which means the server player can move immediately, but the client player must request a movement from the server, wait for the server to update the position NetworkVariable, then replicate the change locally.
409409

sidebars.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,20 @@ module.exports = {
4545
"id": "tutorials/get-started-ngo"
4646
},
4747
{
48-
"type": "doc",
49-
"id": "learn/distributed-authority-quick-start"
50-
},
48+
"collapsed": true,
49+
"type": "category",
50+
"label": "Distributed authority quickstart",
51+
"items": [
52+
{
53+
"type": "doc",
54+
"id": "learn/distributed-authority-quick-start"
55+
},
56+
{
57+
"type": "doc",
58+
"id": "learn/distributed-authority-webgl"
59+
},
60+
]
61+
},
5162
{
5263
"collapsed": true,
5364
"type": "category",

0 commit comments

Comments
 (0)