this post was submitted on 28 Apr 2025
48 points (100.0% liked)

Gaming

31262 readers
17 users here now

From video gaming to card games and stuff in between, if it's gaming you can probably discuss it here!

Please Note: Gaming memes are permitted to be posted on Meme Mondays, but will otherwise be removed in an effort to allow other discussions to take place.

See also Gaming's sister community Tabletop Gaming.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 3 years ago
MODERATORS
 

I made a website. It’s called One Million Chessboards. It has one million chessboards on it.

Moving a piece moves it for everyone, instantly. There are no turns. You can move between boards.

What

Well last year I made this game called One Million Checkboxes.

It was a pretty fun time! So I thought I’d do something like this again.

I worked really hard on this one. I hope you like it.

How

This was the most technically challenging thing that I’ve worked on in a long time. I’m going to save a full technical writeup until I see how my decisions pan out, since I think there’s a decent chance I’ll need to make a lot of changes.

But I’ll summarize a few things for you.

  • Unlike One Million Checkboxes, I designed this for scale
  • The game runs on a single server (!)
  • The board is stored fully in-memory; it’s a 2D array of 64 million uint64s
  • The backend is written in go. This is my first go project.
  • I use a single writer thread, tons of reader threads, and coordinate access to the board with a mutex
  • The frontend optimistically applies all moves you make immediately. It then builds up a dependency graph of the moves you’ve made, and backs them out if it receives a conflicting update before the server acks your move.

That last part - optimistic move application with what games people sometimes call “rollback” - is about 1,600 lines of code that took me a ~7 days of fulltime work to write. I don’t remember the last time I wrestled with a problem that hard!

top 6 comments
sorted by: hot top controversial new old
[–] realitista@lemm.ee 1 points 1 hour ago

I just grabbed a queen and took out a ton of pieces unopposed.

[–] alyaza@beehaw.org 10 points 1 day ago
[–] prof@infosec.pub 6 points 1 day ago

This is super cool. Well done!

[–] wirelesswire@lemmy.zip 4 points 1 day ago

I was taking a rook around and taking a bunch of pieces out. Found someone else making moves and antagonized them for a bit before moving away. I guess they followed me, because as I was taking out a back row on one board, the rook ambushed me as I took out a knight.

[–] NaibofTabr@infosec.pub 5 points 1 day ago* (last edited 1 day ago)

hmm...

hmm...

...and my axe!

[–] Goretantath@lemm.ee 5 points 1 day ago

Wtf? I love it XD Gonna try it out when i get home.