GitHub repository: github.com/spatialos/UnrealSDK
NOTE: The steps below tell you how to migrate from an earlier version of SpatialOS and the Unreal SDK (before SpatialOS version 13). If you are installing SpatialOS and the Unreal SDK for the first time, see: Introduction to the Unreal SDK.
SpatialOS 13.0 splits SpatialOS and the Unreal SDK to make SpatialOS available as a separate product to the Unreal SDK. At the time of initial release, the functionality of SpatialOS 13.0 and the Unreal SDK 1.0.0 is the same as the combined SpatialOS and Unreal SDK 12.2.1. Subsequent patch releases may make the functionality of the versions slightly different. If you want to use the Unreal SDK 1.0.0, you need to upgrade your SpatialOS version to 13.0 and migrate your Unreal SDK version to 1.0.0.
Follow the steps below for every SpatialOS Unreal project you want to upgrade and migrate.
- Run
spatial clean. - Clone the SpatialOS Unreal SDK GitHub repository.
- From the cloned repository, move the
Gamedirectory into your project’s Unreal worker directory (this is usually<root>/workers/unreal). If you are asked whether to merge or replace theGamefolder, select merge, otherwise you will delete files that your game depends upon. - Still in the Unreal worker directory, edit the
spatialos.UnrealClient.worker.jsonfile to remove"generated_build_scripts_type": "unreal"completely and to replace"Game/Intermediate/Improbable/spatialos.unreal.client.build.json"with"Game/Source/SpatialOS/spatialos.unreal.client.build.json".Be sure to remove the comma after.json". - Edit the
spatialos.UnrealWorker.worker.jsonfile to remove"generated_build_scripts_type": "unreal"completely and to replace"Game/Intermediate/Improbable/spatialos.unreal.worker.build.json"with"Game/Source/SpatialOS/spatialos.unreal.worker.build.json".Be sure to remove the comma after.json". - In
<root>\workers\unreal\Game\Intermediate\Improbabledelete thespatialos_worker_packages.jsonfile. - In
Game/<yourgame>.uprojectreplace all instances ofspatial invoke unrealwithBinaries\\ThirdParty\\Improbable\\Programs\\unreal_packager. - Edit the
spatialos.jsonfile in two places so that"version" is “13.0.0”. - Run
spatial clean(again). - Run
spatial worker build. - In your project's Unreal worker directory (for example,
workers/unreal), edit the version control system (VCS) ignore file as below:- Change the line
**/Binaries/to**/Binaries/* - Add the line
!Game/Binaries/ThirdParty/ - Delete the line
Game/Source/SpatialOS/*
- Change the line
Note: In all our starter projects downloaded before 2018-05-15 the VCS ignore files are not set as above, so if your project is based on any of these projects, you need to edit the VCS ignore files as described in the final step.
- Open a terminal window and
cdto the root directory of your project. - Run
spatial clean. Note: It’s very important you start by runningspatial clean. If you don’t, files won’t be cleaned up properly and may cause issues with the new version.
Get the Unreal SDK by cloning the SpatialOS Unreal SDK GitHub repository. Either follow the Clone or download instructions on the web page or clone using the command line. (See the git-scm website for guidance on setting up and using command-line git.)
For command-line git, in a terminal window run:
git clone github.com/spatialos/UnrealSDK
- From the cloned repository, copy the contents of the
Gamedirectory into the directory which contains your Unreal project’s workers. (It is the directory which contains thespatialos_worker_packages.jsonfile.) For example:~/mySpatialOSgame/workers/unreal - In the same directory, edit the
spatialos.UnrealClient.worker.jsonfile to remove"generated_build_scripts_type": "unreal"completely and to replace"spatialos.unreal.client.build.json"with"Game/Source/SpatialOS/spatialos.unreal.client.build.json". Make sure there is no comma after.json".
This part of the file should now look like this:
"build": {
"tasks_filename": "Game/Source/SpatialOS/spatialos.unreal.client.build.json"
},
- In the same directory, edit the
spatialos.UnrealWorker.worker.jsonfile to remove the"generated_build_scripts_type": "unreal"completely and to replace"spatialos.unreal.client.build.json"with"Game/Source/SpatialOS/spatialos.unreal.client.build.json".Make sure there is no comma after.json".
This part of the file should now look like this:
"build": {
"tasks_filename": "Game/Source/SpatialOS/spatialos.unreal.client.build.json"
},
-
Delete
spatialos_worker_packages.jsonasspatialno longer uses this file. -
In
Game/<yourgame>.uprojectreplace all instances ofspatial invoke unrealwithBinaries\\ThirdParty\\Improbable\\Programs\\unreal_packager.
For example, the PostBuildSteps section of Game/<yourgame.uproject> should now look like this:
"PostBuildSteps":
{
"Win64": [
"cd /D \"$(ProjectDir)\"",
"Binaries\\ThirdParty\\Improbable\\Programs\\unreal_packager package --engineDir=\"$(EngineDir)\" --project=\"$(ProjectFile)\" --platform=\"$(TargetPlatform)\" --target=\"$(TargetType)\" --configuration=\"$(TargetConfiguration)\" -- -allmaps",
"exit /B %ERRORLEVEL%"
],
"Linux": [
"cd \"$(ProjectDir)\"",
"Binaries\\ThirdParty\\Improbable\\Programs\\unreal_packager package --engineDir=\"$(EngineDir)\" --project=\"$(ProjectFile)\" --platform=\"$(TargetPlatform)\" --target=\"$(TargetType)\" --configuration=\"$(TargetConfiguration)\" -- -allmaps",
"exit /B %ERRORLEVEL%"
]
}
}
- Navigate two directories up to find the
spatialos.jsonfile. Edit thespatialos.jsonfile so that the"version"is“13.0.0”and save the file. Note that there are two places to edit the version.
The file should now look similar to this:
{
"name": "mySpatialOSgame",
"project_version": "1.0.0",
"sdk_version": "13.0.0",
"dependencies": [
{"name": "standard_library", "version": "13.0.0"}
]
}
- In the root directory of your project, run
spatial clean(again).
Make sure your version control system (VCS) is set to stop ignoring the Unreal SDK directories you have copied, specifically the directories under Game/Binaries/ThirdParty/Improbable and Source/SpatialOS which are ignored by default.
- Locate the VCS ignore file in your project’s Unreal worker directory.
- For example, in the Unreal Starter project on GitHub, the VCS ignore file to edit is in the
workers/unrealdirectory github.com/spatialos/UnrealStarterProject/blob/master/workers/unreal/.gitignore
- Edit the ignore file as below:
- Change the line
**/Binaries/to**/Binaries/* - Add the line
!Game/Binaries/ThirdParty/ - Delete the line
Game/Source/SpatialOS/*
- Change the line
You need to do this for every project you migrate.
Note: In all our starter projects (including Unreal Starter) downloaded before 2018-05-15 the version control ignore files are not set as above, so if your project is based on any of these starter projects, you need to edit the VCS ignore files.
In the root directory of your project, check that the upgrade and migration worked by running:
spatial worker build.
It’s worked when you see 'spatial build UnrealWorker UnrealClient' succeeded (or 'spatial.exe build UnrealWorker UnrealClient' succeeded).