Game ideas & features

Your next feature

User Logs

Record a relevant event for the signed-in player.

BASIC planRequires a player session
Godot
Illustration of User Logs
Your visible result

A test event is linked to the correct player in the dashboard.

Explore user logs2:37
Open video separately ↗

Prepare the same project

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

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

    User Logs requires BASIC or higher.

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.

Needs the BASIC plan or higher.

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

GDScript
res://scripts/user_logs.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: write log entries with a severity.
21 # Write structured logs with a severity level
22 await Horizon.userLogs.info("Tutorial completed")
23 await Horizon.userLogs.warn("Low memory", "MEM_LOW")
24 await Horizon.userLogs.error("Save failed", "SAVE_001")
Open the complete SDK sample ↗

Test your new feature.

A test event is linked to the correct player in the dashboard.

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

Endpoints
  • POST/user-logs/create
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.