Sub topic 8
Model Resource Flow and Upgrade Costs
Assume you know basic spreadsheet navigation, arithmetic, and the game system you are balancing. This chapter models how resources enter and leave the player’s inventory, then connects that flow to upgrade costs.
Separate Resource Stocks and Flows
A resource stock is an amount held at a point in time, such as 250 coins. A resource flow is an amount gained or spent during an interval, such as 40 coins earned from a mission.
For each time period, track:
- Starting resource
- Resource gained
- Resource spent
- Ending resource
- Upgrade purchased, if any
The basic relationship is:
Ending resource = Starting resource + Gains - Spending
The ending value of one row becomes the starting value of the next row.
| Period | Starting Coins | Earned | Upgrade Cost | Ending Coins |
|---|---|---|---|---|
| 1 | 0 | 120 | 0 | 120 |
| 2 | 120 | 140 | 100 | 160 |
| 3 | 160 | 160 | 150 | 170 |
This table reveals pacing problems more clearly than a single total. A player may earn enough coins overall but still wait too long before an important upgrade.
Build the Economy Sheet
Keep assumptions, calculations, and results in separate areas or sheets. Put tunable values in an Inputs sheet:
| Parameter | Value | Meaning |
|---|---|---|
| Mission reward | 120 | Coins earned per mission |
| Reward growth | 0.08 | Reward increase per mission |
| First upgrade cost | 100 | Cost of the first upgrade |
| Upgrade cost growth | 0.25 | Increase applied after each upgrade |
In a Calculations sheet, create one row per mission or progression step. Use formulas that refer to input cells rather than repeating numbers inside formulas.
For example, if the first upgrade cost is in Inputs!B4 and cost growth is in Inputs!B5, the cost for upgrade number n can be:
=Inputs!$B$4*(1+Inputs!$B$5)^(A2-1)Here, A2 contains the upgrade number. The dollar signs make the input references absolute, so copying the formula downward does not change them.
Calculate Cumulative Upgrade Cost
An individual cost answers, “What does this upgrade cost?” A cumulative cost answers, “How much must the player spend to reach this point?”
If individual costs are in column B, place this formula in the first cumulative-cost row and fill it downward:
=SUM($B$2:B2)The first reference remains fixed, while the second expands with each row. This creates a running total.
You can also calculate the resource balance after each purchase:
=StartingCoins + TotalEarned - CumulativeUpgradeCostTrack both values. A steep individual cost may be acceptable if earlier rewards create enough savings. A moderate cost may still feel harsh if the player must spend all available resources every time.
Check Common Economy Errors
Watch for these mistakes:
- Counting a reward twice, once when earned and again in a total.
- Using the current upgrade cost instead of cumulative cost.
- Allowing the balance to become negative when the game forbids debt.
- Applying percentage growth to the wrong base.
- Rounding every intermediate value and creating drift over many rows.
- Forgetting costs that occur outside the modeled activity, such as healing or crafting.
A useful constraint is:
=MAX(0, StartingCoins + Earned - Spent)Use this only when the game clamps the inventory at zero. Otherwise, a negative result may correctly show that the player cannot afford the purchase.
Trace the Economy Loop
Exercise
A player starts with 50 coins, earns 120 coins, and buys an upgrade costing 140 coins. What is the ending balance, and what should the spreadsheet show if debt is not allowed?
Show answer
The unrestricted balance is 30 coins. The spreadsheet should show 30 because the player can afford the purchase. If the cost were 200 coins, the unrestricted balance would be -30, but a no-debt model should show 0 and mark the purchase as unaffordable.