Sub topic 8
Drawing loops with causal loop diagrams
This chapter assumes you can already tell a stock (an amount that accumulates, such as gold or health) from a flow (what changes it, such as income or damage). It also assumes you know the difference between reinforcing and balancing feedback. Here you will learn to draw a game mechanic as a causal loop diagram and to read the loop type directly from the drawing.
What a causal loop diagram is
A causal loop diagram (CLD) is a drawing of the cause-and-effect links inside a system. It shows variables as labels and links as arrows. Each arrow carries a sign that says how the effect responds to the cause. You do not need numbers, formulas or code to draw one. That makes it a good tool for early design discussions, when you want to ask "what loops does this feature create?" before anything is built.
A CLD answers a different question from a simulation. A CLD tells you what kind of behavior a structure tends to produce: runaway growth, settling, or a tug of war. A simulation tells you how fast and how far. Use the diagram first and the simulation second.
The notation
A CLD uses a small set of symbols.
| Symbol | Meaning | Example |
|---|---|---|
| Variable (a noun phrase) | Something that can go up or down | Gold, Income, Lead |
| Arrow A to B | A causes a change in B | Gold to Income |
| `+` on an arrow | B moves in the same direction as A | More Gold, more Income. Less Gold, less Income. |
| `-` on an arrow | B moves in the opposite direction from A | More Penalty, less Income. Less Penalty, more Income. |
| Loop marker R or B | The loop type, written in the middle of the loop | R for reinforcing, B for balancing |
Three habits keep diagrams readable:
- Name variables as quantities that can rise or fall, such as "Gold" or "Enemy pressure". Avoid names that describe an action, such as "Buying a unit". Avoid names with a built-in direction, such as "Gold shortage".
- Label each arrow by asking "if the cause goes up, does the effect go up or down, compared with what it would have been?" The sign describes direction of change. It does not describe whether the result is good.
- Draw one arrow per direct causal link. If you are tempted to draw an arrow that skips a step, add the missing variable.
An example: income, lead and a catch-up penalty
Suppose a strategy game has two rules:
- Each turn, a player earns income proportional to their gold, because their economy buildings scale with spending.
- The leading player pays a penalty that reduces their income. The bigger their lead, the bigger the penalty.
Here is the diagram.
The diagram contains two loops that share the variables Gold and Income:
- Gold, Income, back to Gold. Both links are
+. This is the snowball engine. - Gold, Lead, Catch-up penalty, Income, back to Gold. Three links are
+and one is-. This is the brake.
Mermaid does not draw the R and B markers for you, so name the loops in your notes or in the surrounding text. Many designers write them next to the diagram.
The even/odd rule
You do not need to trace the behavior of a loop to classify it. Count the - arrows on its path:
- An even number of
-links (including zero) makes a reinforcing loop. A change comes back around in the same direction and amplifies itself. - An odd number of
-links makes a balancing loop. A change comes back around in the opposite direction and opposes itself.
Check this against the example. The first loop has zero minus links, so it is reinforcing. The second loop has one minus link, so it is balancing. Now check a mechanic you know. In a racing game, falling behind (more distance to the leader) gives you a speed boost, and the boost reduces the distance. Distance to Boost is +, and Boost to Distance is -. One minus link means the loop is balancing, which matches the rubber-banding behavior you saw earlier.
A subtle point: two minus links in a loop do not make it balancing. "More enemies, fewer resources for the player" and "fewer resources, fewer defenders, more enemies" is two - links in a row, so the loop is reinforcing, and it is also a death spiral. Sign counting catches this where intuition often does not.
Checking your diagram with code
For small diagrams you can check polarity by hand. For larger ones, a script avoids mistakes. The program below lists every loop in a signed graph and classifies each one with the even/odd rule. It uses the same four variables as the example.
edges = {
("Gold", "Income"): "+",
("Income", "Gold"): "+",
("Gold", "Lead"): "+",
("Lead", "Penalty"): "+",
("Penalty", "Income"): "-",
}
graph = {}
for (a, b) in edges:
graph.setdefault(a, []).append(b)
def find_loops(graph):
loops = []
def walk(start, node, path):
for nxt in graph.get(node, []):
if nxt == start:
loops.append(path[:])
elif nxt not in path and nxt > start:
# only extend through names that sort after the start,
# so each loop is reported once
walk(start, nxt, path + [nxt])
for start in graph:
walk(start, start, [start])
return loops
for loop in find_loops(graph):
links = list(zip(loop, loop[1:] + loop[:1]))
negatives = sum(1 for link in links if edges[link] == "-")
kind = "Reinforcing" if negatives % 2 == 0 else "Balancing"
print(f"{kind}: {' -> '.join(loop + loop[:1])} ({negatives} negative links)")It prints:
Reinforcing: Gold -> Income -> Gold (0 negative links)
Balancing: Gold -> Lead -> Penalty -> Income -> Gold (1 negative links)Add or remove an edge and rerun it. If you change ("Penalty", "Income") to "+", the second loop becomes reinforcing, which is the bug you would have shipped if you got that sign wrong on paper.
What a diagram can and cannot tell you
A CLD shows structure. From the example, you can say that the game has a snowball loop and a brake, and that both act on the same flow, Income. You cannot say which one wins. That depends on the strength of each link, which is the subject of the chapter on loop dominance. The diagram also leaves out caps, such as a maximum income, and delays, such as a penalty that applies a turn late. Designers mark a delay on an arrow with two short parallel lines, and later chapters return to why delays cause oscillation.
Common errors
- Reading the sign as good or bad. A
-arrow is not a negative outcome. "Penalty to Income:-" only means they move in opposite directions. - Labeling the sign from the wrong baseline. The sign answers "compared with what would have happened otherwise?" For a stock, such as Gold, the arrow into the stock from a flow is
+if the flow adds to it. A flow that drains it, such as Spending, is-. - Drawing an arrow that skips a variable. If "Lead" affects "Income" only through the penalty, draw the penalty. Skipped variables hide signs, and a hidden
-flips your loop type. - Using vague variables. "Balance" and "Fairness" cannot be counted, so the signs on their arrows are arguments rather than facts. Use measurable quantities such as gold, speed or score.
- Forgetting the player. In most games the player is part of a loop. "Low health leads the player to play defensively, which reduces damage taken" is a balancing loop that runs through a person. Add the decision as a variable, such as "Caution".
- Missing loops that share variables. In the example, Gold and Income sit in two loops. If you only draw the snowball, you will predict runaway growth that the penalty prevents.
Exercise
Exercise
A card game has these rules. (1) The more cards in your hand, the more options you have, and the more options you have, the more cards you can play (+, +). (2) The more cards you play, the fewer cards remain in your hand (-). Draw the loop described by rules 1 and 2 as variables and signed arrows, count the negative links, and say whether it is reinforcing or balancing. Then say what happens to the loop type if you add a rule that the player draws more cards the fewer they hold (hand size to draw count is -, draw count to hand size is +).
Show answer
The loop is Hand size to Options (+), Options to Cards played (+), Cards played to Hand size (-). It has one negative link, so it is balancing: a large hand leads to more plays, which shrinks the hand. The new rule forms a second loop, Hand size to Draw count (-) and Draw count to Hand size (+). It also has one negative link, so it is balancing as well. The two balancing loops act together and push hand size toward a stable middle value, so the hand size settles instead of growing or collapsing.