Kanda Foundation 0.2.0
Loading...
Searching...
No Matches
Set Up Unity Services

Since UGS is still a maturing product, software integrations other than the Unity Editor and Unity Cloud dashboards are lacking. For this reason, we recommend setting up UGS infrastructure manually for the time being.

In the future, once these integrations reach a point of maturation, we may start managing setup of these resources from Kanda Cloud infrastructure code.

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 Build Settings.
  2. Select Dedicated Server platform with Linux as the Target Platform.
  3. Include necessary scenes.
  4. Click Build and name the server executable (default name is KandaServer.x86_64).

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