You can play the game here: progle()
A month ago the blog you are currently reading was published. I wrote a post about the fact that I’m hosting it on my own server in my home. Up until now it had more than 85k unique visitors. All hosted from my Pi. The amount of amazing feedback I got was overwhelming. Though the biggest point against self-hosting people had was that it might work for a blog, but a real app would be unrealistic. Or the other way around, that a blog is too simple for all the hassle. So I’ve decided to check if those comments were right.
I’ve been playing LoLdle for a while, which is a game similar to Wordle. Every day you guess a single 5-letter word. Based on previous guesses you narrow down the answer. Together with my wife we came up with an idea of creating a game with the same rules but for programmers — We called it progle().
The idea is simple. Each day you guess a programming language based on certain hints, info about it, or a block of code. After 24h you can play again.
Knowing the limits of my platform I knew that if the game was a success then it might not be the best idea to use backend as the game state resolver. I want to give the best experience to everyone so if I made a game, that would lag on the first day (like Diablo IV i.e.), then it would be a disaster.
So how to ensure that the game scales well without big servers? You don’t host the game logic on backend and go with a client side approach instead. That’s not a new approach. Games have been built this way forever, and how Wordle itself works. The users visiting the page receive all the code required to play today’s game. No data is stored on the server besides the challenges itself. Server is used as a distribution platform.
This approach has a few advantages:
Less than a week after it’s release more than 4.5k unique people have visited progle(). More than 25k attempts to solve the puzzle were made. And 3k of them were correct!. 2.5k people solved more than 3k puzzles. On average people spent more than 3 minutes on the page.
#1 | #2 | #3 |
---|---|---|
Users | 4500 4500 | |
Winners | 2600 2600 | |
Solved | 3000 3000 |
And the most important thing is that the game works perfectly. No lag, no errors, no problems. It’s just a simple game that works. And again. The game is hosted from a Pi at my home.
Try it yourself: progle()