The SpatialOS Unreal GDK: a deeper look

15 June 2018

We hope you caught our last post announcing our work on the Unreal and Unity GDKs which explained why we’ve chosen to change focus from SDKs to GDKs. This update delves deeper into how we chose this approach and gives a brief overview of how it works, our goals going forward and an update on our progress to date. Most importantly, it tells you how you can get involved.

For those of you that are not already part of the SpatialOS community, here’s a quick summary: SpatialOS is a platform for building games that go beyond the limits of a single server, allowing you to implement new kinds of gameplay, that would have been impossible with the traditional client-server approach. It is also a fully managed service; we host and scale your game globally, and provide tools and services to easily deploy, understand and iterate on your game. To find out more about SpatialOS, go here. This post is about our new Unreal Game Development Kit (GDK) for SpatialOS, which allows you to access the power of the platform through Unreal, and replaces an older SDK which didn’t integrate so closely with Unreal’s workflows.  (You can sign up here to get updates about our Unreal GDK here and our Unity GDK here.)

The experiment and breakthrough

The goal of the Unreal GDK is to allow Unreal developers to use all the things they love about Unreal while being able to take advantage of the SpatialOS platform. The workflow aims to be as native to Unreal as possible so that any experienced Unreal developer can easily start making a SpatialOS game.

Late last year, a small team of engineers was formed, focused on proving this idea would work. The team was led by Callum Lawson who has been at the forefront of helping Improbable’s customers since the beginning. He was supported by a team including Giray Özil who has a decade of engine programming experience with Blizzard and EA (and claims he can draw a Ninja Turtle in 5 seconds, though this remains untested).

The result was the first prototype of the SpatialOS Unreal GDK (Game Development Kit). The existing SpatialOS workflow required users to define entities and components as schema outside of the Unreal engine and to use proprietary APIs to interact with the network. By contrast, the GDK prototype showcased a workflow where game developers could create and replicate Unreal Actors’ movements between clients on a SpatialOS deployment using the same replication API as Unreal’s and an Unreal network connection.

We explored several options but ultimately chose to replace Unreal’s UIpNetDriver (which orchestrates replication in Unreal) with a USpatialNetDriver. This will handle the SpatialOS connection and translate Unreal’s native replication updates and RPCs into SpatialOS commands and component updates.

Unreal dedicated server default replication diagram Unreal GDK prototype replication

The SpatialOS model differs significantly from Unreal Engine when it comes to replicating an Actor. Our design will not replicate Actors to each player individually, as Unreal would. Instead, we update the SpatialOS simulation, and it’s SpatialOS which handles distributing this data to connected clients, so data is not sent multiple times to each interested client.

This experiment was a significant breakthrough, proving that it is possible to design a truly native game engine experience for games that run on the SpatialOS platform. Seeing this, we upgraded the small temporary team to a larger, official team who will now work on the Unreal GDK full time, and we established some firm goals for the project.

Goals for the Unreal GDK

Keeping it Unreal

The GDK sticks to Unreal workflows as much as possible, using Unreal’s networking and multiplayer APIs. While the GDK implements some changes to the API, turning Unreal’s single authority engine into a distributed one, these are only minimal API modifications. This means Unreal developers using the GDK can easily learn to develop games on SpatialOS and begin prototyping SpatialOS games quickly.

Unreal without limits

Game development always starts with a vision of the ideal final product, but all too often games are forced to sacrifice some part of that  vision due to technical limitations. As an example, an Unreal dedicated server can only be as powerful as the single machine that is running it, which can quickly become a bottleneck in games with high entity counts or complex gamelogic. Classic limits like this are seen in the Battle Royale genre only being able to support 100 players.

However, with SpatialOS and the Unreal GDK you don’t have to make these technical tradeoffs. The power of SpatialOS is its ability to spread computation across multiple engines and servers, allowing for far more complex games and much higher player counts.

Port existing games

Often developers don’t know or aren’t ready to expand their game beyond the limits of a single server until much later in the development cycle or even until after the game has launched. The GDK will strive to make it as simple as possible to port existing Unreal prototypes or games from an Unreal dedicated server to SpatialOS.

Comprehensive references in an example game

From speaking to many game developers, we understand the importance of demos and examples in creating a successful game. That’s why we are shipping the GDK with a example game from the outset. The game will act as a useful reference that demonstrates best practices for developing with the GDK on the SpatialOS platform.

Sign up for future updates.