Skip to content

How to Build: Gold Drops

Gold is the only loot in the prototype, and it flows from a single source: killing enemies. There's no separate "loot system" to build here — gold drops are handled entirely within the enemy death handler we built in the death and level reset guide. But the amounts matter a lot for game feel, so let's walk through how gold values are determined and why the multipliers exist.

How gold flows from enemy to player

When an enemy spawns, its gold drop is pre-rolled from the enemy profile's min/max range and stored in EnemyData.goldDrop. When that enemy dies, the death handler reads the value and calls addGold on the player. That's it — no dice roll at death time, no loot table lookup, no dropped items on the ground.

typescript
// Inside onEnemyDeath:
const data = enemy.get(EnemyData)
addGold(player, data.goldDrop)

Pre-rolling at spawn time keeps the death handler dead simple and makes it easy to preview gold values in debug tools.

Multipliers that reward risk

Two multipliers modify the base gold range:

Boss multiplier (ECONOMY.BOSS_GOLD_MULTIPLIER, currently 5x) applies to the level boss. Bosses are the hardest fight in the level and they don't respawn, so the payout needs to feel worthwhile. At 5x, a boss that would normally drop 4-6 gold drops 20-30 instead.

Off-road camp multiplier (2x) applies to every enemy in an off-road camp. Camps are optional, harder encounters — the player has to leave the road and fight tougher compositions. Doubling the gold rewards active exploration without making road grinding feel pointless.

Both multipliers are applied at spawn time, baked into EnemyData.goldDrop.

Gold range tables

Gold amounts are defined per enemy profile in shared game data. Here are the baseline ranges for the first two tiers:

Tier 1: The Hollows

EnemyGold Range
Rat1-2
Goblin2-3
Skeleton3-5
Zombie3-4
Hollow Knight4-6

Tier 2: The Verdant Deep

EnemyGold Range
Cave Bat3-4
Fungal Crawler4-6
Root Strangler5-8
Spore Beast5-7
Deep Warden7-10

These values will absolutely need tuning once vendor prices and progression pacing are in place. The numbers above are starting points, not gospel.

Why this is so simple

I want to call out that this system is intentionally minimal. There are no loot tables, no item drops, no rarity tiers. Gold is the single currency that feeds into the vendor (buying potions, buying gear upgrades). By keeping the loot pipeline this narrow, we can focus development time on the systems that actually create interesting gameplay — combat, progression, and level generation.

If the game ever needs more complex drops, the EnemyData trait and spawn-time pre-rolling pattern are extensible. But for the prototype, gold is all we need.

Dependencies

This system ties into:

  • Inventory and Gold — the addGold action that modifies the player's wallet
  • Death and Level Reset — the enemy death handler where gold is granted
  • Shared Game Data — enemy profiles with gold ranges per type

We now have a complete economic loop: enemies spawn with gold values, combat kills them, death handlers pay the player. Next, let's give the player a way to spend some of that gold — on potions that keep them alive.