Multiple deployments for session-based games
3: Build and upload workers
Step 1: Edit the .ini file
Before you build your assembly, you need to edit the Example Project
DefaultEngine.ini file. To do this:
- In File Explorer, navigate to
DefaultEngine.iniin a text editor.
In your text editor, search for
bPreventAutoConnectWithLocator=Falseand change this value to
True. This setting forces your game client to stay offline after being launched until you select a deployment or select Quick Join in the game. Your changes should look like this:
Save and close
DefaultEngine.inionce you have made your changes.
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.
Step 2: Build your assembly
There are two ways to build workers for your assembly, you can either:
Build your workers using `BuildProject.bat`
In File Explorer, navigate to the
BuildProject.bat. This opens a command line window and automatically builds your client and server workers.
This script automatically builds both the server-workers and client-workers required to run your game in the cloud. It then compresses your workers and saves them as
.zip files to the
UnrealGDKExampleProject\spatial\build\assembly\worker directory. Use this script if you want to build server-workers and client-workers at the same time.
Build your workers using terminal commands
In a terminal window, navigate to the
Build a server-worker by running the following command:
Game\Plugins\UnrealGDK\SpatialGDK\Build\Scripts\BuildWorker.bat GDKShooterServer Linux Development GDKShooter.uproject
Build a client-worker by running the following command:
Game\Plugins\UnrealGDK\SpatialGDK\Build\Scripts\BuildWorker.bat GDKShooter Win64 Development GDKShooter.uproject
Note: Building your workers can take a long time, regardless of which method you use.
BuildProject.bat can’t find the path specified
If you receive the error
The system cannot find the path specified. Builds failed., open the
ProjectPaths.bat file in a text editor and ensure that
GAME_NAME are correct.
PROJECT_PATH needs to be the name of your Unreal project folder (usually “Game”).
GAME_NAME needs to be the same name as your Unreal Project
Step 3: Upload your assembly
Before launching a cloud deployment, you must upload your assembly, which contains your server-worker and client-worker. To do this:
- Open a terminal window and navigate to
- Run the following SpatialOS CLI command:
spatial cloud upload <assembly_name>
<assembly_name>is a name you create here for the upload (for example “myassembly”).
Make a note of the
<assembly_name> you create, as you will need it later.
2019-05-21 Page added with editorial review