Spielerando

Lesson 15 of 16Finish it7 minFree

Where Players Stop in Your Game: Count It, Don't Guess

A pixel art beekeeper walks through a cave past two flags, picking up gems. She touches the first flag and it turns green; a beetle then knocks her down, and after a short wait she comes back at that flag, blinking, while the beetle walks through her. The gems she took after the flag are back in their places.

A flag only counts if its number is higher than the green one. After a death she waits 1.2 seconds and comes back at the green flag, and for 1.5 seconds hits do nothing; the pit still does. Gems in the chest are safe, the ones carried since the flag go back.

Try it: Pick up a gem, then let the beetle catch you before the next flag: the gem number goes back to 0 and the gem lies in the cave again. Touch flag 2, walk back to flag 1 and die: you come back at 2. Right after coming back, walk into the beetle: nothing happens until the blinking stops.

Keys: ←→ walk Space jump

This little game runs this blueprint's tested code in your browser. Nothing you press is sent anywhere. Its code on GitHub.

The game above is the playable demo of our blueprint Checkpoints. It runs that blueprint's tested code in your browser.

Once your game is out, people play it without you, so you do not see where they go down, try again or give up. You can count it instead: a few events, each chosen for a question, written down without knowing who anybody is, and then read. This lesson picks those events on the cave above and keeps the count by hand, before any code is written.

Also in this lesson 4 things to read up on 3 questions to check yourself

The idea

A guess about where players stop is a guess about the part you worry about. A count says where they really went down, on what, and what they did next. Those are the numbers this lesson is about: numbers of the game, such as where players die, retry and quit. Not who they are.

Counting only helps if somebody reads it. So the events come from a question, written down before anything is recorded, and an event that no question needs is left out. A short list you read beats a long one you mean to read one day.

An event says what happened and where in the game. It does not say who did it. Whether you may record anything at all, and how to ask the player first, is a question of its own that this lesson does not answer: the page on privacy in game tracking in the reading list is where that starts.

In the game above, the beekeeper walks through a cave past two flags. A beetle walks to and fro, and there is a pit. When she goes down, she comes back at the last green flag, or at the start if no flag is green yet. Play it for a minute, and go down a few times on purpose.

How it works

Write the question first, and your guess next to it. For the cave: where does she go down, and on what? Write your guess before you play, for example "the pit". You will compare it with the count at the end.

Look at what the game already counts. The number in the top right corner counts how often she went down. It answers how often, and nothing else. Three deaths could all be the beetle, all the pit, or one here and two there, and each would need another change.

Split the game where it already splits. The two flags cut the cave into three stretches: from the start to flag 1, from flag 1 to flag 2, and from flag 2 to the way out. The beetle walks on both sides of flag 1, the pit lies between flag 1 and flag 2, and past flag 2 nothing can hurt her. So the middle stretch holds both dangers, and a count by stretch alone cannot tell them apart.

Choose the fewest events that answer the question. For the cave, four are enough:

There is no event for stopping. Somebody who closes the game sends nothing more. You find where people stop as the last event of a sitting. That is why back is on the list: she comes back by herself 1.2 seconds after going down, so in this cave a down with no back after it is a sitting that ended right there.

Keep the count by hand. Play a few rounds and write one line on paper for every event, the way the log would. Then read the lines, not the corner. Which stretch, which danger, how many times in a row at the same place? Put your guess next to it. If the two differ, the count wins.

Only then does your AI build anything, and what it builds is the list you already tried by hand.

What goes wrong

The usual message is: add analytics to my game. The shortcut is to record everything. Every key press, where she stands on every tick, whatever the device says about itself, and perhaps all of it sent off to some service at once. Such a file grows fast, and nobody reads it. And the one line you need is not in it: a stream of positions never says "went down in the pit". To find a death you would have to work it out again from the positions, and that second working-out may not agree with the game.

An article on user analytics in the reading list makes the same point from the other side: tracking every behaviour makes very large files that cost a lot to keep, and the extra measures can add noise instead of insight.

There is a quieter mistake too. It is easy for an AI to write the death where the game handles damage. In the cave, the beetle goes through that code and the pit does not: in the checkpoints blueprint, being hit and falling out of the world are two different things. Such a log shows every beetle death and not one fall, and the pit reads as harmless.

You notice both by asking two things. Which question does each event answer? If your AI cannot say, the event goes. And does every way of going down write exactly one line? Go down once in every way the game has, then read the log.

Tell your AI

I want to count where players go down, try again and stop in my game, without knowing who anybody is. My question: [for example: where in the first level do players go down, and on what?]

Before you write any code:
1. Draw the path through [the level] as a Mermaid state diagram, with every way to go down and every place the player comes back. Mark where each event fires.
2. List the events, no more than my question needs: the name, when it fires, and what it carries (where in the game, what caused it). Nothing about the player or the device, no clock time and no free text. Next to each event, write the question it answers.
3. Wait for my yes.

Then build it with the game-event-log recipe from spielerando.com if you can get it: it records nothing until the player says yes and sends nothing anywhere. Write one test for each way of going down: play it once and check that exactly one line was written, with the right cause and place. Run the tests and show me their output, and show me every line one round of play writes.

Do not tell me what the numbers mean before there are enough of them. Do not tell me that any of this is allowed or safe; I will take that question elsewhere.

Try it

Read up

Where to go deeper: the pages of ours this lesson builds on, and what others have written about its point.

Check yourself: three questions

Each answer is checked and explained at once. The questions are part of the quiz, so they count for your Game Coder IQ like any other.

Question 1 of 3Easy

The cave game of this lesson counts in its corner how often the beekeeper went down. Why is that number alone not enough to decide what to change in the cave?

All questions of this course · The quiz and the Game Coder IQ

Next lesson When Is a Game Done? When a Stranger Finishes It

How useful was this page?

Nobody has rated this page yet.

One click, no account. It tells us which pages to make better next.

Last updated: 2026-11-27