Sites

Menu

Helper scripts

These scripts are located under Plugins\UnrealGDK\SpatialGDK\Build\Scripts\ directory of your game.

Helper script Parameters Description
BuildWorker.bat <target> <platform> <configuration> <YourGame>.uproject [--skip-codegen] Run this script from the command line to build your game’s Unreal server-workers and client-workers ready for uploading as a SpatialOS cloud deployment or set them up for testing in a local deployment in the Unreal Editor on your development machine.

Some parameters also cook your workers to Unreal format and zip them up. (A SpatialOS cloud deployment requires built workers in zipped files.)

(In the example and list below, <YourGame> is the name of your Unreal project.)

Example
BuildWorker.bat <YourGame>Editor Win64 Development <YourGame>.uproject

Flags
<target>
This is the output file the built workers are stored in. They are Unreal’s build target files. The target can be:

* <YourGame>Editor: Set up server-workers for a local deployment for testing in the Unreal Editor on your development machine. This option does not cook or zip server-workers as this is not needed for local deployments.

* <YourGame>Server: Build, cook and zip server-workers ready for upload to the SpatialOS cloud as a cloud deployment.

* <YourGame>: Cooks a stand-alone version of the game to test it as a game client.

* <YourGame>SimulatedPlayer: Cooks a headless standalone version of the game ready for upload to the SpatialOS cloud as a simulated player cloud deployment. This is similar to <YourGame> but headless and bundled with additional tooling to run simulated players in the cloud.

If you specify other Unreal <target>, this script passes all arguments to the UE script, \Engine\Build\BatchFiles\Build.batwith no cooking or zipping.

<platform>
Specify the platform your built server-worker or game client to runs on. This is:
* linux for your server-workers
* win64 for you game client exectuable

<configuration>
Use the Unreal build configuration Development which is the one you usually use during game development.

* --skip-codegen is optional, add this if you want the build script to NOT generate schema.
DeploymentLauncher.bat create <project_name> <assembly_name> <main_deployment_name> <main_deployment_json_path> <main_deployment_snapshot_path> <main_deployment_region> [<sim_deployment_name> <sim_deployment_json_path> <sim_deployment_region> <num_sim_players>]

list <project_name>

stop <project_name> [<deployment_id>]
Run this script to launch a cloud deployment (and optional simulated player deployment), to list deployments, or to stop deployments.

Note: You need to be logged in for these commands to succeed. If any authentication errors occur, try running spatial auth login.

Create

This command allows you to launch a deployment, and optionally launch a simulated player deployment.

Note: If you specify a project name, you need to specify all of the other flags (except those relating to simulated players). If you specify a simulated player deployment name, you need to specify all of the other simulated player flags.

Flags
*<project_name>: The name of your project (see the Console - this should look something like beta_randomword_anotherword_randomnumber).

* <assembly_name>: The name of an assembly you have uploaded. (You need to upload an assembly before you run this script.)

* <main_deployment_name>: Specify a name for your deployment. This labels the deployment in the Console.

* <main_deployment_json_path>: The path to the launch configuration file you want to use.

* <main_deployment_snapshot_path>: The path to the snapshot file you want to use.

* <main_deployment_region>: The deployment region. Can be EU, US, or AP.

* [<sim_deployment_name>]: Specify a name for the simulated player deployment. This labels the deployment in the Console.

* [<sim_deployment_json_path>]: Specify the path to a launch configuration file. We recommend you use the launch configuration file located at UnrealGDK/SpatialGDK/Build/Programs/
Improbable.Unreal.Scripts/WorkerCoordinator/
SpatialConfig/cloud_launch_sim_player_deployment.json.

* [<sim_deployment_region>]: The deployment region. Can be EU, US, or AP.

* [<num_sim_players>]: The number of simulated players to start.

List

This command lists all starting and active deployments within the specified project that are launched by this script.

Flags
* <project_name>: The name of your project (see the Console - this should look something like beta_randomword_anotherword_randomnumber).

Output
The output contains a line in the following format for each deployment:

<deployment_type> <deployment_id> <deployment_name> <overview_page_url> <status>

where <deployment_type> is either <deployment> or <simulated-player-deployment>.

Stop

Flags
* <project_name>: The name of your project (see the Console - this should look something like beta_randomword_anotherword_randomnumber).

* [<deployment_id>]: The ID of the deployment you want to stop. You can find this by running list <project_name>.

If you don’t provide a deployment ID, this command stops all active deployments within your project that have been launched by the deployment launcher script (in other words, all active deployments that have the tag unreal_deployment_launcher). This includes active deployments launched by other users within the same project.

If you provide a deployment ID, this command only stops the specified deployment.
ExternalSchemaCodegen.bat <project_directory> <schema_directory> <output_code_directory> If you create non-Unreal server-worker types, using the SpatialOS Worker SDK outside of the GDK and your Unreal Engine, you manually create schema. Use this script to generate Unreal code from manually-created schema; it enables your Unreal game code to interoperate with non-Unreal server-worker types.

Example:
ExternalSchemaCodegen.bat UnrealGDKProjects\MyProject spatial\schema\my_external_schema Game\Source\ThirdPersonShooter\ExternalSchemaCodegen

The script forwards its arguments to a code-generator binary executable within the GDK; the binary was created by the setup.bat script when you first built the GDK for Unreal module dependencies. The binary takes manually-defined schema and generates Unreal C++ types and an interface for sending and registering callbacks for worker instances to receive SpatialOS component updates.

Flags:
Both flags are defined relative to the project root.
* <schema_directory> is a subdirectory of the spatial\schema folder; you manually create this folder and the schema files in it when you set up non-Unreal server-worker types - these are not schema files generated by the GDK.
* <output_code_directory> is an output directory created for the code generated by the binary and should be inside your Source directory.



————
2019-07-31 Page updated with limited editorial review: added DeploymentLauncher.bat
2019-06-27 Page updated with editorial review: added ExternalSchemaCodegen.bat

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums