Every reward goes through one door
Why we routed every reward in the game through a single gateway, and what it saved us when we audited for exploits.
The most useful decision we made about the economy was also the least clever one.
The problem with granting rewards where they’re earned
The obvious way to build a game economy is for each system to hand out its own rewards. The card game awards its winnings, the quest system awards its prizes, the daily bonus awards its bonus. Each one is a few lines of code, right next to the thing it’s rewarding, and it reads perfectly clearly.
It’s also how you end up with a dozen independent ways to put currency into the world, each with its own idea of what the limits are — and, inevitably, one that has no idea at all.
The failure mode isn’t that any single path is wrong. It’s that nobody can answer “what are all the ways a player can gain currency?” without reading the entire codebase, and that answer goes stale every time someone adds a feature.
One gateway
So every reward in the game — every game, every quest, every bonus, every one-off — goes through a single call. Nothing grants anything directly.
That one place owns the daily limits, the anti-abuse checks, the audit trail, and the rules about what can be earned how often. It’s a chokepoint, deliberately.
What it bought us
Three things, and the third was the surprise.
New systems inherit the safety net. Adding a mini-game doesn’t mean re-implementing limits, because the limits aren’t in the mini-game. This has stopped being a design decision and started being just how things work.
“Where did this come from?” is answerable. Every grant is logged in the same shape by the same code, so tracing a suspicious balance is a query rather than an investigation.
An exploit audit became tractable. When we went through the game looking for ways to cheat the economy, the question wasn’t “where are all the reward paths?” — that was a list we already had. It was the much smaller question of whether anything had slipped around the gateway. A handful of things had. Because there was a canonical door, finding the ones going through the window was a bounded job rather than an open-ended one.
The general shape
If something in your system is valuable and comes from many places, it’s worth forcing it through one. You lose a little local clarity — the reward code is no longer next to the thing being rewarded — and you gain the ability to reason about the whole system at once.
That trade looks bad on day one and obviously correct the first time you have to audit anything.