Game ideas & features

Your next feature

Cloud Save

Save game progress and load it on the next launch.

Requires a player session
Godot
Illustration of Cloud Save
Your visible result

Saved progress loads again after restarting the game.

Inspect a cloud save1:56
Open video separately ↗

Prepare the same project

  1. Choose the same project in the dashboard as in your game configuration.

    Cloud Save →
  2. No additional definition is needed for the first request. An empty result is valid until matching game data exists.

    Use a test player. This example replaces their save with level 5 and 1000 coins.

Build this feature

You can preview the guide. Running it requires an active project key. Prepare project

SDK installed, project configuration imported and player signed in.

Save the GDScript, attach it to a node in the main scene and run it. Check Output.

GDScript
res://scripts/cloud_save.gd
horizOn callSetup
1# Attach this script to a node in your main scene.
2extends Node
3​
4​
5func _ready() -> void:
6 # Setup: initialize, connect and sign in a player.
7 var connected = await Horizon.connect_to_server()
8 if not connected:
9 print("Failed to connect to horizOn server")
10 return
11 if not Horizon.auth.isSignedIn():
12 var signed_in: bool
13 if Horizon.auth.hasCachedAnonymousToken():
14 signed_in = await Horizon.auth.restoreAnonymousSession()
15 else:
16 signed_in = await Horizon.auth.signUpAnonymous("StatisticsPlayer")
17 if not signed_in:
18 return
19​
20 # horizOn: save the player data and load it again.
21 # Save a JSON object, then read it only after the save succeeds.
22 var data: Dictionary = {"level": 5, "coins": 1000}
23 var saved: bool = await Horizon.cloudSave.saveObject(data)
24 if not saved:
25 push_warning("Cloud save failed")
26 return
27 var loaded: Dictionary = await Horizon.cloudSave.loadObject()
28 print("Loaded level=", loaded.get("level"), ", coins=", loaded.get("coins"))
Open the complete SDK sample ↗

Test your new feature.

Saved progress loads again after restarting the game.

Choose the same project in the dashboard as in your game configuration.

Endpoints
  • POST/cloud-save/save
  • POST/cloud-save/load
All endpoints in the API reference
Our suggestion for your next step

Give every round a high score.

Save the score after a round and show who's ahead. Keep using your connection and player session.

Tutorial video

Cloud SaveGodot4:06
Open video separately ↗