Skip to content

📊 Economy Samples — Scenes & Integrations

The Economy Samples folder contains runnable demonstration scenes showing how to configure, query, and integrate the Economy system with other RevFramework modules (Currency, Inventory, etc.).

These scenes are learning and validation tools, not production code, and can be safely removed from builds.

Some samples demonstrate cross-SKU integrations and require the corresponding modules to be installed.

Teachable panels and diagnostic tooling live in separate teachable scenes.


📂 Folder Layout

Samples/
  Economy/
    00_Economy_Quickstart/        // Minimal economy setup and value queries
    01_Economy_WithInventory/     // Full Economy + Currency + Inventory integration
    02_Economy_OverlayScene/      // Lightweight overlay-based validation scene

🎬 Scene Samples

Scene Demonstrates Notes
00_Economy_Quickstart Core economy model, price lookup, value tables, and service setup. Smallest possible baseline.
01_Economy_WithInventory Full flow: Economy → Currency → Inventory with rollback safety. Realistic multi-system wiring.
02_Economy_OverlayScene Running economy flows via a live sample overlay. No teaching UI; quick validation only.

▶️ Usage

Open any economy sample from:

Assets/RevFramework/Samples/Economy/

Each scene is self-contained and focused on a single goal.

Typical setup includes:

  • An EconomyServiceBootstrap configured with price tables
  • A bound CurrencyService for value calculation and mutation
  • Optional Inventory integration where item values are required
  • Lightweight sample UI or overlays for interaction

🧠 What These Samples Teach

  • How to configure price tables (EconomyTable, EconomyValueEntry)
  • How to query values (IEconomyService.TryGetValue)
  • How Economy orchestrates value flow across Currency and Inventory
  • How to wire real services without hidden dependencies
  • How rollback guarantees deterministic state on failure

🌐 Authority & Multiplayer Notes (Important)

The Economy system does not implement its own authority layer.

Instead:

  • All Economy mutations are gated by Currency authority
  • All spend / grant / refund operations flow through:
    Economy → IValueLedger → ICurrencyService
    
  • If the active ICurrencyService enforces authority (ICurrencyAuthority), Economy automatically respects it

This means:

  • There is no EconomyAuthorityBinder in these samples
  • Multiplayer authority is configured at the Currency level
  • In server-authoritative games, Economy should be executed from your server or host layer — not directly from clients

These samples run locally using permissive Currency setups for clarity.


⚠️ Gotchas

  • Sample price tables are intentionally simple
  • Only one EconomyServiceBootstrap should exist per scene
  • Economy requires Currency
  • Some scenes demonstrate Economy + Inventory integration and require the Inventory SKU (REV_INVENTORY_PRESENT)
  • Sample scripts prioritise clarity over defensive error handling
  • Multiplayer authority is not demonstrated here

  • Economy Core — modeling, price lookups, value tables
  • Economy Adapters — inventory-backed and currency-backed providers
  • Currency — authority, ledgers, escrow, idempotency
  • Inventory — optional value source for certain demos
  • Teachable Panels — deep-dive learning and diagnostics (separate scenes)

These samples exist purely to demonstrate and validate economy behaviour.

Use them to learn, copy patterns, or sanity-check configuration —
then remove or replace them in production projects.