Get SpatialOS

Sites

Menu

Setup guide for Windows (64-bit)

This guide will prepare your Windows machine for local development with the SpatialOS SDK.

Note: You need to have access to SpatialOS to download the SDK.

1. System requirements

We support up-to-date versions of Windows 7 and 10.

Before following the setup guide check that your machine meets the hardware requirements.

2. Set up the SpatialOS CLI

To set up the SpatialOS CLI (spatial):

  1. Install chocolatey, the package manager, following the instructions at chocolatey.org/install.

  2. Open a terminal (PowerShell or cmd) and run:

    choco install spatial --yes
    

    This will install the CLI and put it in your PATH. By installing it, you agree to the SpatialOS EULA.

    Having trouble with Chocolatey? Try setting the SpatialOS SDK up manually instead.

  3. Check this succeeded by running spatial update in your terminal. You should get the output:

    Current version of the 'spatial' command-line tool: <version number>

    Attempting to download the latest version...

3. Set up external development tools

These steps depend on which SDK you’ll be using with SpatialOS.

3.1. (optional) Unity

To use the Unity SDK, even if you’ve already got Unity installed, you must follow these steps, because SpatialOS only supports specific versions of Unity, and requires specific build support.

Unity versions 5.5.3 and 5.6.0 have been tested with SpatialOS. Later versions may work fine, but have not been extensively tested.

  1. Choose one of the options below:

    • If you already have Unity 5.6.0 installed:

      In a terminal, run the following commands to install Unity build support for Linux and Mac, JRE, and MSVC Redistributable:

      spatial setup install-dependencies --sdk-version=12.0.4
      choco install --yes unity-linux --version 5.6.0
      choco install --yes unity-mac --version 5.6.0
      
    • If you have another version of Unity, or don’t have it installed at all:

      In a terminal, run the following command to install Unity 5.6.0, JRE, and MSVC Redistributable:

      spatial setup install-dependencies --sdk-version=12.0.4 --with_unity
      

    By running these commands you agree with the individual terms of each separate dependency.

    Run spatial setup install-dependencies --sdk-version=12.0.4 --help for more information.

  2. Restart your computer to complete the install process.

  3. If you didn’t already have Unity installed, run it and register or activate your license.

3.2. (optional) Unreal

To use the Unreal SDK, you must build the Unreal engine from source:

3.2.1. Install dependencies

  1. In a terminal, run the following command to install JRE and MSVC Redistributable:

    spatial setup install-dependencies --sdk-version=12.0.4
    

    By running this command you agree with the individual terms of each separate dependency.

    Run spatial setup install-dependencies --sdk-version=12.0.4 --help for more information.

  2. Restart your computer to complete the install process.

  3. If you don’t have it already, install Visual Studio 2015.

  4. If you don’t have it already, install the Windows SDK 8.1.

3.2.2. Get the Unreal Engine source

To use the Unreal SDK, you need to build the Unreal Engine 4 from source. To get the source and set it up to build:

  1. Check if you have access to the Unreal Engine 4 GitHub repository.

    If you don’t, follow these instructions to get access.

  2. Clone the repository and check out the 4.16.3-release branch by running either of these commands in a Git bash terminal:

    • via HTTPS: git clone https://github.com/EpicGames/UnrealEngine.git -b 4.16.3-release
    • via SSH: git clone git@github.com:EpicGames/UnrealEngine -b 4.16.3-release
  3. Navigate to the root of the cloned repo.

  4. Open a terminal as an administrator. Run the following command to add a system environment variable named UNREAL_HOME, using the path to the directory you cloned into above (for example, D:\Work\UnrealEngine):

    setx UNREAL_HOME "path to cloned directory" /m
    
  5. Restart your terminal and run echo $env:UNREAL_HOME (PowerShell) or echo %UNREAL_HOME% (cmd) to make sure that the new environment variable is registered. This should output the path to the directory you cloned into above. For example, D:\Work\UnrealEngine.

3.2.3. Build Unreal Engine

To build Unreal workers for SpatialOS deployments, you need to build targeting Linux, which requires cross-compilation of your SpatialOS project and Unreal Engine.

Note: Building Unreal Engine from source could take up to a few hours. Just so you know!

  1. Follow the compiling for Linux setup guide for UnrealEngine 4.16, installing the Linux-x86_64 cross compile toolchain. You don’t need to follow the “Packaging for Linux” section.
  2. After following the Linux setup instructions, restart your terminal and run echo $LINUX_MULTIARCH_ROOT to make sure that the new environment variable is registered. This should output the path to the clang v8 directory that you installed in the previous step.
  3. Navigate to the directory you cloned the Unreal Engine source code into. For example, D:\Work\UnrealEngine.
  4. In this folder, run the batch file Setup.bat.

    This will install prerequisites for building Unreal Engine 4.

  5. While running the batch file, you should see Checking dependencies (excluding Mac, Android).... If it says excluding Linux too, make sure that you set the environment variable LINUX_MULTIARCH_ROOT correctly, and run the batch file again.

  6. In the same directory, run the batch file GenerateProjectFiles.bat.

    This sets up the project files required to build Unreal Engine 4.

  7. Open UE4.sln in Visual Studio 2015.

  8. In the Build > Configuration Manager window, set your solution configuration to Development Editor and your solution platform to Win64.

  9. In the Solution Explorer, right-click on the UE4 target and select Build (you may be prompted to install some dependencies first).

    UE4 target

    This builds Unreal Engine, which can take up to a couple of hours.

  10. Once the build succeeds, search for Automation Tool project in the solution explorer, right-click it and click Build.

You have now built UnrealEngine 4 to support cross-compilation for Linux.

Warning: Once you’ve built the Unreal Engine, don’t move it into another directory: that will break the integration.

4. (optional) Install the launcher

If you want to run a game client to connect to a SpatialOS game running in the cloud, you must install the Launcher.

  1. Download the Launcher.
  2. Follow the instructions in the installation wizard.

5. Next steps

You’ve now set up your machine for development with SpatialOS!

Recommended: To learn how to use SpatialOS and experiment with its main APIs, try our tutorials:

If you’d just like to find out about what SpatialOS is:

To get started building something of your own, go to github.com/spatialos and use one of the repositories there as a starting point.

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums