An exchange house that defines rates between two currencies, one-way or bidirectional.

currencyExchange#

Defines exchanges between currencies: 100 Gems → 5000 Gold, 10 Tickets → 1 Gem, etc. Supports one direction only or both sides.

Why it matters#

In games with multiple currencies (premium + soft + event), conversions need to be visible and auditable. If "100 Gems = 5000 Gold" lives only in the shop's code, the design team can't iterate on the economy without asking a programmer for a build. Here it becomes both a document and an exported JSON.

Where it usually lives#

  • A page of type 💱 Exchange House. The wizard asks for the two currencies and the initial rate.
  • Blank pages when you want to group several related exchanges (e.g. "Premium Bank" with 5 different conversions).

Singleton — 1 addon per page, with N exchanges (entries[]).

Schema#

CampoTipoPadrãoDescrição
idYesstringInternal ID.
nameYesstringAddon name.
entriesYesCurrencyExchangeEntry[]List of exchanges.

CurrencyExchangeEntry#

CampoTipoPadrãoDescrição
idYesstringInternal ID.
fromCurrencyRefstring (sectionId)Page of the currency the player spends.
fromAmountYesnumberHow much of fromCurrency is spent per exchange.
toCurrencyRefstring (sectionId)Page of the currency the player receives.
toAmountYesnumberHow much of toCurrency is received per exchange.
directionYes"oneWay" | "bidirectional"oneWay: only from→to (Gems become Gold, but not the other way). bidirectional: can exchange in both directions at the same rate.
notesstringFree notes (daily limits, conditions, flavor text).

Example#

Premium Bank with 2 exchanges: Gems → Gold (oneWay) and Tickets ↔ Gems (bidirectional).

{
  "id": "exchange-bank",
  "name": "Premium Bank",
  "entries": [
    {
      "id": "ex1",
      "fromCurrencyRef": "section-gem",
      "fromAmount": 100,
      "toCurrencyRef": "section-gold",
      "toAmount": 5000,
      "direction": "oneWay",
      "notes": "Fixed rate. Cannot be reversed."
    },
    {
      "id": "ex2",
      "fromCurrencyRef": "section-tickets",
      "fromAmount": 10,
      "toCurrencyRef": "section-gem",
      "toAmount": 1,
      "direction": "bidirectional",
      "notes": "Only available during events."
    }
  ]
}

Validation#

  • Same currency on both sides: the panel blocks this (exchanging Gold for Gold makes no sense).
  • Broken refs: if you delete one of the currencies, the panel shows the entry with a warning and it won't export until you fix it.
  • Amounts ≤ 0: rejected; a free or negative exchange has no clear meaning.

Wizard#

The 💱 Exchange House page type has a more detailed wizard than usual:

  1. Dialog asks for the two currencies this house exchanges (cannot be the same).
  2. Asks for the direction (oneWay/bidirectional).
  3. Asks for the rate (fromAmounttoAmount).
  4. The page is created with the initial entry already filled in.

Afterward you can add more entries (e.g. bundle tiers — 100 Gems → 5000 Gold, 500 Gems → 30000 Gold with a bonus).

See also#