Sub topic 1
What a Game Economy Is: Resources and Flows
Prerequisites
This chapter assumes you have the following:
- You know how games reward and charge players: loot drops, shops, upgrades, repair costs.
- You can read short Python snippets and do simple arithmetic with rates and percentages.
- You understand a core game loop, the repeating cycle of actions a player performs (for example fight, loot, upgrade, fight again).
No economics background is needed. Later chapters build on the vocabulary introduced here.
What a game economy is
A game economy is the set of resources in a game, the ways players get them, the ways players use them up, and the rules that connect these. It is a system, not a price list. Changing one number, such as a quest reward, changes how fast players progress, what they can afford, and what they stop doing because it no longer pays.
Every game has an economy, even a game with no shop. If a player collects ammunition and fires it, ammunition is a resource, pickups are one half of the system, and shooting is the other half.
Designers study game economies for three reasons:
- Pacing. The economy controls how long it takes to reach goals.
- Longevity. An economy that runs out of goals, or one that makes everything cheap, ends the game early.
- Fairness and health. Players notice when the economy rewards the wrong behavior or punishes them for no clear reason.
Resources
A resource is anything a player can hold, accumulate, and spend that affects what they can do. Resources come in several kinds:
| Kind | Examples | Typical use |
|---|---|---|
| Currency | Gold, gems, credits | General purchasing power |
| Materials | Wood, ore, herbs | Crafting and building |
| Consumables | Potions, ammunition, fuel | Used up during play |
| Time-gated resources | Energy, stamina, cooldown charges | Limit how much a player can do per session |
| Progress resources | Experience points, reputation | Unlock content when thresholds are reached |
| Items | Weapons, armor, cosmetics | Held long term, sometimes traded |
The boundary between kinds is loose. A health potion is a consumable, but it also has a price in gold, so it carries value in currency terms. When you analyze an economy, you can treat any of these as a resource as long as you can count it and say how it enters and leaves the game.
Two properties matter for each resource:
- Is it scarce? A resource that players can obtain without limit has no decision attached to it.
- Is it fungible? A fungible resource is interchangeable unit by unit, like gold coins. A non-fungible one, like a unique sword with random stats, differs from copy to copy and is harder to price.
Stocks and flows
Two ideas from systems thinking give the economy a working model.
- A stock is the amount of a resource that exists at a moment. A player's gold balance is a stock. The total gold held by all players is also a stock.
- A flow is the rate at which the stock changes. Gold earned per hour is a flow.
A bathtub is the usual picture. The water level is the stock. The tap is an inflow and the drain is an outflow. The level rises when the tap runs faster than the drain, and falls in the opposite case.
In game terms:
- A source (also called a faucet) is any mechanism that adds a resource to the game: quest rewards, monster drops, daily login bonuses, selling items to a shop.
- A sink (also called a drain) is any mechanism that removes a resource from the game: repairs, fees, consumables, upgrades, purchases from a shop.
The key word is game. A source creates currency from nothing, as far as the game is concerned. A sink destroys it. Currency that moves from one player to another, through a trade or a gift, is a transfer. It changes who holds the stock but not the total. This distinction is the most common place beginners go wrong, and later chapters on inflation and trading depend on it.
A first model in code
You can see stock and flow behavior in a few lines. The function below gives a player a fixed income each day and then removes a percentage of the balance, for example as repair costs or fees.
def simulate(days, income_per_day, sink_rate, start=0.0):
"""Track one player's balance. Each day they earn a fixed amount,
then a percentage of the balance is removed (for example repair costs or fees)."""
balance = start
history = []
for _ in range(days):
balance += income_per_day
balance -= balance * sink_rate
history.append(round(balance, 2))
return history
print(simulate(60, 100, 0.10)[-1]) # close to 900The source adds 100 per day. The sink removes 10% of the balance. Because the sink grows with the balance, it removes more as the player gets richer. The balance settles where outflow equals inflow. Setting the balance after the daily step to B and requiring that the sink removes exactly what the source adds gives roughly income * (1 - rate) / rate, which is 900 here. The balance stops growing, even though the player keeps earning forever.
This is a proportional sink, and it gives the economy a natural ceiling. Compare it with a fixed sink, such as a flat 20 gold fee per day. A fixed sink cannot stop a player who earns more than 20 per day from growing richer without limit.
Tracking changes with a ledger
To reason about an economy you need to know where each unit came from and where it went. A ledger records every change to a balance together with a reason. The class below routes every change through earn or spend, which gives you totals per source and per sink.
from collections import defaultdict
class Ledger:
def __init__(self):
self.balance = 0
self.earned = defaultdict(int)
self.spent = defaultdict(int)
def earn(self, reason, amount):
if amount <= 0:
raise ValueError("amount must be positive")
self.balance += amount
self.earned[reason] += amount
def spend(self, reason, amount):
if amount <= 0:
raise ValueError("amount must be positive")
if amount > self.balance:
raise ValueError("insufficient funds")
self.balance -= amount
self.spent[reason] += amount
wallet = Ledger()
wallet.earn("quest_reward", 500)
wallet.spend("weapon_repair", 120)
print(wallet.balance, dict(wallet.earned), dict(wallet.spent))The output is 380 {'quest_reward': 500} {'weapon_repair': 120}. Two design choices are worth noting:
- The code rejects non-positive amounts. If
earnaccepted a negative number, it would act as a hidden sink, and the per-reason totals would no longer match reality. - The code rejects overdrafts. Letting a balance go negative is a design decision, and the code should not make it by accident.
Later chapters return to ledgers as a safeguard against exploits.
Identifying an economy in an existing game
A practical skill for this tutorial is to take a game you know and list its parts. Use this procedure:
- List every resource the player holds or sees on screen.
- For each resource, list every way it increases. These are the sources.
- For each resource, list every way it decreases. These are the sinks.
- Mark each mechanism as a source, a sink, or a transfer.
- Note conversions, where one resource turns into another (ore becomes bars, gems buy gold).
Conversions are easy to miss because they act as a sink for one resource and a source for another at the same time.
Consider a simple action RPG. Gold comes from monster drops and from selling loot (sources). Gold leaves through potion purchases, armor repair, and fast travel fees (sinks). Ore comes from mining and leaves when a blacksmith crafts it into a sword. Experience points enter from kills and quests and are never spent, only accumulated, so there is no sink for them, and that is a deliberate choice.
Common errors
- Counting only the obvious sources. Selling items to a vendor, refunds, event rewards, and bug-fix compensation all add currency. If you miss one, your estimates of total inflow will be too low.
- Counting transfers as sources or sinks. Player-to-player trades move currency but do not create or destroy it.
- Ignoring non-currency resources. Energy, materials, and time often limit progress more tightly than gold does.
- Treating an unspent balance as removed. Hoarded currency has not left the game. It is still in the stock and can be spent later.
- Looking at one player only. The economy is the sum over all players, who earn at very different rates.
Summary of the model
- A resource is a countable thing that players hold and use.
- A stock is how much exists. A flow is how fast it changes.
- Sources add to the stock, sinks remove from it, and transfers only move it.
- A proportional sink gives a balance ceiling. A fixed sink does not.
- A ledger with labeled reasons lets you see every flow.
The next chapters take these parts one at a time: currencies, then sources, then sinks, then the balance between them.
Exercise
In a farming game, a player harvests 40 crops per day and sells them to a shop for 5 gold each. The player pays a flat 50 gold daily land tax and spends 100 gold per day on seeds. The player also gives 30 gold per day to a friend. List the sources and sinks, and say whether the gift is either. What is the net change in this player's gold per day?
Show answer
The source is the shop sale: 40 x 5 = 200 gold per day. The sinks are the land tax (50) and seeds (100), a total of 150. The gift is a transfer, not a sink, because the gold moves to another player and stays in the game. The player's own balance changes by 200 - 150 - 30 = +20 gold per day. The total gold in the game changes by 200 - 150 = +50 per day, because the friend receives the 30.
Exercise
In the simulate function, an income of 50 per day and a sink rate of 0.25 are used. Roughly what balance does the player approach? What happens to that balance if you replace the proportional sink with a flat 10 gold per day fee?
Show answer
The balance approaches income (1 - rate) / rate = 50 0.75 / 0.25 = 150. With a flat 10 gold fee, the player nets +40 per day, so the balance grows without limit and never settles.