The Core Loop

game design — fundamentals & frameworks

$ while true; do play; done

What is the last game you played?

What do you have to do repeatedly in that game?

That's your core loop!

thank you for coming to my ted talk

What do you actually do?

Tetris rotate, drop
Pac-Man eat, run away
Super Mario jump
Minecraft mine, craft, build
Among Us do tasks, accuse
Clash Royale place a card, wait for elixir

What you do most, over and over, is the core loop.

The core loop

ACTION FEEDBACK REWARD REPEAT

e.g. Pac-Man

action move, eat dots
feedback waka-waka, the score goes up
reward power pill, level cleared
repeat next maze, faster ghosts
LIVE DEMO

Watch the loop run

ACTION FEEDBACK REWARD REPEAT

Loops inside loops

HOURS MINUTES SECONDS

Super Mario

seconds run, jump, stomp, grab a coin
minutes reach the flag, clear the level
hours beat the world, save the princess

$ your turn: Minecraft?

MDA

mechanics, dynamics, aesthetics — Hunicke, LeBlanc & Zubek, 2004

Mechanics

The rules and systems.

jump button, health points, enemy AI

Dynamics

How mechanics become play.

timing jumps, strategic decisions

Aesthetics

What the player feels.

excitement, challenge, discovery

designer  M → D → A  builds the rules

player    A → D → M  starts from the feeling

Eight kinds of fun

the A in MDA — which ones is your game about?

Sensation

game as sense-pleasure

Beat Saber

Fantasy

game as make-believe

Skyrim

Narrative

game as drama

The Last of Us

Challenge

game as obstacle course

Celeste

Fellowship

game as social framework

Among Us

Discovery

game as uncharted territory

Zelda: BotW

Expression

game as self-discovery

Minecraft

Submission

game as pastime

Stardew Valley

LIVE DEMO

Same Mechanic, different Dynamic/Aesthetic

space / ↑ / A jump · 1 2 3 or LB RB feel · J or X juice · esc to leave

Feedback loops

+ + + PROPERTIES RENT MONEY R

Positive

Success buys more success. Monopoly: the leader collects the rent that buys the next street. Risk: the game is decided long before it ends.

+ + − DISTANCE BEHIND ITEM POWER CATCH-UP B

Negative

Falling behind helps you catch up. Mario Kart: the further back you are, the better your items — Bullet Bill, and a blue shell for whoever's in first. Benefit: everyone stays in it.

LIVE DEMO

Race the loops

Balance is key — most good games mix both.

You have a great idea, now what?

Why diagrams?

communication share ideas clearly with the team
planning think the structure through before coding
documentation a reference for later
problem-solving find issues early, when they're cheap
collaboration everyone sees the same blueprint

An architect draws blueprints before building a house.

We draw diagrams before building a game.

UML class diagrams

Unified Modeling Language — a picture of a game's structure

the shape

ClassName
- attribute1: type
- attribute2: type
+ method1()
+ method2()

for example

Player
- health: int
- position: Vector2
- score: int
+ move()
+ takeDamage()
+ collectItem()

class = a thing in the game · attributes = what it knows · methods = what it does · - private, + public

LIVE DEMO

Pong, running its diagram

controller or mouse: left paddle · first to 5

Paddle
- position: Vector2
- speed: float
+ moveUp()
+ moveDown()
Ball
- position: Vector2
- velocity: Vector2
+ move()
+ bounce()
GameManager
- player1Score: int
- player2Score: int
+ updateScore()
+ checkWinner()

What else might we need?

1 2 GameManager Ball Paddle Wall bounces off SoundManager ScoreBoard

Design patterns

proven solutions to problems that keep coming back

Singleton

problem: exactly one instance of a class

e.g. GameManager, AudioManager

one manager owns the global game state

Observer

problem: objects need to know when something changes

e.g. the UI updates when health changes

decouples the UI from game logic

Don't implement these yet — just know they exist.

LIVE DEMO

Observer

Player health: 100 observers = [ ] for each: notify(event) HealthBar SoundManager not listening ScreenShake not listening Achievements not listening

the Player's code never changes

ACTIVITY

Design your game

  1. Find a partner
  2. Pick a simple game
  3. Write its core loop
  4. Sketch a class diagram on paper
  5. Be ready to share it

structure over notation — it doesn't have to be perfect

pick one

  • Breakout — paddle, ball, bricks
  • Space Invaders — player, enemies, bullets
  • a platformer — player, platforms, enemies
  • or your own idea

then sketch

  • 3–5 classes
  • 2–3 attributes each
  • 2–3 methods each

$ sleep 720

12:00

12 min

loop · classes · attributes · methods

Good design checklist

core loop can you name the thing players do over and over?
agency do players make meaningful choices?
feedback does the game respond clearly to the player?
challenge neither too easy nor too hard?
structure are responsibilities clearly separated?
scalability can you add features easily?

Good design makes development easier and games more fun.