Kanda Foundation 0.8.0
Loading...
Searching...
No Matches
Unity Services

We utilise Unity Cloud as the default service provider for multiplayer integrations such as dedicated server hosting with Multiplay and voice chat with Vivox.

These services are primarily set up via the Unity Editor and the Unity Cloud dashboard:

1. Link Project to Unity Cloud

Linking your project to Unity Cloud enables access to various Unity services, including multiplayer hosting.

  1. Go to Project Settings > Services.
  2. Under Unity Project ID, click the button to link this project to Unity Cloud.

2. Create Environments

A environment allows you to safely test new server builds and service configurations before deploying to production.

  1. Go to Project Settings > Services > Environments.
  2. If a staging environment doesn't exist, click Manage environments to add it in Unity Cloud.
  3. Select staging from the dropdown to set it as the active environment.
  4. Optionally, you can also create a development environment.

3. Create a Dedicated Server Build

Creating a dedicated server build is a prerequisite for setting up Game Server Hosting.

  1. Go to Kanda Sdk > Distribution > To Unity Game Server Hosting....
  2. Follow the instructions shown.

To publish builds, you must have a service account and an associated key. These can be generated from the Unity cloud dashboard under Administration > Service accounts.

First time setup: To upload builds, you need a build ID from Unity Game Server Hosting. For your project's first ever server build, you may want to manually create a build first, which you can then continue to step 4 below. To create a build manually:

  1. Open the build settings and switch platform to Dedicated Server (Linux).
  2. Build the game server. It should be named KandaServer.x86_64 by default.

4. Create a Game Server Hosting Build

A Game Server Hosting (GSH) build is required to deploy your game server to Unity's cloud infrastructure.

  1. In the Unity Cloud dashboard, go to Game Server Hosting and select Builds.
  2. For each environment:
  3. Press Create build and set the following configuration:
    • Build name: Main
    • Operating system: Linux
    • Upload method: Direct file upload
  4. Press Next and upload initial dedicated server build files.
  5. Press Next and optionally select a name for the initial build version.
  6. Press Finish

5. Create a Game Server Hosting Build Configuration

Build configurations define how your game server should be run and scaled in the cloud.

  1. In the Unity Cloud dashboard, go to Game Server Hosting and select Build Configurations.
  2. For each environment:
  3. Press Create build configuration and set the following configuration:
    • Build configuration name: Main
    • Build: Main
    • Game server executable: The path of your server executable (eg. KandaServer.x86_64)
    • Query type: SQP
    • Server readiness: True
    • Launch parameters: -port $$port$$ -queryport $$query_port$$ -logFile $$log_dir$$/Engine.log
  4. Press Next and optionally set any custom configuration variables you need.
  5. Press Finish.

6. Create a Game Server Hosting Fleet

A fleet is a group of server instances that run your game server build.

  1. In the Unity Cloud dashboard, go to Game Server Hosting and select Fleets.
  2. For each environment:
  3. Press Create fleet and set the following configuration:
    • Fleet name: Main
    • Operating system: Linux
    • Build configuration(s): Main
  4. Press Next and set the following configuration:
    • Region: Your preferred region (eg. Europe)
    • Min available servers: 0 for minimal cost or 1 to prevent cold starts
    • Max servers: You maximum expected concurrent sessions (eg. 10)
  5. Press Next and set the following configuration:
    • Servers per machine: 4
  6. Press Finish.

The scaling and density settings for the fleet may be tweaked later using the GSH dashboard.

7. Configure Service Account

To configure the Unity Editor and Kanda Cloud to interact with Unity Services APIs, you need a Service Account.

Create one following Unity Service Account documentation, ensuring it has the following roles:

  • Cloud Content Delivery API Public Editor
  • Game Server Hosting API Manager
  • Game Server Hosting Allocations Admin

8. Configure Kanda Cloud

The Kanda Cloud team will need various information about your Unity Services setup to configure cloud integrations. Ask the team for the most up-to-date information. At the time of writing, the information required is:

  • Unity Service Account Key
  • Unity Service Account Secret
  • Unity Project ID
  • For each environment:
    • Unity Environment ID
    • Game Server Hosting Fleet ID
    • Game Server Build Configuration ID
    • Game Server Hosting Region ID