Sub topic 2
Currencies: what they are and what they are for
This chapter assumes you know what a source and a sink are (the previous chapters introduced them), and that you can read short Python snippets and do percentage arithmetic. Soft and hard currencies and exchange rates get their own chapters later. Here the question is more basic: what is a currency, and when does a game need another one?
What counts as a currency
A currency is a resource with three properties:
- Countable. It is a number the game tracks per player.
- Fungible. One unit is interchangeable with any other unit of the same currency.
- Accepted by many sinks. Several different things in the game can be paid for with it.
Gold in an RPG meets all three. A unique sword does not, because it is not fungible. A single-use quest key is countable but only one door accepts it, so it is better described as an item. The line is blurry, and the third property is the one that usually settles it. The more sinks accept a resource, the more it behaves like money.
The jobs a currency does
In a real economy money has several roles. Game currencies inherit them, and each role is a design decision.
| Role | What it means in a game | Design consequence |
|---|---|---|
| Medium of exchange | Players trade effort for goods through a shop, not item for item | Every reward and price can be stated in one unit |
| Unit of account | Designers compare unrelated things by price | A sword and a cosmetic can be weighed against each other |
| Store of value | Players save now to spend later | Hoards build up, so balances matter as well as flows |
| Progression gate | Spending is limited by how long the player has played | Prices control pacing |
| Access control | Some currencies are earned only by certain activities | Currency type controls which content a player can reach |
The last two roles are the ones that matter most. In most games, currency is mainly a way to pace players and steer them. It is a pricing tool for the designer more than a convenience for the player.
One currency or several
A single currency is easy to understand and easy to balance. Every source feeds one stock and every sink drains it. The cost is that everything competes for the same money. If a player can buy a cosmetic and a weapon upgrade with the same gold, you cannot make cosmetics cheap without also making upgrades cheaper in effect.
A second currency is justified when you need to separate two economies so that tuning one does not disturb the other. The usual reasons are:
- Isolate a progression track. Upgrade materials are earned from combat and spent only on gear. Their price never needs to be compared with housing decorations.
- Gate content by activity. A currency earned only in a dungeon mode makes the shop for that mode a reward for playing it.
- Control a scarce reward. A rare currency drops slowly, so the items it buys stay rare no matter how much common currency players accumulate.
- Protect a sink from inflation. If the main currency inflates, an item priced in a separate token keeps its cost in effort.
- Support a different business model. This is the soft and hard split, covered in a later chapter.
The diagram below turns these reasons into a check you can run before adding a currency.
Defining a currency's contract
Before a currency goes into a design document, write down four facts about it:
- Purpose. One sentence on what it lets the player do.
- Sources. Which activities create it, and at roughly what rate per hour.
- Sinks. Which purchases or fees remove it.
- Scope. Whether it is per character, per account, or tradable between players.
If you cannot fill in the sinks, the currency will pile up. If you cannot fill in the sources, nobody can obtain it. A currency with a vague purpose is a common cause of clutter, where players hold five different tokens and cannot tell which one matters.
Modeling several currencies in code
Games that have several currencies often need purchases that cost more than one of them. A wallet should treat a purchase as all-or-nothing. If it deducts one currency and then finds the second is short, the player loses resources and gets nothing.
from collections import defaultdict
class Wallet:
def __init__(self, currencies):
self.allowed = set(currencies)
self.balances = defaultdict(int)
def _check(self, currency, amount):
if currency not in self.allowed:
raise ValueError(f"unknown currency: {currency}")
if amount <= 0:
raise ValueError("amount must be positive")
def earn(self, currency, amount):
self._check(currency, amount)
self.balances[currency] += amount
def spend(self, costs):
"""costs maps currency to amount, for example {"gold": 200, "ore": 5}.
Either every cost is paid or nothing changes."""
for currency, amount in costs.items():
self._check(currency, amount)
if self.balances.get(currency, 0) < amount:
raise ValueError(f"not enough {currency}")
for currency, amount in costs.items():
self.balances[currency] -= amount
wallet = Wallet(["gold", "ore"])
wallet.earn("gold", 500)
wallet.earn("ore", 8)
wallet.spend({"gold": 200, "ore": 5})
print(dict(wallet.balances)) # {'gold': 300, 'ore': 3}
try:
wallet.spend({"gold": 100, "ore": 10})
except ValueError as error:
print(error) # not enough ore
print(dict(wallet.balances)) # unchanged: {'gold': 300, 'ore': 3}The two-pass structure matters. The first loop validates every cost, and the second loop applies them. In a real server you would also need this to run as one atomic transaction, so that two simultaneous requests cannot both pass validation against the same balance. The ledger chapter covers that.
Common errors
Too many currencies. Each currency adds a full economy to balance: its own sources, sinks, pacing, and inflation risk. Teams often add currencies to solve a content problem, such as "players need a reason to run this mode", when a reward item would do. A useful rule of thumb is that every extra currency should remove a specific balancing problem, not just add flavor.
Currencies with no sinks. A reward token that buys nothing useful, or buys things players already own, becomes a counter that only goes up. Players notice. It teaches them that the reward is worthless.
Hidden convertibility. If players can turn currency A into currency B through a side route, such as buying items with A and selling them for B, then in practice you have one currency. Any price or drop-rate decision you made to keep them separate is undone by the cheapest conversion path. Audit these paths before launch.
Currency doing an item's job. Resources that one recipe consumes belong in the inventory system. Putting them in the wallet adds UI and accounting for nothing, unless several sinks genuinely accept them.
Unclear scope. Deciding late whether a currency belongs to the character or the account is expensive. It changes how fast alternate characters progress and whether players can move wealth between them, which affects every pacing calculation you have already made.
A worked example
Suppose a dungeon crawler has gold from all activities and a proposal to add "relic shards" earned only from the hardest dungeon.
Apply the contract. The purpose is to buy endgame gear. The sources are the hard dungeon only, at about 10 shards per run and 4 runs per hour. The sinks are the relic shop, with gear at 400 shards each. The scope is per account.
At 40 shards per hour, one piece of gear takes about 10 hours of that dungeon. That number is directly tunable without touching gold prices. It also keeps the best gear tied to the hardest content, which is the access-control role. The relic shards pass the checks in the diagram: independent tuning, their own source and sink, and a one-sentence purpose. If the same gear were priced in gold, any gold inflation from easier activities would erode the 10-hour target.
Exercise
A team proposes a "festival tickets" currency. Players earn tickets from daily login and spend them on cosmetics, the same cosmetics already sold for gold. Using the checks in this chapter, should they add it? Give two reasons.
Show answer
Probably not. First, its sinks duplicate the gold sinks, so prices could not be tuned independently unless the cosmetics are repriced. Second, if players can buy gold-priced cosmetics with tickets, ticket value is effectively tied to gold, so it becomes one currency under two names with extra UI and extra balancing work. A better choice is to give daily login a gold reward, or to make the festival items exclusive and sold only for tickets, which would give the currency its own sink.
Exercise
Write the four-part contract (purpose, sources, sinks, scope) for a currency of your choice from a game you know, then say which role from the table matters most for it.
Show answer
Answers vary. A strong answer states a one-sentence purpose, lists concrete activities as sources with rough rates, lists the purchases or fees that remove it, and names the scope (character, account, or tradable). It should then pick one role, such as progression gate or access control, and explain how the sources and sinks serve it. For example, a dungeon token earned only in one mode and spent only on that mode's gear is mostly an access-control currency.