Sub topic 10
Exchange and conversion between currencies
Assume you understand sources, sinks, soft currency, and hard currency. You should also be comfortable with percentages and short Python programs. This chapter uses those ideas to decide whether players can exchange one currency for another.
Why convert currencies?
A conversion lets players trade one resource for another. For example, a player might exchange earned gold for premium gems, or convert event tokens into crafting materials.
Conversion can solve a real design problem:
- A player has too much of one resource.
- A player needs a resource that comes from an activity they do not enjoy.
- A temporary event needs its own currency.
- A premium currency needs to buy items priced in regular currency.
However, every conversion connects two economies. If the exchange is too generous, players may bypass intended activities. If it is too expensive, the feature feels useless.
Exchange rates and fees
An exchange rate states how much of one currency buys another. For example:
- 100 gold buys 1 gem.
- 1 gem buys 80 gold.
These rates do not need to be symmetrical. A difference between the two rates creates a fee and removes currency from the system. Without that difference, players might repeatedly convert currencies and create value through rounding.
A conversion can include a percentage fee. If a player converts 1,000 gold with a 10% fee, only 900 gold contributes to the exchange.
| Conversion | Rate | Player receives |
|---|---|---|
| Gold to gems | 100 gold per gem | 10 gems from 1,000 gold before fees |
| Gems to gold | 1 gem for 80 gold | 800 gold from 10 gems |
| Gold fee | 10% | 900 gold remains before conversion |
def convert(amount, rate, fee=0.0):
"""Return the target currency after applying a conversion fee.
rate is target units received per source unit.
"""
if amount <= 0:
raise ValueError("amount must be positive")
if not 0 <= fee < 1:
raise ValueError("fee must be between 0 and 1")
usable_amount = amount * (1 - fee)
return usable_amount * rate
gold = 1000
gems = convert(gold, rate=1 / 100, fee=0.10)
print(gems) # 9.0The example treats fractional gems as valid. If the target currency uses whole units, decide whether to round down, round up, or store a fractional internal balance. Rounding down protects the economy but can make small conversions feel unfair.
Design choices and failure modes
A fixed rate is predictable and easy to explain. A changing rate can respond to supply and demand, but it is harder to balance and can reward players who wait for favorable prices.
A one-way conversion is safer when the currencies have different roles. It can help players spend excess event tokens without allowing them to turn premium currency into unlimited progression. A two-way conversion gives players flexibility, but it must account for fees, rounding, and limits.
Conversion also affects monetization fairness. If players can buy hard currency and convert it into powerful soft-currency advantages, compare the resulting progression with what free players can earn through play.
Exercise
A game lets players exchange 500 gold for 4 gems, and exchange 1 gem back for 100 gold. Does a player gain value by converting 1,000 gold to gems and back? Assume no rounding.
Show answer
1,000 gold becomes 8 gems, and 8 gems become 800 gold. The player loses 200 gold, so the loop acts as a sink rather than creating value.