At Improbable, we get a lot of questions about SpatialOS, and in particular how it works with game engines. We thought it would be helpful for the developer community if we explained how SpatialOS works and how developers use game engines with it.
The most important points we will cover are:
SpatialOS is a cloud platform for developing and hosting multiplayer games. It empowers developers to create innovative games which are able to use more than one game server in a single instance. This means that games powered by SpatialOS can vary from smaller-scale session-based titles to persistent worlds with very large scale, high player count and much complexity.
SpatialOS is made up of a number of different services that are designed to work together:
The SpatialOS Worker Service allows developers to upload server executables and host them on our cloud platform. We call these executables workers. Workers are often game engine dedicated servers, but can also be made from custom-built code written in C#, C, C++, or Java. This is not something we dictate - it’s up to the developer. Workers run in containers, in a similar fashion to other hosting services.
The SpatialOS Runtime is our unique networking solution. It allows game clients and game servers (running in the Worker Service) to communicate with each other. The Runtime also has an entity database which saves the state of your game world.
The SpatialOS SDK is a set of packages that developers can use to build games that use these cloud services. This is similar to how cloud providers like Amazon’s AWS, Google’s GCP or Microsoft’s Azure provide an SDK. It contains:
The Worker Service is similar to other game server hosting options (e.g Kubernetes or GameLift). Our platform manages the lifecycle of workers, scaling the number of them according to a load balancing policy decided by the developer. It also manages worker failures and can restart them when they crash.
It is neither. SpatialOS is a set of cloud services for hosting and networking game engines, but it is not built using them. The only game engines present are those a developer uploads and runs on our platform as part of their game.
Games almost always use a game engine as a game client. They usually also use a game engine for server-side logic (running in our Worker Service).
No. Running game engines server-side can be useful to prevent cheating, or when you want to run the same code on clients and servers for predictive purposes. However, many games only need simpler workers (not full game engines) to run, which can be built without an engine; some developers have even used scripting languages like Lua on top of our C SDK.
It’s possible to use almost any commercial or open source game engine with SpatialOS. For example, Improbable and CRYENGINE are working to deliver official support for CRYENGINE and SpatialOS. However, the game studio Automaton Games has already built SpatialOS support for CRYENGINE. To do this, they used the C++ SDK. You can take a look at their code on Github.
We hope these points were useful in explaining more about how SpatialOS works with game engines.