Sub topic 8
Emergent behavior from simple rules
This chapter assumes you can tell mechanics, dynamics, and aesthetics apart from the earlier chapters. It also assumes you can read short Python programs. By the end you should be able to explain why a dynamic cannot be read off a rule list, and how to check for one by running the rules.
What emergence means
Emergent behavior is a pattern at the level of the whole system that no single rule describes. No rule states it, and no single component produces it. It appears when many rules act on many pieces of state over time.
In MDA terms, emergence is the link between mechanics and dynamics. Mechanics are written down in advance. Dynamics are the run-time behavior of those mechanics with players or agents acting on them. If every dynamic could be read straight off the rules, you would not need to play the game to learn what it does. You do need to, because the dynamics are produced by interaction, not stored in any rule.
Three conditions usually have to hold:
- Several interacting parts. One rule acting on one piece of state rarely surprises anyone.
- Repetition over time. The rules are applied again and again, and each result feeds the next application.
- Local rules, global pattern. Each rule refers only to nearby or immediate state, yet the pattern you notice spans the whole game.
A minimal example: Conway's Game of Life
Life is a zero-player game, which makes it a clean demonstration. The mechanics fit in two sentences. A live cell with two or three live neighbors stays alive. A dead cell with exactly three live neighbors becomes alive. All other cells are dead in the next generation.
Nothing in those sentences mentions movement. Yet a five-cell shape called a glider travels across the grid. The program below applies only the neighbor-count rule and then checks that the shape has moved diagonally by one cell after four generations.
from collections import Counter
def step(live):
"""Apply the Life rules once. `live` is a set of (x, y) cells."""
counts = Counter(
(x + dx, y + dy)
for x, y in live
for dx in (-1, 0, 1)
for dy in (-1, 0, 1)
if (dx, dy) != (0, 0)
)
return {
cell for cell, n in counts.items()
if n == 3 or (n == 2 and cell in live)
}
glider = {(1, 0), (2, 1), (0, 2), (1, 2), (2, 2)}
state = glider
for generation in range(1, 5):
state = step(state)
print("generation", generation, sorted(state))
moved = {(x + 1, y + 1) for x, y in glider}
print("same shape, shifted by (1, 1):", state == moved)The step function contains no variable called velocity and no code that moves anything. The motion is a dynamic. It exists only when the rules run repeatedly on this particular starting state. A different starting state gives a different dynamic, such as a block that never changes or a pattern that dies out.
Emergence in game design
Life is a toy, but the same structure appears in games people play. The table pairs simple mechanics with dynamics that none of the rules mention.
| Mechanics (written down) | Emergent dynamic (observed at run time) | Aesthetic it may serve |
|---|---|---|
| Each player may trade resources; resources are scarce and unevenly placed | Alliances, price norms, and blockades form | Fellowship, challenge |
| Units beat one type and lose to another (rock-paper-scissors structure) | Players keep switching strategies; no unit stays best | Challenge, discovery |
| Fire spreads to flammable neighbors; explosive barrels exist | Chain reactions and improvised traps | Expression, discovery |
| Trailing racers get a speed bonus based on the gap | Races stay close, with frequent lead changes | Challenge |
In each row, the middle column cannot be found by reading the left column alone. A designer learns it by playing, by watching others play, or by simulating.
Emergence from one racing rule
The spine's catch-up rule is a small, explicit mechanic: a trailing racer's speed is multiplied by 1 + min(gap * 0.05, 0.3). The rule never mentions "tension" or "lead changes". The simulation below runs many races with and without it and reports two dynamics: how often the lead changes hands, and how large the final gap is.
import random
from statistics import mean
def simulate_race(catch_up, steps=100, seed=1):
rng = random.Random(seed)
pos = [0.0, 0.0]
leaders = []
for _ in range(steps):
for i in range(2):
gap = max(pos[1 - i] - pos[i], 0.0)
base = rng.uniform(0.8, 1.2)
boost = min(gap * 0.05, 0.3) if catch_up else 0.0
pos[i] += base * (1 + boost)
leaders.append(0 if pos[0] > pos[1] else 1)
lead_changes = sum(1 for a, b in zip(leaders, leaders[1:]) if a != b)
return lead_changes, abs(pos[0] - pos[1])
for flag in (False, True):
runs = [simulate_race(flag, seed=s) for s in range(200)]
print(
"catch_up =", flag,
"| mean lead changes:", round(mean(r[0] for r in runs), 2),
"| mean final gap:", round(mean(r[1] for r in runs), 2),
)Run it and compare the two lines. The averages over 200 seeds are the measured dynamic. A single seed is one race, and one race can be unrepresentative, which is why the loop uses many seeds.
From rules to dynamics to experience
The chain from mechanics to aesthetics passes through emergence. The diagram shows where it sits.
The dotted arrow is the practical consequence. Because a designer cannot derive the dynamic in advance, design becomes a loop: change a rule, run the game, observe, and change it again. Later chapters on feedback loops, tuning, and simulation build on this loop.
Why you cannot just read the rules
A rule list describes what is allowed at one moment. A dynamic describes what happens over thousands of moments with decision makers involved. Three things widen the gap between them:
- Compounding. A small advantage early can multiply. With a different rule it can shrink instead, and the rule text looks equally innocent either way.
- Player adaptation. Players respond to the rules. If one strategy is strong, players copy it, and the game's dynamics become "everyone uses that strategy", which no rule says.
- Sensitivity to parameters. A boost of 0.05 per unit of gap and one of 0.5 use the same rule with different numbers. The second can make the trailing racer overtake and then trail again, turning a close race into a back-and-forth swing.
Common errors
- Treating emergence as magic. Emergent behavior is fully determined by the rules and the state. It is hard to predict by hand, but it can be reproduced and measured. If you cannot reproduce a behavior, you have not yet understood it.
- Designing the dynamic directly. Writing "players will form alliances" in a design document describes a hoped-for dynamic, not a mechanic. You can only add rules that make alliances worthwhile and see whether they appear.
- Confusing a mechanic with its dynamic. "Catch-up boost" is a mechanic. "Close races" is the dynamic. Mixing them makes it impossible to say which layer failed when a test goes badly.
- Judging from one run. Random elements and individual players vary. One game, or one seed, tells you little about the typical dynamic.
- Assuming more rules mean more emergence. Many emergent systems, Life included, have very few rules. Rich dynamics depend on how the rules interact, not on how many there are.
- Ignoring unwanted emergence. Dynamics can undermine the aesthetic you wanted, for example one dominant strategy that removes meaningful choice. Emergence is not always good news.
Summary of the working model
- Mechanics are the rules and data you write. Dynamics are what the running system does. Emergent dynamics are the ones no single rule states.
- Emergence needs interacting parts, repetition, and (in most games) players who adapt.
- You find emergent dynamics by running the system: by playtesting with people or by simulating with code, and by measuring the same quantity across many runs.
- Designers use this by changing mechanics, observing the dynamics, and comparing the result with the aesthetic they want.
Exercise
In the Life example, which layer of MDA does "the glider moves diagonally" belong to, and which rule in the code is responsible for it?
Show answer
It is a dynamic. No rule moves anything. The step function only counts neighbors and decides which cells live. The motion appears when that rule is applied repeatedly to this starting pattern.
Exercise
A designer says, "Our trading rules will make players form alliances." What is wrong with this statement as a design plan, and what would you do instead?
Show answer
It names a dynamic as if it were a mechanic. Alliances cannot be added directly. Instead, add or adjust rules that give players a reason to cooperate (for example, scarce resources that are unevenly distributed, or goals that are easier to reach together). Then playtest or simulate many sessions and check whether alliances actually form.
Exercise
You run simulate_race(True) once with seed 1 and see more lead changes than simulate_race(False) with seed 1. Why is this not enough to conclude that the catch-up rule increases lead changes, and what would you do?
Show answer
A single seed is one random race and may not be typical. Run both conditions across many seeds, as in the loop that uses range(200), and compare the averages. If the averages differ consistently, you have evidence of the rule's effect on the dynamic.