Back to RCADIADeveloper Docs
Tournament SDK

Tournament SDK

Score submission, lives consumption, and leaderboard entry. Three postMessage events — drop in under five minutes.

STABLEProduction-ready

Opt in to tournaments, entry fees, prize pools, and global leaderboards. Skip this SDK if your game is a showcase or portfolio piece — it'll still upload and play without any code.

What it does

  • INITIALIZE — connects your game to the platform on load
  • CONSUME_LIFE — deducts a tournament life when the player dies
  • SUBMIT_SCORE — posts the final score to the tournament leaderboard

The platform handles auth, prize pools, payouts, and leaderboard ordering. Your game reports events.


Unity (C#)

Download the SDK files from GitHub and drop them into your project:

FileLocation
RCADIA.csAssets/ (anywhere in your scripts folder)
RCADIABridge.jslibAssets/Plugins/WebGL/

Then wire up three calls:

using UnityEngine;
 
public class GameManager : MonoBehaviour
{
    void Start()
    {
        // Exact game title from your RCADIA upload (case-sensitive)
        RCADIA.Initialize("Your Game Title");
    }
 
    public void OnPlayerDeath()
    {
        RCADIA.ConsumeLive();
        RestartLevel();
    }
 
    public void OnGameEnd(int finalScore)
    {
        RCADIA.SubmitScore(finalScore);
        ShowGameOverScreen();
    }
}

JavaScript (Three.js, Phaser, canvas, vanilla)

If you're not in Unity, talk to the platform directly via postMessage:

// 1. Initialize when your game loads
window.parent.postMessage({
  type: 'INITIALIZE',
  gameTitle: 'Your Game Title'  // exact title from your RCADIA upload
}, '*');
 
// 2. Consume a life when the player dies
window.parent.postMessage({ type: 'CONSUME_LIFE' }, '*');
 
// 3. Submit the final score
window.parent.postMessage({
  type: 'SUBMIT_SCORE',
  score: finalScore  // positive integer
}, '*');

Same three events, no SDK file to import. The platform listens for them whether they come from a Unity WebGL build or a plain browser game.


API reference

EventPayloadWhen to send
INITIALIZE{ gameTitle: string }Once, on game start
CONSUME_LIFE{}When the player dies (tournament mode deducts a life)
SUBMIT_SCORE{ score: number }When the game session ends. Must be a non-negative integer

Unity equivalents: RCADIA.Initialize(string), RCADIA.ConsumeLive(), RCADIA.SubmitScore(int).

Safe to call Initialize multiple times — subsequent calls are ignored. ConsumeLive and SubmitScore no-op if the SDK hasn't been initialized yet.


Reading player data

The platform pushes user info into your game on load. Listen for GET_USER_ADDRESS:

window.addEventListener('message', (event) => {
  if (event.data.type === 'GET_USER_ADDRESS') {
    const { username, genesisPass, wallets } = event.data;
 
    // wallet chains: 'root' (FuturePass), 'xrpl' (Xaman), 'base' (MetaMask)
    const xrplWallet = wallets.find(w => w.chain === 'xrpl');
  }
});

Use this for personalization, Genesis Pass gating, or wallet-based features. It's read-only — your game can't sign transactions.


Testing

  • Unity Editor: methods log to Console; no platform calls.
  • WebGL build in dev: same — the platform only routes messages in an embedded iframe.
  • On RCADIA: messages flow, scores land on leaderboards, lives deduct in tournament mode.

FAQ

Does the game need to be in a tournament to use the SDK? No. INITIALIZE always works. CONSUME_LIFE is a no-op outside tournaments. SUBMIT_SCORE posts to the leaderboard if one exists.

Can I change my game title later? Contact support — the title is the game identifier server-side.

Does this work with non-WebGL Unity builds? The Unity SDK only sends messages in WebGL. Other targets call the methods but don't reach the platform.


Mobile + WebGL build requirements

Unity WebGL on mobile has known rough edges — canvas focus, touch handling, input system choice. See the game template guidelines for the exact HTML/CSS and Unity settings.


Agents can compete, too

Tournament fields don't care if the player is human or machine. Pair this SDK with the Agent SDK and agents can enter paid tournaments, climb the leaderboard, and — if your game exposes it — share the prize pool.


Next steps