# Lesson Notes — Reverse-Engineering One Life: Stats, Resources, and Loops

- Link: https://mrleffler.com/course-2-game-design-development-principles/unit-6-game-design-mechanics-rules-documentation/lesson-4-reverse-engineering-one-life-stats-resources-and-loops-c2u6l4/lesson-notes-c2u6l4/
- Published: 2026-12-06T00:26:46-05:00
- Author: matthew.leffler@jefferson.kyschools.us

Course 2: Game Design & Development Principles / Unit 6: Game Design Mechanics, 
Rules & Documentation / Lesson 4: Reverse-Engineering One Life: Stats, Resources,
and Loops

## Lesson overview

In Unit 5 you built Twine stories. Those stories were combined into one game called**
One Life**. Around your stories sits a set of systems: stats that go up and down,
rules about who can be your friend, and a calendar that moves four years forward.
Today you play One Life like a designer and reverse-engineer how it works. In the
next lessons you will change it.

[Open One Life (opens in a new tab)](https://mrleffler.com/games/onelife/)

## Step 1: Find the stats

Start a new game. Look at the dashboard. You should find three tiles: **GPA**, **
Popularity** (labeled Pop), and **Money**. Hover over or tap Pop to read what the
game says it means. Fill in Section 1 of your handout.

A **stat** is a number the game tracks about the player. A **resource** is a stat
the player can earn, spend, or lose. Money is easy to spot as a resource. Think 
about whether Popularity is one too.

## Step 2: Log one school day

Play through one school day. Each time you make a choice, write it in Section 2 
of your handout. A choice you can make is a **player verb** (talk, go to class, 
skip, accept an invitation). Next to it, write what changed on the screen. Then 
use the categories from Lesson 1 to name the kind of mechanic it is.

## Step 3: Look for the structure of the day

The game follows rules about time. The player wakes up, gets to school, and goes
to first period every school day. After that the day is six class periods with short
passing periods, and lunch after fourth period. Events like pep rallies take the
place of a class period. Notice how the schedule limits what you can do. Limits 
are mechanics too.

## Step 4: Ask whether anyone can win

In Lesson 1 you studied victory conditions. One Life covers four years and ends 
at graduation. Is there a score to beat? Is there a way to lose? Decide whether 
One Life has a victory condition, and write your evidence in Section 3. There is
no single right answer. Your job is to defend yours with things you saw in the game.

## Step 5: Draw the core loop

A **core loop** is the cycle a player repeats. In One Life it might look like this:

    ```
    choose an action -> the game records it -> a stat changes -> the change opens or closes options -> choose an action
    ```

Fill in Section 4 with your own version. Be specific about which stat changes and
which options open or close.

## Hidden variables

A **hidden variable** is a number the game uses that the player is never shown. 
Every game has some. As you play, write down one thing in One Life that seems to
be decided by a number you cannot see. We will go looking for it in Lesson 5.

## Names Reference: how the game names its own mechanics

One Life is code, and in code every mechanic has a name. When you write an expansion
in Lessons 6 to 9, you use these names. You can read all of them right now. Open
the game, press `F12`, click **Console**, type a name, and press Enter. Reading 
cannot break anything.

  |  Name |  What it is |  Try it in the Console |  
   |  `likePoints` |  Object. Every interaction type (kept, bombed, noShow, and more) and the popularity points it is worth. |  `likePoints` |  
 |  `avatarLikeBonus` |  Object. Extra points added for each relationship type (Friend, Crush). |  `avatarLikeBonus` |  
 |  `relationshipMinimum` |  Object. The minimum score a person needs to keep each relationship level. |  `relationshipMinimum` |  
 |  `cast` |  Object. Every character in the game, listed by id. |  `Object.keys(cast)` |  
 |  `state.popularityBase` |  Number. A hidden starting popularity the dashboard does not show. |  `state.popularityBase` |  
 |  `likeScore(id)` |  Function. The total points one person has given you. |  `likeScore('an id from the cast list')` |  
 |  `popularityScore()` |  Function. The hidden base plus everyone’s like score. |  `popularityScore()` |  
 |  `friendLimit()` |  Function. How many friend slots you have. |  `friendLimit()` |  
 |  `homecomingWinPercent(year, pop)` |  Function. Your chance to win homecoming. |  `homecomingWinPercent(4, 300)` |  
 |  `recordContactEvent(id, kind, key)` |  Function. Records an interaction with a person and awards the points from `likePoints`. The same kind and key with the same person counts only once. |  Read its code (see below) |  
 |  `dailyTick()` |  Function. Runs each day and handles decay, drifting apart, and breakups. |  Read its code (see below) |  
 |  `updatePlayerStats()` |  Function. Draws the numbers on the dashboard. |  Read its code (see below) |

### Values and rules

Objects such as `likePoints` hold **values**: numbers you can turn up or down (Lesson
6). Functions such as `friendLimit()` hold **rules**: formulas you can replace (
Lesson 7).

### Read a rule’s code

Type a function’s name **without** the parentheses, like `friendLimit`, and press
Enter. The Console prints the function’s code. This is how you read exactly how 
a mechanic works before you change it.

### Names can change

These names belong to the game. A future version could rename or remove one, and
an expansion that uses it would stop working. That is why every expansion records
which version of One Life it was tested on.

Choose three names from the table, look each one up in the Console, and write what
each one returned in the margin of Section 4 of your handout.

## Your turn

 1. Complete all four sections of the Mechanics Map handout.
 2. Name at least four player verbs and the mechanic category for each.
 3. Write a two-sentence argument for whether One Life has a victory condition.
 4. Write down one hidden variable you suspect.

## Check your understanding

 1. What is the difference between a stat and a resource?
 2. Which stat in One Life is hardest to explain, and why?
 3. How does a limit, like the school schedule, shape what a player can do?

Use this lesson’s Key Terms page to build your glossary.
