Try SpatialOS

Sites

Menu

Scheduled maintenance

You need to set up some prerequisites before you can follow these steps.

Run all commands from the project root folder.

Follow these steps if:

  • you need to do regular, scheduled maintenance
  • Improbable notifies you in advance of a destructive cluster take-down
  1. Around 20 minutes before you remove players from the game, create a worker flag to let players know how long they have until the game stops:

    1. In the Console, open the deployment and go to the Worker flags tab.
    2. From the drop-down list, select the worker type that you registered the callback for, and add a worker flag with the same name as you used when setting up the callback.
    3. Set the flag’s value. This is handled by the callback you set up above. For example, you could set the value to be a message to display to players.
    4. Click Submit. This sends the flag update to the worker.
  2. Five minutes before you remove players from the game, let them know by updating the worker flag.

  3. Wait for 5 minutes.

  4. Remove all the players from the game.

    We don’t provide any out-of-the-box ways of doing this, so you’ll need to write your own.

  5. Take a snapshot of the deployment without players in it:

    spatial cloud history snapshot create <deployment_name>
    
  6. Download this snapshot:

    spatial project history snapshot download <deployment_name> latest <snapshot_file>
    

    where snapshot_file is the file name you want to give the snapshot.

  7. There may be elements of the game world that you want to edit or remove before restarting, such as battle debris or timestamps. To do this, you’ll probably need to convert the snapshot into a text file:

    spatial project history snapshot convert --input=<snapshot_file> --output=<text_file> --input-format=binary --output-format=text
    

    When you’ve finished editing the file, convert it back:

    spatial project history snapshot convert --input=<text_file> --output=<snapshot_file> --input-format=text --output-format=binary
    
  8. From your project folder, run a cloud deployment using the snapshot:

    spatial cloud launch <assembly_name> <launch_config> <deployment_name> --tags=<comma-separated list of tags> --snapshot=<snapshot_file>
    

    If you’re using a tag (such as a Steam tag) to control access to the game, don’t include this in the list of tags - you don’t want players to be able to connect until you’ve validated the deployment.

  9. Validate the deployment from the Console.

    1. On the Advanced tab, confirm that all nodes are healthy: nodes healthy
    2. In the World view, check you have the right number of different types of worker: workers healthy

    It’s also a good idea to run an end-to-end connection test (either manually or automatically) in which a client connects to the game and performs an action (for example, jumps and shoots a wall down). We don’t provide anything out-of-the-box for automating these steps, so get in touch if you’d like help with this.

  10. If you’re using a tag (such as a Steam tag) to control access to the game, add this tag so that players can join the game again:

    spatial project deployment tags add <deployment_name> <tag_name>
    
  11. Let your community know they can join the game again.

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums