Running a million-board chess MMO in a single process

https://news.ycombinator.com/rss Hits: 12
Summary

One Million Chessboards is a 1000x1000 grid of chess boards. Moving a piece moves it for everyone, instantly. There are no turns, and pieces can move between boards. Loading...making some moves In the 10 days after launch, over 150,000 players made over 15,000,000 moves and hundreds of millions of queries. The game runs out of a single process that I didn’t touch over those 10 days 1. 1Once activity died down I bounced the server, reset the game, and started experimenting with rule tweaks. Making this project taught me a lot. It’s the first time I’ve used protobufs or golang, the first time I’ve measured nanoseconds, and my first time writing rollback netcode. Let me tell you about it. Basics Here’s a quick overview of the site before we jump into the details. Rules Pieces can move between boards - I wanted one global game, not a million simultaneous ones 2. 2This seemed to really disappoint actual chess players. I’m a little surprised by that - I don’t think that a million simultaneous games would lead to particularly interesting gameplay! - but maybe I’m wrong. Loading...moving between boards This meant that sharding the boards over many processes wasn’t free because those processes would need to communicate. There are no turns. I didn’t think asking the whole internet to take turns would work well. And I thought real-time chess would be fun. This meant that speed mattered; I needed to make sure that clients could make moves fast. I prevented pieces from capturing pieces on other boards. This was originally to prevent a queen from immediately capturing the king on the board above or below her, but ended up producing fun emergent gameplay as people (ab)used it to make indestructible structures like Rooklyn and Queens. Rooklyn, Queens, and a digital monument This rule was interesting, but it locked up the game. After activity died down I tried relaxing the restriction to only apply to unmoved pieces. I think this was a mistake - the original version was likely bette...

First seen: 2025-07-16 01:05

Last seen: 2025-07-16 12:08