Get SpatialOS



Get started: 3 - Upload and launch your game

This has 2 steps:

  • Set your SpatialOS project name
  • Upload and launch your cloud deployment

Set your SpatialOS project name

When you signed up for SpatialOS, your account was automatically associated with an organisation and a project, both of which have the same generated name.

  1. Find this name by going to the Console.
    The name should look something like beta_randomword_anotherword_randomnumber. In the example below, it’s beta_yankee_hawaii_621.

    Example autogenerated SpatialOS project name

  2. Using a text editor of your choice, open gdk-for-unity-fps-starter-project/spatialos.json and replace the unity_gdk project name with the project name you were assigned in the Console. This tells SpatialOS which SpatialOS project you intend to upload to.

    Your spatialos.json should look like this:
  "name": "beta_yankee_hawaii_621",
  "project_version": "0.0.1",
  "sdk_version": "13.5.1-gdk-for-unity",
  "dependencies": [
      {"name": "standard_library", "version": "13.5.1-gdk-for-unity"}

Upload and launch your cloud deployment

The FPS Starter Project has the Deployments window in the Unity Editor which you can use to do this. (Note that this window is only available as part of the FPS Starter Project; it’s not part of the GDK.)

1. Reference your Unity project in the Deployments window

  • To open the Deployments window, in your Unity Editor, select SpatialOS > Deployment Launcher.
  • Enter your project name in the Project Name field at the top of the window. (Use the one you just located in the SpatialOS Console.)

2. Upload worker assemblies

An assembly is a bundle of code, art assets and other files necessary to run your game in the cloud.

To run a deployment in the cloud, you need to upload the worker assemblies to your SpatialOS project.

To do this:

  • First, in the Assembly section of the Deployments window, enter the Assembly Name field. The assembly name is a string you choose made up of alphanumeric characters, _, ., and -; for example my_assembly. (As shown in the example below.)
  • Now select Upload Assembly to start the upload.

TIP: If you want to overwrite an existing assembly, ensure the Force Upload option is enabled.

Example Deployments window showing the Assembly section completed

It’s finished uploading when: You see an upload report printed in your Unity Console, for example:

Uploaded assembly my_assembly to project unity_gdk successfully.

TIP: Depending on your network speed, the upload may take a little while (1-10 minutes) to complete.

3. Launch a cloud deployment

The next step is to start a cloud deployment using the assembly that you just uploaded. When you launch a cloud deployment you have to provide five parameters:

  • Assembly Name - this identifies the worker assemblies to use.
  • Deployment Name - this labels your deployment in the SpatialOS Console.
  • Snapshot File - this specifies which snapshot file the deployment uses. A snapshot declares the state of the world as the deployment starts.
  • Launch Config File - this is the deployment’s launch configuration .json file which declares the world and load balancing configuration.
  • Deployment Region - the geographic location that your deployment starts in: EU for Europe or US for USA. Set to US by default.

To launch your cloud deployment:

1. First enter the parameters in the Deployment Launcher section of the Deployments window. Complete the settings as below:

Setting name The setting you add
Assembly Name The name you gave the assembly in step 2 - for example; myassembly.
(The name needs to conform to the following regex: [a-zA-Z0-9_.-]{5,64}.)
Deployment Name A name of your choice - for example; shootyshooty.
(The name needs to conform to the following regex: [a-z0-9_]{2,32}.)
Snapshot File snapshots/cloud.snapshot
Note that this is a relative path from the root of your SpatialOS project.
Launch Config File cloud_launch_large.json
Note that this is a relative path from the root of your SpatialOS project.
Deployment Region You can set this to US for the USA (default) or EU for Europe. Select the geographical location closest to you for lower latencies when connecting clients.
(Note that the simulated players deployment deploys to the same region - you will find out more about simulated players in later steps.)
Enable Simulated Players Ensure this is checked.
Override Name Leave this unchecked.
This allows you to change the name of the simulated players deployment - more about simulated players in the next steps.
Deployment Name
(The second Deployment Name listed)
Do not edit this field.
Launch Config File
(The second config listed)
Note that this is a relative path from the root of your SpatialOS project.

Example completed Deployments window

2. Now start your deployment: Select Launch deployments.

Note: You will see that there are two Deployment Names and two Launch Config Files listed in the Deployment window; the first listed is your FPS Starter Project, the second is a deployment for simulated players. You will find out more about simulated players in later steps.

It’s finished when: The Console pages for both deployments open automatically in your browser.

You should also see two messages printed in your Unity Console indicating both deployments have started:

Successfully created the main deployment.
Successfully created the simulated player deployment.

Well done getting set up!

It’s time to play your game.

Next: Get playing!

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums