Game ideas & features

Your next feature

Player values

Server-owned currencies, counters and energy. Define balances, offers and checked changes for each project.

SDK developRequires a player session
Godot
Illustration of Player values
Your visible result

Your game shows configured balances and offers. Purchases return the current player state.

Video coming later

This step does not have a video yet. The guide and MCP request are ready to use.

Player values

Prepare the same project

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

    Player values →
  2. Create or reuse these test entries in the dashboard form. These are example values, not current project data.

    Values
    coins: initialBalance=100, maxBalance=1000000; energy: initialBalance=10, maxBalance=100
    Allow direct changes
    false
    Offers
    energy-pack: costs=[{"key":"coins","amount":20}], rewards=[{"key":"energy","amount":5}]

    Starting balances apply once per value key. Direct changes are off by default. Validated Actions keeps its own per-run bounds; daily and balance caps come from these definitions. Blank optional limits mean no cap.

  3. Save, reload and verify the entries before running the example. Preserve unrelated definitions.

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.

This SDK example uses develop. Check whether the required APIs exist in your installed SDK.

Complete the Quickstart connection with the intended player. Call run_reviewed_action() from an explicit button or scene action. Opening the file alone sends no request.

GDScript
res://scripts/player_values.gd
horizOn call
1extends Node
2​
3# Existing configured SDK and authenticated player session required.
4# Invoke run_reviewed_action explicitly after reviewing this example.
5func run_reviewed_action() -> void:
6 if not Horizon.auth.isSignedIn():
7 return
8 var user_id: String = Horizon.auth.getCurrentUser().userId
9 var current: Dictionary = await Horizon.playerValues.getState(user_id)
10 if not current.success:
11 push_error(current.errorCode)
12 return
13 print(current.state.values)
14 # Authoritative balances only; never add a copied historical reward locally.
15 # Purchases and exact original retry use the official player_values_example.gd
16 # and pending_purchase.gd. Persist the original user/offer/operationId before send.
17 # Keep an uncertain or expired original; do not silently create another ID.
Open the complete SDK sample ↗

Test your new feature.

Your game shows configured balances and offers. Purchases return the current player state.

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

Endpoints
  • GET/player-values
  • GET/player-values/offers
  • POST/player-values/purchase
  • POST/player-values/adjust
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.