Sub topic 1
What emergent gameplay is
Prerequisites
This chapter assumes you can:
- Read short Python programs that use loops, functions, lists, tuples, sets and dictionaries.
- Describe how a video or board game works in terms of its rules, for example "units have health and attacks reduce it".
- Picture a game as state that changes in discrete steps, either ticks (real-time loops) or turns.
Later chapters build on this one. Here you get a working definition, a way to test whether a behavior is emergent, and the errors designers most often make when they use the word.
A working definition
Emergent gameplay is behavior that no single rule describes, but that appears when several rules act on the same shared state. The designer wrote the rules. The player and the simulation together produce the situation.
A situation counts as emergent only if it passes all four of these tests:
- No rule names it. You cannot find a line of code or a design-document sentence that says "when this happens, produce that outcome".
- It comes from interaction. At least two rules affect the same piece of state, and the outcome depends on their combination.
- It is reproducible from the rules. If you restore the same state and the same inputs, the same thing happens. Randomness alone does not make behavior emergent.
- It matters to play. The outcome changes what the player can or should do next. A pattern that nobody can act on is a curiosity, not gameplay.
The word "emergent" describes how an outcome came about. It does not describe how good the outcome is. Emergent outcomes can be delightful, dull or game-breaking, and later chapters cover how to tell them apart.
Scripted versus emergent
A scripted behavior is one the designer authored as a specific case. An emergent behavior is one the designer authored only indirectly, through general rules.
| Aspect | Scripted | Emergent |
|---|---|---|
| Where the outcome is written | In a specific trigger or cutscene | Nowhere. It follows from several rules |
| Cost of adding one more outcome | One more authored case | Often none, because the rules already cover it |
| Cost of adding one more object | One more case per existing object | A few tags or properties on the new object |
| Designer predictability | Complete | Partial. You may be surprised by your own game |
| Typical failure | A missing case, so the world feels fake | An unwanted combination, so the world feels broken |
| Testing approach | Check each authored case | Play the system and watch what happens |
Both approaches are legitimate. Many shipped games mix them, scripting the story beats and letting the rules govern the moment-to-moment world. The skill is knowing which parts of a design deserve which treatment.
How rules produce outcomes
Think of an emergent system as a loop with four parts:
- Rules are small, general statements such as "fire ignites flammable neighbors".
- Shared state is the data that more than one rule reads or writes, such as the grid of tiles.
- Interaction happens when one rule's output becomes another rule's input.
- Patterns are what an observer, usually the player, sees at a larger scale than any individual rule.
The player's actions are part of the loop. This is why emergent systems create so many situations. The rules produce patterns, the player responds to them, and the response creates a new state that the rules then process.
A worked example in code
The following program is a one-dimensional world. Each cell is grass, a barrel, or water. Only two rules exist:
- A burning cell ignites flammable cells within its reach. Grass and barrels are flammable. Water is not.
- A burning barrel has a reach of 2. Every other burning cell has a reach of 1.
Nothing in the code says that fire can jump over water. Uppercase letters show burning cells.
FLAMMABLE = {"grass", "barrel"}
LETTER = {"g": "grass", "b": "barrel", "w": "water"}
SYMBOL = {kind: letter for letter, kind in LETTER.items()}
def make(text):
"""Build a row of (kind, burning) cells. Uppercase letters are burning."""
return [(LETTER[c.lower()], c.isupper()) for c in text]
def show(row):
return "".join(
SYMBOL[kind].upper() if burning else SYMBOL[kind]
for kind, burning in row
)
def step(row):
"""Apply both rules once. Burning cells stay burning."""
new = list(row)
for i, (kind, burning) in enumerate(row):
if not burning:
continue
reach = 2 if kind == "barrel" else 1
for j in range(max(0, i - reach), min(len(row), i + reach + 1)):
other_kind, _ = row[j]
if other_kind in FLAMMABLE:
new[j] = (other_kind, True)
return new
def run(text, steps):
row = make(text)
lines = [show(row)]
for _ in range(steps):
row = step(row)
lines.append(show(row))
return lines
print("\n".join(run("Ggbwg", 4)))
print()
print("\n".join(run("Gggwg", 3)))The program prints:
Ggbwg
GGbwg
GGBwg
GGBwG
GGBwG
Gggwg
GGgwg
GGGwg
GGGwgIn the second row, every cell is grass. Fire spreads cell by cell and stops at the water, as a designer would expect. In the first row, a barrel sits between the fire and the water. When the barrel ignites, its reach of 2 carries fire over the water cell and lights the grass on the far side.
Check this against the four tests:
- No rule says "fire crosses water". Rule 1 treats water as non-flammable, and rule 2 only sets a larger reach for barrels.
- The outcome needs both rules and the shared row.
- Running the program again gives the same output.
- A player who wanted to protect the right-hand grass would learn that a water gap is not enough when a barrel is nearby. They would move the barrel or widen the gap.
What this example shows about design
The designer gets the surprise for free, but also takes on a duty. If a water gap is meant to be a reliable firebreak, the reach rule has made it unreliable. The designer has two choices. They can accept the behavior as a feature, because the player now has a puzzle to solve. Or they can change a rule, for example by letting water block the reach. Either choice is a design decision, and it can only be made once someone notices the behavior.
This is the central working habit of emergent design. You do not specify outcomes directly. You write rules, observe what they produce, and then keep, adjust or remove rules based on what you see.
Common errors
Treating randomness as emergence
A loot table that rolls a random item is unpredictable, but nothing emerges from it. The outcome comes from one rule and a random number generator. Emergence needs rules that interact. Randomness can feed an emergent system, for example by choosing which cell ignites first, but it is not the source of the emergent pattern.
Treating complexity as emergence
A game with 200 rules is complicated, but it is not necessarily emergent. If every rule affects its own private state, such as a separate cooldown for each ability, the rules never interact, and the player faces a long list instead of a rich system. Emergence comes from rules sharing state, not from the number of rules.
Calling a hidden script emergent
If a designer authors a case such as "when a fire-arrow hits a wooden bridge, the bridge burns" and then adds ten similar cases, the result looks systemic but is still scripted. A useful check is to add a new object, such as a wooden barrel. If you must write new interaction code for each existing object, the system is scripted. If you only need to give the barrel a property, such as being flammable, the system is rule-based.
Assuming emergence is always desirable
Emergent behavior is a property of how a system works, not a measure of quality. Some emergent outcomes undermine the design, for example a combination of two rules that lets a player gain unlimited resources. Later chapters on feedback loops, exploits and tuning cover how to spot and handle these.
Confusing emergent behavior with emergent narrative
Emergent behavior is about what the simulation does. Emergent narrative is the story a player tells about it, such as "my doomed colonist survived by luck". Players do this storytelling readily, and good rule systems give them material for it. But a story told about a scripted event is not evidence that the system is emergent. Apply the four tests to the system, not to the story.
Why designers pursue emergence
Designers choose emergent approaches for practical reasons:
- Coverage. A small set of general rules covers many situations without authoring each one.
- Replay value. The same rules, started from different states, lead to different play.
- Player expression. Players can invent solutions the designer never planned, because the rules allow them.
- Consistency. Objects behave the same way everywhere, so players can form accurate expectations and plan with them.
The cost is control. You exchange authored certainty for variety, and you accept that you will need to test the game by playing it. The remaining chapters give you the tools to manage that cost: how local interaction works, how to combine rules without them colliding, how to shape feedback, and how to find and fix problems.
Summary of the working model
- An emergent outcome is not named by any one rule, comes from rules interacting on shared state, is reproducible, and matters to play.
- The player's actions are part of the loop, which is why the same rules produce many situations.
- To tell scripted from rule-based design, add a new object and see whether you must write new interaction code.
- Randomness, complexity and surprise are not evidence of emergence.
- Emergence is a means, not a goal. You judge its results after you observe them.
Exercise
In the barrel example, suppose you add a rule: "Water cells stop fire from spreading through them, so a burning cell cannot ignite anything on the other side of a water cell." Does fire still reach the far grass in the row "Ggbwg"? Is the new behavior still emergent, and which of the four tests tells you?
Show answer
No. The burning barrel at index 2 would reach index 4 with its reach of 2, but the new rule blocks that path because water sits at index 3, so the far grass stays unburned. The outcome of this row is now the same as for plain grass, a firebreak. The behavior is still produced by rules acting on shared state, so test 2 still holds. But the specific surprising pattern, fire crossing water, no longer occurs, so you have removed the thing that made this row interesting. You have traded a puzzle for a reliable firebreak, which is a design decision.
Exercise
A designer writes a table of 30 authored responses, for example "fire-arrow plus wooden door gives burning door" and "ice spell plus water gives frozen water". A tester says, "The game is very emergent, because I keep finding interactions I did not expect." Which of the four tests does this design most likely fail, and what quick check would confirm it?
Show answer
It most likely fails test 1, because each outcome is named in an authored table entry. The tester's surprise comes from not having seen those entries, not from rules combining. To confirm it, add a new object, such as a wooden crate. If every pairing with existing elements needs a new table entry, the system is scripted. If giving the crate a tag such as "flammable" is enough, the system is rule-based.
Exercise
Extend the code so a burning grass cell burns out and becomes "ash" after one step, as in a normal fire. State which rule you would add, and predict whether the barrel can still ignite across the water gap in "Ggbwg".
Show answer
Add a rule that a burning grass cell turns into ash after it has had one step to ignite its neighbors. Ash is not in FLAMMABLE, so it cannot be reignited. The barrel can still cross the water gap, because the chain is grass at index 0 igniting grass at index 1, which ignites the barrel at index 2, and then the barrel ignites index 4. Burning out grass cells earlier in the chain does not stop the later ignition, as long as each cell has burned for one step while its neighbors were still flammable. The barrel's own burn time should be handled so it still ignites its reach before turning to ash.