Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

spatialos/deployment-manager

Repository files navigation

[Deprecated] SpatialOS Deployment Manager

This repository is deprecated. To manage a SpatialOS game with multiple deployments, please use the deployment pool module of the SpatialOS Online Services

The SpatialOS Deployment Manager is a SpatialOS game management tool. It starts and stops game deployments - instances of your game running in SpatialOS. It’s useful for player-limited and time-limited match-based games such as battle royales where you have multiple game sessions, with a defined number of players.

Overview

The Deployment Manager is a C# SpatialOS project. You set it up and deploy it separately to setting up and deploying your game project.

Once set up and deployed, the Deployment Manager starts and stops multiple deployments of your game: Every deployment of your game which it can start and stop is a separate game instance with its own SpatialOS game world.
Note: The Deployment Manager does not manage its own deployment; you have to manually start and stop the Deployment Manager as it only starts and stops game deployments.

The Deployment Manager is one worker instance.

img
Conceptual organization of a Deployment Manager and a game’s deployments

How to set your game with the Deployment Manager

Overview

There are two elements to preparing your Deployment Manager:

Configure a Deployment Manager project

Inside your Deployment Manager project, there is a deploymentmanager/config.json file containing the configuration for your Deployment Manager. Use this to configure the Deployment Manager and your game deployments.

Add a deployment state entity to your game project

Add an entity type to act as a Deployment State Entity to your game. The Deployment Manager then gets updates on the components in the Deployment State Entity in each of your running game deployments.

Example Deployment State Entity

Example of a Deployment Manager integrated with a game

There is an example implementation of a Deployment Manager in a GDK for Unreal project and a GDK for Unity project:

Steps

1. Download and set up a Deployment Manager project

Clone the Deployment Manager project.

Run a script to download and build the SpatialOS dependencies. To do this, in a command line or terminal window, from the root directory of the cloned Deployment Manager project, enter:


Windows

powershell ./build-nuget-packages.ps1


Mac

./build-nuget-packages.sh

You need to generate a service account token. The service account token enables the Deployment Manager to list, start and stop deployments in your SpatialOS project. (See SpatialOS documentation on development authentification for more details on tokens.)

To generate the token, from the root directory of the cloned Deployment Manager project, open a command line or terminal window and enter:


Windows

powershell ./generate-service-account-token.ps1 <your SpatialOS project name> <token life time in days>


Mac

./generate-service-account-token.sh <your SpatialOS project name> <token life time in days>

This automatically generates and adds a service account token to your Deployment Manager project. You do not need to make a note of the token or add it to the project manually.

2. Set up and launch your game

Add an entity template to act as a Deployment State Entity to your game project.
(See examples in the projects in the Overview section above.)
Add a worker configuration file (spatialos.DeploymentManager.worker.json) for the Deployment Manager worker type to your game project.
(You can copy the worker configuration file examples in the projects Overview section above.) Go through the usual workflow to deploy your game locally or to the cloud. See:

3. Configure and Launch the Deployment Manager

Update the configuration: navigate to the deployment-manager/DeploymentManager/ directory and, in a text editor, edit the config.json file as shown below:

  • "ClientType": “<edit this>” is your SpatialOS development platform’s game client type, for example, ”UnityClient" or "UnrealClient".
  • "NumberOfDeployments": “<edit this>” is the number of game deployments you want to launch.
  • "AssemblyName": “<edit this>” is the name of the assembly you uploaded to the cloud in step 2. This enables the Deployment Manager to launch deployments using this assembly.

Launch your Deployment Manager locally on your computer or to the cloud. To do this, follow the steps below.

Launch the Deployment Manager locally on your computer

Open a command line or terminal window and enter:

Windows

powershell ./publish-windows-workers.ps1 <game launch config path> <game snapshot path>
powershell ./local-launch.ps1

Mac

./publish-macos-workers.sh <game launch config path> <game snapshot path>
./local-launch.sh
Launch the Deployment Manager in the cloud

Open a command line or terminal window and enter:

Windows

powershell ./publish-linux-workers.ps1 <game launch config path> <game snapshot path>
powershell ./cloud-launch.ps1 <Deployment Manager assembly name> <Deployment Manager deployment name>

Mac

sh./publish-linux-workers.sh <game launch config path> <game snapshot path>
sh ./cloud-launch.sh <Deployment Manager assembly name> <Deployment Manager deployment name>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published