Now you can start a local deployment of your game.
To start the deployment:
Image: The Schema button on the GDK toolbar
- Select Start Deployment. This starts a local SpatialOS deployment. Your game is ready to play when you see the output
SpatialOS runtime startup completed in ....in the Editor’s SpatialOS Output log window.
Image: The Start Deployment button on the GDK toolbar
- On the Unreal toolbar, select Play to open the drop-down menu.
Image: The Play button on the Unreal toolbar
- In the drop-down menu, under Multiplayer Options, do the following:
- Set Number of players to
- In Net Mode, select Play As Client
- Select SpatialOS Networking
- Set Number of players to
Image: The Unreal toolbar Play drop-down menu, with Multiplayer Options highlighted
- Under Modes, select New Editor Window (PIE) to run the game. This starts one SpatialOS server-worker instance and two SpatialOS client-worker instances locally, in your Unreal Editor.
Image: The Unreal toolbar Play drop-down menu, with New Editor Window (PIE) highlighted
The server-worker instance is acting as an Unreal server and the two client-worker instances are acting as two Unreal game clients (as would be used by two game players).
You can switch between the two Editor windows to see and interact with each game client.
- If the game does not run automatically after selecting New Editor Window (PIE), on the Unreal toolbar, select Play to run the game.
Image: On the Unreal toolbar, select Play
- When your game is running, select Inspector to open the Inspector in your default web browser. The Inspector is a web-based tool that you use to explore the internal state of a SpatialOS world. It gives you a real-time view of what’s happening in a local or cloud deployment. Selecting Inspector opens the Inspector for local deployments in your browser.
Image: On the GDK toolbar, select Inspector
- When you’re done, select Stop on the Unreal toolbar to stop your PIE session.
Image: On the Unreal toolbar in the Editor, select Stop
To run a local deployment with managed workers, or a cloud deployment, take a look at the Starter Template guide.
You have now ported your Unreal game to the GDK.
The main menu loads when you launch a local deployment
You might need to add an explicit name to configure the map file. Add the map name (for example "Control_Medium" or "Control_Small" for the Example Project) as the third argument to the bottom of the file inside
<ProjectRoot>/spatial/workers/unreal/spatialos.UnrealWorker.worker.json for the Linux configuration.
Note: This is a game-specific fix because the Example Project has custom logic to manage its match states and load maps, so it may not be applicable to your launch issue.
There’s a warning dialog box about the Runtime.
You can only have one instance of the SpatialOS Runtime. If there is an instance of the SpatialOS Runtime running with another project, a warning dialog box appears.
Select Yes to stop that instance and start the Runtime for your current project.
There's a Windows Defender Firewall message (Windows only).
When you start a local deployment for the first time, you might see a Windows Defender Firewall message stating that it has blocked some features of runtime.exe. Select Allow access to continue and open the Unreal Editor.
There's a macOS warning about incoming network connections (macOS only).
When you start a local deployment for the first time, you might see a warning message asking you if you want to accept incoming network connections. Select Allow to continue and open the Unreal Editor.
> Next: 4. Logs and modifications
2020-09-07 Page updated with editorial review: corrected path to JSON file in Troubleshooting
2020-08-19 Page updated with editorial review: updated procedure to reflect changes in Unreal 4.25
2020-06-25 Page updated with editorial review: added macOS, mobile, UI and deployment workflow changes
2019-08-02 Page updated with editorial review: updated project
2019-07-16 Page updated with editorial review
Updated about a year ago