Game ideas & features

Your next feature

Shared objects

Share opaque game data through explicit access policies, indexed queries and original revisions.

SDK developRequires a player session
Unity
Illustration of Shared objects
Your visible result

Read the owner usage before creating. Creation uses its revision; update and deletion use the original object revision. Owner, group and creation expiry stay unchanged.

Video coming later

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

Shared objects

Prepare the same project

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

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

    Key
    bases
    Read policy
    all
    Write policy
    owner
    Grid position
    true
    Maximum object bytes
    1024
    Maximum objects per owner
    1

    Keys stay reserved. After first use, policies, search schema, TTL and position are immutable. Archive blocks new writes; reads and deletion remain available.

    This first example reads data. It creates no group, match or object. An empty list is a valid first response.

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

C#
Assets/Scripts/SharedObjectsDemo.cs
horizOn call
1using UnityEngine;
2using PM.horizOn.Cloud.Manager;
3using PM.horizOn.Cloud.Objects.Network.Responses;
4​
5public sealed class SharedObjectsDemo : MonoBehaviour
6{
7 // Initialize/connect and restore the existing player in the Quickstart first.
8 // Wire an explicit player action; do not add this read to a startup/poll loop.
9 public async void ReadWorldMap()
10 {
11 var user = UserManager.Instance.CurrentUser;
12 if (user == null || !user.IsValid()) return;
13 var result = await SharedObjectsManager.Instance.QueryObjects(user.UserId, "bases", new SharedQuery {
14 mode = SharedQueryMode.Rectangle,
15 minX = -10, maxX = 10, minY = -10, maxY = 10, limit = 20
16 });
17 if (!result.IsSuccess) {
18 Debug.LogWarning(result.ErrorCode);
19 return;
20 }
21 foreach (var item in result.Data.objects) {
22 byte[] bytes = item.data; // Opaque game bytes; validate your game's own format.
23 Debug.Log($"Object {item.id}: {bytes.Length} bytes");
24 }
25 // Respect result.Data.pollAfterSeconds; no automatic poll or next-page loop.
26 // Keep exact dataBase64 and typed search metadata unchanged on metadata edits.
27 // Persist original target, bytes and If-Match revision before a single mutation.
28 // Unknown CREATE: explicit GetRecoveryUsage/QueryRecoveryObjects; never resend.
29 // Generic/defense/ranked VA starts share one start/submit lease; do not replace a pending run.
30 // Trusted validation and durable ordinary Inbox delivery belong to the game backend.
31 }
32}
Open the complete SDK sample ↗

World map

Store owner bases as opaque bytes. Query a configured integer grid rectangle explicitly; update with the original object revision. Position is a query index, not a game-rule validator.

Asynchronous PvP

Choose an opponent through a bounded nonuniform integer query. Load their defense bytes and validate play with a server-owned Validated Actions run. Only a trusted backend decides the outcome and sends an immutable Inbox notice.

Use matching player sessions, a durable original write intent and explicit bounded reads. Trusted outcome validation and Inbox delivery belong on your game backend; Account Keys never belong in game builds.

Test your new feature.

Read the owner usage before creating. Creation uses its revision; update and deletion use the original object revision. Owner, group and creation expiry stay unchanged.

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

Endpoints
  • GET/shared-objects/collections
  • GET/shared-objects/{collection}/usage
  • GET/shared-objects/{collection}/objects/{objectId}
  • POST/shared-objects/{collection}/query
  • POST/shared-objects/{collection}/objects
  • PUT/shared-objects/{collection}/objects/{objectId}
  • DELETE/shared-objects/{collection}/objects/{objectId}
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.