Create a Machinations diagram that models the full game economy of a farming tower defense game. The game combines incremental/idle mechanics with tower defense in a 3x3 grid. Model all resource flows, feedback loops, wave pressure, and the lose condition.
Resources to model
There are two player currencies:
Harvest Gold — earned by manually harvesting mature crops. Used for upgrades (upgrades are a drain, model as a single "Upgrades" drain for now).
Kill Seeds — earned by killing enemies. Used to purchase and plant both productive and defensive plants.
Nodes and Flows
1. Passive Income (Center Tile)
Create an automatic Source that generates +1 Harvest Gold every 10 time steps. Label it "Center Tile Passive Income - HG".
Create an automatic Source that generates +1 Kill Seeds every 10 time steps. Label it "Center Tile Passive Income - KS".
These represent the fixed central tile that always generates a small amount of both resources.
2. Crop Production Loop
Create a Pool called "Active Crops" (starts at 2, max 8 — represents how many productive plants are currently planted).
Create an automatic Source called "Crop Harvest" that generates Harvest Gold. Its flow rate is state-connected to the "Active Crops" pool: each crop generates 5 Harvest Gold every 15 time steps. Use a state connection from Active Crops → Crop Harvest to multiply the rate.
Create a Pool called "Harvest Gold" that accumulates the currency.
Connect: Crop Harvest Source → Harvest Gold Pool.
Create a Drain called "Upgrades" connected from Harvest Gold Pool. This represents the player spending Harvest Gold on upgrades (interactive drain, player-triggered, costs 20 HG per upgrade).
Create a state connection from "Upgrades" Drain → back to "Crop Harvest" rate (each upgrade increases crop yield by +1 HG per crop, representing the upgrade loop).
3. Enemy Waves and Kill Seeds Loop
Create a Pool called "Wave Number" starting at 1. It increases by 1 every 30 time steps (use an automatic Source feeding into it labeled "Wave Progression").
Create an automatic Source called "Enemy Spawn" that feeds into a Pool called "Enemies on Field". The spawn rate is state-connected to "Wave Number": base rate 3 enemies + 2 per wave level (so Wave 1 = 3 enemies, Wave 2 = 5, etc.).
Create an interactive Drain called "Player Click Kill" that drains from "Enemies on Field". Each click removes 1 enemy (represents player clicking to kill). Has a cooldown (model as interval of 1 time step minimum between activations).
Create a Pool called "Kill Seeds" that accumulates the kill currency.
Create a Converter called "Enemy Death" that takes 1 resource from "Enemies on Field" and outputs 3 Kill Seeds into the "Kill Seeds" Pool. Connect the "Player Click Kill" drain output to this converter.
Create a Drain called "Plant Purchase" connected from "Kill Seeds" Pool. Interactive drain, costs 5–10 Kill Seeds, represents player buying and placing plants.
Create a state connection from "Plant Purchase" Drain → "Active Crops" Pool (buying productive plants increases active crops by 1).
4. Defensive Plants Loop
Create a Pool called "Defensive Plants" starting at 0, max 8.
The "Plant Purchase" drain should feed into a Gate that distributes between "Active Crops" (+1) and "Defensive Plants" (+1) based on player choice — model as a 50/50 gate for simulation purposes, or as two separate interactive drains ("Buy Crop" and "Buy Defense").
Create an automatic Drain called "Defensive Plant Attacks" that drains from "Enemies on Field". Its rate is state-connected to "Defensive Plants" pool: each defensive plant removes 1 enemy every 3 time steps.
This drain also outputs to the "Enemy Death" Converter to generate Kill Seeds.
5. Pressure and Damage Loop
Create a Pool called "Plant HP Total" starting at 80 (8 tiles × 10 HP each). This represents the collective health of all planted plants.
Create an automatic Source called "Enemy Damage to Plants" that drains from "Plant HP Total". Its rate is state-connected to "Enemies on Field": each enemy deals 1 damage to plants every 2 time steps.
Create a state connection from "Plant HP Total" back to "Active Crops" and "Defensive Plants": when Plant HP drops by 10, reduce one plant pool by 1 (plants are destroyed when their HP reaches 0). Model this as a state connection threshold.
Create a Drain called "Plants Destroyed" that receives overflow from the damage system.
6. Center Tile HP and Lose Condition
Create a Pool called "Center Tile HP" starting at 100.
Create an automatic Drain called "Enemies Reach Center" that drains from "Center Tile HP". Its rate is state-connected to "Enemies on Field" with a threshold: only activates when enemies have passed through all plants (simulate as: if "Active Crops" + "Defensive Plants" = 0, enemies deal 5 damage to Center per time step).
Create an End Condition that triggers Game Over when "Center Tile HP" reaches 0.
7. Escalating Pressure (Negative Feedback)
Add state connections to represent the escalating difficulty:
"Wave Number" → "Enemy Spawn" rate: more waves = more enemies per wave
"Wave Number" → enemy damage rate: higher waves = enemies deal more damage (multiply "Enemy Damage to Plants" drain rate by wave number)
"Defensive Plants" → reduce damage to "Plant HP Total": each defensive plant reduces incoming damage (negative state connection from Defensive Plants to Enemy Damage Drain)
Key Feedback Loops to Verify
After building, confirm these loops exist in the diagram:
Positive Loop A (Farming Snowball):
Kill Seeds → Buy Crops → More Harvest Gold → Upgrades → Better Crops → More HG
Positive Loop B (Defense Snowball):
Kill Seeds → Buy Defensive Plants → More Enemies Killed → More Kill Seeds
Negative Loop (Enemy Pressure):
More Enemies → Damage Plants → Fewer Plants → Less Income → Harder to Recover
Escalating Pressure Loop:
Time Passes → Wave Number Increases → More Enemies → More Damage → More Pressure
Simulation Parameters
Time step = 1 second of real game time
Run simulation for 300 time steps (5 minutes of gameplay)
Starting resources: Harvest Gold = 0, Kill Seeds = 10
Starting state: 1 Active Crop, 0 Defensive Plants, Center Tile HP = 100
What to Observe in Simulation
Does Harvest Gold grow steadily or stagnate?
Does Kill Seeds ever run out completely (softlock)?
At what wave does the Center Tile HP start dropping?
Is there a "tipping point" where the player loses control?
Does the passive income from the Center Tile prevent complete softlock?