Get SpatialOS

SpatialOS

Company

Careers

Sites

The SpatialOS GDK for Unreal: go beyond a single Unreal Engine server

Three months ago, we entered the pre-alpha phase for the SpatialOS Game Development Kit (GDK) for Unreal Engine: we outlined our vision and started open development, inviting adventurous early adopters to join our community and give feedback on their experience.

Today, we are thrilled to announce that, in large part thanks to the invaluable feedback from our community, the GDK is now ready to be used for building projects using Unreal Engine. All the core building blocks and supporting resources for you to start building more advanced Unreal Engine multiplayer games are now available – and it’s free to get started. We’re really excited to find out what you think of it.

For anyone not already aware, SpatialOS is a platform for creating games that go beyond the limits of a single server, enabling you to implement new kinds of gameplay that would be impossible with the traditional client-server approach. It’s a fully managed service, meaning that we do all of the work required to host and scale your game globally while you focus on finding the fun in your game. The GDK for Unreal allows you to seamlessly integrate SpatialOS with Unreal Engine 4.

Our Survival tech demo from GDC 2018 showed a glimpse of what’s possible with SpatialOS and Unreal Engine. It hosted up to 1000 concurrent players in a single “shard” with 10,000 AI opponents and 100,000 other individual game objects, like trees and rocks, in a 400km2 world.

The GDK’s key goals

When building the GDK, we followed a number of goals that shaped its feature set, both in this initial release and in our roadmap beyond.

Multiserver support

This first goal will be no surprise to our existing community. We have built a fully managed service for online multiplayer games built with Unreal Engine. That means we provide all the tools and services required to host, scale and run your game globally, allowing you to focus on delivering your game design and finding the fun.

The GDK enables multiple servers to communicate with each other using familiar Unreal semantics, so you can tap into more computing power than a single server provides. This means games with more players, Actors and gameplay systems than previously possible.

After achieving parity with Unreal’s networking API in pre-alpha, we focused on extending it to achieve multiserver support and implemented handover properties, cross-server RPCs, overlapping server boundaries, and more, which you can read about in detail in the features section below.

An Unreal-native experience

The Unreal character controller working with SpatialOS in server-authoritative mode, enabling running and shooting across server boundaries

The second key goal we followed is keeping traditional workflows and networking APIs familiar to Unreal Engine developers while introducing new native-feeling concepts that supercharge Unreal’s networking – turning a single-authority engine into a distributed one.

This enables the GDK to maintain parity with Unreal’s networking API and retain the functionality of the networking features Unreal offers out of the box: transform synchronization, character movement controller, client-side prediction, etc.

It is also a way to retain familiar Unreal Engine development workflows – blueprints work the same, and with the newly implemented Dynamic typebindings and SpatialType modifiers, the GDK’s iteration speed matches that of Unreal Engine itself.

Easy to get started

Finally, we wanted to make sure it is easy to get started with the GDK, including porting your current multiplayer Unreal game onto SpatialOS. The Unreal-native goal of the GDK, maintaining parity with Unreal’s networking API and workflows, helped achieve this. Alpha also brings an upgraded Starter Project, Unreal 4.20 support (which many of our customers requested for their current projects) and a detailed Porting Guide.

Next steps: performance and scale

Having focused on a seamless SpatialOS integration and development experience for our initial release of the GDK for Unreal, we will now shift our focus towards optimising performance and scale.

To this end, we are planning to build scale tests and share the results with you, to provide guidance on what you can expect. We will instrument our codebase to allow you to see the performance characteristics, and find improvements in network, CPU and memory utilisation.

To ensure SpatialOS continues offering a great development experience as games scale, we will also work on our authoring tools to facilitate large-world composition and fill gaps in our workflow for streaming level support. We know each game has different needs, so giving you the ability to fine-tune replication frequency and granularity is a priority for making sure you are able to achieve the scale you want.

Key features in this release

Let’s dive into some of the key features in the GDK which helped us achieve our goals. (If you were using the GDK in pre-alpha, you may want to go through these release notes instead.)

Multiserver support

Cross-server RPCs

Distributing a game across multiple servers requires a brand new way to communicate with Actors that live on other servers. For this, we came up with the concept of “cross-server RPCs”. Declaring a cross-server RPC is as simple as any other kind of RPC, both in C++ and Blueprint. You simply call it via a non-authoritative Actor on the server or an Actor proxy (coming soon!) and it will automatically be routed to the right server.

For example, here’s what a cross-server RPC would look like:

UFUNCTION(CrossServer)
void TakeDamage(int Damage);

Overlapping server boundaries

To ensure stable interaction across server boundaries, there should be an area of overlap between what each server can “see”. However, SpatialOS dictates that there is only one server authoritative for each Actor. This creates a virtually unprecedented situation in Unreal where a server is not authoritative over Actors it sees. We have made modifications to the engine and implemented a dynamic role and authority scheme to accommodate this phenomenon.

An AI following a player across server boundaries. The AI changes its material every time authority is handed off.

An Unreal-native experience

Dynamic type bindings

In the pre-alpha, the “glue layer” between Unreal and SpatialOS was compile-time. Which meant that after every change, you had to generate additional code and compile again for SpatialOS to understand the latest Unreal code or Blueprint. Naturally, this was a major barrier to productivity, taking up to 3-5 minutes at a time.

Now, the interoperability between Unreal and SpatialOS is handled fully at runtime, so the compilation overhead is completely gone and iteration with the GDK is virtually as fast as with Unreal. Check out this docs page to find out more if you’re curious.

Automatic class replication

In the pre-alpha, telling SpatialOS that it should replicate an Unreal class was done manually in the Editor. This was time-consuming and increased the risk of input errors. Discovery of classes is now handled automatically. The GDK now automatically finds all the classes SpatialOS needs to know about and generates the appropriate replication code.

Ability system

The Unreal Engine 4 Ability System is a powerful tool for implementing robust gameplay abilities, used in games such as Paragon and Fortnite. The GDK alpha introduces support for replication of arbitrary subobjects, meaning that we now have limited support for the Ability System out of the box. We are planning on having full-fledged ability system support in the future.

Easy to get started

It is now very easy to get started with the GDK by porting your already existing game or prototype. Pre-release versions of the SpatialOS GDK for Unreal are already being used by celebrated game developers. Aaryn Flynn, former General Manager of BioWare, used Unreal Engine to build hits like the Mass Effect trilogy. Now, as Improbable’s General Manager, North America, he and his team are using Unreal Engine to build original demonstrative game content highlighting the unique possibilities of SpatialOS.

“Developers want technology to enable their vision and enhance their creativity,” said Flynn. “The new SpatialOS GDK unlocks new possibilities within Unreal Engine, empowering developers to make many game servers work together and act as one in a way that is seamless to players.”

“To turn your vision into a prototype and iterate on it to make a successful game, you need the best tools,” says Flynn. “I believe that SpatialOS is already transforming how people make and play games and that this GDK smooths the path for developing existing and future games, whether that’s simple multiplayer or something more ambitious and enormous.”

Scavengers is Midwinter's forthcoming game, built on SpatialOS and Unreal.

Scavengers is Midwinter’s forthcoming game, built on SpatialOS and Unreal.

Similarly, Midwinter Entertainment, a Seattle-based studio featuring veterans of the Halo, Battlefield, Call of Duty and Gears of War franchises, has just done that with their new Unreal Engine-based game Scavengers. This is what founder Josh Holmes said about their experience with GDK Alpha:

“Our goal with Scavengers is to combine elements like map scale, player numbers and the amount and sophistication of AI enemies to create a new kind of game experience. That made Unreal Engine and SpatialOS a natural choice. Midwinter Entertainment has partnered closely with the team at Improbable to inform the development of the SpatialOS GDK for Unreal. The vision for the GDK is to empower developers to create and support any type or size of game world,  while maintaining the familiarity and ease of use of the Unreal Engine and its workflows.”

All the learnings and best practices from Midwinter and others are now captured in our porting guide, which you can follow to jumpstart your SpatialOS experience. To make things even easier, you can use the networking switch feature to go back and forth between Unreal and Spatial networking.

Happy Developing!

To get started, we recommend you follow the multiserver shooter tutorial to get a taste of what the GDK and the SpatialOS platform can provide. Then you can either start from scratch using our Starter Project as a base or, if you have an existing Unreal game, you can kickstart your SpatialOS journey by porting to the GDK.

We’d love to hear what you think – join our community on Discord or our Forums.