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
Unity
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 RunReviewedAction() from an explicit button or scene action. Opening the file alone sends no request.

C#
Assets/Scripts/PlayerValuesDemo.cs
horizOn call
1using UnityEngine;
2using PM.horizOn.Cloud.Core;
3using PM.horizOn.Cloud.Manager;
4​
5// Existing SDK/project configuration and authenticated player session required.
6// Call RunReviewedAction explicitly after reviewing this example and its data.
7public sealed class PlayerValuesDemo : MonoBehaviour
8{
9 public async void RunReviewedAction()
10 {
11 var sessionUser = UserManager.Instance.CurrentUser;
12 if (sessionUser == null || !sessionUser.IsValid()) return;
13 var userId = UserManager.Instance.CurrentUser.UserId;
14 var current = await PlayerValuesManager.Instance.GetState(userId);
15 if (!current.IsSuccess) { Debug.LogWarning(current.ErrorCode); return; }
16 foreach (var value in current.State.values) Debug.Log(value.key + "=" + value.balance);
17 // This minimal first call reads authoritative balances, never a local reward delta.
18 // For purchases and original retry, import PlayerValuesExample and its
19 // PendingPlayerValuesPurchase helper from the official SDK samples.
20 // Persist the complete original user/offer/operationId before one send.
21 // An uncertain or expired original must never become a fresh purchase ID.
22 }
23}
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.