1. Set up your project

To begin porting your project to the GDK, you need to:

  • Modify your project's directory structure
  • Copy the required SpatialOS folder and helper scripts (Windows only) from the Unreal Engine TP_SpatialGDK template
  • Configure the helper scripts (Windows only)

Step 1: Modify your project's directory structure

The GDK uses a specific directory structure to run SpatialOS locally, and to build client-worker instances and server-worker instances. You must set up your project’s directory structure before using the GDK.

To do this: Create a new empty directory to represent your <ProjectRoot> and move your <GameRoot> directory inside it.

Your project structure should be: /<ProjectRoot>/<GameRoot>/<YourProject>.uproject

For example:
/MyProject/Game/TP_SpatialGDK.uproject

Step 2: Copy the required SpatialOS folder and helper scripts (Windows only) from the Unreal Engine TP_SpatialGDK template

Your project needs some extra files and folders to run with the GDK. From the root directory of your Unreal Engine, navigate to Templates/TP_SpatialGDK.


Copy the following files and directories inside /TP_SpatialGDK/spatial-resources/ to your <ProjectRoot>.

  • Spatial resources: /TP_SpatialGDK/spatial-resources/ - This folder contains all the files and folders that SpatialOS needs to run a deployment, specifically:
    • Client: /TP_SpatialGDK/spatial-resources/LaunchClient.bat - The GDK uses this script to launch a local Unreal client-worker instance and connects it to a local SpatialOS deployment.
    • Server: /TP_SpatialGDK/spatial-resources/LaunchServer.bat - The GDK uses this script to launch a local Unreal server-worker instance and connects it to a local SpatialOS deployment.
    • Paths: /TP_SpatialGDK/spatial-resources/ProjectPaths.bat - This script is used by the LaunchClient.bat and LaunchServer.bat scripts to specify the project environment when those scripts are run.
    • Find Engine: /TP_SpatialGDK/spatial-resources/FindEngine.bat - This script is used by the LaunchClient.bat and LaunchServer.bat scripts to locate your Unreal Engine fork.

Your project's directory structure should now resemble:

   \<ProjectRoot>\<GameRoot>\
   \<ProjectRoot>\spatial\ 
   \<ProjectRoot>\LaunchClient.bat  
   \<ProjectRoot>\LaunchServer.bat 
   \<ProjectRoot>\ProjectPaths.bat   
   \<ProjectRoot>\FindEngine.bat
   Etc…

Copy the following files and directories inside /TP_SpatialGDK/spatial-resources/ to your <ProjectRoot>.

  • Spatial resources:/TP_SpatialGDK/spatial-resources/ - This folder contains all the files and folders that SpatialOS needs to run a deployment.

Your project's directory structure should now resemble:

  /<ProjectRoot>/<GameRoot>/
  /<ProjectRoot>/spatial/ 

Step 3: Configure the helper scripts (Windows only)


You must edit the ProjectPaths.bat GDK helper scripts to run additional client-worker instances and server-worker instances outside the Unreal Editor using LaunchClient.bat and LaunchServer.bat GDK helper scripts.

To do this:

  1. Open /<ProjectRoot>/ProjectPaths.bat in a text editor.
  2. In set PROJECT_PATH=Game, replace Game with your <GameRoot> folder name.
  3. In set GAME_NAME=TP_SpatialGDK, replace TP_SpatialGDK with the name of your game's .uproject.

Note: The helper scripts LaunchClient.bat and LaunchServer.bat will not work if you do not follow this step correctly.

> Next: 2. Modify and build your project


2020-06-25 Page updated with editorial review: added macOS, mobile, UI and deployment workflow changes.
2019-07-16 Page updated with editorial review.

Updated about a year ago


1. Set up your project


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.