Why your progress lives in your browser, and how levels and badges work
· 5 min read
PLAYPILE has no sign-up. You open a game and play it, and your best scores, coins and unlocks are still there next time. On 14 October we added a profile page with a site-wide level, XP, fifteen badges and a daily challenge. All of it works without an account, and nothing you do is sent to us. This post explains why it is built that way and exactly how it works.
A website with nobody at home
PLAYPILE is a static site: a folder of files served from a content network, with no server of ours behind it. There is nowhere for us to keep your progress, so your browser keeps it, in its local storage. Every game saves under keys that start with pd., and that prefix has been the rule since the first game shipped. Your progress is simply every pd. key on your device.
This has real advantages. There is no password to forget, no email to hand over, and no database of players that could leak. It also has a cost, and we would rather say it plainly: if you clear your browser's site data, your progress goes with it. It also does not follow you to another browser on its own. That is what save codes are for.
Save codes
Since 20 September every profile can be copied out as a save code and pasted into another browser. The code is not clever. It is every pd. key and its value, written out as text and encoded so it can be pasted safely. It is not compressed or encrypted, so a code is only as private as wherever you paste it.
Loading a code does not simply overwrite what is already there. It merges the two key by key. For a game's best score, the higher one wins. Play stats, badges, favourites and daily challenge records are combined, so pasting an old code onto a newer browser never takes anything away. A test copies 250 coins from one game's purse into a fresh browser through a code and checks that they arrive.
XP: earned by playing, with a cap
The level on your profile is earned by playing, across every game on the site. The rules are:
- 1 XP for every 30 seconds of play, counted only while the game's page is visible and focused. It checks every five seconds, so a game left open in a background tab earns nothing.
- At most 30 minutes per game per day count towards XP, and at most 240 XP a day from time across all games.
- +10 XP the first time you play a game, and +50 for a daily challenge.
- Each badge also pays its own XP.
The caps are deliberate. Without them, the fastest way to level up would be to leave one game running overnight. With them, the fastest way is to play lots of different games for a while each, which is what we would like people to do anyway. Level 2 needs 100 XP, and each level after that needs 50 more than the one before: 100, then 150, then 200, and so on. Early levels come quickly and later ones take a while.
Fifteen badges
The badges reward trying things rather than grinding one thing:
- For variety: First game (25 XP), Five games (50), Ten games (100), Explorer for 25 different games (200), and Tried everything for a game in every category (150).
- For time: One hour in (75), Regular for ten hours in total (250), and Marathon for half an hour in one game in one day (75).
- For coming back: Three days running (50) and Week streak (150).
- For the daily challenge: Challenger for your first (50) and Daily devotee for seven in a row (200).
- And Favourite for adding a game to your favourites (15), plus Level 5 and Level 10.
One small detail: badges are checked twice in a row. A badge's XP can push you into a new level, and that level can itself be a badge.
The same daily challenge for everyone, with no server
The daily challenge picks one game a day, and it is the same game for everyone. Normally that would need a server to announce it. Ours works it out from the date alone. Every browser takes the text "playpile:" followed by today's date, runs it through a simple, well-known hashing function, and uses the result to pick from the list of games, sorted by name. Since every browser does the same sum on the same date, they all get the same answer.
The same number decides the kind of challenge. On some days it is "play for three minutes". For the games that keep a score, it can instead be "beat your best from the start of the day, or play for five minutes". Either way it pays 50 XP.
The honest limitation is time zones. The date is your local date, so the challenge changes at your midnight, not at the same moment worldwide. Two friends in different countries share a challenge for most of the day, but not all of it.
Streaks
There are two streaks. Your play streak counts consecutive days on which you played anything, and if you have not played yet today, yesterday still counts, so the streak does not look broken at breakfast. Your daily streak counts consecutive daily challenges. Miss a day and it starts again at one, but your best is kept.
Profiles, and what leaves your machine
A single browser can hold several named profiles, each with its own picture, which suits a family sharing one computer. Switching profile swaps in that player's saved keys. Leaderboards on a game page currently show the profiles on this device.
On the privacy settings page you can see every score and save the site has kept in your browser, download a copy as a file, or delete it, either all at once or a group at a time. For guests and local profiles, nothing you do leaves your machine. The only outside services the site talks to are the advertising script and, for games with online play, a matchmaking service that introduces two players' browsers to each other. We keep no analytics at all.