Multiserver Shooter tutorial
4: Test changes in the cloud
Step 1: Build your workers
Step 4: Test your changes in the cloud
Build your assemblies
An assembly is what’s created when you run
.zip files that contain all the files that your game uses when running in the cloud.
Note: You must close the Unreal Editor before building your workers. If the Editor is open when you try to build your workers the command will fail.
Note: Unreal GDK projects default to using [Spatial for networking](). However, if the
bSpatialNetworking option is present in your
DefaultGame.ini configuration file (located in
<ProjectRoot>\Game\Config directory), ensure that it is set to
True (as in,
bSpatialNetworking=True) to enable networking with Spatial for your cloud deployment.
- In a terminal window, change directory to the root directory of the Third-Person Shooter repository.
- Build a server-worker assembly by running:
Game\Plugins\UnrealGDK\SpatialGDK\Build\Scripts\BuildWorker.bat ThirdPersonShooterServer Linux Development ThirdPersonShooter.uproject
- Build a client-worker assembly by running:
Game\Plugins\UnrealGDK\SpatialGDK\Build\Scripts\BuildWorker.bat ThirdPersonShooter Win64 Development ThirdPersonShooter.uproject
Step 2: Upload your game
- In File Explorer, navigate to
spatialos.jsonin a text editor.
- Change the
namefield to the name of your project. You can find this in the Console. It’ll be something like
In a terminal window, change directory to
spatial cloud upload <assembly_name>, where
<assembly_name>is a name of your choice (for example
myassembly). A valid upload command looks like this:
spatial cloud upload myassembly
Note: Depending on your network speed it may take a little while (1-10 minutes) to upload your assembly.
Step 3: Launch a cloud deployment
The next step is to launch a cloud deployment using the assembly that you just uploaded. This can only be done through the SpatialOS command-line interface (also known as the SpatialOS CLI.
When launching a cloud deployment you must provide three parameters:
- the assembly name, which identifies the worker assemblies to use.
- a launch configuration, which declares the world and load balancing configuration.
- a name for your deployment, which is used to label the deployment in the Console.
In a terminal window, in the same directory you used to upload your game, run:
spatial cloud launch --snapshot=snapshots/default.snapshot <assembly_name> two_worker_test.json <deployment_name>
assembly_nameis the name you gave the assembly in the previous step and
deployment_nameis a name of your choice. A valid launch command would look like this:
spatial cloud launch --snapshot=snapshots/default.snapshot myassembly two_worker_test.json mydeployment
Note: This command defaults to deploying to clusters located in the US. If you’re in Europe, add the
--cluster_region=euflag for lower latency.
Step 4: Play your game
When your deployment has launched, SpatialOS automatically opens the Console in your browser.
- In the Console, Select the Launch button on the left of the page, and then click the Launch button that appears in the centre of the page. The SpatialOS Launcher, which was installed along with SpatialOS, downloads the game client for this deployment and runs it on your local machine.
- Once the client has launched, enter the game and fire a few celebratory shots - you are now playing in your first SpatialOS cloud deployment!
TIP: Check out the cloud deployment workflow page for a reference diagram of this workflow.
Step 5: Invite your friends
- To invite other players to this game, head back to the Deployment Overview page in your Console, and select the Share button.
- Share the generated link with your friends!
When you’re done shooting your friends, you can click the Stop button in the Console to stop your deployment.
** Next steps:**
- If you want to create a new game using the GDK, you should get the Starter Template.
- If you want to port your existing game to the GDK, follow the Porting guide.
2019-03-20 Page updated with limited editorial review