Multiserver offloading


Step 1: Running the Gym

Let’s start by opening the Crashbot Gym and verifying it’s current behavior.

  1. Open the Example Project in the Editor.
  2. In the Content Browser, open Maps/Crashbot_Gym.
  3. Once the map is loaded, Generate Schema & Snapshot.
  4. When generation is complete, hit Play.

You should see the Crashbots running towards the turrets and the turrets shooting them.

Watch out, the turrets will also shoot you!

Step 2: Adding a new Server Worker

The next step is to define a new server-worker and instruct the GDK to run an instance of it.

  1. Stop the game.
  2. Go to the SpatialOS Runtime Settings panel.
  3. Navigate to the Offloading section at the bottom.
  4. Check the box to Enable Offloading.
  5. Go to the SpatialOS Editor Settings panel.
  6. In the ‘Launch’ section expand the ‘Launch configuration file options’ property.
  7. Add a new element to the ‘Server Workers’ Array using the ‘+’.
  8. Expand the new element and set the ‘Worker Type Name’ to CrashbotWorker.
  9. Use the toolbar to generate a new snapshot that will support the new server worker.
  10. Hit Play, the GDK should restart your local deployment to support the new server worker.
  11. Open up the inspector and verify the CrashbotWorker is running.

Step 3: Creating an Actor Group

Now that you have a new server worker running, you need to offload Actors to it. This is done using ‘Actor Groups’

An Actor Group is a named set of Actor Classes that is owned by a server worker. In order to offload the Crashbots, you must define a new Actor Group containing the Crashbots and their Weapons.

  1. Stop the game.
  2. Go to the SpatialOS Runtime Settings panel.
  3. Navigate to the Offloading section at the bottom.
  4. Add a new element to the ‘Actor Groups’ Map.
  5. Name the new group Crashbots and set its ‘Owning Worker Type’ to CrashbotWorker.
  6. Add an element to the ‘Actor Classes’ Set and select BP_Crashbot.
  7. Add BP_Crashbot_Rifle to ‘Actor Classes’ as well.
    Final Actor Group Configuration

Step 4: Verifying the Results

You can verify everything is working correctly using the Inspector.

  1. Since you’ve changed Actor Group configurations, you’ll need to restart the deployment by pressing Stop, then Play
  2. Once the game is running, you should see the Crashbots running forwards and getting shot as usual.
  3. Open the inspector, select the CrashbotWorker and UnrealWorker in the Workers tab.
  4. In the ‘Show Me’ tab, select ‘Authority / Interest’ and ‘Authority area’.
  5. You should be able to see that CrashbotWorker has authority over the Crashbots and that UnrealWorker has authority over the turrets & player.

> Next: 2: Gameplay changes

2019-08-29 Page updated without editorial review: added setting up offloading and removed pre-set configurations
2019-07-30 Page added without editorial review

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums