diff --git a/docs/learn/distributed-authority-quick-start.md b/docs/learn/distributed-authority-quick-start.md index e0cf9522f..178ad6744 100644 --- a/docs/learn/distributed-authority-quick-start.md +++ b/docs/learn/distributed-authority-quick-start.md @@ -1,6 +1,6 @@ --- id: distributed-authority-quick-start -title: Distributed authority quickstart for Netcode for GameObjects +title: Distributed authority general quickstart --- 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: - An active Unity account with a valid license. - The [Unity Hub](https://unity.com/download). -- A supported version of the Unity 6 Editor. - - Additional requirements information can be found here: [Netcode for GameObjects requirements](https://docs-multiplayer.unity3d.com/netcode/current/installation). +- A supported version of the Unity 6 Editor. Refer to the [Netcode for GameObjects requirements](https://docs-multiplayer.unity3d.com/netcode/current/installation). ## Project setup diff --git a/docs/learn/distributed-authority-webgl.md b/docs/learn/distributed-authority-webgl.md new file mode 100644 index 000000000..3938d4f97 --- /dev/null +++ b/docs/learn/distributed-authority-webgl.md @@ -0,0 +1,39 @@ +--- +id: distributed-authority-webgl +title: Distributed authority and WebGL quickstart +--- + +Use this guide to learn how to create your first [distributed authority](../terms-concepts/distributed-authority.md) Netcode for GameObjects WebGL project. + +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. + +:::note Beta feature +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). +::: + +## Prerequisites + +Before you begin, you need the following general requirements to use the distributed authority network topology: + +- An active Unity account with a valid license. +- The [Unity Hub](https://unity.com/download). +- A supported version of the Unity 6 Editor. Refer to the [Netcode for GameObjects requirements](https://docs-multiplayer.unity3d.com/netcode/current/installation). + - When installing the Editor, make sure to include the __WebGL Build Support_ module. + +You also need the following packages and minimum versions for a WebGL distributed authority session: + +- Netcode for GameObjects version 2.1.1+ +- Unity Transport version 2.3.0+ + - Note that you don't need to create a self-signed certificate to connect to a distributed authority session. +- Multiplayer Services version 1.0.2+ + +## Create and set up your project + +Follow the instructions on the [distributed authority general quickstart](distributed-authority-quick-start.md) page. + +## Build and run with WebGL + +1. Navigate to __File__ > __Build Profiles__ to open the __Build Profiles__ window. Select WebGL as your target platform. +1. From the __Build Profiles__ window, click __Build and Run__. + - Unity launches a small web hosting app to provide the HTTP services required to launch the WebGL application in your browser. +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. diff --git a/docs/terms-concepts/distributed-authority.md b/docs/terms-concepts/distributed-authority.md index 95d37a282..44614dfce 100644 --- a/docs/terms-concepts/distributed-authority.md +++ b/docs/terms-concepts/distributed-authority.md @@ -32,7 +32,7 @@ For game designs that don't require a precise physics simulation or client predi 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. -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. +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.

diff --git a/docs/tutorials/get-started-with-ngo.md b/docs/tutorials/get-started-with-ngo.md index 4c202e35b..193fc9f86 100644 --- a/docs/tutorials/get-started-with-ngo.md +++ b/docs/tutorials/get-started-with-ngo.md @@ -1,6 +1,6 @@ --- id: get-started-ngo -title: Client-server quickstart for Netcode for GameObjects +title: Client-server quickstart --- 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 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. -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. +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. 1. Select **Play** from the top of the Unity Editor to start the scene. @@ -403,7 +403,7 @@ namespace HelloWorld } ``` -#### A Review of the `HelloWorldPlayer.cs` script +#### A Review of the `HelloWorldPlayer.cs` script 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. diff --git a/sidebars.js b/sidebars.js index 38ad299a3..1dd9ad9aa 100644 --- a/sidebars.js +++ b/sidebars.js @@ -45,9 +45,20 @@ module.exports = { "id": "tutorials/get-started-ngo" }, { - "type": "doc", - "id": "learn/distributed-authority-quick-start" - }, + "collapsed": true, + "type": "category", + "label": "Distributed authority quickstart", + "items": [ + { + "type": "doc", + "id": "learn/distributed-authority-quick-start" + }, + { + "type": "doc", + "id": "learn/distributed-authority-webgl" + }, + ] + }, { "collapsed": true, "type": "category",