This guide shows you how to offload the computation of AI characters from the out-of-the-box single Unreal server-worker instance onto a second server-worker instance dedicated to AI Actors.
Image: The red team controls the control point in the Example Project’s offloading demonstration map
This guide shows you how to set up multiserver offloading on Windows only. To set up and run SpatialOS games in the cloud, you need to use a Windows machine for development. We recommend using a Windows machine as your main development environment and macOS for developing and testing game clients on iOS.
Out of the box, the GDK for Unreal starts one server-worker instance when you run your game. This main Unreal server-worker instance computes all Actor types across the whole game world.
You can set up additional server-worker instances to load balance the computation. There are different ways to do this: offloading, zoning, and offloading and zoning together.
When you set up offloading, you divide the compute load between the main Unreal server-worker instance and one or more additional (“offloaded”) server-worker instances. Each instance computes one or more sets of Actor types across the whole game world.
You can use these offloaded server-worker instances to handle computationally expensive but latency-tolerant systems, such as AI decision-making. This leaves your main server-worker instance to run other game systems at a larger scale.
In zoning, you split the game world into geographical areas and each area has a main Unreal server-worker instance computing all the Actors in that area only. With zoning, Actors change the server-worker instance which computes them during the game by moving across a computation boundary.
(Zoning is currently (in preview) and not in the scope of this guide.)
Offloading and zoning together
You can use both offloading and zoning together, by setting up zoning to split the game world into geographical areas and offloading to assign computationally expensive systems to dedicated server-worker instances.
(Offloading and zoning together is not in the scope of this guide.)
The offloading demonstration map
The Example Project includes a first-person-shooter map to demonstrate offloading. The map is a level in the Example Project game where the game player fights several non-player character (NPC) bots. In the game:
- if the game player is killed, there’s a ‘killed’ message displayed on screen
- after the game player has captured the control point, all NPC bots that are killed join the game player’s team when they respawn
This guide shows you how to configure the Example Project to offload computation of the first-person-shooter map’s AI Actors (the NPC bots in the game) onto a dedicated AI server-worker instance.
2020-06-19 Page updated with editorial review: rewrite for new tutorial
2020-02-24 Page updated with editorial review
2019-08-29 Page updated without editorial review: clarified overview of tutorial
2019-07-30 Page added without editorial review
Updated about a month ago