Spielerando

Add Anonymous Game Tracking With AI

Have your AI add a small log that writes events to a file or to the browser on the player's own device, and only after the player says yes. Then play one planned round and compare the log with what you really did, because tracking that counts wrong is worse than none.

What can go wrong with tracking?

Mostly, it counts the wrong thing and looks fine doing it. Radish Cavalry is an invented game, and these numbers are made up for this example.

You play one round on purpose: open the game, start level 1, lose, start again, win, quit. That should be six lines in the log. You find eight.

You did The log says
Opened the game game-start
Started level 1 level-start, level-start
Lost level-lose
Started again level-start, level-start
Won level-win
Quit quit

The start event fires twice, because the level loads twice. You would never see that in the game. But your numbers would say you needed four attempts for your one win, so you win 25% of your attempts when the truth is 50%. Spread over 100 players, level 1 would look twice as hard as it is, and you would make an easy level even easier.

Eight instead of six took a minute to spot, because you knew what to expect. That is the whole trick: write down what should happen first.

Which way of tracking fits a small game?

  • Writes to the player's device only. A file for a desktop game, browser storage for a web game. Our event log recipe does both, one event per line. That format is called JSON Lines, and it suits log files. Browsers allow about 5 MiB per site for this, so the recipe removes the oldest sessions when space runs low.
  • Asks first. Nothing is written until the player agrees. It is switched off by default.
  • Keeps nothing personal. No accounts, no device ids, no IP addresses, no clock times. A random label is made for each sitting and thrown away afterwards. It refuses keys like "email", and values that look like an address.
  • Sends nothing. A "copy my play log" button lets a player paste their log to you if they want to, and a delete button removes it. So your data comes from people who chose to help, such as playtesters.

Automatic sending to your own server is a bigger step. nginx, a common web server, logs IP addresses by default, which is exactly what this design avoids, so read privacy in game tracking first.

If you have a dozen testers, ask them to send the file and merge the files. The recipe counts a file sent twice only once, and a half-written last line from a closed tab is counted as broken and does not spoil the rest.

Paste this to your AI

Add anonymous event tracking to my game, in this order.

1. Draw the normal flow of play as a Mermaid state diagram, and turn it into a list of allowed moves between event names, such as game-start to level-start. Show it to me and wait for my yes.
2. Use get_recipe with game-event-log if Spielerando is connected. If it is not, write the same thing: events on the player's device only, one per line, nothing recorded before the player agrees, no accounts, device ids, IP addresses or clock times, and nothing sent anywhere.
3. Add a short plain question for the player, a button to copy their log and a button to delete it.
4. Tell me one exact round to play, and how many lines it should write.
5. After I have played it, compare the log with your list of allowed moves and show me both side by side: expected count, real count, every move that does not fit. Fix what does not fit and compare again.

Whether you write tests is up to you. Do not tell me tracking works until the counts match. One round only proves that round, so say that too. If you cannot run the game yourself, say so and ask me for the log.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP

How to check it worked

  • Say no. Decline the question and play. The log must stay empty.
  • Play the planned round. The line count must match exactly.
  • Close it mid-level. Open the log. Everything before that point should still read fine.
  • Read one line aloud. Nothing in it should describe a person or a device.
  • Press delete. The log must be gone, also after a reload.

Sources

Last updated: 2026-11-02