Port your project to SpatialOS
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 from the Template project
- Configure the helper scripts
Step 1: Modify your project’s directory structure
The GDK uses a specific directory structure to run SpatialOS locally, and to build client-workers and server-workers. 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 of it.
Your project structure should be:
Step 2: Copy files from the Template project
Your project needs some extra files and folders to run with the GDK. Copy these files from the template project that you set up earlier in the Before you start section.
To do this: Open File Explorer and navigate to the root of the
Copy all of the files and directories below to your
\TP_SpatialGDK\spatial\This folder contains the files that SpatialOS needs to run a deployment.
\TP_SpatialGDK\LaunchClient.batThe GDK uses this script to launch a local Unreal client-worker and connects it to a local SpatialOS deployment.
\TP_SpatialGDK\LaunchServer.batThe GDK uses this script to launch a local Unreal server-worker and connects it to a local SpatialOS deployment.
\TP_SpatialGDK\ProjectPaths.batThis script is used by the LaunchClient.bat and LaunchServer.bat scripts to specify the project environment when those scripts are run.
Your project’s directory structure should now resemble:
\<ProjectRoot>\<GameRoot>\ \<ProjectRoot>\spatial\ \<ProjectRoot>\LaunchClient.bat \<ProjectRoot>\LaunchServer.bat \<ProjectRoot>\ProjectPaths.bat Etc…
Note: You must place the
spatial directory in the directory above your
Step 3. Configure the ProjectPaths.bat GDK helper script.
You must edit the ProjectPaths.bat GDK helper scripts to launch local deployments of your project.
To do this:
\<ProjectRoot>\ProjectPaths.batin a text editor.
set PROJECT_PATH=Game, replace
set GAME_NAME= TP_SpatialGDK, replace
TP_SpatialGDKwith the name of your game’s
<YourProject>terms used in this guide).
Note: The helper scripts
LaunchServer.bat will not work if you do not follow this step correctly.
> Next: 2. Modify and build your project
2019-07-16 Page updated with editorial review.