Sub topic 1
What the Formal Elements Are and Why They Matter
Prerequisites
This chapter assumes you have played a range of board, card, or video games and can name a few that feel very different from each other. You should know roughly what a game designer does: someone who decides how a game works, not only how it looks. Reading short Python programs helps with the code example, but you can skip the code and still follow the argument.
The problem: describing a game precisely
Ask two people to describe chess and you get two kinds of answer. One says, "It's a medieval battle between kings." The other says, "Two players alternate moves on an 8x8 grid, and you win by trapping the opposing king." The first is about theme. The second is about structure.
Both are true, but only the second tells you how the game works. If you swap the carved knights for plain wooden pieces, the game is unchanged. If you change how a knight moves, you have made a different game.
The formal elements of a game are its structural parts: the pieces of the system that exist apart from theme, art, sound, and story. Learning to name them lets you read any game as a system, compare games fairly, and predict what will happen when you change one part.
Formal elements versus what surrounds them
A useful test: remove a feature and ask whether the set of possible plays changes. If it doesn't, the feature is presentation. If it does, the feature is formal.
| Layer | Examples | Change it, and... |
|---|---|---|
| Theme | Space opera, farming, medieval war | Players do the same things with new labels |
| Narrative | Backstory, cutscenes, character arcs | The decisions available stay the same |
| Presentation | Art, music, animation, interface style | Moves look different but remain the same moves |
| Formal elements | Players, objectives, rules, resources, procedures | The game itself changes |
This separation has limits. Presentation affects how easily players read the game state, and theme affects why players care. A confusing interface can make a good ruleset unplayable. But those effects work through the players' understanding. They don't alter the underlying structure. This chapter and the rest of the tutorial concern the structure.
The five elements
The spine for this tutorial names four headline elements, players, objectives, rules, and resources, and a fifth, procedures, that connects them. Each gets its own chapter later. Here is the working definition of each, so you can recognize them.
- Players are the agents who make decisions in the game. A player might be a person, a team, or a computer-controlled participant. What matters is how many there are, what roles they hold, and why they take part.
- Objectives are the states of the game that players try to bring about. "Capture the opposing king" and "collect ten points" are objectives. An objective says what counts as success, not what players may do.
- Rules define what is and is not allowed. They set limits on actions and fix how the game state changes in response.
- Resources are the assets players gain, spend, trade, or protect: stones in a pile, gold, cards in hand, time, health.
- Procedures are the actions players can actually take, such as moving a piece, drawing a card, or placing a tile. Rules limit procedures, and resources are often what procedures consume or produce.
A quick map
Different questions point to different elements.
| Question | Element |
|---|---|
| Who is deciding? | Players |
| What are they trying to achieve? | Objectives |
| What may they not do, and what happens when they act? | Rules |
| What do they have to work with? | Resources |
| What can they do on their turn? | Procedures |
If you can answer all five questions about a game, you have a structural description of it. If one question is hard to answer, either the game is unusual or your description is incomplete.
Worked example: Nim as a formal model
Nim is a small game that makes the elements easy to see. Two players share a pile of stones. On each turn, a player removes one to three stones. The player who takes the last stone wins.
Mapping the five elements:
- Players: two, alternating turns.
- Objective: take the last stone.
- Rules: take between one and three stones, and never more than remain in the pile.
- Resources: the shared pile of stones.
- Procedures: the action "take N stones".
Notice what is absent. Nothing says the stones are stones. They could be matchsticks, coins, or tokens in a spaceship cargo bay. That is the point of separating the formal layer from the theme.
Here is the same description as code. Each formal element maps to a visible piece of the program.
from dataclasses import dataclass
PLAYERS = 2 # players: two alternating players
MAX_TAKE = 3 # rule: take 1 to 3 stones per turn
@dataclass(frozen=True)
class State:
stones: int # resource: a shared pile of stones
current: int # index of the player whose turn it is
def legal_moves(state):
return list(range(1, min(MAX_TAKE, state.stones) + 1))
def apply_move(state, take):
if take not in legal_moves(state):
raise ValueError('illegal move')
return State(state.stones - take, (state.current + 1) % PLAYERS)
def winner(state):
# objective: take the last stone
if state.stones == 0:
return (state.current - 1) % PLAYERS
return None
state = State(stones=5, current=0)
print(legal_moves(state)) # [1, 2, 3]
state = apply_move(state, 3) # player 0 takes 3
print(state) # State(stones=2, current=1)
state = apply_move(state, 2) # player 1 takes the last two
print(winner(state)) # 1Walk through what each part does:
Stateholds everything that changes during play: the pile and whose turn it is. This is the game state.legal_movesencodes the rules. It never offers more than three stones, and never more than are left.apply_moveis the procedure. It rejects an illegal move, then returns a new state with fewer stones and the other player to move.winnerencodes the objective. When the pile is empty, the player who just moved took the last stone. That is the previous player, which is why the code usescurrent - 1.
The last four lines play a short game. Player 0 takes three stones from five, leaving two. Player 1 takes both and wins.
Why the formal elements matter
They give you a shared vocabulary
"The game feels off" is hard to act on. "The objective rewards hoarding, but the rules make hoarding impossible" is a diagnosis. Naming elements lets designers, testers, and players say exactly where a problem sits.
They let you compare games
Two games with different themes can share nearly all their structure. Two games with the same theme can differ completely. Comparing at the formal level tells you which similarities matter.
They make changes predictable
Because the elements depend on one another, a change in one can ripple into the rest. Nim shows this in miniature. Keep the players, rules, and resources exactly as they are, but change the objective so that taking the last stone loses. The same pile now rewards entirely different moves. A designer who knows the elements are linked checks the other elements after changing one. Later chapters work through this in detail.
They make games testable
A game described as players, objectives, rules, and resources can be modeled, as the Nim code shows. Once modeled, you can simulate thousands of games, look for states where no legal move exists, or check whether the first player always wins. You can't do that with "it's a medieval battle."
Common errors
- Treating theme as structure. Saying "the game is about trading" describes a topic. The structure is in what a player can offer, what they receive, and which rules constrain the exchange.
- Confusing objectives with rules. "Take the last stone" is an objective. "Take one to three stones" is a rule. A rule limits what you may do. An objective defines what you are trying to reach. A later chapter on objectives covers how to write them clearly.
- Counting only the visible resources. Time, turn order, and information held in a hand are resources too, even though no token represents them.
- Forgetting implicit rules. Many games depend on unwritten assumptions, such as that players don't look at each other's cards. These are rules, and they appear in the rulebook's gaps. Later chapters classify rules by how they are stated.
- Assuming the elements are independent. You can list them separately, but you can't change them separately and expect the same game.
Where this chapter fits
This chapter gives you the five-part frame. The next chapters take each element in turn: players, objectives, rules, resources, and procedures. After those come the chapters on how the elements interact, and finally how to analyze and modify a complete game. Whenever you meet a new game, try the five questions from the quick map. They are the working tool for the rest of the tutorial.
Exercise
Pick a game you know well, such as tic-tac-toe or a card game like Go Fish. List its players, objective, two or three rules, its resources, and one procedure. Then name one thing you could change about its theme or art without altering any formal element.
Show answer
A sample answer for tic-tac-toe. Players: two, alternating turns. Objective: place three of your marks in a row. Rules: mark only an empty square, and take one turn at a time. Resources: the empty squares on the 3x3 grid, which both players share, and the turn itself. Procedure: place your mark in a square. Theme or art you could change freely: use X and O, coins and buttons, or cats and dogs. The play possibilities stay identical, because only presentation changed. If your list for another game has a theme element such as "fantasy setting" under rules or objectives, move it out. If you named something like "the board is 4x4" as presentation, move it in, because that changes what plays exist.
Exercise
In the Nim code, suppose you change MAX_TAKE from 3 to 2. Which formal element did you change? Does the winner function need to change?
Show answer
You changed a rule, because MAX_TAKE limits how many stones a player may take. The objective is unchanged, so winner stays as it is. The change still affects play: with a limit of two, the pile sizes that are bad for the player to move shift from multiples of four to multiples of three. This shows that changing one element, here a rule, alters which choices are good even when the objective and resources are untouched.